From fb34573636079ff1ddbf193f86e72b4fb55c1e7d Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Wed, 13 Dec 2023 14:54:42 +0000 Subject: [PATCH 001/261] 8321894: Bump update version for OpenJDK: 21.0.3 Reviewed-by: goetz --- .jcheck/conf | 2 +- make/conf/version-numbers.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.jcheck/conf b/.jcheck/conf index 942d6e26905..e2ca212ab3a 100644 --- a/.jcheck/conf +++ b/.jcheck/conf @@ -1,7 +1,7 @@ [general] project=jdk-updates jbs=JDK -version=21.0.2 +version=21.0.3 [checks] error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists diff --git a/make/conf/version-numbers.conf b/make/conf/version-numbers.conf index 70ff29bfa2d..b4571b544e2 100644 --- a/make/conf/version-numbers.conf +++ b/make/conf/version-numbers.conf @@ -28,15 +28,15 @@ DEFAULT_VERSION_FEATURE=21 DEFAULT_VERSION_INTERIM=0 -DEFAULT_VERSION_UPDATE=1 +DEFAULT_VERSION_UPDATE=3 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_EXTRA1=0 DEFAULT_VERSION_EXTRA2=0 DEFAULT_VERSION_EXTRA3=0 -DEFAULT_VERSION_DATE=2023-10-17 +DEFAULT_VERSION_DATE=2024-04-16 DEFAULT_VERSION_CLASSFILE_MAJOR=65 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_VERSION_DOCS_API_SINCE=11 DEFAULT_ACCEPTABLE_BOOT_VERSIONS="20 21" DEFAULT_JDK_SOURCE_TARGET_VERSION=21 -DEFAULT_PROMOTED_VERSION_PRE= +DEFAULT_PROMOTED_VERSION_PRE=ea From 0e0e89779fbf1aacda0e5ed85592b5732239878e Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 14 Dec 2023 15:03:48 +0000 Subject: [PATCH 002/261] 8320898: exclude compiler/vectorapi/reshape/TestVectorReinterpret.java on ppc64(le) platforms Backport-of: 78b6c2b40885529adb2627e004317466b2c03868 --- test/hotspot/jtreg/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 6425fdffaa7..0459a0b8b87 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -67,6 +67,7 @@ compiler/c2/Test8004741.java 8235801 generic-all compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-all +compiler/vectorapi/reshape/TestVectorReinterpret.java 8320897 aix-ppc64,linux-ppc64le compiler/vectorapi/VectorLogicalOpIdentityTest.java 8302459 linux-x64,windows-x64 compiler/c2/irTests/TestVectorConditionalMove.java 8306922 generic-all From 0106db077b2e20d1b6d5e9dc3bbc323c42e43b4d Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Thu, 14 Dec 2023 16:33:27 +0000 Subject: [PATCH 003/261] 8320807: [PPC64][ZGC] C1 generates wrong code for atomics Backport-of: 3087e14cde9257680f0406b11942f9cb7739cb7b --- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 45 ++++++++++++++----- src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp | 35 --------------- .../c1/shenandoahBarrierSetC1_ppc.cpp | 45 +++++++------------ .../cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp | 5 ++- 4 files changed, 51 insertions(+), 79 deletions(-) diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp index 8081c9245ae..3f4b8520b9f 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp @@ -2635,6 +2635,13 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { Unimplemented(); } + // There might be a volatile load before this Unsafe CAS. + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ sync(); + } else { + __ lwsync(); + } + if (is_64bit) { __ cmpxchgd(BOOL_RESULT, /*current_value=*/R0, cmp_value, new_value, addr, MacroAssembler::MemBarNone, @@ -2996,9 +3003,24 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr assert(addr->disp() == 0 && addr->index()->is_illegal(), "use leal!"); const Register Rptr = addr->base()->as_pointer_register(), Rtmp = tmp->as_register(); - Register Rco = noreg; - if (UseCompressedOops && data->is_oop()) { - Rco = __ encode_heap_oop(Rtmp, data->as_register()); + Register Robj = noreg; + if (data->is_oop()) { + if (UseCompressedOops) { + Robj = __ encode_heap_oop(Rtmp, data->as_register()); + } else { + Robj = data->as_register(); + if (Robj == dest->as_register()) { // May happen with ZGC. + __ mr(Rtmp, Robj); + Robj = Rtmp; + } + } + } + + // There might be a volatile load before this Unsafe OP. + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ sync(); + } else { + __ lwsync(); } Label Lretry; @@ -3018,18 +3040,11 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr } else if (data->is_oop()) { assert(code == lir_xchg, "xadd for oops"); const Register Rold = dest->as_register(); + assert_different_registers(Rptr, Rold, Robj); if (UseCompressedOops) { - assert_different_registers(Rptr, Rold, Rco); __ lwarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update()); - __ stwcx_(Rco, Rptr); + __ stwcx_(Robj, Rptr); } else { - Register Robj = data->as_register(); - assert_different_registers(Rptr, Rold, Rtmp); - assert_different_registers(Rptr, Robj, Rtmp); - if (Robj == Rold) { // May happen with ZGC. - __ mr(Rtmp, Robj); - Robj = Rtmp; - } __ ldarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update()); __ stdcx_(Robj, Rptr); } @@ -3057,6 +3072,12 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr if (UseCompressedOops && data->is_oop()) { __ decode_heap_oop(dest->as_register()); } + + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } } diff --git a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp index ecc40d6fde7..32aab91c7d3 100644 --- a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp @@ -639,13 +639,6 @@ LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_ cmp_value.load_item(); new_value.load_item(); - // Volatile load may be followed by Unsafe CAS. - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar(); - } else { - __ membar_release(); - } - if (is_reference_type(type)) { if (UseCompressedOops) { t1 = new_register(T_OBJECT); @@ -670,21 +663,7 @@ LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) LIR_Opr tmp = FrameMap::R0_opr; value.load_item(); - - // Volatile load may be followed by Unsafe CAS. - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar(); - } else { - __ membar_release(); - } - __ xchg(addr, value.result(), result, tmp); - - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar_acquire(); - } else { - __ membar(); - } return result; } @@ -694,21 +673,7 @@ LIR_Opr LIRGenerator::atomic_add(BasicType type, LIR_Opr addr, LIRItem& value) { LIR_Opr tmp = FrameMap::R0_opr; value.load_item(); - - // Volatile load may be followed by Unsafe CAS. - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar(); // To be safe. Unsafe semantics are unclear. - } else { - __ membar_release(); - } - __ xadd(addr, value.result(), result, tmp); - - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar_acquire(); - } else { - __ membar(); - } return result; } diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp index fc06e1b71e0..6d9a1db1ed4 100644 --- a/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. - * Copyright (c) 2012, 2021 SAP SE. All rights reserved. + * Copyright (c) 2018, 2023, Red Hat, Inc. All rights reserved. + * Copyright (c) 2012, 2023 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,8 +53,13 @@ void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler *masm) { __ encode_heap_oop(new_val, new_val); } - // Due to the memory barriers emitted in ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved, - // there is no need to specify stronger memory semantics. + // There might be a volatile load before this Unsafe CAS. + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ sync(); + } else { + __ lwsync(); + } + ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), addr, cmp_val, new_val, tmp1, tmp2, false, result); @@ -63,6 +68,12 @@ void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler *masm) { __ decode_heap_oop(new_val); } + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } + __ block_comment("} LIR_OpShenandoahCompareAndSwap (shenandaohgc)"); } @@ -80,14 +91,6 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved(LIRAccess &access, LI if (access.is_oop()) { LIRGenerator* gen = access.gen(); - if (ShenandoahCASBarrier) { - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar(); - } else { - __ membar_release(); - } - } - if (ShenandoahSATBBarrier) { pre_barrier(gen, access.access_emit_info(), access.decorators(), access.resolved_addr(), LIR_OprFact::illegalOpr); @@ -104,12 +107,6 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved(LIRAccess &access, LI __ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, result)); - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar_acquire(); - } else { - __ membar(); - } - return result; } } @@ -125,12 +122,6 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess &access, LIRIt value.load_item(); LIR_Opr value_opr = value.result(); - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar(); - } else { - __ membar_release(); - } - if (access.is_oop()) { value_opr = iu_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators()); } @@ -152,11 +143,5 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess &access, LIRIt } } - if (support_IRIW_for_not_multiple_copy_atomic_cpu) { - __ membar_acquire(); - } else { - __ membar(); - } - return result; } diff --git a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp index 1d07c6d573a..9ed47b688ff 100644 --- a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp @@ -340,11 +340,12 @@ void ZBarrierSetAssembler::store_barrier_medium(MacroAssembler* masm, } __ ld(R0, in_bytes(ZThreadLocalData::store_good_mask_offset()), R16_thread); __ cmpxchgd(CCR0, tmp, (intptr_t)0, R0, ref_base, - MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update()); + MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, need_restore ? nullptr : &slow_path); if (need_restore) { __ subf(ref_base, ind_or_offs, ref_base); + __ bne(CCR0, slow_path); } - __ bne(CCR0, slow_path); } else { // A non-atomic relocatable object won't get to the medium fast path due to a // raw null in the young generation. We only get here because the field is bad. From 901048b43fa057e0b1f2f6c1e5a4e287747c6adf Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 14 Dec 2023 19:21:25 +0000 Subject: [PATCH 004/261] 8315680: java/lang/ref/ReachabilityFenceTest.java should run with -Xbatch Backport-of: a290256bbf85a52fbeab24dab5fbe195cf58750f --- test/jdk/java/lang/ref/ReachabilityFenceTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/jdk/java/lang/ref/ReachabilityFenceTest.java b/test/jdk/java/lang/ref/ReachabilityFenceTest.java index 4ddc9e0c9eb..9dde3f6b81d 100644 --- a/test/jdk/java/lang/ref/ReachabilityFenceTest.java +++ b/test/jdk/java/lang/ref/ReachabilityFenceTest.java @@ -27,11 +27,11 @@ * * @requires vm.opt.DeoptimizeALot != true * - * @run main/othervm -Xint -Dpremature=false ReachabilityFenceTest - * @run main/othervm -XX:TieredStopAtLevel=1 -Dpremature=true ReachabilityFenceTest - * @run main/othervm -XX:TieredStopAtLevel=2 -Dpremature=true ReachabilityFenceTest - * @run main/othervm -XX:TieredStopAtLevel=3 -Dpremature=true ReachabilityFenceTest - * @run main/othervm -XX:TieredStopAtLevel=4 -Dpremature=true ReachabilityFenceTest + * @run main/othervm -Xint -Dpremature=false ReachabilityFenceTest + * @run main/othervm -Xbatch -XX:TieredStopAtLevel=1 -Dpremature=true ReachabilityFenceTest + * @run main/othervm -Xbatch -XX:TieredStopAtLevel=2 -Dpremature=true ReachabilityFenceTest + * @run main/othervm -Xbatch -XX:TieredStopAtLevel=3 -Dpremature=true ReachabilityFenceTest + * @run main/othervm -Xbatch -XX:TieredStopAtLevel=4 -Dpremature=true ReachabilityFenceTest */ import java.lang.ref.Reference; @@ -54,7 +54,7 @@ public class ReachabilityFenceTest { * the object cannot be finalized. There is no sense running a positive test when premature finalization * is not expected. It is a job for negative test to verify that invariant. * - * The test methods should be appropriately compiled, therefore we do several iterations. + * The test methods should be appropriately compiled, therefore we do several iterations and run with -Xbatch. */ // Enough to OSR and compile From d65289db6320aac9875bcadc057c8c8587867900 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 14 Dec 2023 20:11:05 +0000 Subject: [PATCH 005/261] 8313082: Enable CreateCoredumpOnCrash for testing in makefiles Backport-of: ba645da97b00a7cc9d5a9d4dd58b1cd6737b4822 --- make/RunTests.gmk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make/RunTests.gmk b/make/RunTests.gmk index 063f7bda7d1..b82d2b2b601 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -801,8 +801,10 @@ define SetupRunJtregTestBody $1_JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR # If running on Windows, propagate the _NT_SYMBOL_PATH to enable # symbol lookup in hserr files + # The minidumps are disabled by default on client Windows, so enable them ifeq ($$(call isTargetOs, windows), true) $1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH + $1_JTREG_BASIC_OPTIONS += -vmoption:-XX:+CreateCoredumpOnCrash else ifeq ($$(call isTargetOs, linux), true) $1_JTREG_BASIC_OPTIONS += -e:_JVM_DWARF_PATH=$$(SYMBOLS_IMAGE_DIR) endif From e8cf56c21f18cd9910df30576a742aac83f5ef66 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 14 Dec 2023 20:13:17 +0000 Subject: [PATCH 006/261] 8320798: Console read line with zero out should zero out underlying buffer Backport-of: d568562966e9a2020704eee3d67b8a106f647d9c --- .../jdk/internal/io/JdkConsoleImpl.java | 10 ++++++++- .../classes/sun/nio/cs/StreamDecoder.java | 21 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java b/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java index 65d9177dddb..370fc73fcd0 100644 --- a/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java +++ b/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -195,6 +195,9 @@ else if (rcb[len-1] == '\n') { System.arraycopy(rcb, 0, b, 0, len); if (zeroOut) { Arrays.fill(rcb, 0, len, ' '); + if (reader instanceof LineReader lr) { + lr.zeroOut(); + } } } return b; @@ -228,6 +231,11 @@ class LineReader extends Reader { nextChar = nChars = 0; leftoverLF = false; } + public void zeroOut() throws IOException { + if (in instanceof StreamDecoder sd) { + sd.fillZeroToPosition(); + } + } public void close () {} public boolean ready() throws IOException { //in.ready synchronizes on readLock already diff --git a/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java b/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java index 340349a40fe..a2026744f04 100644 --- a/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java +++ b/src/java.base/share/classes/sun/nio/cs/StreamDecoder.java @@ -42,6 +42,8 @@ import java.nio.charset.CodingErrorAction; import java.nio.charset.IllegalCharsetNameException; import java.nio.charset.UnsupportedCharsetException; +import java.util.Arrays; + import jdk.internal.misc.InternalLock; public class StreamDecoder extends Reader { @@ -271,6 +273,25 @@ private boolean isOpen() { return !closed; } + public void fillZeroToPosition() throws IOException { + Object lock = this.lock; + if (lock instanceof InternalLock locker) { + locker.lock(); + try { + lockedFillZeroToPosition(); + } finally { + locker.unlock(); + } + } else { + synchronized (lock) { + lockedFillZeroToPosition(); + } + } + } + + private void lockedFillZeroToPosition() { + Arrays.fill(bb.array(), bb.arrayOffset(), bb.arrayOffset() + bb.position(), (byte)0); + } // -- Charset-based stream decoder impl -- From 63aecc5e8a66f14c6ab4badd17f5f773b5a48c88 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Fri, 15 Dec 2023 08:00:38 +0000 Subject: [PATCH 007/261] 8320300: Adjust hs_err output in malloc/mmap error cases Backport-of: 60c8d9c045be16fee99a83117844c2a8100f7c1a --- src/hotspot/share/utilities/vmError.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 8aebd82cb1a..62cd36e0f73 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -486,7 +486,7 @@ static void print_oom_reasons(outputStream* st) { st->print_cr("# Possible reasons:"); st->print_cr("# The system is out of physical RAM or swap space"); if (UseCompressedOops) { - st->print_cr("# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap"); + st->print_cr("# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap"); } if (LogBytesPerWord == 2) { st->print_cr("# In 32 bit mode, the process size limit was hit"); @@ -824,9 +824,9 @@ void VMError::report(outputStream* st, bool _verbose) { "(mprotect) failed to protect "); jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); st->print("%s", buf); - st->print(" bytes"); + st->print(" bytes."); if (strlen(_detail_msg) > 0) { - st->print(" for "); + st->print(" Error detail: "); st->print("%s", _detail_msg); } st->cr(); From db343c902de5165b52fe74bb34a9155663a7c900 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Fri, 15 Dec 2023 16:53:25 +0000 Subject: [PATCH 008/261] 8314612: TestUnorderedReduction.java fails with -XX:MaxVectorSize=32 and -XX:+AlignVector Backport-of: f804f8652da71b18cc654c08c12d07d6fd43c2a7 --- src/hotspot/share/opto/loopopts.cpp | 6 ++ .../superword/TestUnorderedReduction.java | 56 +++++++++++++++++-- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index 969751190fc..011ce76fd8b 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -4237,6 +4237,12 @@ void PhaseIdealLoop::move_unordered_reduction_out_of_loop(IdealLoopTree* loop) { break; // Chain traversal fails. } + assert(current->vect_type() != nullptr, "must have vector type"); + if (current->vect_type() != last_ur->vect_type()) { + // Reductions do not have the same vector type (length and element type). + break; // Chain traversal fails. + } + // Expect single use of UnorderedReduction, except for last_ur. if (current == last_ur) { // Expect all uses to be outside the loop, except phi. diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java index 7fb11d1f808..52b319a85b7 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java @@ -22,11 +22,39 @@ */ /** - * @test - * @bug 8302652 + * @test id=Vanilla-Unaligned + * @bug 8302652 8314612 * @summary Special test cases for PhaseIdealLoop::move_unordered_reduction_out_of_loop + * @requires vm.compiler2.enabled * @library /test/lib / - * @run driver compiler.loopopts.superword.TestUnorderedReduction + * @run driver compiler.loopopts.superword.TestUnorderedReduction Vanilla-Unaligned + */ + +/** + * @test id=Vanilla-Aligned + * @bug 8302652 8314612 + * @summary Special test cases for PhaseIdealLoop::move_unordered_reduction_out_of_loop + * @requires vm.compiler2.enabled + * @library /test/lib / + * @run driver compiler.loopopts.superword.TestUnorderedReduction Vanilla-Aligned + */ + +/** + * @test id=MaxVectorSize16-Unaligned + * @bug 8302652 8314612 + * @summary Special test cases for PhaseIdealLoop::move_unordered_reduction_out_of_loop + * @requires vm.compiler2.enabled + * @library /test/lib / + * @run driver compiler.loopopts.superword.TestUnorderedReduction MaxVectorSize16-Unaligned + */ + +/** + * @test id=MaxVectorSize32-Aligned + * @bug 8302652 8314612 + * @summary Special test cases for PhaseIdealLoop::move_unordered_reduction_out_of_loop + * @requires vm.compiler2.enabled + * @library /test/lib / + * @run driver compiler.loopopts.superword.TestUnorderedReduction MaxVectorSize32-Aligned */ package compiler.loopopts.superword; @@ -38,9 +66,22 @@ public class TestUnorderedReduction { static final int ITER = 10; public static void main(String[] args) { - TestFramework.runWithFlags("-Xbatch", - "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestUnorderedReduction::test*", - "-XX:MaxVectorSize=16"); + TestFramework framework = new TestFramework(TestUnorderedReduction.class); + framework.addFlags("-Xbatch", + "-XX:CompileCommand=compileonly,compiler.loopopts.superword.TestUnorderedReduction::test*"); + + if (args.length != 1) { + throw new RuntimeException("Test requires exactly one argument!"); + } + + switch (args[0]) { + case "Vanilla-Unaligned" -> { framework.addFlags("-XX:-AlignVector"); } + case "Vanilla-Aligned" -> { framework.addFlags("-XX:+AlignVector"); } + case "MaxVectorSize16-Unaligned" -> { framework.addFlags("-XX:-AlignVector", "-XX:MaxVectorSize=16"); } + case "MaxVectorSize32-Aligned" -> { framework.addFlags("-XX:+AlignVector", "-XX:MaxVectorSize=32"); } + default -> { throw new RuntimeException("Test argument not recognized: " + args[0]); } + } + framework.start(); } @Run(test = {"test1", "test2", "test3"}) @@ -78,6 +119,7 @@ public void runTests() throws Exception { @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_VI, "= 0", IRNode.ADD_REDUCTION_VI, "> 0"}, // count can be high + applyIfAnd = {"MaxVectorSize", "=16", "AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static int test1(int[] data, int sum) { // Vectorizes, but the UnorderedReduction cannot be moved out of the loop, @@ -118,6 +160,7 @@ static int ref1(int[] data, int sum) { IRNode.ADD_VI, "> 0", IRNode.ADD_REDUCTION_VI, "> 0", IRNode.ADD_REDUCTION_VI, "<= 2"}, // count must be low + applyIfAnd = {"MaxVectorSize", "=16", "AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static int test2(int[] data, int sum) { for (int i = 0; i < RANGE; i+=8) { @@ -153,6 +196,7 @@ static int ref2(int[] data, int sum) { IRNode.MUL_VI, "> 0", IRNode.ADD_VI, "= 0", // reduction not moved out of loop IRNode.ADD_REDUCTION_VI, "> 0",}, + applyIfAnd = {"MaxVectorSize", "=16", "AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static int test3(int[] data, int sum) { for (int i = 0; i < RANGE; i+=8) { From fccb0a150a0ac37c52c52a8011f7bca1409bf612 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sat, 16 Dec 2023 10:39:39 +0000 Subject: [PATCH 009/261] 8321131: Console read line with zero out should zero out underlying buffer in JLine Reviewed-by: mbaesken Backport-of: bd04f91e9103ee04f643f8d04553705c4d78fda3 --- .../jdk/internal/org/jline/JdkConsoleProviderImpl.java | 8 +++++--- .../classes/jdk/internal/org/jline/reader/Buffer.java | 4 ++++ .../jdk/internal/org/jline/reader/impl/BufferImpl.java | 7 +++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java index 1be2d168769..5b1b965d55b 100644 --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java @@ -67,6 +67,9 @@ public JdkConsole console(boolean isTTY, Charset charset) { * public Console class. */ private static class JdkConsoleImpl implements JdkConsole { + private final Terminal terminal; + private volatile LineReader jline; + @Override public PrintWriter writer() { return terminal.writer(); @@ -108,6 +111,8 @@ public char[] readPassword(String fmt, Object ... args) { return jline.readLine(fmt.formatted(args), '\0').toCharArray(); } catch (EndOfFileException eofe) { return null; + } finally { + jline.getBuffer().zeroOut(); } } @@ -126,9 +131,6 @@ public Charset charset() { return terminal.encoding(); } - private final LineReader jline; - private final Terminal terminal; - public JdkConsoleImpl(Terminal terminal) { this.terminal = terminal; this.jline = LineReaderBuilder.builder().terminal(terminal).build(); diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Buffer.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Buffer.java index 9fdd6e0bd7e..c47746f566c 100644 --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Buffer.java +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Buffer.java @@ -84,4 +84,8 @@ public interface Buffer { void copyFrom(Buffer buffer); + // JDK specific modification + default void zeroOut() { + throw new UnsupportedOperationException(); + } } diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/BufferImpl.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/BufferImpl.java index a3b2a21ac66..d0c4c2cb7ae 100644 --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/BufferImpl.java +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/BufferImpl.java @@ -8,6 +8,7 @@ */ package jdk.internal.org.jline.reader.impl; +import java.util.Arrays; import java.util.Objects; import jdk.internal.org.jline.reader.Buffer; @@ -369,4 +370,10 @@ private void moveGapToCursor() { g1 += l; } } + + // JDK specific modification + @Override + public void zeroOut() { + Arrays.fill(buffer, 0); + } } From dcf6eea1e53f913068340142fd925dfc89b10d8c Mon Sep 17 00:00:00 2001 From: Joachim Kern Date: Mon, 18 Dec 2023 11:04:32 +0000 Subject: [PATCH 010/261] 8319633: runtime/posixSig/TestPosixSig.java intermittent timeouts on UNIX Reviewed-by: mbaesken, mdoerr --- test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java b/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java index 52402ebe83f..354273d1516 100644 --- a/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java +++ b/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java @@ -44,8 +44,17 @@ public static void main(String[] args) throws Throwable { if (args.length == 0) { // Create a new java process for the TestPsig Java/JNI test. + // We run the VM in interpreted mode, because the JIT might mark + // a Java method as not-entrant, which means turning the first instruction + // into an illegal one. Calling such a method after establishing + // the new SIGILL signal handler with TestPosixSig.changeSigActionFor(4) + // below, but before the JNI checker noted and reacted on this signal handler + // modification, the JVM may crash or hang in an endless loop, where the + // illegal instruction will be continously executed, raising SIGILL, and + // the signal handler will return to the illegal instruction again... ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+CheckJNICalls", + "-Xint", "-Djava.library.path=" + libpath + ":.", "TestPosixSig", "dummy"); From 947dfc488bc134c04aa0ba23c7203b5bcaa851d4 Mon Sep 17 00:00:00 2001 From: Kimura Yukihiro Date: Mon, 18 Dec 2023 15:53:37 +0000 Subject: [PATCH 011/261] 8318410: jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh fails on Japanese Windows Backport-of: d051f22284e7ccc288c658588f73da672d9bfacd --- .../BootClassPath/BootClassPathTest.sh | 15 ++++++- .../lang/instrument/BootClassPath/Setup.java | 43 +++++++++++-------- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/test/jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh b/test/jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh index 99d20c45098..1c3b81cd14d 100644 --- a/test/jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh +++ b/test/jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2023, 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 @@ -64,7 +64,18 @@ echo "Creating manifest file..." # java Setup # - outputs boot class path to boot.dir -"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent +OS=`uname -s` +case ${OS} in + CYGWIN*) + CYGWIN="CYGWIN" + ;; + *) + CYGWIN="" + ;; +esac + +"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent "${CYGWIN}" + BOOTDIR=`cat ${TESTCLASSES}/boot.dir` echo "Created ${BOOTDIR}" diff --git a/test/jdk/java/lang/instrument/BootClassPath/Setup.java b/test/jdk/java/lang/instrument/BootClassPath/Setup.java index e59475be2cd..b37a868b1f5 100644 --- a/test/jdk/java/lang/instrument/BootClassPath/Setup.java +++ b/test/jdk/java/lang/instrument/BootClassPath/Setup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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,6 +45,10 @@ public static void main(String[] args) throws Exception { } String workDir = args[0]; String premainClass = args[1]; + boolean isCygwin = false; + if (args.length == 3 && args[2].equals("CYGWIN")) { + isCygwin = true; + } String manifestFile = workDir + fileSeparator + "MANIFEST.MF"; String bootClassPath = "boot" + suffix(); @@ -94,7 +98,12 @@ public static void main(String[] args) throws Exception { */ f = new File(workDir + fileSeparator + "boot.dir"); try (FileOutputStream out = new FileOutputStream(f)) { - out.write(bootDir.getBytes(filePathEncoding)); + if (osName.startsWith("Windows") && isCygwin) { + out.write(bootDir.getBytes("UTF-8")); + } + else { + out.write(bootDir.getBytes(filePathEncoding)); + } } } @@ -131,39 +140,39 @@ private static String suffix() { // Use null if encoding isn't used. String[][] names = { { "UTF-8", unicode, "" }, - { "windows-1256", null, "" }, + { "Cp1256", null, "" }, { "iso-8859-6", arabic, null }, { "GBK", s_chinese, s_chinese }, { "GB18030", s_chinese, s_chinese }, { "GB2312", s_chinese, null }, - { "x-windows-950", null, t_chinese }, - { "x-MS950-HKSCS", null, t_chinese }, - { "x-euc-tw", t_chinese, null }, + { "MS950", null, t_chinese }, + { "MS950_HKSCS_XP", null, t_chinese }, + { "EUC-TW", t_chinese, null }, { "Big5", t_chinese, null }, { "Big5-HKSCS", t_chinese, null }, { "windows-1251", null, "" }, { "iso-8859-5", russian, null }, { "koi8-r", russian, null }, - { "windows-1253", null, "" }, + { "Cp1253", null, "" }, { "iso-8859-7", greek, null }, - { "windows-1255", null, "" }, - { "iso8859-8", hebrew, null }, - { "windows-31j", null, japanese }, + { "Cp1255", null, "" }, + { "iso-8859-8", hebrew, null }, + { "MS932", null, japanese }, { "x-eucJP-Open", japanese, null }, - { "x-EUC-JP-LINUX", japanese, null }, + { "EUC-JP-LINUX", japanese, null }, { "x-pck", japanese, null }, - { "x-windows-949", null, korean }, + { "MS949", null, korean }, { "euc-kr", korean, null }, - { "windows-1257", null, "" }, + { "Cp1257", null, "" }, { "iso-8859-13", lithuanian, null }, - { "windows-1250", null, "" }, + { "Cp1250", null, "" }, { "iso-8859-2", czech, null }, - { "windows-1254", null, "" }, + { "Cp1254", null, "" }, { "iso-8859-9", turkish, null }, - { "windows-1252", null, "" }, + { "Cp1252", null, "" }, { "iso-8859-1", spanish, null }, { "iso-8859-15", spanish, null }, - { "x-windows-874", null, thai }, + { "MS874", null, thai }, { "tis-620", thai, null }, }; From 4f17ea72c89de7c0c1177acdfa93b81cc1c2c1de Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 19 Dec 2023 08:23:07 +0000 Subject: [PATCH 012/261] 8320383: refresh libraries cache on AIX in VMError::report Backport-of: 26c3390421f4888eb59017cadb2bf21a15e25b5e --- src/hotspot/os/aix/os_aix.cpp | 4 ++++ src/hotspot/os/bsd/os_bsd.cpp | 3 +++ src/hotspot/os/linux/os_linux.cpp | 3 +++ src/hotspot/os/windows/os_windows.cpp | 3 +++ src/hotspot/share/runtime/os.hpp | 2 ++ src/hotspot/share/utilities/vmError.cpp | 11 ++++++----- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 3818df86395..906b473e51b 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -1011,6 +1011,10 @@ int os::current_process_id() { // directory not the java application's temp directory, ala java.io.tmpdir. const char* os::get_temp_directory() { return "/tmp"; } +void os::prepare_native_symbols() { + LoadedLibraries::reload(); +} + // Check if addr is inside libjvm.so. bool os::address_is_in_vm(address addr) { diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 79ea61c2536..ec8fd440bf3 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -891,6 +891,9 @@ bool os::address_is_in_vm(address addr) { return false; } +void os::prepare_native_symbols() { +} + bool os::dll_address_to_function_name(address addr, char *buf, int buflen, int *offset, bool demangle) { diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index da6dac554f4..09d7f72afcc 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -1460,6 +1460,9 @@ bool os::address_is_in_vm(address addr) { return false; } +void os::prepare_native_symbols() { +} + bool os::dll_address_to_function_name(address addr, char *buf, int buflen, int *offset, bool demangle) { diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 69c957135c0..a6aa82012e8 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -1395,6 +1395,9 @@ const char* os::get_current_directory(char *buf, size_t buflen) { return _getcwd(buf, n); } +void os::prepare_native_symbols() { +} + //----------------------------------------------------------- // Helper functions for fatal error handler #ifdef _WIN64 diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index fdac523ccdd..9dbf895965a 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -663,6 +663,8 @@ class os: AllStatic { static const char* get_temp_directory(); static const char* get_current_directory(char *buf, size_t buflen); + static void prepare_native_symbols(); + // Builds the platform-specific name of a library. // Returns false if the buffer is too small. static bool dll_build_name(char* buffer, size_t size, diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 62cd36e0f73..6d122b36f3c 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -74,10 +74,6 @@ #include "jvmci/jvmci.hpp" #endif -#ifdef AIX -#include "loadlib_aix.hpp" -#endif - #ifndef PRODUCT #include #endif // PRODUCT @@ -718,6 +714,11 @@ void VMError::report(outputStream* st, bool _verbose) { "Runtime Environment to continue."); } + // avoid the cache update for malloc/mmap errors + if (should_report_bug(_id)) { + os::prepare_native_symbols(); + } + #ifdef ASSERT // Error handler self tests // Meaning of codes passed through in the tests. @@ -1341,7 +1342,7 @@ void VMError::report(outputStream* st, bool _verbose) { void VMError::print_vm_info(outputStream* st) { char buf[O_BUFLEN]; - AIX_ONLY(LoadedLibraries::reload()); + os::prepare_native_symbols(); report_vm_version(st, buf, sizeof(buf)); From fc49ca39a4d36d8431e45cc621dfa0518d276441 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 08:56:21 +0000 Subject: [PATCH 013/261] 8314837: 5 compiled/codecache tests ignore VM flags Backport-of: 2a11bc41baec20cf670393ff29689043ed2d2114 --- .../jtreg/compiler/codecache/CheckCodeCacheInfo.java | 10 ++++------ .../compiler/codecache/CodeCacheFullCountTest.java | 3 ++- .../codecache/cli/TestSegmentedCodeCacheOption.java | 1 + .../cli/codeheapsize/TestCodeHeapSizeOptions.java | 1 + .../cli/printcodecache/TestPrintCodeCacheOption.java | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java b/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java index 9b2c9b316ac..53d555ee139 100644 --- a/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java +++ b/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java @@ -28,9 +28,7 @@ * @library /test/lib * @requires vm.debug * - * @run driver jdk.test.lib.helpers.ClassFileInstaller - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * compiler.codecache.CheckCodeCacheInfo + * @run driver compiler.codecache.CheckCodeCacheInfo */ package compiler.codecache; @@ -68,9 +66,9 @@ public class CheckCodeCacheInfo { public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintCodeCache", - "-XX:+Verbose", - "-version"); + pb = ProcessTools.createTestJvm("-XX:+PrintCodeCache", + "-XX:+Verbose", + "-version"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); out.stdoutShouldMatch(VERBOSE_REGEXP); diff --git a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java index 9b1a5e89071..ee6866c396d 100644 --- a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java +++ b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java @@ -33,6 +33,7 @@ * @test * @bug 8276036 8277213 8277441 * @summary test for the value of full_count in the message of insufficient codecache + * @requires vm.compMode != "Xint" * @library /test/lib */ public class CodeCacheFullCountTest { @@ -54,7 +55,7 @@ public static void wasteCodeCache() throws Exception { } public static void runTest() throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( "-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "-XX:-MethodFlushing", "CodeCacheFullCountTest", "WasteCodeCache"); OutputAnalyzer oa = ProcessTools.executeProcess(pb); // Ignore adapter creation failures diff --git a/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java b/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java index 2a810abdd48..a5068b47454 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java @@ -25,6 +25,7 @@ * @test * @bug 8015774 * @summary Verify SegmentedCodeCache option's processing + * @requires vm.flagless * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler diff --git a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java index 7ae62407ece..4d52f470645 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java @@ -26,6 +26,7 @@ * @key randomness * @bug 8015774 * @summary Verify processing of options related to code heaps sizing. + * @requires vm.flagless * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler diff --git a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java index 223d683fc24..c0d826e59ec 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java @@ -25,6 +25,7 @@ * @test * @bug 8015774 * @summary Verify that PrintCodeCache option print correct information. + * @requires vm.flagless * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler From a75b88dc58ff289c98d13a070a1114082d23cf17 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 08:58:02 +0000 Subject: [PATCH 014/261] 8314838: 3 compiler tests ignore vm flags Backport-of: ab6a87e6705ef7d431ac2955e8501426344a4e1c --- .../ciReplay/TestInvalidReplayFile.java | 4 +-- .../TestRangeCheckHoistingScaledIV.java | 2 +- .../sharedstubs/SharedStubToInterpTest.java | 30 +++++++++---------- .../sharedstubs/SharedTrampolineTest.java | 21 +++++-------- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java b/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java index 9e80552087e..8112a7a43f6 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java +++ b/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception { w.flush(); w.close(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:+ReplayCompiles", "-XX:ReplayDataFile=./bogus-replay-file.txt"); diff --git a/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java b/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java index afe36ee89ef..5c58c6222f3 100644 --- a/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java +++ b/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java @@ -82,7 +82,7 @@ public static void main(String[] args) { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( "--enable-preview", "--add-modules", "jdk.incubator.vector", "-Xbatch", "-XX:+TraceLoopPredicate", Launcher.class.getName()); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java b/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java index 7ae227e783e..cd8471317ff 100644 --- a/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java +++ b/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java @@ -23,15 +23,21 @@ */ /** - * @test SharedStubToInterpTest - * @summary Checks that stubs to the interpreter can be shared for static or final method. + * @test id=C1 * @bug 8280481 + * @summary Checks that stubs to the interpreter can be shared for static or final method. * @library /test/lib + * @requires vm.opt.TieredStopAtLevel == null & vm.opt.TieredCompilation == null + * @requires vm.simpleArch == "x86" | vm.simpleArch == "x64" | vm.simpleArch == "aarch64" | vm.simpleArch == "riscv64" + * @requires vm.debug + * @run driver compiler.sharedstubs.SharedStubToInterpTest -XX:TieredStopAtLevel=1 * - * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="i386" | os.arch=="x86" | os.arch=="aarch64" | os.arch=="riscv64" + * @test id=C2 + * @requires vm.opt.TieredStopAtLevel == null & vm.opt.TieredCompilation == null + * @requires vm.simpleArch == "x86" | vm.simpleArch == "x64" | vm.simpleArch == "aarch64" | vm.simpleArch == "riscv64" * @requires vm.debug + * @run driver compiler.sharedstubs.SharedStubToInterpTest -XX:-TieredCompilation * - * @run driver compiler.sharedstubs.SharedStubToInterpTest */ package compiler.sharedstubs; @@ -45,10 +51,9 @@ public class SharedStubToInterpTest { private final static int ITERATIONS_TO_HEAT_LOOP = 20_000; - private static void runTest(String compiler, String test) throws Exception { + private static void runTest(String test) throws Exception { String testClassName = SharedStubToInterpTest.class.getName() + "$" + test; ArrayList command = new ArrayList(); - command.add(compiler); command.add("-XX:+UnlockDiagnosticVMOptions"); command.add("-Xbatch"); command.add("-XX:+PrintRelocations"); @@ -61,7 +66,7 @@ private static void runTest(String compiler, String test) throws Exception { command.add("-XX:CompileCommand=dontinline," + testClassName + "::" + "log02"); command.add(testClassName); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createTestJvm(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); @@ -73,14 +78,9 @@ private static void runTest(String compiler, String test) throws Exception { } public static void main(String[] args) throws Exception { - List compilers = java.util.Arrays.asList("-XX:-TieredCompilation" /* C2 */, - "-XX:TieredStopAtLevel=1" /* C1 */); - List tests = java.util.Arrays.asList("StaticMethodTest", - "FinalClassTest", "FinalMethodTest"); - for (String compiler : compilers) { - for (String test : tests) { - runTest(compiler, test); - } + String[] methods = new String[] { "StaticMethodTest", "FinalClassTest", "FinalMethodTest"}; + for (String methodName : methods) { + runTest(methodName); } } diff --git a/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java b/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java index a2b08071d08..49158fecd04 100644 --- a/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java +++ b/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java @@ -23,23 +23,22 @@ */ /** - * @test SharedTrampolineTest + * @test SharedTrampolineTest id=C2 * @summary Checks that trampolines can be shared for static method. * @bug 8280152 * @library /test/lib * + * @requires vm.opt.TieredCompilation == null * @requires os.arch=="aarch64" | os.arch=="riscv64" * @requires vm.debug * - * @run driver compiler.sharedstubs.SharedTrampolineTest + * @run driver compiler.sharedstubs.SharedTrampolineTest -XX:-TieredCompilation */ package compiler.sharedstubs; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.stream.Collectors; import java.util.regex.Pattern; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; @@ -47,10 +46,9 @@ public class SharedTrampolineTest { private final static int ITERATIONS_TO_HEAT_LOOP = 20_000; - private static void runTest(String compiler, String test) throws Exception { + private static void runTest(String test) throws Exception { String testClassName = SharedTrampolineTest.class.getName() + "$" + test; ArrayList command = new ArrayList(); - command.add(compiler); command.add("-XX:+UnlockDiagnosticVMOptions"); command.add("-Xbatch"); command.add("-XX:+PrintRelocations"); @@ -60,7 +58,7 @@ private static void runTest(String compiler, String test) throws Exception { command.add(testClassName); command.add("a"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createTestJvm(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); @@ -72,12 +70,9 @@ private static void runTest(String compiler, String test) throws Exception { } public static void main(String[] args) throws Exception { - List compilers = List.of("-XX:-TieredCompilation" /* C2 */); - List tests = List.of("StaticMethodTest"); - for (String compiler : compilers) { - for (String test : tests) { - runTest(compiler, test); - } + String[] tests = new String[] {"StaticMethodTest"}; + for (String test : tests) { + runTest(test); } } From 16875f218b6814c1f1e74861a6b067ae62d8806f Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 08:59:49 +0000 Subject: [PATCH 015/261] 8315988: Parallel: Make TestAggressiveHeap use createTestJvm Backport-of: fbc766ee21ff7e6d414bd7d2c8bd7c9e1889a8af --- test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java b/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java index 8eda52a20b3..5c4463db2b8 100644 --- a/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java +++ b/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ public static void main(String args[]) throws Exception { " *bool +UseParallelGC *= *true +\\{product\\} *\\{command line\\}"; private static void testFlag() throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJvm( option, heapSizeOption, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); From 9e8cee6ea33d43a90532d4867f552d7415e592df Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 09:02:10 +0000 Subject: [PATCH 016/261] 8317042: G1: Make TestG1ConcMarkStepDurationMillis use createTestJvm Backport-of: 7e39e664cf6d4658b0aa03f9b5162cf7de40de28 --- .../gc/arguments/TestG1ConcMarkStepDurationMillis.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java b/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java index d5a273b3d01..53afba28a1a 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ /* * @test TestG1ConcMarkStepDurationMillis - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.G1ConcMarkStepDurationMillis == null * @summary Tests argument processing for double type flag, G1ConcMarkStepDurationMillis * @library /test/lib * @library / @@ -78,7 +78,7 @@ private static void runG1ConcMarkStepDurationMillisTest(String expectedValue, in Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:G1ConcMarkStepDurationMillis="+expectedValue, "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createTestJvm(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(expectedResult == PASS ? 0 : 1); From be19bda590f641347c9abcfb23b11dd402d79077 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 09:06:14 +0000 Subject: [PATCH 017/261] 8316973: GC: Make TestDisableDefaultGC use createTestJvm Backport-of: 5f4be8cea980b3c2e8e5fb2067dc64b62fa0245c --- .../jtreg/gc/arguments/TestDisableDefaultGC.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java b/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java index 297415de850..c282a784203 100644 --- a/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java +++ b/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -40,13 +40,13 @@ public class TestDisableDefaultGC { public static void main(String[] args) throws Exception { // Start VM, disabling all possible default GCs - ProcessBuilder pb = GCArguments.createJavaProcessBuilder("-XX:-UseSerialGC", - "-XX:-UseParallelGC", - "-XX:-UseG1GC", - "-XX:-UseZGC", - "-XX:+UnlockExperimentalVMOptions", - "-XX:-UseShenandoahGC", - "-version"); + ProcessBuilder pb = GCArguments.createTestJvm("-XX:-UseSerialGC", + "-XX:-UseParallelGC", + "-XX:-UseG1GC", + "-XX:-UseZGC", + "-XX:+UnlockExperimentalVMOptions", + "-XX:-UseShenandoahGC", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldMatch("Garbage collector not selected"); output.shouldHaveExitValue(1); From c0b78b79fe600a19014babf7c435bd5a716b12ca Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 09:08:21 +0000 Subject: [PATCH 018/261] 8316410: GC: Make TestCompressedClassFlags use createTestJvm Backport-of: e649c563242a876a20007470c9412311ffa2a568 --- .../hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java b/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java index 5e5bf97b7cf..f33554c46e6 100644 --- a/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -35,6 +35,7 @@ * @library / * @modules java.base/jdk.internal.misc * java.management + * @requires vm.opt.CompressedClassSpaceSize == null & vm.opt.UseCompressedClassPointers == null * @run driver gc.arguments.TestCompressedClassFlags */ public class TestCompressedClassFlags { @@ -50,7 +51,7 @@ public static void main(String[] args) throws Exception { } private static OutputAnalyzer runJava(String ... args) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(args); + ProcessBuilder pb = GCArguments.createTestJvm(args); return new OutputAnalyzer(pb.start()); } } From 6f3cd91942418b3a0d26474a2ba93e6b9eced9d7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 09:14:14 +0000 Subject: [PATCH 019/261] 8316028: Update FreeType to 2.13.2 Backport-of: 3b65b8797a0798474947d38d3facd17b3e89c602 --- src/java.desktop/share/legal/freetype.md | 2 +- .../include/freetype/config/ftoption.h | 47 +- .../include/freetype/config/ftstdlib.h | 14 +- .../libfreetype/include/freetype/freetype.h | 563 +++++++--- .../libfreetype/include/freetype/ftchapters.h | 23 +- .../libfreetype/include/freetype/ftdriver.h | 11 +- .../libfreetype/include/freetype/ftimage.h | 10 +- .../libfreetype/include/freetype/ftlogging.h | 2 +- .../libfreetype/include/freetype/ftmm.h | 57 +- .../libfreetype/include/freetype/ftoutln.h | 2 +- .../libfreetype/include/freetype/ftrender.h | 2 +- .../libfreetype/include/freetype/ftsynth.h | 12 + .../libfreetype/include/freetype/ftsystem.h | 16 +- .../freetype/internal/compiler-macros.h | 7 +- .../include/freetype/internal/ftcalc.h | 4 +- .../include/freetype/internal/ftdrv.h | 1 + .../include/freetype/internal/ftmmtypes.h | 20 +- .../freetype/internal/services/svmetric.h | 10 +- .../include/freetype/internal/services/svmm.h | 109 +- .../freetype/internal/services/svpscmap.h | 2 +- .../include/freetype/internal/t1types.h | 26 +- .../include/freetype/internal/tttypes.h | 137 +-- .../native/libfreetype/src/autofit/afblue.dat | 2 +- .../native/libfreetype/src/autofit/afcjk.c | 62 +- .../native/libfreetype/src/autofit/afcjk.h | 20 +- .../native/libfreetype/src/autofit/afglobal.c | 5 +- .../native/libfreetype/src/autofit/afglobal.h | 2 +- .../native/libfreetype/src/autofit/afhints.c | 58 +- .../native/libfreetype/src/autofit/afindic.c | 32 +- .../native/libfreetype/src/autofit/aflatin.c | 87 +- .../native/libfreetype/src/autofit/aflatin.h | 4 +- .../native/libfreetype/src/autofit/afloader.c | 6 +- .../native/libfreetype/src/autofit/afmodule.c | 37 +- .../native/libfreetype/src/autofit/afshaper.c | 6 +- .../native/libfreetype/src/base/ftbbox.c | 42 +- .../native/libfreetype/src/base/ftcalc.c | 86 +- .../native/libfreetype/src/base/ftdbgmem.c | 2 +- .../share/native/libfreetype/src/base/ftmac.c | 2 +- .../share/native/libfreetype/src/base/ftmm.c | 146 ++- .../native/libfreetype/src/base/ftobjs.c | 26 +- .../native/libfreetype/src/base/ftoutln.c | 52 +- .../native/libfreetype/src/base/ftstream.c | 8 +- .../native/libfreetype/src/base/ftstroke.c | 21 +- .../native/libfreetype/src/base/ftsynth.c | 20 +- .../native/libfreetype/src/base/ftsystem.c | 9 +- .../native/libfreetype/src/cff/cffcmap.c | 107 +- .../native/libfreetype/src/cff/cffdrivr.c | 443 ++++---- .../native/libfreetype/src/cff/cffgload.c | 6 +- .../native/libfreetype/src/cff/cffload.c | 40 +- .../native/libfreetype/src/cff/cffload.h | 4 +- .../native/libfreetype/src/cff/cffobjs.c | 24 +- .../native/libfreetype/src/cff/cffparse.c | 250 ++--- .../native/libfreetype/src/cff/cffparse.h | 13 +- .../native/libfreetype/src/cid/cidgload.c | 141 ++- .../native/libfreetype/src/cid/cidgload.h | 8 + .../native/libfreetype/src/cid/cidload.c | 51 +- .../native/libfreetype/src/cid/cidobjs.c | 14 +- .../native/libfreetype/src/cid/cidparse.c | 16 +- .../native/libfreetype/src/cid/cidriver.c | 97 +- .../native/libfreetype/src/psaux/afmparse.c | 2 +- .../native/libfreetype/src/psaux/cffdecode.c | 6 +- .../native/libfreetype/src/psaux/pshints.c | 2 +- .../native/libfreetype/src/psaux/t1cmap.c | 141 +-- .../native/libfreetype/src/psaux/t1decode.c | 4 +- .../native/libfreetype/src/pshinter/pshalgo.c | 2 +- .../native/libfreetype/src/pshinter/pshmod.c | 9 +- .../native/libfreetype/src/pshinter/pshrec.c | 63 +- .../native/libfreetype/src/psnames/psmodule.c | 42 +- .../native/libfreetype/src/raster/ftraster.c | 44 +- .../native/libfreetype/src/raster/ftrend1.c | 21 +- .../native/libfreetype/src/sfnt/pngshim.c | 7 +- .../native/libfreetype/src/sfnt/sfdriver.c | 143 +-- .../native/libfreetype/src/sfnt/sfobjs.c | 30 +- .../native/libfreetype/src/sfnt/sfwoff.c | 2 +- .../native/libfreetype/src/sfnt/sfwoff2.c | 20 +- .../native/libfreetype/src/sfnt/ttcmap.c | 547 +++++----- .../native/libfreetype/src/sfnt/ttcolr.c | 10 +- .../native/libfreetype/src/sfnt/ttcpal.c | 2 +- .../native/libfreetype/src/sfnt/ttload.c | 7 + .../share/native/libfreetype/src/sfnt/ttmtx.c | 2 +- .../native/libfreetype/src/sfnt/ttpost.c | 284 ++---- .../native/libfreetype/src/sfnt/ttsbit.c | 2 +- .../native/libfreetype/src/sfnt/woff2tags.c | 2 +- .../native/libfreetype/src/smooth/ftgrays.c | 54 +- .../native/libfreetype/src/smooth/ftsmooth.c | 22 +- .../libfreetype/src/truetype/ttdriver.c | 157 +-- .../native/libfreetype/src/truetype/ttgload.c | 559 +++------- .../native/libfreetype/src/truetype/ttgxvar.c | 524 ++++++---- .../native/libfreetype/src/truetype/ttgxvar.h | 40 +- .../libfreetype/src/truetype/ttinterp.c | 959 +----------------- .../libfreetype/src/truetype/ttinterp.h | 84 +- .../native/libfreetype/src/truetype/ttobjs.c | 88 +- .../native/libfreetype/src/truetype/ttobjs.h | 8 +- .../native/libfreetype/src/truetype/ttpload.c | 37 +- .../native/libfreetype/src/truetype/ttpload.h | 6 +- .../native/libfreetype/src/type1/t1afm.c | 2 +- .../native/libfreetype/src/type1/t1driver.c | 93 +- .../native/libfreetype/src/type1/t1load.c | 260 ++--- .../native/libfreetype/src/type1/t1load.h | 22 +- .../native/libfreetype/src/type1/t1objs.c | 8 +- 100 files changed, 3424 insertions(+), 3919 deletions(-) diff --git a/src/java.desktop/share/legal/freetype.md b/src/java.desktop/share/legal/freetype.md index d602abbe5ae..6bcb4976fd2 100644 --- a/src/java.desktop/share/legal/freetype.md +++ b/src/java.desktop/share/legal/freetype.md @@ -1,4 +1,4 @@ -## The FreeType Project: Freetype v2.13.0 +## The FreeType Project: Freetype v2.13.2 ### FreeType Notice diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h b/src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h index c13a3ef4288..4375c7a6ff3 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h @@ -661,36 +661,12 @@ FT_BEGIN_HEADER * not) instructions in a certain way so that all TrueType fonts look like * they do in a Windows ClearType (DirectWrite) environment. See [1] for a * technical overview on what this means. See `ttinterp.h` for more - * details on the LEAN option. + * details on this option. * - * There are three possible values. - * - * Value 1: - * This value is associated with the 'Infinality' moniker, contributed by - * an individual nicknamed Infinality with the goal of making TrueType - * fonts render better than on Windows. A high amount of configurability - * and flexibility, down to rules for single glyphs in fonts, but also - * very slow. Its experimental and slow nature and the original - * developer losing interest meant that this option was never enabled in - * default builds. - * - * The corresponding interpreter version is v38. - * - * Value 2: - * The new default mode for the TrueType driver. The Infinality code - * base was stripped to the bare minimum and all configurability removed - * in the name of speed and simplicity. The configurability was mainly - * aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'. - * Legacy fonts are fonts that modify vertical stems to achieve clean - * black-and-white bitmaps. The new mode focuses on applying a minimal - * set of rules to all fonts indiscriminately so that modern and web - * fonts render well while legacy fonts render okay. - * - * The corresponding interpreter version is v40. - * - * Value 3: - * Compile both, making both v38 and v40 available (the latter is the - * default). + * The new default mode focuses on applying a minimal set of rules to all + * fonts indiscriminately so that modern and web fonts render well while + * legacy fonts render okay. The corresponding interpreter version is v40. + * The so-called Infinality mode (v38) is no longer available in FreeType. * * By undefining these, you get rendering behavior like on Windows without * ClearType, i.e., Windows XP without ClearType enabled and Win9x @@ -705,9 +681,7 @@ FT_BEGIN_HEADER * [1] * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */ -/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */ -#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 -/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */ +#define TT_CONFIG_OPTION_SUBPIXEL_HINTING /************************************************************************** @@ -977,21 +951,14 @@ FT_BEGIN_HEADER /* - * The next three macros are defined if native TrueType hinting is + * The next two macros are defined if native TrueType hinting is * requested by the definitions above. Don't change this. */ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #define TT_USE_BYTECODE_INTERPRETER - #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING -#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1 -#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY -#endif - -#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2 #define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL #endif -#endif #endif diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/config/ftstdlib.h b/src/java.desktop/share/native/libfreetype/include/freetype/config/ftstdlib.h index 3c9d2ae59a4..f65148a902e 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/config/ftstdlib.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/config/ftstdlib.h @@ -111,13 +111,13 @@ #include -#define FT_FILE FILE -#define ft_fclose fclose -#define ft_fopen fopen -#define ft_fread fread -#define ft_fseek fseek -#define ft_ftell ftell -#define ft_sprintf sprintf +#define FT_FILE FILE +#define ft_fclose fclose +#define ft_fopen fopen +#define ft_fread fread +#define ft_fseek fseek +#define ft_ftell ftell +#define ft_snprintf snprintf /************************************************************************** diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/freetype.h b/src/java.desktop/share/native/libfreetype/include/freetype/freetype.h index efff74fe399..92acf3794a7 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/freetype.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/freetype.h @@ -102,61 +102,25 @@ FT_BEGIN_HEADER */ - - /*************************************************************************/ - /*************************************************************************/ - /* */ - /* B A S I C T Y P E S */ - /* */ - /*************************************************************************/ - /*************************************************************************/ - - /************************************************************************** * * @section: - * base_interface + * font_testing_macros * * @title: - * Base Interface + * Font Testing Macros * * @abstract: - * The FreeType~2 base font interface. + * Macros to test various properties of fonts. * * @description: - * This section describes the most important public high-level API - * functions of FreeType~2. + * Macros to test the most important font properties. * - * @order: - * FT_Library - * FT_Face - * FT_Size - * FT_GlyphSlot - * FT_CharMap - * FT_Encoding - * FT_ENC_TAG - * - * FT_FaceRec - * - * FT_FACE_FLAG_SCALABLE - * FT_FACE_FLAG_FIXED_SIZES - * FT_FACE_FLAG_FIXED_WIDTH - * FT_FACE_FLAG_HORIZONTAL - * FT_FACE_FLAG_VERTICAL - * FT_FACE_FLAG_COLOR - * FT_FACE_FLAG_SFNT - * FT_FACE_FLAG_CID_KEYED - * FT_FACE_FLAG_TRICKY - * FT_FACE_FLAG_KERNING - * FT_FACE_FLAG_MULTIPLE_MASTERS - * FT_FACE_FLAG_VARIATION - * FT_FACE_FLAG_GLYPH_NAMES - * FT_FACE_FLAG_EXTERNAL_STREAM - * FT_FACE_FLAG_HINTER - * FT_FACE_FLAG_SVG - * FT_FACE_FLAG_SBIX - * FT_FACE_FLAG_SBIX_OVERLAY + * It is recommended to use these high-level macros instead of directly + * testing the corresponding flags, which are scattered over various + * structures. * + * @order: * FT_HAS_HORIZONTAL * FT_HAS_VERTICAL * FT_HAS_KERNING @@ -176,21 +140,59 @@ FT_BEGIN_HEADER * FT_IS_NAMED_INSTANCE * FT_IS_VARIATION * - * FT_STYLE_FLAG_BOLD - * FT_STYLE_FLAG_ITALIC + */ + + + /************************************************************************** + * + * @section: + * library_setup * - * FT_SizeRec - * FT_Size_Metrics + * @title: + * Library Setup * - * FT_GlyphSlotRec - * FT_Glyph_Metrics - * FT_SubGlyph + * @abstract: + * Functions to start and end the usage of the FreeType library. * - * FT_Bitmap_Size + * @description: + * Functions to start and end the usage of the FreeType library. + * + * Note that @FT_Library_Version and @FREETYPE_XXX are of limited use + * because even a new release of FreeType with only documentation + * changes increases the version number. * + * @order: + * FT_Library * FT_Init_FreeType * FT_Done_FreeType * + * FT_Library_Version + * FREETYPE_XXX + * + */ + + + /************************************************************************** + * + * @section: + * face_creation + * + * @title: + * Face Creation + * + * @abstract: + * Functions to manage fonts. + * + * @description: + * The functions and structures collected in this section operate on + * fonts globally. + * + * @order: + * FT_Face + * FT_FaceRec + * FT_FACE_FLAG_XXX + * FT_STYLE_FLAG_XXX + * * FT_New_Face * FT_Done_Face * FT_Reference_Face @@ -198,10 +200,36 @@ FT_BEGIN_HEADER * FT_Face_Properties * FT_Open_Face * FT_Open_Args + * FT_OPEN_XXX * FT_Parameter * FT_Attach_File * FT_Attach_Stream * + */ + + + /************************************************************************** + * + * @section: + * sizing_and_scaling + * + * @title: + * Sizing and Scaling + * + * @abstract: + * Functions to manage font sizes. + * + * @description: + * The functions and structures collected in this section are related to + * selecting and manipulating the size of a font globally. + * + * @order: + * FT_Size + * FT_SizeRec + * FT_Size_Metrics + * + * FT_Bitmap_Size + * * FT_Set_Char_Size * FT_Set_Pixel_Sizes * FT_Request_Size @@ -209,44 +237,37 @@ FT_BEGIN_HEADER * FT_Size_Request_Type * FT_Size_RequestRec * FT_Size_Request + * * FT_Set_Transform * FT_Get_Transform - * FT_Load_Glyph - * FT_Get_Char_Index - * FT_Get_First_Char - * FT_Get_Next_Char - * FT_Load_Char * - * FT_OPEN_MEMORY - * FT_OPEN_STREAM - * FT_OPEN_PATHNAME - * FT_OPEN_DRIVER - * FT_OPEN_PARAMS - * - * FT_LOAD_DEFAULT - * FT_LOAD_RENDER - * FT_LOAD_MONOCHROME - * FT_LOAD_LINEAR_DESIGN - * FT_LOAD_NO_SCALE - * FT_LOAD_NO_HINTING - * FT_LOAD_NO_BITMAP - * FT_LOAD_SBITS_ONLY - * FT_LOAD_NO_AUTOHINT - * FT_LOAD_COLOR - * - * FT_LOAD_VERTICAL_LAYOUT - * FT_LOAD_IGNORE_TRANSFORM - * FT_LOAD_FORCE_AUTOHINT - * FT_LOAD_NO_RECURSE - * FT_LOAD_PEDANTIC - * - * FT_LOAD_TARGET_NORMAL - * FT_LOAD_TARGET_LIGHT - * FT_LOAD_TARGET_MONO - * FT_LOAD_TARGET_LCD - * FT_LOAD_TARGET_LCD_V + */ + + + /************************************************************************** + * + * @section: + * glyph_retrieval + * + * @title: + * Glyph Retrieval + * + * @abstract: + * Functions to manage glyphs. + * + * @description: + * The functions and structures collected in this section operate on + * single glyphs, of which @FT_Load_Glyph is most important. * + * @order: + * FT_GlyphSlot + * FT_GlyphSlotRec + * FT_Glyph_Metrics + * + * FT_Load_Glyph + * FT_LOAD_XXX * FT_LOAD_TARGET_MODE + * FT_LOAD_TARGET_XXX * * FT_Render_Glyph * FT_Render_Mode @@ -254,34 +275,121 @@ FT_BEGIN_HEADER * FT_Kerning_Mode * FT_Get_Track_Kerning * + */ + + + /************************************************************************** + * + * @section: + * character_mapping + * + * @title: + * Character Mapping + * + * @abstract: + * Functions to manage character-to-glyph maps. + * + * @description: + * This section holds functions and structures that are related to + * mapping character input codes to glyph indices. + * + * Note that for many scripts the simplistic approach used by FreeType + * of mapping a single character to a single glyph is not valid or + * possible! In general, a higher-level library like HarfBuzz or ICU + * should be used for handling text strings. + * + * @order: + * FT_CharMap * FT_CharMapRec + * FT_Encoding + * FT_ENC_TAG + * * FT_Select_Charmap * FT_Set_Charmap * FT_Get_Charmap_Index * + * FT_Get_Char_Index + * FT_Get_First_Char + * FT_Get_Next_Char + * FT_Load_Char + * + */ + + + /************************************************************************** + * + * @section: + * information_retrieval + * + * @title: + * Information Retrieval + * + * @abstract: + * Functions to retrieve font and glyph information. + * + * @description: + * Functions to retrieve font and glyph information. Only some very + * basic data is covered; see also the chapter on the format-specific + * API for more. + * + * + * @order: * FT_Get_Name_Index * FT_Get_Glyph_Name * FT_Get_Postscript_Name * FT_Get_FSType_Flags + * FT_FSTYPE_XXX * FT_Get_SubGlyph_Info + * FT_SUBGLYPH_FLAG_XXX + * + */ + + + /************************************************************************** + * + * @section: + * other_api_data + * + * @title: + * Other API Data + * + * @abstract: + * Other structures, enumerations, and macros. * + * @description: + * Other structures, enumerations, and macros. Deprecated functions are + * also listed here. + * + * @order: * FT_Face_Internal * FT_Size_Internal * FT_Slot_Internal * - * FT_FACE_FLAG_XXX - * FT_STYLE_FLAG_XXX - * FT_OPEN_XXX - * FT_LOAD_XXX - * FT_LOAD_TARGET_XXX - * FT_SUBGLYPH_FLAG_XXX - * FT_FSTYPE_XXX + * FT_SubGlyph * * FT_HAS_FAST_GLYPHS + * FT_Face_CheckTrueTypePatents + * FT_Face_SetUnpatentedHinting * */ + /*************************************************************************/ + /*************************************************************************/ + /* */ + /* B A S I C T Y P E S */ + /* */ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************** + * + * @section: + * glyph_retrieval + * + */ + /************************************************************************** * * @struct: @@ -349,6 +457,13 @@ FT_BEGIN_HEADER } FT_Glyph_Metrics; + /************************************************************************** + * + * @section: + * sizing_and_scaling + * + */ + /************************************************************************** * * @struct: @@ -409,6 +524,13 @@ FT_BEGIN_HEADER /*************************************************************************/ /*************************************************************************/ + /************************************************************************** + * + * @section: + * library_setup + * + */ + /************************************************************************** * * @type: @@ -483,7 +605,7 @@ FT_BEGIN_HEADER /************************************************************************** * * @section: - * base_interface + * face_creation * */ @@ -519,6 +641,13 @@ FT_BEGIN_HEADER typedef struct FT_FaceRec_* FT_Face; + /************************************************************************** + * + * @section: + * sizing_and_scaling + * + */ + /************************************************************************** * * @type: @@ -551,6 +680,13 @@ FT_BEGIN_HEADER typedef struct FT_SizeRec_* FT_Size; + /************************************************************************** + * + * @section: + * glyph_retrieval + * + */ + /************************************************************************** * * @type: @@ -570,6 +706,13 @@ FT_BEGIN_HEADER typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; + /************************************************************************** + * + * @section: + * character_mapping + * + */ + /************************************************************************** * * @type: @@ -877,6 +1020,13 @@ FT_BEGIN_HEADER /*************************************************************************/ + /************************************************************************** + * + * @section: + * other_api_data + * + */ + /************************************************************************** * * @type: @@ -892,6 +1042,13 @@ FT_BEGIN_HEADER typedef struct FT_Face_InternalRec_* FT_Face_Internal; + /************************************************************************** + * + * @section: + * face_creation + * + */ + /************************************************************************** * * @struct: @@ -918,7 +1075,7 @@ FT_BEGIN_HEADER * If we have the third named instance of face~4, say, `face_index` is * set to 0x00030004. * - * Bit 31 is always zero (this is, `face_index` is always a positive + * Bit 31 is always zero (that is, `face_index` is always a positive * value). * * [Since 2.9] Changing the design coordinates with @@ -936,7 +1093,7 @@ FT_BEGIN_HEADER * * [Since 2.6.1] Bits 16-30 hold the number of named instances * available for the current face if we have a GX or OpenType variation - * (sub)font. Bit 31 is always zero (this is, `style_flags` is always + * (sub)font. Bit 31 is always zero (that is, `style_flags` is always * a positive value). Note that a variation font has always at least * one named instance, namely the default instance. * @@ -1002,7 +1159,7 @@ FT_BEGIN_HEADER * Note that the bounding box might be off by (at least) one pixel for * hinted fonts. See @FT_Size_Metrics for further discussion. * - * Note that the bounding box does not vary in OpenType variable fonts + * Note that the bounding box does not vary in OpenType variation fonts * and should only be used in relation to the default instance. * * units_per_EM :: @@ -1090,9 +1247,9 @@ FT_BEGIN_HEADER FT_Generic generic; - /*# The following member variables (down to `underline_thickness`) */ - /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ - /*# for bitmap fonts. */ + /* The following member variables (down to `underline_thickness`) */ + /* are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ + /* for bitmap fonts. */ FT_BBox bbox; FT_UShort units_per_EM; @@ -1110,7 +1267,7 @@ FT_BEGIN_HEADER FT_Size size; FT_CharMap charmap; - /*@private begin */ + /* private fields, internal to FreeType */ FT_Driver driver; FT_Memory memory; @@ -1123,8 +1280,6 @@ FT_BEGIN_HEADER FT_Face_Internal internal; - /*@private end */ - } FT_FaceRec; @@ -1207,13 +1362,13 @@ FT_BEGIN_HEADER * successfully; in all other cases you get an * `FT_Err_Invalid_Argument` error. * - * Note that CID-keyed fonts that are in an SFNT wrapper (this is, all + * Note that CID-keyed fonts that are in an SFNT wrapper (that is, all * OpenType/CFF fonts) don't have this flag set since the glyphs are * accessed in the normal way (using contiguous indices); the * 'CID-ness' isn't visible to the application. * * FT_FACE_FLAG_TRICKY :: - * The face is 'tricky', this is, it always needs the font format's + * The face is 'tricky', that is, it always needs the font format's * native hinting engine to get a reasonable result. A typical example * is the old Chinese font `mingli.ttf` (but not `mingliu.ttc`) that * uses TrueType bytecode instructions to move and scale all of its @@ -1235,8 +1390,8 @@ FT_BEGIN_HEADER * FT_FACE_FLAG_VARIATION :: * [Since 2.9] Set if the current face (or named instance) has been * altered with @FT_Set_MM_Design_Coordinates, - * @FT_Set_Var_Design_Coordinates, or @FT_Set_Var_Blend_Coordinates. - * This flag is unset by a call to @FT_Set_Named_Instance. + * @FT_Set_Var_Design_Coordinates, @FT_Set_Var_Blend_Coordinates, or + * @FT_Set_MM_WeightVector to select a non-default instance. * * FT_FACE_FLAG_SVG :: * [Since 2.12] The face has an 'SVG~' OpenType table. @@ -1272,6 +1427,13 @@ FT_BEGIN_HEADER #define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 ) + /************************************************************************** + * + * @section: + * font_testing_macros + * + */ + /************************************************************************** * * @macro: @@ -1381,6 +1543,13 @@ FT_BEGIN_HEADER ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) ) + /************************************************************************** + * + * @section: + * other_api_data + * + */ + /************************************************************************** * * @macro: @@ -1393,6 +1562,13 @@ FT_BEGIN_HEADER #define FT_HAS_FAST_GLYPHS( face ) 0 + /************************************************************************** + * + * @section: + * font_testing_macros + * + */ + /************************************************************************** * * @macro: @@ -1451,8 +1627,8 @@ FT_BEGIN_HEADER * * @description: * A macro that returns true whenever a face object has been altered by - * @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates, or - * @FT_Set_Var_Blend_Coordinates. + * @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates, + * @FT_Set_Var_Blend_Coordinates, or @FT_Set_MM_WeightVector. * * @since: * 2.9 @@ -1628,6 +1804,13 @@ FT_BEGIN_HEADER ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) ) + /************************************************************************** + * + * @section: + * face_creation + * + */ + /************************************************************************** * * @enum: @@ -1654,6 +1837,13 @@ FT_BEGIN_HEADER #define FT_STYLE_FLAG_BOLD ( 1 << 1 ) + /************************************************************************** + * + * @section: + * other_api_data + * + */ + /************************************************************************** * * @type: @@ -1666,6 +1856,13 @@ FT_BEGIN_HEADER typedef struct FT_Size_InternalRec_* FT_Size_Internal; + /************************************************************************** + * + * @section: + * sizing_and_scaling + * + */ + /************************************************************************** * * @struct: @@ -1817,6 +2014,13 @@ FT_BEGIN_HEADER } FT_SizeRec; + /************************************************************************** + * + * @section: + * other_api_data + * + */ + /************************************************************************** * * @struct: @@ -1848,6 +2052,13 @@ FT_BEGIN_HEADER typedef struct FT_Slot_InternalRec_* FT_Slot_Internal; + /************************************************************************** + * + * @section: + * glyph_retrieval + * + */ + /************************************************************************** * * @struct: @@ -2092,6 +2303,13 @@ FT_BEGIN_HEADER /*************************************************************************/ + /************************************************************************** + * + * @section: + * library_setup + * + */ + /************************************************************************** * * @function: @@ -2149,6 +2367,13 @@ FT_BEGIN_HEADER FT_Done_FreeType( FT_Library library ); + /************************************************************************** + * + * @section: + * face_creation + * + */ + /************************************************************************** * * @enum: @@ -2451,7 +2676,7 @@ FT_BEGIN_HEADER * Each new face object created with this function also owns a default * @FT_Size object, accessible as `face->size`. * - * One @FT_Library instance can have multiple face objects, this is, + * One @FT_Library instance can have multiple face objects, that is, * @FT_Open_Face and its siblings can be called multiple times using the * same `library` argument. * @@ -2650,6 +2875,13 @@ FT_BEGIN_HEADER FT_Done_Face( FT_Face face ); + /************************************************************************** + * + * @section: + * sizing_and_scaling + * + */ + /************************************************************************** * * @function: @@ -2679,7 +2911,7 @@ FT_BEGIN_HEADER * silently uses outlines if there is no bitmap for a given glyph index. * * For GX and OpenType variation fonts, a bitmap strike makes sense only - * if the default instance is active (this is, no glyph variation takes + * if the default instance is active (that is, no glyph variation takes * place); otherwise, FreeType simply ignores bitmap strikes. The same * is true for all named instances that are different from the default * instance. @@ -2942,6 +3174,13 @@ FT_BEGIN_HEADER FT_UInt pixel_height ); + /************************************************************************** + * + * @section: + * glyph_retrieval + * + */ + /************************************************************************** * * @function: @@ -2976,7 +3215,7 @@ FT_BEGIN_HEADER * glyph may be transformed. See @FT_Set_Transform for the details. * * For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument` is returned - * for invalid CID values (this is, for CID values that don't have a + * for invalid CID values (that is, for CID values that don't have a * corresponding glyph in the font). See the discussion of the * @FT_FACE_FLAG_CID_KEYED flag for more details. * @@ -2990,6 +3229,13 @@ FT_BEGIN_HEADER FT_Int32 load_flags ); + /************************************************************************** + * + * @section: + * character_mapping + * + */ + /************************************************************************** * * @function: @@ -3033,6 +3279,13 @@ FT_BEGIN_HEADER FT_Int32 load_flags ); + /************************************************************************** + * + * @section: + * glyph_retrieval + * + */ + /************************************************************************** * * @enum: @@ -3172,10 +3425,11 @@ FT_BEGIN_HEADER * * [Since 2.12] If the glyph index maps to an entry in the face's * 'SVG~' table, load the associated SVG document from this table and - * set the `format` field of @FT_GlyphSlotRec to @FT_GLYPH_FORMAT_SVG. - * Note that FreeType itself can't render SVG documents; however, the - * library provides hooks to seamlessly integrate an external renderer. - * See sections @ot_svg_driver and @svg_fonts for more. + * set the `format` field of @FT_GlyphSlotRec to @FT_GLYPH_FORMAT_SVG + * ([since 2.13.1] provided @FT_LOAD_NO_SVG is not set). Note that + * FreeType itself can't render SVG documents; however, the library + * provides hooks to seamlessly integrate an external renderer. See + * sections @ot_svg_driver and @svg_fonts for more. * * [Since 2.10, experimental] If the glyph index maps to an entry in * the face's 'COLR' table with a 'CPAL' palette table (as defined in @@ -3189,6 +3443,9 @@ FT_BEGIN_HEADER * @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering * so that the client application can handle blending by itself. * + * FT_LOAD_NO_SVG :: + * [Since 2.13.1] Ignore SVG glyph data when loading. + * * FT_LOAD_COMPUTE_METRICS :: * [Since 2.6.1] Compute glyph metrics from the glyph data, without the * use of bundled metrics tables (for example, the 'hdmx' table in @@ -3254,6 +3511,7 @@ FT_BEGIN_HEADER #define FT_LOAD_COLOR ( 1L << 20 ) #define FT_LOAD_COMPUTE_METRICS ( 1L << 21 ) #define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 ) +#define FT_LOAD_NO_SVG ( 1L << 24 ) /* */ @@ -3372,6 +3630,13 @@ FT_BEGIN_HEADER FT_STATIC_CAST( FT_Render_Mode, ( (x) >> 16 ) & 15 ) + /************************************************************************** + * + * @section: + * sizing_and_scaling + * + */ + /************************************************************************** * * @function: @@ -3447,6 +3712,13 @@ FT_BEGIN_HEADER FT_Vector* delta ); + /************************************************************************** + * + * @section: + * glyph_retrieval + * + */ + /************************************************************************** * * @enum: @@ -3841,6 +4113,13 @@ FT_BEGIN_HEADER FT_Fixed* akerning ); + /************************************************************************** + * + * @section: + * character_mapping + * + */ + /************************************************************************** * * @function: @@ -4057,6 +4336,13 @@ FT_BEGIN_HEADER FT_UInt *agindex ); + /************************************************************************** + * + * @section: + * face_creation + * + */ + /************************************************************************** * * @function: @@ -4155,6 +4441,13 @@ FT_BEGIN_HEADER FT_Parameter* properties ); + /************************************************************************** + * + * @section: + * information_retrieval + * + */ + /************************************************************************** * * @function: @@ -4266,9 +4559,10 @@ FT_BEGIN_HEADER * * [Since 2.9] Special PostScript names for named instances are only * returned if the named instance is set with @FT_Set_Named_Instance (and - * the font has corresponding entries in its 'fvar' table). If - * @FT_IS_VARIATION returns true, the algorithmically derived PostScript - * name is provided, not looking up special entries for named instances. + * the font has corresponding entries in its 'fvar' table or is the + * default named instance). If @FT_IS_VARIATION returns true, the + * algorithmically derived PostScript name is provided, not looking up + * special entries for named instances. */ FT_EXPORT( const char* ) FT_Get_Postscript_Name( FT_Face face ); @@ -4900,32 +5194,10 @@ FT_BEGIN_HEADER /************************************************************************** * * @section: - * version - * - * @title: - * FreeType Version - * - * @abstract: - * Functions and macros related to FreeType versions. - * - * @description: - * Note that those functions and macros are of limited use because even a - * new release of FreeType with only documentation changes increases the - * version number. - * - * @order: - * FT_Library_Version - * - * FREETYPE_MAJOR - * FREETYPE_MINOR - * FREETYPE_PATCH - * - * FT_Face_CheckTrueTypePatents - * FT_Face_SetUnpatentedHinting + * library_setup * */ - /************************************************************************** * * @enum: @@ -4950,7 +5222,7 @@ FT_BEGIN_HEADER */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 13 -#define FREETYPE_PATCH 0 +#define FREETYPE_PATCH 2 /************************************************************************** @@ -4992,6 +5264,13 @@ FT_BEGIN_HEADER FT_Int *apatch ); + /************************************************************************** + * + * @section: + * other_api_data + * + */ + /************************************************************************** * * @function: diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftchapters.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftchapters.h index 6a9733ad7c1..7566fbd10f8 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftchapters.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftchapters.h @@ -31,9 +31,28 @@ * Core API * * @sections: - * version * basic_types - * base_interface + * library_setup + * face_creation + * font_testing_macros + * sizing_and_scaling + * glyph_retrieval + * character_mapping + * information_retrieval + * other_api_data + * + */ + + + /************************************************************************** + * + * @chapter: + * extended_api + * + * @title: + * Extended API + * + * @sections: * glyph_variants * color_management * layer_management diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h index f90946fd17d..7af7465bc76 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h @@ -134,7 +134,7 @@ FT_BEGIN_HEADER * each being rounded to the nearest pixel edge, taking care of overshoot * suppression at small sizes, stem darkening, and scaling. * - * Hstems (this is, hint values defined in the font to help align + * Hstems (that is, hint values defined in the font to help align * horizontal features) that fall within a blue zone are said to be * 'captured' and are aligned to that zone. Uncaptured stems are moved * in one of four ways, top edge up or down, bottom edge up or down. @@ -446,7 +446,7 @@ FT_BEGIN_HEADER * at smaller sizes. * * For the auto-hinter, stem-darkening is experimental currently and thus - * switched off by default (this is, `no-stem-darkening` is set to TRUE + * switched off by default (that is, `no-stem-darkening` is set to TRUE * by default). Total consistency with the CFF driver is not achieved * right now because the emboldening method differs and glyphs must be * scaled down on the Y-axis to keep outline points inside their @@ -651,11 +651,8 @@ FT_BEGIN_HEADER * Windows~98; only grayscale and B/W rasterizing is supported. * * TT_INTERPRETER_VERSION_38 :: - * Version~38 corresponds to MS rasterizer v.1.9; it is roughly - * equivalent to the hinting provided by DirectWrite ClearType (as can - * be found, for example, in the Internet Explorer~9 running on - * Windows~7). It is used in FreeType to select the 'Infinality' - * subpixel hinting code. The code may be removed in a future version. + * Version~38 is the same Version~40. The original 'Infinality' code is + * no longer available. * * TT_INTERPRETER_VERSION_40 :: * Version~40 corresponds to MS rasterizer v.2.1; it is roughly diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftimage.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftimage.h index 2e8e6734cc0..6baa812560e 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftimage.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftimage.h @@ -19,7 +19,7 @@ /************************************************************************** * * Note: A 'raster' is simply a scan-line converter, used to render - * FT_Outlines into FT_Bitmaps. + * `FT_Outline`s into `FT_Bitmap`s. * */ @@ -256,6 +256,12 @@ FT_BEGIN_HEADER * palette :: * A typeless pointer to the bitmap palette; this field is intended for * paletted pixel modes. Not used currently. + * + * @note: + * `width` and `rows` refer to the *physical* size of the bitmap, not the + * *logical* one. For example, if @FT_Pixel_Mode is set to + * `FT_PIXEL_MODE_LCD`, the logical width is a just a third of the + * physical one. */ typedef struct FT_Bitmap_ { @@ -856,7 +862,7 @@ FT_BEGIN_HEADER * @FT_SpanFunc that takes the y~coordinate of the span as a parameter. * * The anti-aliased rasterizer produces coverage values from 0 to 255, - * this is, from completely transparent to completely opaque. + * that is, from completely transparent to completely opaque. */ typedef struct FT_Span_ { diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftlogging.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftlogging.h index 2246dc83651..53b8b896427 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftlogging.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftlogging.h @@ -62,7 +62,7 @@ FT_BEGIN_HEADER * component. * * ``` - * FT_Trace_Set_Level( "any:7 memory:0 ); + * FT_Trace_Set_Level( "any:7 memory:0" ); * ``` * * @note: diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftmm.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftmm.h index e381ef3d30a..d145128a9bc 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftmm.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftmm.h @@ -153,7 +153,7 @@ FT_BEGIN_HEADER * @note: * The fields `minimum`, `def`, and `maximum` are 16.16 fractional values * for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the - * values are integers. + * values are whole numbers (i.e., the fractional part is zero). */ typedef struct FT_Var_Axis_ { @@ -399,8 +399,8 @@ FT_BEGIN_HEADER * * @note: * The design coordinates are 16.16 fractional values for TrueType GX and - * OpenType variation fonts. For Adobe MM fonts, the values are - * integers. + * OpenType variation fonts. For Adobe MM fonts, the values are supposed + * to be whole numbers (i.e., the fractional part is zero). * * [Since 2.8.1] To reset all axes to the default values, call the * function with `num_coords` set to zero and `coords` set to `NULL`. @@ -446,8 +446,8 @@ FT_BEGIN_HEADER * * @note: * The design coordinates are 16.16 fractional values for TrueType GX and - * OpenType variation fonts. For Adobe MM fonts, the values are - * integers. + * OpenType variation fonts. For Adobe MM fonts, the values are whole + * numbers (i.e., the fractional part is zero). * * @since: * 2.7.1 @@ -602,10 +602,12 @@ FT_BEGIN_HEADER * * @note: * Adobe Multiple Master fonts limit the number of designs, and thus the - * length of the weight vector to~16. + * length of the weight vector to 16~elements. * - * If `len` is zero and `weightvector` is `NULL`, the weight vector array - * is reset to the default values. + * If `len` is larger than zero, this function sets the + * @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e., + * @FT_IS_VARIATION will return true). If `len` is zero, this bit flag + * is unset and the weight vector array is reset to the default values. * * The Adobe documentation also states that the values in the * WeightVector array must total 1.0 +/-~0.001. In practice this does @@ -753,6 +755,45 @@ FT_BEGIN_HEADER FT_Set_Named_Instance( FT_Face face, FT_UInt instance_index ); + + /************************************************************************** + * + * @function: + * FT_Get_Default_Named_Instance + * + * @description: + * Retrieve the index of the default named instance, to be used with + * @FT_Set_Named_Instance. + * + * The default instance of a variation font is that instance for which + * the nth axis coordinate is equal to `axis[n].def` (as specified in the + * @FT_MM_Var structure), with~n covering all axes. + * + * FreeType synthesizes a named instance for the default instance if the + * font does not contain such an entry. + * + * @input: + * face :: + * A handle to the source face. + * + * @output: + * instance_index :: + * The index of the default named instance. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * For Adobe MM fonts (which don't have named instances) this function + * always returns zero for `instance_index`. + * + * @since: + * 2.13.1 + */ + FT_EXPORT( FT_Error ) + FT_Get_Default_Named_Instance( FT_Face face, + FT_UInt *instance_index ); + /* */ diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftoutln.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftoutln.h index 54434b25f6f..f9329ca40c9 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftoutln.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftoutln.h @@ -118,7 +118,7 @@ FT_BEGIN_HEADER * attachement. * * Similarly, the function returns success for an empty outline also - * (doing nothing, this is, not calling any emitter); if necessary, you + * (doing nothing, that is, not calling any emitter); if necessary, you * should filter this out, too. */ FT_EXPORT( FT_Error ) diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftrender.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftrender.h index a8576dab002..0b6fad32e84 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftrender.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftrender.h @@ -158,7 +158,7 @@ FT_BEGIN_HEADER FT_Renderer_GetCBoxFunc get_glyph_cbox; FT_Renderer_SetModeFunc set_mode; - FT_Raster_Funcs* raster_class; + const FT_Raster_Funcs* raster_class; } FT_Renderer_Class; diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftsynth.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftsynth.h index 5d196976572..af90967dda0 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftsynth.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftsynth.h @@ -68,6 +68,18 @@ FT_BEGIN_HEADER FT_EXPORT( void ) FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); + /* Precisely adjust the glyph weight either horizontally or vertically. */ + /* The `xdelta` and `ydelta` values are fractions of the face Em size */ + /* (in fixed-point format). Considering that a regular face would have */ + /* stem widths on the order of 0.1 Em, a delta of 0.05 (0x0CCC) should */ + /* be very noticeable. To increase or decrease the weight, use positive */ + /* or negative values, respectively. */ + FT_EXPORT( void ) + FT_GlyphSlot_AdjustWeight( FT_GlyphSlot slot, + FT_Fixed xdelta, + FT_Fixed ydelta ); + + /* Slant an outline glyph to the right by about 12 degrees. */ FT_EXPORT( void ) FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/ftsystem.h b/src/java.desktop/share/native/libfreetype/include/freetype/ftsystem.h index a995b078de5..3a08f4912c9 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/ftsystem.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftsystem.h @@ -229,8 +229,7 @@ FT_BEGIN_HEADER * A handle to the source stream. * * offset :: - * The offset from the start of the stream to seek to if this is a seek - * operation (see note). + * The offset from the start of the stream to seek to. * * buffer :: * The address of the read buffer. @@ -239,16 +238,9 @@ FT_BEGIN_HEADER * The number of bytes to read from the stream. * * @return: - * The number of bytes effectively read by the stream. - * - * @note: - * This function performs a seek *or* a read operation depending on the - * argument values. If `count` is zero, the operation is a seek to - * `offset` bytes. If `count` is >~0, the operation is a read of `count` - * bytes from the current position in the stream, and the `offset` value - * should be ignored. - * - * For seek operations, a non-zero return value indicates an error. + * If count >~0, return the number of bytes effectively read by the + * stream (after seeking to `offset`). If count ==~0, return the status + * of the seek operation (non-zero indicates an error). * */ typedef unsigned long diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/compiler-macros.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/compiler-macros.h index 7883317fed9..6f67650979e 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/compiler-macros.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/compiler-macros.h @@ -41,8 +41,11 @@ FT_BEGIN_HEADER # if ( defined( __STDC_VERSION__ ) && __STDC_VERSION__ > 201710L ) || \ ( defined( __cplusplus ) && __cplusplus > 201402L ) # define FALL_THROUGH [[__fallthrough__]] -# elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \ - ( defined( __clang__ ) && __clang_major__ >= 10 ) +# elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \ + ( defined( __clang__ ) && \ + ( defined( __apple_build_version__ ) \ + ? __apple_build_version__ >= 12000000 \ + : __clang_major__ >= 10 ) ) # define FALL_THROUGH __attribute__(( __fallthrough__ )) # else # define FALL_THROUGH ( (void)0 ) diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftcalc.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftcalc.h index d1baa392bd6..d9aea236024 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftcalc.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftcalc.h @@ -332,9 +332,9 @@ FT_BEGIN_HEADER * Based on geometric considerations we use the following inequality to * identify a degenerate matrix. * - * 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2 + * 32 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2 * - * Value 50 is heuristic. + * Value 32 is heuristic. */ FT_BASE( FT_Bool ) FT_Matrix_Check( const FT_Matrix* matrix ); diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftdrv.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftdrv.h index f78912ca0c7..9001c07ad0b 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftdrv.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftdrv.h @@ -157,6 +157,7 @@ FT_BEGIN_HEADER * A handle to a function used to select a new fixed size. It is used * only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the * scaling done in the base layer suffices. + * * @note: * Most function pointers, with the exception of `load_glyph`, can be set * to 0 to indicate a default behaviour. diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftmmtypes.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftmmtypes.h index b7c66c35def..c4b21d6144e 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftmmtypes.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftmmtypes.h @@ -28,13 +28,19 @@ FT_BEGIN_HEADER typedef struct GX_ItemVarDataRec_ { - FT_UInt itemCount; /* number of delta sets per item */ - FT_UInt regionIdxCount; /* number of region indices */ - FT_UInt* regionIndices; /* array of `regionCount' indices; */ - /* these index `varRegionList' */ - FT_ItemVarDelta* deltaSet; /* array of `itemCount' deltas */ - /* use `innerIndex' for this array */ - + FT_UInt itemCount; /* Number of delta sets per item. */ + FT_UInt regionIdxCount; /* Number of region indices. */ + FT_UInt* regionIndices; /* Array of `regionCount` indices; */ + /* these index `varRegionList`. */ + FT_Byte* deltaSet; /* Array of `itemCount` deltas; */ + /* use `innerIndex` for this array. */ + FT_UShort wordDeltaCount; /* Number of the first 32-bit ints */ + /* or 16-bit ints of `deltaSet` */ + /* depending on `longWords`. */ + FT_Bool longWords; /* If true, `deltaSet` is a 32-bit */ + /* array followed by a 16-bit */ + /* array, otherwise a 16-bit array */ + /* followed by an 8-bit array. */ } GX_ItemVarDataRec, *GX_ItemVarData; diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmetric.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmetric.h index e588ea4872a..167617ebb3d 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmetric.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmetric.h @@ -77,6 +77,9 @@ FT_BEGIN_HEADER typedef void (*FT_Metrics_Adjust_Func)( FT_Face face ); + typedef FT_Error + (*FT_Size_Reset_Func)( FT_Size size ); + FT_DEFINE_SERVICE( MetricsVariations ) { @@ -90,6 +93,7 @@ FT_BEGIN_HEADER FT_VOrg_Adjust_Func vorg_adjust; FT_Metrics_Adjust_Func metrics_adjust; + FT_Size_Reset_Func size_reset; }; @@ -101,7 +105,8 @@ FT_BEGIN_HEADER tsb_adjust_, \ bsb_adjust_, \ vorg_adjust_, \ - metrics_adjust_ ) \ + metrics_adjust_, \ + size_reset_ ) \ static const FT_Service_MetricsVariationsRec class_ = \ { \ hadvance_adjust_, \ @@ -111,7 +116,8 @@ FT_BEGIN_HEADER tsb_adjust_, \ bsb_adjust_, \ vorg_adjust_, \ - metrics_adjust_ \ + metrics_adjust_, \ + size_reset_ \ }; /* */ diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmm.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmm.h index d94204232e1..7e76ab8324e 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmm.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmm.h @@ -60,9 +60,9 @@ FT_BEGIN_HEADER /* use return value -1 to indicate that the new coordinates */ /* are equal to the current ones; no changes are thus needed */ typedef FT_Error - (*FT_Set_MM_Blend_Func)( FT_Face face, - FT_UInt num_coords, - FT_Long* coords ); + (*FT_Set_MM_Blend_Func)( FT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); typedef FT_Error (*FT_Get_Var_Design_Func)( FT_Face face, @@ -70,13 +70,17 @@ FT_BEGIN_HEADER FT_Fixed* coords ); typedef FT_Error - (*FT_Set_Instance_Func)( FT_Face face, - FT_UInt instance_index ); + (*FT_Set_Named_Instance_Func)( FT_Face face, + FT_UInt instance_index ); typedef FT_Error - (*FT_Get_MM_Blend_Func)( FT_Face face, - FT_UInt num_coords, - FT_Long* coords ); + (*FT_Get_Default_Named_Instance_Func)( FT_Face face, + FT_UInt *instance_index ); + + typedef FT_Error + (*FT_Get_MM_Blend_Func)( FT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); typedef FT_Error (*FT_Get_Var_Blend_Func)( FT_Face face, @@ -86,7 +90,7 @@ FT_BEGIN_HEADER FT_MM_Var* *mm_var ); typedef void - (*FT_Done_Blend_Func)( FT_Face ); + (*FT_Done_Blend_Func)( FT_Face face ); typedef FT_Error (*FT_Set_MM_WeightVector_Func)( FT_Face face, @@ -98,6 +102,9 @@ FT_BEGIN_HEADER FT_UInt* len, FT_Fixed* weight_vector ); + typedef void + (*FT_Construct_PS_Name_Func)( FT_Face face ); + typedef FT_Error (*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face, FT_ULong offset, @@ -134,11 +141,13 @@ FT_BEGIN_HEADER FT_Get_MM_Var_Func get_mm_var; FT_Set_Var_Design_Func set_var_design; FT_Get_Var_Design_Func get_var_design; - FT_Set_Instance_Func set_instance; + FT_Set_Named_Instance_Func set_named_instance; + FT_Get_Default_Named_Instance_Func get_default_named_instance; FT_Set_MM_WeightVector_Func set_mm_weightvector; FT_Get_MM_WeightVector_Func get_mm_weightvector; /* for internal use; only needed for code sharing between modules */ + FT_Construct_PS_Name_Func construct_ps_name; FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map; FT_Var_Load_Item_Var_Store_Func load_item_var_store; FT_Var_Get_Item_Delta_Func get_item_delta; @@ -149,43 +158,49 @@ FT_BEGIN_HEADER }; -#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \ - get_mm_, \ - set_mm_design_, \ - set_mm_blend_, \ - get_mm_blend_, \ - get_mm_var_, \ - set_var_design_, \ - get_var_design_, \ - set_instance_, \ - set_weightvector_, \ - get_weightvector_, \ - load_delta_set_idx_map_, \ - load_item_var_store_, \ - get_item_delta_, \ - done_item_var_store_, \ - done_delta_set_idx_map_, \ - get_var_blend_, \ - done_blend_ ) \ - static const FT_Service_MultiMastersRec class_ = \ - { \ - get_mm_, \ - set_mm_design_, \ - set_mm_blend_, \ - get_mm_blend_, \ - get_mm_var_, \ - set_var_design_, \ - get_var_design_, \ - set_instance_, \ - set_weightvector_, \ - get_weightvector_, \ - load_delta_set_idx_map_, \ - load_item_var_store_, \ - get_item_delta_, \ - done_item_var_store_, \ - done_delta_set_idx_map_, \ - get_var_blend_, \ - done_blend_ \ +#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \ + get_mm_, \ + set_mm_design_, \ + set_mm_blend_, \ + get_mm_blend_, \ + get_mm_var_, \ + set_var_design_, \ + get_var_design_, \ + set_named_instance_, \ + get_default_named_instance_, \ + set_mm_weightvector_, \ + get_mm_weightvector_, \ + \ + construct_ps_name_, \ + load_delta_set_idx_map_, \ + load_item_var_store_, \ + get_item_delta_, \ + done_item_var_store_, \ + done_delta_set_idx_map_, \ + get_var_blend_, \ + done_blend_ ) \ + static const FT_Service_MultiMastersRec class_ = \ + { \ + get_mm_, \ + set_mm_design_, \ + set_mm_blend_, \ + get_mm_blend_, \ + get_mm_var_, \ + set_var_design_, \ + get_var_design_, \ + set_named_instance_, \ + get_default_named_instance_, \ + set_mm_weightvector_, \ + get_mm_weightvector_, \ + \ + construct_ps_name_, \ + load_delta_set_idx_map_, \ + load_item_var_store_, \ + get_item_delta_, \ + done_item_var_store_, \ + done_delta_set_idx_map_, \ + get_var_blend_, \ + done_blend_ \ }; /* */ diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpscmap.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpscmap.h index fd99d857e47..6e599f3aabe 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpscmap.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpscmap.h @@ -97,7 +97,7 @@ FT_BEGIN_HEADER (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes, FT_UInt32 unicode ); - typedef FT_UInt32 + typedef FT_UInt (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes, FT_UInt32 *unicode ); diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/t1types.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/t1types.h index 5a105c58795..b9c94398fd1 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/t1types.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/t1types.h @@ -201,30 +201,30 @@ FT_BEGIN_HEADER typedef struct T1_FaceRec_ { - FT_FaceRec root; - T1_FontRec type1; - const void* psnames; - const void* psaux; - const void* afm_data; - FT_CharMapRec charmaprecs[2]; - FT_CharMap charmaps[2]; + FT_FaceRec root; + T1_FontRec type1; + const void* psnames; + const void* psaux; + const void* afm_data; + FT_CharMapRec charmaprecs[2]; + FT_CharMap charmaps[2]; /* support for Multiple Masters fonts */ - PS_Blend blend; + PS_Blend blend; /* undocumented, optional: indices of subroutines that express */ /* the NormalizeDesignVector and the ConvertDesignVector procedure, */ /* respectively, as Type 2 charstrings; -1 if keywords not present */ - FT_Int ndv_idx; - FT_Int cdv_idx; + FT_Int ndv_idx; + FT_Int cdv_idx; /* undocumented, optional: has the same meaning as len_buildchar */ /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */ - FT_UInt len_buildchar; - FT_Long* buildchar; + FT_UInt len_buildchar; + FT_Long* buildchar; /* since version 2.1 - interface to PostScript hinter */ - const void* pshinter; + const void* pshinter; } T1_FaceRec; diff --git a/src/java.desktop/share/native/libfreetype/include/freetype/internal/tttypes.h b/src/java.desktop/share/native/libfreetype/include/freetype/internal/tttypes.h index 3b521924ca5..b9788c7831e 100644 --- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/tttypes.h +++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/tttypes.h @@ -779,13 +779,15 @@ FT_BEGIN_HEADER /************************************************************************** * * @struct: - * TT_Post_20Rec + * TT_Post_NamesRec * * @description: - * Postscript names sub-table, format 2.0. Stores the PS name of each - * glyph in the font face. + * Postscript names table, either format 2.0 or 2.5. * * @fields: + * loaded :: + * A flag to indicate whether the PS names are loaded. + * * num_glyphs :: * The number of named glyphs in the table. * @@ -798,68 +800,13 @@ FT_BEGIN_HEADER * glyph_names :: * The PS names not in Mac Encoding. */ - typedef struct TT_Post_20Rec_ + typedef struct TT_Post_NamesRec_ { + FT_Bool loaded; FT_UShort num_glyphs; FT_UShort num_names; FT_UShort* glyph_indices; - FT_Char** glyph_names; - - } TT_Post_20Rec, *TT_Post_20; - - - /************************************************************************** - * - * @struct: - * TT_Post_25Rec - * - * @description: - * Postscript names sub-table, format 2.5. Stores the PS name of each - * glyph in the font face. - * - * @fields: - * num_glyphs :: - * The number of glyphs in the table. - * - * offsets :: - * An array of signed offsets in a normal Mac Postscript name encoding. - */ - typedef struct TT_Post_25_ - { - FT_UShort num_glyphs; - FT_Char* offsets; - - } TT_Post_25Rec, *TT_Post_25; - - - /************************************************************************** - * - * @struct: - * TT_Post_NamesRec - * - * @description: - * Postscript names table, either format 2.0 or 2.5. - * - * @fields: - * loaded :: - * A flag to indicate whether the PS names are loaded. - * - * format_20 :: - * The sub-table used for format 2.0. - * - * format_25 :: - * The sub-table used for format 2.5. - */ - typedef struct TT_Post_NamesRec_ - { - FT_Bool loaded; - - union - { - TT_Post_20Rec format_20; - TT_Post_25Rec format_25; - - } names; + FT_Byte** glyph_names; } TT_Post_NamesRec, *TT_Post_Names; @@ -1253,12 +1200,16 @@ FT_BEGIN_HEADER * mm :: * A pointer to the Multiple Masters service. * - * var :: - * A pointer to the Metrics Variations service. + * tt_var :: + * A pointer to the Metrics Variations service for the "truetype" + * driver. * - * hdmx :: - * The face's horizontal device metrics ('hdmx' table). This table is - * optional in TrueType/OpenType fonts. + * face_var :: + * A pointer to the Metrics Variations service for this `TT_Face`'s + * driver. + * + * psaux :: + * A pointer to the PostScript Auxiliary service. * * gasp :: * The grid-fitting and scaling properties table ('gasp'). This table @@ -1364,6 +1315,12 @@ FT_BEGIN_HEADER * var_postscript_prefix_len :: * The length of the `var_postscript_prefix` string. * + * var_default_named_instance :: + * The index of the default named instance. + * + * non_var_style_name :: + * The non-variation style name, used as a backup. + * * horz_metrics_size :: * The size of the 'hmtx' table. * @@ -1410,14 +1367,6 @@ FT_BEGIN_HEADER * A mapping between the strike indices exposed by the API and the * indices used in the font's sbit table. * - * cpal :: - * A pointer to data related to the 'CPAL' table. `NULL` if the table - * is not available. - * - * colr :: - * A pointer to data related to the 'COLR' table. `NULL` if the table - * is not available. - * * kern_table :: * A pointer to the 'kern' table. * @@ -1445,19 +1394,23 @@ FT_BEGIN_HEADER * vert_metrics_offset :: * The file offset of the 'vmtx' table. * - * sph_found_func_flags :: - * Flags identifying special bytecode functions (used by the v38 - * implementation of the bytecode interpreter). - * - * sph_compatibility_mode :: - * This flag is set if we are in ClearType backward compatibility mode - * (used by the v38 implementation of the bytecode interpreter). - * * ebdt_start :: * The file offset of the sbit data table (CBDT, bdat, etc.). * * ebdt_size :: * The size of the sbit data table. + * + * cpal :: + * A pointer to data related to the 'CPAL' table. `NULL` if the table + * is not available. + * + * colr :: + * A pointer to data related to the 'COLR' table. `NULL` if the table + * is not available. + * + * svg :: + * A pointer to data related to the 'SVG' table. `NULL` if the table + * is not available. */ typedef struct TT_FaceRec_ { @@ -1508,8 +1461,14 @@ FT_BEGIN_HEADER void* mm; /* a typeless pointer to the FT_Service_MetricsVariationsRec table */ - /* used to handle the HVAR, VVAR, and MVAR OpenType tables */ - void* var; + /* used to handle the HVAR, VVAR, and MVAR OpenType tables by the */ + /* "truetype" driver */ + void* tt_var; + + /* a typeless pointer to the FT_Service_MetricsVariationsRec table */ + /* used to handle the HVAR, VVAR, and MVAR OpenType tables by this */ + /* TT_Face's driver */ + void* face_var; /* since 2.13.1 */ #endif /* a typeless pointer to the PostScript Aux service */ @@ -1591,6 +1550,9 @@ FT_BEGIN_HEADER const char* var_postscript_prefix; /* since 2.7.2 */ FT_UInt var_postscript_prefix_len; /* since 2.7.2 */ + FT_UInt var_default_named_instance; /* since 2.13.1 */ + + const char* non_var_style_name; /* since 2.13.1 */ #endif /* since version 2.2 */ @@ -1627,13 +1589,6 @@ FT_BEGIN_HEADER FT_ULong horz_metrics_offset; FT_ULong vert_metrics_offset; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* since 2.4.12 */ - FT_ULong sph_found_func_flags; /* special functions found */ - /* for this face */ - FT_Bool sph_compatibility_mode; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS /* since 2.7 */ FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */ diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afblue.dat b/src/java.desktop/share/native/libfreetype/src/autofit/afblue.dat index b7efe8be6ce..8299baa2591 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afblue.dat +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afblue.dat @@ -89,7 +89,7 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: "ت ث ط ظ ك" // We don't necessarily have access to medial forms via Unicode in case // Arabic presentational forms are missing. The only character that is - // guaranteed to have the same vertical position with joining (this is, + // guaranteed to have the same vertical position with joining (that is, // non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both // round and flat curves. AF_BLUE_STRING_ARABIC_JOIN diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.c b/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.c index 5daefff359c..f414289adcd 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.c @@ -417,16 +417,14 @@ { FT_Int nn; - FT_Int first = 0; - FT_Int last = -1; + FT_Int pp, first, last; - for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ ) + last = -1; + for ( nn = 0; nn < outline.n_contours; nn++ ) { - FT_Int pp; - - - last = outline.contours[nn]; + first = last + 1; + last = outline.contours[nn]; /* Avoid single-point contours since they are never rasterized. */ /* In some fonts, they correspond to mark attachment points */ @@ -569,8 +567,8 @@ af_cjk_metrics_check_digits( AF_CJKMetrics metrics, FT_Face face ) { - FT_Bool started = 0, same_width = 1; - FT_Fixed advance = 0, old_advance = 0; + FT_Bool started = 0, same_width = 1; + FT_Long advance = 0, old_advance = 0; /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ @@ -635,10 +633,11 @@ /* Initialize global metrics. */ FT_LOCAL_DEF( FT_Error ) - af_cjk_metrics_init( AF_CJKMetrics metrics, - FT_Face face ) + af_cjk_metrics_init( AF_StyleMetrics metrics_, /* AF_CJKMetrics */ + FT_Face face ) { - FT_CharMap oldmap = face->charmap; + AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_; + FT_CharMap oldmap = face->charmap; metrics->units_per_em = face->units_per_EM; @@ -756,9 +755,12 @@ /* Scale global values in both directions. */ FT_LOCAL_DEF( void ) - af_cjk_metrics_scale( AF_CJKMetrics metrics, - AF_Scaler scaler ) + af_cjk_metrics_scale( AF_StyleMetrics metrics_, /* AF_CJKMetrics */ + AF_Scaler scaler ) { + AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_; + + /* we copy the whole structure since the x and y scaling values */ /* are not modified, contrary to e.g. the `latin' auto-hinter */ metrics->root.scaler = *scaler; @@ -771,11 +773,14 @@ /* Extract standard_width from writing system/script specific */ /* metrics class. */ - FT_LOCAL_DEF( void ) - af_cjk_get_standard_widths( AF_CJKMetrics metrics, - FT_Pos* stdHW, - FT_Pos* stdVW ) + FT_CALLBACK_DEF( void ) + af_cjk_get_standard_widths( AF_StyleMetrics metrics_, /* AF_CJKMetrics */ + FT_Pos* stdHW, + FT_Pos* stdVW ) { + AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_; + + if ( stdHW ) *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; @@ -1376,9 +1381,10 @@ /* Initalize hinting engine. */ FT_LOCAL_DEF( FT_Error ) - af_cjk_hints_init( AF_GlyphHints hints, - AF_CJKMetrics metrics ) + af_cjk_hints_init( AF_GlyphHints hints, + AF_StyleMetrics metrics_ ) /* AF_CJKMetrics */ { + AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_; FT_Render_Mode mode; FT_UInt32 scaler_flags, other_flags; @@ -1628,7 +1634,7 @@ stem_edge->pos = base_edge->pos + fitted_width; - FT_TRACE5(( " CJKLINK: edge %ld @%d (opos=%.2f) linked to %.2f," + FT_TRACE5(( " CJKLINK: edge %td @%d (opos=%.2f) linked to %.2f," " dist was %.2f, now %.2f\n", stem_edge - hints->axis[dim].edges, stem_edge->fpos, (double)stem_edge->opos / 64, @@ -1852,7 +1858,7 @@ continue; #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " CJKBLUE: edge %ld @%d (opos=%.2f) snapped to %.2f," + FT_TRACE5(( " CJKBLUE: edge %td @%d (opos=%.2f) snapped to %.2f," " was %.2f\n", edge1 - edges, edge1->fpos, (double)edge1->opos / 64, (double)blue->fit / 64, (double)edge1->pos / 64 )); @@ -1916,7 +1922,7 @@ /* this should not happen, but it's better to be safe */ if ( edge2->blue_edge ) { - FT_TRACE5(( "ASSERTION FAILED for edge %ld\n", edge2-edges )); + FT_TRACE5(( "ASSERTION FAILED for edge %td\n", edge2 - edges )); af_cjk_align_linked_edge( hints, dim, edge2, edge ); edge->flags |= AF_EDGE_DONE; @@ -2268,11 +2274,13 @@ /* Apply the complete hinting algorithm to a CJK glyph. */ FT_LOCAL_DEF( FT_Error ) - af_cjk_hints_apply( FT_UInt glyph_index, - AF_GlyphHints hints, - FT_Outline* outline, - AF_CJKMetrics metrics ) + af_cjk_hints_apply( FT_UInt glyph_index, + AF_GlyphHints hints, + FT_Outline* outline, + AF_StyleMetrics metrics_ ) /* AF_CJKMetrics */ { + AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_; + FT_Error error; int dim; diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.h b/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.h index bd7b81b3e24..f380ef6e032 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.h +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afcjk.h @@ -103,22 +103,22 @@ FT_BEGIN_HEADER #ifdef AF_CONFIG_OPTION_CJK FT_LOCAL( FT_Error ) - af_cjk_metrics_init( AF_CJKMetrics metrics, - FT_Face face ); + af_cjk_metrics_init( AF_StyleMetrics metrics, + FT_Face face ); FT_LOCAL( void ) - af_cjk_metrics_scale( AF_CJKMetrics metrics, - AF_Scaler scaler ); + af_cjk_metrics_scale( AF_StyleMetrics metrics, + AF_Scaler scaler ); FT_LOCAL( FT_Error ) - af_cjk_hints_init( AF_GlyphHints hints, - AF_CJKMetrics metrics ); + af_cjk_hints_init( AF_GlyphHints hints, + AF_StyleMetrics metrics ); FT_LOCAL( FT_Error ) - af_cjk_hints_apply( FT_UInt glyph_index, - AF_GlyphHints hints, - FT_Outline* outline, - AF_CJKMetrics metrics ); + af_cjk_hints_apply( FT_UInt glyph_index, + AF_GlyphHints hints, + FT_Outline* outline, + AF_StyleMetrics metrics ); /* shared; called from afindic.c */ FT_LOCAL( void ) diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.c b/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.c index ede27eb1660..b1957570f03 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.c @@ -376,8 +376,11 @@ FT_LOCAL_DEF( void ) - af_face_globals_free( AF_FaceGlobals globals ) + af_face_globals_free( void* globals_ ) { + AF_FaceGlobals globals = (AF_FaceGlobals)globals_; + + if ( globals ) { FT_Memory memory = globals->face->memory; diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.h b/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.h index 83a7c2ff15b..66170e419dd 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.h +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afglobal.h @@ -156,7 +156,7 @@ FT_BEGIN_HEADER AF_StyleMetrics *ametrics ); FT_LOCAL( void ) - af_face_globals_free( AF_FaceGlobals globals ); + af_face_globals_free( void* globals ); FT_LOCAL( FT_Bool ) af_face_globals_is_digit( AF_FaceGlobals globals, diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afhints.c b/src/java.desktop/share/native/libfreetype/src/autofit/afhints.c index 6515af9f04e..e4a378fbf74 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afhints.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afhints.c @@ -320,8 +320,9 @@ static char* - af_print_idx( char* p, - int idx ) + af_print_idx( char* p, + size_t n, + int idx ) { if ( idx == -1 ) { @@ -330,7 +331,7 @@ p[2] = '\0'; } else - ft_sprintf( p, "%d", idx ); + ft_snprintf( p, n, "%d", idx ); return p; } @@ -457,12 +458,12 @@ " %5d %5d %7.2f %7.2f %7.2f %7.2f" " %5s %5s %5s %5s\n", point_idx, - af_print_idx( buf1, + af_print_idx( buf1, 16, af_get_edge_index( hints, segment_idx_1, 1 ) ), - af_print_idx( buf2, segment_idx_1 ), - af_print_idx( buf3, + af_print_idx( buf2, 16, segment_idx_1 ), + af_print_idx( buf3, 16, af_get_edge_index( hints, segment_idx_0, 0 ) ), - af_print_idx( buf4, segment_idx_0 ), + af_print_idx( buf4, 16, segment_idx_0 ), ( point->flags & AF_FLAG_NEAR ) ? " near " : ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) @@ -476,18 +477,22 @@ (double)point->x / 64, (double)point->y / 64, - af_print_idx( buf5, af_get_strong_edge_index( hints, - point->before, - 1 ) ), - af_print_idx( buf6, af_get_strong_edge_index( hints, - point->after, - 1 ) ), - af_print_idx( buf7, af_get_strong_edge_index( hints, - point->before, - 0 ) ), - af_print_idx( buf8, af_get_strong_edge_index( hints, - point->after, - 0 ) ) )); + af_print_idx( buf5, 16, + af_get_strong_edge_index( hints, + point->before, + 1 ) ), + af_print_idx( buf6, 16, + af_get_strong_edge_index( hints, + point->after, + 1 ) ), + af_print_idx( buf7, 16, + af_get_strong_edge_index( hints, + point->before, + 0 ) ), + af_print_idx( buf8, 16, + af_get_strong_edge_index( hints, + point->after, + 0 ) ) )); } AF_DUMP(( "\n" )); } @@ -574,9 +579,12 @@ AF_INDEX_NUM( seg->first, points ), AF_INDEX_NUM( seg->last, points ), - af_print_idx( buf1, AF_INDEX_NUM( seg->link, segments ) ), - af_print_idx( buf2, AF_INDEX_NUM( seg->serif, segments ) ), - af_print_idx( buf3, AF_INDEX_NUM( seg->edge, edges ) ), + af_print_idx( buf1, 16, + AF_INDEX_NUM( seg->link, segments ) ), + af_print_idx( buf2, 16, + AF_INDEX_NUM( seg->serif, segments ) ), + af_print_idx( buf3, 16, + AF_INDEX_NUM( seg->edge, edges ) ), seg->height, seg->height - ( seg->max_coord - seg->min_coord ), @@ -716,8 +724,10 @@ AF_INDEX_NUM( edge, edges ), (double)(int)edge->opos / 64, af_dir_str( (AF_Direction)edge->dir ), - af_print_idx( buf1, AF_INDEX_NUM( edge->link, edges ) ), - af_print_idx( buf2, AF_INDEX_NUM( edge->serif, edges ) ), + af_print_idx( buf1, 16, + AF_INDEX_NUM( edge->link, edges ) ), + af_print_idx( buf2, 16, + AF_INDEX_NUM( edge->serif, edges ) ), edge->blue_edge ? 'y' : 'n', (double)edge->opos / 64, diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afindic.c b/src/java.desktop/share/native/libfreetype/src/autofit/afindic.c index 289a09d71d8..7fb12c63d5a 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afindic.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afindic.c @@ -28,9 +28,12 @@ static FT_Error - af_indic_metrics_init( AF_CJKMetrics metrics, - FT_Face face ) + af_indic_metrics_init( AF_StyleMetrics metrics_, /* AF_CJKMetrics */ + FT_Face face ) { + AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_; + + /* skip blue zone init in CJK routines */ FT_CharMap oldmap = face->charmap; @@ -55,8 +58,8 @@ static void - af_indic_metrics_scale( AF_CJKMetrics metrics, - AF_Scaler scaler ) + af_indic_metrics_scale( AF_StyleMetrics metrics, + AF_Scaler scaler ) { /* use CJK routines */ af_cjk_metrics_scale( metrics, scaler ); @@ -64,8 +67,8 @@ static FT_Error - af_indic_hints_init( AF_GlyphHints hints, - AF_CJKMetrics metrics ) + af_indic_hints_init( AF_GlyphHints hints, + AF_StyleMetrics metrics ) { /* use CJK routines */ return af_cjk_hints_init( hints, metrics ); @@ -73,10 +76,10 @@ static FT_Error - af_indic_hints_apply( FT_UInt glyph_index, - AF_GlyphHints hints, - FT_Outline* outline, - AF_CJKMetrics metrics ) + af_indic_hints_apply( FT_UInt glyph_index, + AF_GlyphHints hints, + FT_Outline* outline, + AF_StyleMetrics metrics ) { /* use CJK routines */ return af_cjk_hints_apply( glyph_index, hints, outline, metrics ); @@ -87,10 +90,13 @@ /* metrics class. */ static void - af_indic_get_standard_widths( AF_CJKMetrics metrics, - FT_Pos* stdHW, - FT_Pos* stdVW ) + af_indic_get_standard_widths( AF_StyleMetrics metrics_, /* AF_CJKMetrics */ + FT_Pos* stdHW, + FT_Pos* stdVW ) { + AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_; + + if ( stdHW ) *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.c b/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.c index 4b3c59b3c31..b86367aa94d 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.c @@ -496,23 +496,20 @@ /* now compute min or max point indices and coordinates */ points = outline.points; best_point = -1; + best_contour_first = -1; + best_contour_last = -1; best_y = 0; /* make compiler happy */ - best_contour_first = 0; /* ditto */ - best_contour_last = 0; /* ditto */ { FT_Int nn; - FT_Int first = 0; - FT_Int last = -1; + FT_Int pp, first, last; - for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ ) + last = -1; + for ( nn = 0; nn < outline.n_contours; nn++ ) { - FT_Int old_best_point = best_point; - FT_Int pp; - - - last = outline.contours[nn]; + first = last + 1; + last = outline.contours[nn]; /* Avoid single-point contours since they are never */ /* rasterized. In some fonts, they correspond to mark */ @@ -551,7 +548,7 @@ } } - if ( best_point != old_best_point ) + if ( best_point > best_contour_last ) { best_contour_first = first; best_contour_last = last; @@ -1025,7 +1022,7 @@ { *a = *b; FT_TRACE5(( "blue zone overlap:" - " adjusting %s %ld to %ld\n", + " adjusting %s %td to %ld\n", a_is_top ? "overshoot" : "reference", blue_sorted[i] - axis->blues, *a )); @@ -1068,8 +1065,8 @@ af_latin_metrics_check_digits( AF_LatinMetrics metrics, FT_Face face ) { - FT_Bool started = 0, same_width = 1; - FT_Fixed advance = 0, old_advance = 0; + FT_Bool started = 0, same_width = 1; + FT_Long advance = 0, old_advance = 0; /* If HarfBuzz is not available, we need a pointer to a single */ /* unsigned long value. */ @@ -1134,9 +1131,11 @@ /* Initialize global metrics. */ FT_LOCAL_DEF( FT_Error ) - af_latin_metrics_init( AF_LatinMetrics metrics, + af_latin_metrics_init( AF_StyleMetrics metrics_, /* AF_LatinMetrics */ FT_Face face ) { + AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_; + FT_Error error = FT_Err_Ok; FT_CharMap oldmap = face->charmap; @@ -1489,9 +1488,12 @@ /* Scale global values in both directions. */ FT_LOCAL_DEF( void ) - af_latin_metrics_scale( AF_LatinMetrics metrics, + af_latin_metrics_scale( AF_StyleMetrics metrics_, /* AF_LatinMetrics */ AF_Scaler scaler ) { + AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_; + + metrics->root.scaler.render_mode = scaler->render_mode; metrics->root.scaler.face = scaler->face; metrics->root.scaler.flags = scaler->flags; @@ -1504,11 +1506,14 @@ /* Extract standard_width from writing system/script specific */ /* metrics class. */ - FT_LOCAL_DEF( void ) - af_latin_get_standard_widths( AF_LatinMetrics metrics, + FT_CALLBACK_DEF( void ) + af_latin_get_standard_widths( AF_StyleMetrics metrics_, /* AF_LatinMetrics */ FT_Pos* stdHW, FT_Pos* stdVW ) { + AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_; + + if ( stdHW ) *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; @@ -2041,7 +2046,7 @@ max = seg2->max_coord; /* compute maximum coordinate difference of the two segments */ - /* (this is, how much they overlap) */ + /* (that is, how much they overlap) */ len = max - min; if ( len >= len_threshold ) { @@ -2610,8 +2615,10 @@ static FT_Error af_latin_hints_init( AF_GlyphHints hints, - AF_LatinMetrics metrics ) + AF_StyleMetrics metrics_ ) /* AF_LatinMetrics */ { + AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_; + FT_Render_Mode mode; FT_UInt32 scaler_flags, other_flags; FT_Face face = metrics->root.scaler.face; @@ -2953,7 +2960,7 @@ stem_edge->pos = base_edge->pos + fitted_width; - FT_TRACE5(( " LINK: edge %ld (opos=%.2f) linked to %.2f," + FT_TRACE5(( " LINK: edge %td (opos=%.2f) linked to %.2f," " dist was %.2f, now %.2f\n", stem_edge - hints->axis[dim].edges, (double)stem_edge->opos / 64, (double)stem_edge->pos / 64, @@ -3078,13 +3085,13 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( !anchor ) - FT_TRACE5(( " BLUE_ANCHOR: edge %ld (opos=%.2f) snapped to %.2f," - " was %.2f (anchor=edge %ld)\n", + FT_TRACE5(( " BLUE_ANCHOR: edge %td (opos=%.2f) snapped to %.2f," + " was %.2f (anchor=edge %td)\n", edge1 - edges, (double)edge1->opos / 64, (double)blue->fit / 64, (double)edge1->pos / 64, edge - edges )); else - FT_TRACE5(( " BLUE: edge %ld (opos=%.2f) snapped to %.2f," + FT_TRACE5(( " BLUE: edge %td (opos=%.2f) snapped to %.2f," " was %.2f\n", edge1 - edges, (double)edge1->opos / 64, (double)blue->fit / 64, @@ -3134,7 +3141,7 @@ /* this should not happen, but it's better to be safe */ if ( edge2->blue_edge ) { - FT_TRACE5(( " ASSERTION FAILED for edge %ld\n", edge2 - edges )); + FT_TRACE5(( " ASSERTION FAILED for edge %td\n", edge2 - edges )); af_latin_align_linked_edge( hints, dim, edge2, edge ); edge->flags |= AF_EDGE_DONE; @@ -3202,7 +3209,7 @@ anchor = edge; edge->flags |= AF_EDGE_DONE; - FT_TRACE5(( " ANCHOR: edge %ld (opos=%.2f) and %ld (opos=%.2f)" + FT_TRACE5(( " ANCHOR: edge %td (opos=%.2f) and %td (opos=%.2f)" " snapped to %.2f and %.2f\n", edge - edges, (double)edge->opos / 64, edge2 - edges, (double)edge2->opos / 64, @@ -3231,7 +3238,7 @@ if ( edge2->flags & AF_EDGE_DONE ) { - FT_TRACE5(( " ADJUST: edge %ld (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " ADJUST: edge %td (pos=%.2f) moved to %.2f\n", edge - edges, (double)edge->pos / 64, (double)( edge2->pos - cur_len ) / 64 )); @@ -3272,7 +3279,7 @@ edge->pos = cur_pos1 - cur_len / 2; edge2->pos = cur_pos1 + cur_len / 2; - FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)" + FT_TRACE5(( " STEM: edge %td (opos=%.2f) linked to %td (opos=%.2f)" " snapped to %.2f and %.2f\n", edge - edges, (double)edge->opos / 64, edge2 - edges, (double)edge2->opos / 64, @@ -3303,7 +3310,7 @@ edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2; edge2->pos = edge->pos + cur_len; - FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)" + FT_TRACE5(( " STEM: edge %td (opos=%.2f) linked to %td (opos=%.2f)" " snapped to %.2f and %.2f\n", edge - edges, (double)edge->opos / 64, edge2 - edges, (double)edge2->opos / 64, @@ -3326,7 +3333,7 @@ if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " BOUND: edge %td (pos=%.2f) moved to %.2f\n", edge - edges, (double)edge->pos / 64, (double)edge[-1].pos / 64 )); @@ -3428,7 +3435,7 @@ if ( delta < 64 + 16 ) { af_latin_align_serif_edge( hints, edge->serif, edge ); - FT_TRACE5(( " SERIF: edge %ld (opos=%.2f) serif to %ld (opos=%.2f)" + FT_TRACE5(( " SERIF: edge %td (opos=%.2f) serif to %td (opos=%.2f)" " aligned to %.2f\n", edge - edges, (double)edge->opos / 64, edge->serif - edges, (double)edge->serif->opos / 64, @@ -3438,9 +3445,9 @@ { edge->pos = FT_PIX_ROUND( edge->opos ); anchor = edge; - FT_TRACE5(( " SERIF_ANCHOR: edge %ld (opos=%.2f)" + FT_TRACE5(( " SERIF_ANCHOR: edge %td (opos=%.2f)" " snapped to %.2f\n", - edge-edges, + edge - edges, (double)edge->opos / 64, (double)edge->pos / 64 )); } else @@ -3467,8 +3474,8 @@ after->pos - before->pos, after->opos - before->opos ); - FT_TRACE5(( " SERIF_LINK1: edge %ld (opos=%.2f) snapped to %.2f" - " from %ld (opos=%.2f)\n", + FT_TRACE5(( " SERIF_LINK1: edge %td (opos=%.2f) snapped to %.2f" + " from %td (opos=%.2f)\n", edge - edges, (double)edge->opos / 64, (double)edge->pos / 64, before - edges, (double)before->opos / 64 )); @@ -3477,7 +3484,7 @@ { edge->pos = anchor->pos + ( ( edge->opos - anchor->opos + 16 ) & ~31 ); - FT_TRACE5(( " SERIF_LINK2: edge %ld (opos=%.2f)" + FT_TRACE5(( " SERIF_LINK2: edge %td (opos=%.2f)" " snapped to %.2f\n", edge - edges, (double)edge->opos / 64, (double)edge->pos / 64 )); @@ -3498,7 +3505,7 @@ if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " BOUND: edge %td (pos=%.2f) moved to %.2f\n", edge - edges, (double)edge->pos / 64, (double)edge[-1].pos / 64 )); @@ -3519,7 +3526,7 @@ if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " BOUND: edge %td (pos=%.2f) moved to %.2f\n", edge - edges, (double)edge->pos / 64, (double)edge[1].pos / 64 )); @@ -3547,8 +3554,10 @@ af_latin_hints_apply( FT_UInt glyph_index, AF_GlyphHints hints, FT_Outline* outline, - AF_LatinMetrics metrics ) + AF_StyleMetrics metrics_ ) /* AF_LatinMetrics */ { + AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_; + FT_Error error; int dim; diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.h b/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.h index 3c6a7ee4f62..31aa91d3bdb 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.h +++ b/src/java.desktop/share/native/libfreetype/src/autofit/aflatin.h @@ -116,11 +116,11 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) - af_latin_metrics_init( AF_LatinMetrics metrics, + af_latin_metrics_init( AF_StyleMetrics metrics, FT_Face face ); FT_LOCAL( void ) - af_latin_metrics_scale( AF_LatinMetrics metrics, + af_latin_metrics_scale( AF_StyleMetrics metrics, AF_Scaler scaler ); FT_LOCAL( void ) diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afloader.c b/src/java.desktop/share/native/libfreetype/src/autofit/afloader.c index c8082796fe8..7c47d562af6 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afloader.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afloader.c @@ -55,10 +55,8 @@ error = af_face_globals_new( face, &loader->globals, module ); if ( !error ) { - face->autohint.data = - (FT_Pointer)loader->globals; - face->autohint.finalizer = - (FT_Generic_Finalizer)af_face_globals_free; + face->autohint.data = (FT_Pointer)loader->globals; + face->autohint.finalizer = af_face_globals_free; } } diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afmodule.c b/src/java.desktop/share/native/libfreetype/src/autofit/afmodule.c index 92e5156ab2d..20a6b96bc4f 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afmodule.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afmodule.c @@ -89,10 +89,8 @@ error = af_face_globals_new( face, &globals, module ); if ( !error ) { - face->autohint.data = - (FT_Pointer)globals; - face->autohint.finalizer = - (FT_Generic_Finalizer)af_face_globals_free; + face->autohint.data = (FT_Pointer)globals; + face->autohint.finalizer = af_face_globals_free; } } @@ -374,8 +372,9 @@ FT_DEFINE_SERVICE_PROPERTIESREC( af_service_properties, - (FT_Properties_SetFunc)af_property_set, /* set_property */ - (FT_Properties_GetFunc)af_property_get ) /* get_property */ + af_property_set, /* FT_Properties_SetFunc set_property */ + af_property_get /* FT_Properties_GetFunc get_property */ + ) FT_DEFINE_SERVICEDESCREC1( @@ -430,12 +429,14 @@ FT_CALLBACK_DEF( FT_Error ) - af_autofitter_load_glyph( AF_Module module, - FT_GlyphSlot slot, - FT_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ) + af_autofitter_load_glyph( FT_AutoHinter module_, + FT_GlyphSlot slot, + FT_Size size, + FT_UInt glyph_index, + FT_Int32 load_flags ) { + AF_Module module = (AF_Module)module_; + FT_Error error = FT_Err_Ok; FT_Memory memory = module->root.library->memory; @@ -499,10 +500,10 @@ FT_DEFINE_AUTOHINTER_INTERFACE( af_autofitter_interface, - NULL, /* reset_face */ - NULL, /* get_global_hints */ - NULL, /* done_global_hints */ - (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph /* load_glyph */ + NULL, /* FT_AutoHinter_GlobalResetFunc reset_face */ + NULL, /* FT_AutoHinter_GlobalGetFunc get_global_hints */ + NULL, /* FT_AutoHinter_GlobalDoneFunc done_global_hints */ + af_autofitter_load_glyph /* FT_AutoHinter_GlyphLoadFunc load_glyph */ ) FT_DEFINE_MODULE( @@ -517,9 +518,9 @@ (const void*)&af_autofitter_interface, - (FT_Module_Constructor)af_autofitter_init, /* module_init */ - (FT_Module_Destructor) af_autofitter_done, /* module_done */ - (FT_Module_Requester) af_get_interface /* get_interface */ + af_autofitter_init, /* FT_Module_Constructor module_init */ + af_autofitter_done, /* FT_Module_Destructor module_done */ + af_get_interface /* FT_Module_Requester get_interface */ ) diff --git a/src/java.desktop/share/native/libfreetype/src/autofit/afshaper.c b/src/java.desktop/share/native/libfreetype/src/autofit/afshaper.c index 1b8b870e89d..abc6f1d292d 100644 --- a/src/java.desktop/share/native/libfreetype/src/autofit/afshaper.c +++ b/src/java.desktop/share/native/libfreetype/src/autofit/afshaper.c @@ -258,7 +258,7 @@ /* * We now check whether we can construct blue zones, using glyphs * covered by the feature only. In case there is not a single zone - * (this is, not a single character is covered), we skip this coverage. + * (that is, not a single character is covered), we skip this coverage. * */ if ( style_class->coverage != AF_COVERAGE_DEFAULT ) @@ -313,9 +313,9 @@ * hinted and usually rendered glyph. * * Consider the superscript feature of font `pala.ttf': Some of the - * glyphs are `real', this is, they have a zero vertical offset, but + * glyphs are `real', that is, they have a zero vertical offset, but * most of them are small caps glyphs shifted up to the superscript - * position (this is, the `sups' feature is present in both the GSUB and + * position (that is, the `sups' feature is present in both the GSUB and * GPOS tables). The code for blue zones computation actually uses a * feature's y offset so that the `real' glyphs get correct hints. But * later on it is impossible to decide whether a glyph index belongs to, diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftbbox.c b/src/java.desktop/share/native/libfreetype/src/base/ftbbox.c index 7dd71882ea5..385fea40401 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftbbox.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftbbox.c @@ -82,10 +82,13 @@ * @Return: * Always 0. Needed for the interface only. */ - static int - BBox_Move_To( FT_Vector* to, - TBBox_Rec* user ) + FT_CALLBACK_DEF( int ) + BBox_Move_To( const FT_Vector* to, + void* user_ ) { + TBBox_Rec* user = (TBBox_Rec*)user_; + + FT_UPDATE_BBOX( to, user->bbox ); user->last = *to; @@ -116,10 +119,13 @@ * @Return: * Always 0. Needed for the interface only. */ - static int - BBox_Line_To( FT_Vector* to, - TBBox_Rec* user ) + FT_CALLBACK_DEF( int ) + BBox_Line_To( const FT_Vector* to, + void* user_ ) { + TBBox_Rec* user = (TBBox_Rec*)user_; + + user->last = *to; return 0; @@ -205,11 +211,14 @@ * In the case of a non-monotonous arc, we compute directly the * extremum coordinates, as it is sufficiently fast. */ - static int - BBox_Conic_To( FT_Vector* control, - FT_Vector* to, - TBBox_Rec* user ) + FT_CALLBACK_DEF( int ) + BBox_Conic_To( const FT_Vector* control, + const FT_Vector* to, + void* user_ ) { + TBBox_Rec* user = (TBBox_Rec*)user_; + + /* in case `to' is implicit and not included in bbox yet */ FT_UPDATE_BBOX( to, user->bbox ); @@ -410,12 +419,15 @@ * In the case of a non-monotonous arc, we don't compute directly * extremum coordinates, we subdivide instead. */ - static int - BBox_Cubic_To( FT_Vector* control1, - FT_Vector* control2, - FT_Vector* to, - TBBox_Rec* user ) + FT_CALLBACK_DEF( int ) + BBox_Cubic_To( const FT_Vector* control1, + const FT_Vector* control2, + const FT_Vector* to, + void* user_ ) { + TBBox_Rec* user = (TBBox_Rec*)user_; + + /* We don't need to check `to' since it is always an on-point, */ /* thus within the bbox. Only segments with an off-point outside */ /* the bbox can possibly reach new extreme values. */ diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftcalc.c b/src/java.desktop/share/native/libfreetype/src/base/ftcalc.c index 13e74f3353b..c5bc7e3b14e 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftcalc.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftcalc.c @@ -749,65 +749,43 @@ FT_BASE_DEF( FT_Bool ) FT_Matrix_Check( const FT_Matrix* matrix ) { - FT_Matrix m; - FT_Fixed val[4]; - FT_Fixed nonzero_minval, maxval; - FT_Fixed temp1, temp2; - FT_UInt i; + FT_Fixed xx, xy, yx, yy; + FT_Fixed val; + FT_Int shift; + FT_ULong temp1, temp2; if ( !matrix ) return 0; - val[0] = FT_ABS( matrix->xx ); - val[1] = FT_ABS( matrix->xy ); - val[2] = FT_ABS( matrix->yx ); - val[3] = FT_ABS( matrix->yy ); + xx = matrix->xx; + xy = matrix->xy; + yx = matrix->yx; + yy = matrix->yy; + val = FT_ABS( xx ) | FT_ABS( xy ) | FT_ABS( yx ) | FT_ABS( yy ); - /* - * To avoid overflow, we ensure that each value is not larger than - * - * int(sqrt(2^31 / 4)) = 23170 ; - * - * we also check that no value becomes zero if we have to scale. - */ - - maxval = 0; - nonzero_minval = FT_LONG_MAX; - - for ( i = 0; i < 4; i++ ) - { - if ( val[i] > maxval ) - maxval = val[i]; - if ( val[i] && val[i] < nonzero_minval ) - nonzero_minval = val[i]; - } - - /* we only handle 32bit values */ - if ( maxval > 0x7FFFFFFFL ) + /* we only handle non-zero 32-bit values */ + if ( !val || val > 0x7FFFFFFFL ) return 0; - if ( maxval > 23170 ) - { - FT_Fixed scale = FT_DivFix( maxval, 23170 ); - + /* Scale matrix to avoid the temp1 overflow, which is */ + /* more stringent than avoiding the temp2 overflow. */ - if ( !FT_DivFix( nonzero_minval, scale ) ) - return 0; /* value range too large */ + shift = FT_MSB( val ) - 12; - m.xx = FT_DivFix( matrix->xx, scale ); - m.xy = FT_DivFix( matrix->xy, scale ); - m.yx = FT_DivFix( matrix->yx, scale ); - m.yy = FT_DivFix( matrix->yy, scale ); + if ( shift > 0 ) + { + xx >>= shift; + xy >>= shift; + yx >>= shift; + yy >>= shift; } - else - m = *matrix; - temp1 = FT_ABS( m.xx * m.yy - m.xy * m.yx ); - temp2 = m.xx * m.xx + m.xy * m.xy + m.yx * m.yx + m.yy * m.yy; + temp1 = 32U * (FT_ULong)FT_ABS( xx * yy - xy * yx ); + temp2 = (FT_ULong)( xx * xx ) + (FT_ULong)( xy * xy ) + + (FT_ULong)( yx * yx ) + (FT_ULong)( yy * yy ); - if ( temp1 == 0 || - temp2 / temp1 > 50 ) + if ( temp1 <= temp2 ) return 0; return 1; @@ -1061,7 +1039,7 @@ /* */ /* This approach has the advantage that the angle between */ /* `in' and `out' is not checked. In case one of the two */ - /* vectors is `dominant', this is, much larger than the */ + /* vectors is `dominant', that is, much larger than the */ /* other vector, we thus always have a flat corner. */ /* */ /* hypotenuse */ @@ -1092,9 +1070,6 @@ { FT_UInt i; FT_Int64 temp; -#ifndef FT_INT64 - FT_Int64 halfUnit; -#endif #ifdef FT_INT64 @@ -1103,7 +1078,7 @@ for ( i = 0; i < count; ++i ) temp += (FT_Int64)s[i] * f[i]; - return ( temp + 0x8000 ) >> 16; + return (FT_Int32)( ( temp + 0x8000 ) >> 16 ); #else temp.hi = 0; temp.lo = 0; @@ -1139,13 +1114,10 @@ FT_Add64( &temp, &multResult, &temp ); } - /* Round value. */ - halfUnit.hi = 0; - halfUnit.lo = 0x8000; - FT_Add64( &temp, &halfUnit, &temp ); + /* Shift and round value. */ + return (FT_Int32)( ( ( temp.hi << 16 ) | ( temp.lo >> 16 ) ) + + ( 1 & ( temp.lo >> 15 ) ) ); - return (FT_Int32)( ( (FT_Int32)( temp.hi & 0xFFFF ) << 16 ) | - ( temp.lo >> 16 ) ); #endif /* !FT_INT64 */ diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftdbgmem.c b/src/java.desktop/share/native/libfreetype/src/base/ftdbgmem.c index 6730c4c8d38..8fab50dd017 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftdbgmem.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftdbgmem.c @@ -963,7 +963,7 @@ #else /* !FT_DEBUG_MEMORY */ /* ANSI C doesn't like empty source files */ - typedef int _debug_mem_dummy; + typedef int debug_mem_dummy_; #endif /* !FT_DEBUG_MEMORY */ diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftmac.c b/src/java.desktop/share/native/libfreetype/src/base/ftmac.c index de34e834f25..492d0553845 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftmac.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftmac.c @@ -1082,7 +1082,7 @@ #else /* !FT_MACINTOSH */ /* ANSI C doesn't like empty source files */ - typedef int _ft_mac_dummy; + typedef int ft_mac_dummy_; #endif /* !FT_MACINTOSH */ diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftmm.c b/src/java.desktop/share/native/libfreetype/src/base/ftmm.c index a2b4bd03d78..9e2dd7ee79d 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftmm.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftmm.c @@ -185,6 +185,14 @@ error = FT_ERR( Invalid_Argument ); if ( service->set_mm_design ) error = service->set_mm_design( face, num_coords, coords ); + + if ( !error ) + { + if ( num_coords ) + face->face_flags |= FT_FACE_FLAG_VARIATION; + else + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + } } /* enforce recomputation of auto-hinting data */ @@ -220,6 +228,14 @@ error = FT_ERR( Invalid_Argument ); if ( service->set_mm_weightvector ) error = service->set_mm_weightvector( face, len, weightvector ); + + if ( !error ) + { + if ( len ) + face->face_flags |= FT_FACE_FLAG_VARIATION; + else + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + } } /* enforce recomputation of auto-hinting data */ @@ -283,6 +299,30 @@ if ( service_mm->set_var_design ) error = service_mm->set_var_design( face, num_coords, coords ); + if ( !error || error == -1 ) + { + FT_Bool is_variation_old = FT_IS_VARIATION( face ); + + + if ( num_coords ) + face->face_flags |= FT_FACE_FLAG_VARIATION; + else + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + + if ( service_mm->construct_ps_name ) + { + if ( error == -1 ) + { + /* The PS name of a named instance and a non-named instance */ + /* usually differs, even if the axis values are identical. */ + if ( is_variation_old != FT_IS_VARIATION( face ) ) + service_mm->construct_ps_name( face ); + } + else + service_mm->construct_ps_name( face ); + } + } + /* internal error code -1 means `no change'; we can exit immediately */ if ( error == -1 ) return FT_Err_Ok; @@ -359,6 +399,30 @@ if ( service_mm->set_mm_blend ) error = service_mm->set_mm_blend( face, num_coords, coords ); + if ( !error || error == -1 ) + { + FT_Bool is_variation_old = FT_IS_VARIATION( face ); + + + if ( num_coords ) + face->face_flags |= FT_FACE_FLAG_VARIATION; + else + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + + if ( service_mm->construct_ps_name ) + { + if ( error == -1 ) + { + /* The PS name of a named instance and a non-named instance */ + /* usually differs, even if the axis values are identical. */ + if ( is_variation_old != FT_IS_VARIATION( face ) ) + service_mm->construct_ps_name( face ); + } + else + service_mm->construct_ps_name( face ); + } + } + /* internal error code -1 means `no change'; we can exit immediately */ if ( error == -1 ) return FT_Err_Ok; @@ -410,6 +474,30 @@ if ( service_mm->set_mm_blend ) error = service_mm->set_mm_blend( face, num_coords, coords ); + if ( !error || error == -1 ) + { + FT_Bool is_variation_old = FT_IS_VARIATION( face ); + + + if ( num_coords ) + face->face_flags |= FT_FACE_FLAG_VARIATION; + else + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + + if ( service_mm->construct_ps_name ) + { + if ( error == -1 ) + { + /* The PS name of a named instance and a non-named instance */ + /* usually differs, even if the axis values are identical. */ + if ( is_variation_old != FT_IS_VARIATION( face ) ) + service_mm->construct_ps_name( face ); + } + else + service_mm->construct_ps_name( face ); + } + } + /* internal error code -1 means `no change'; we can exit immediately */ if ( error == -1 ) return FT_Err_Ok; @@ -535,8 +623,35 @@ if ( !error ) { error = FT_ERR( Invalid_Argument ); - if ( service_mm->set_instance ) - error = service_mm->set_instance( face, instance_index ); + if ( service_mm->set_named_instance ) + error = service_mm->set_named_instance( face, instance_index ); + + if ( !error || error == -1 ) + { + FT_Bool is_variation_old = FT_IS_VARIATION( face ); + + + face->face_flags &= ~FT_FACE_FLAG_VARIATION; + face->face_index = ( instance_index << 16 ) | + ( face->face_index & 0xFFFFL ); + + if ( service_mm->construct_ps_name ) + { + if ( error == -1 ) + { + /* The PS name of a named instance and a non-named instance */ + /* usually differs, even if the axis values are identical. */ + if ( is_variation_old != FT_IS_VARIATION( face ) ) + service_mm->construct_ps_name( face ); + } + else + service_mm->construct_ps_name( face ); + } + } + + /* internal error code -1 means `no change'; we can exit immediately */ + if ( error == -1 ) + return FT_Err_Ok; } if ( !error ) @@ -554,11 +669,32 @@ face->autohint.data = NULL; } + return error; + } + + + /* documentation is in ftmm.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Get_Default_Named_Instance( FT_Face face, + FT_UInt *instance_index ) + { + FT_Error error; + + FT_Service_MultiMasters service_mm = NULL; + + + /* check of `face' delayed to `ft_face_get_mm_service' */ + + error = ft_face_get_mm_service( face, &service_mm ); if ( !error ) { - face->face_index = ( instance_index << 16 ) | - ( face->face_index & 0xFFFFL ); - face->face_flags &= ~FT_FACE_FLAG_VARIATION; + /* no error if `get_default_named_instance` is not available */ + if ( service_mm->get_default_named_instance ) + error = service_mm->get_default_named_instance( face, + instance_index ); + else + error = FT_Err_Ok; } return error; diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftobjs.c b/src/java.desktop/share/native/libfreetype/src/base/ftobjs.c index ad6ef0ae168..89a25bc732d 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftobjs.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftobjs.c @@ -1019,7 +1019,8 @@ /* elegant. */ /* try to load SVG documents if available */ - if ( FT_HAS_SVG( face ) ) + if ( ( load_flags & FT_LOAD_NO_SVG ) == 0 && + FT_HAS_SVG( face ) ) { error = driver->clazz->load_glyph( slot, face->size, glyph_index, @@ -1245,9 +1246,13 @@ /* destructor for sizes list */ static void destroy_size( FT_Memory memory, - FT_Size size, - FT_Driver driver ) + void* size_, + void* driver_ ) { + FT_Size size = (FT_Size)size_; + FT_Driver driver = (FT_Driver)driver_; + + /* finalize client-specific data */ if ( size->generic.finalizer ) size->generic.finalizer( size ); @@ -1293,10 +1298,12 @@ /* destructor for faces list */ static void destroy_face( FT_Memory memory, - FT_Face face, - FT_Driver driver ) + void* face_, + void* driver_ ) { - FT_Driver_Class clazz = driver->clazz; + FT_Face face = (FT_Face)face_; + FT_Driver driver = (FT_Driver)driver_; + FT_Driver_Class clazz = driver->clazz; /* discard auto-hinting data */ @@ -1310,7 +1317,7 @@ /* discard all sizes for this face */ FT_List_Finalize( &face->sizes_list, - (FT_List_Destructor)destroy_size, + destroy_size, memory, driver ); face->size = NULL; @@ -1346,7 +1353,7 @@ Destroy_Driver( FT_Driver driver ) { FT_List_Finalize( &driver->faces_list, - (FT_List_Destructor)destroy_face, + destroy_face, driver->root.memory, driver ); } @@ -1740,7 +1747,8 @@ FT_Memory memory = library->memory; - args.flags = 0; + args.driver = NULL; + args.flags = 0; if ( driver_name ) { diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftoutln.c b/src/java.desktop/share/native/libfreetype/src/base/ftoutln.c index 30ff21ff39e..134f39d2b1f 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftoutln.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftoutln.c @@ -58,7 +58,9 @@ FT_Error error; FT_Int n; /* index of contour in outline */ - FT_UInt first; /* index of first point in contour */ + FT_Int first; /* index of first point in contour */ + FT_Int last; /* index of last point in contour */ + FT_Int tag; /* current point's state */ FT_Int shift; @@ -73,18 +75,17 @@ shift = func_interface->shift; delta = func_interface->delta; - first = 0; + last = -1; for ( n = 0; n < outline->n_contours; n++ ) { - FT_Int last; /* index of last point in contour */ - - - FT_TRACE5(( "FT_Outline_Decompose: Outline %d\n", n )); + FT_TRACE5(( "FT_Outline_Decompose: Contour %d\n", n )); - last = outline->contours[n]; - if ( last < 0 ) + first = last + 1; + last = outline->contours[n]; + if ( last < first ) goto Invalid_Outline; + limit = outline->points + last; v_start = outline->points[first]; @@ -282,8 +283,6 @@ Close: if ( error ) goto Exit; - - first = (FT_UInt)last + 1; } FT_TRACE5(( "FT_Outline_Decompose: Done\n" )); @@ -368,7 +367,7 @@ if ( n_points <= 0 || n_contours <= 0 ) goto Bad; - end0 = end = -1; + end0 = -1; for ( n = 0; n < n_contours; n++ ) { end = outline->contours[n]; @@ -380,7 +379,7 @@ end0 = end; } - if ( end != n_points - 1 ) + if ( end0 != n_points - 1 ) goto Bad; /* XXX: check the tags array */ @@ -388,7 +387,7 @@ } Bad: - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Outline ); } @@ -550,10 +549,12 @@ if ( !outline ) return; - first = 0; - + last = -1; for ( n = 0; n < outline->n_contours; n++ ) { + /* keep the first contour point as is and swap points around it */ + /* to guarantee that the cubic arches stay valid after reverse */ + first = last + 2; last = outline->contours[n]; /* reverse point table */ @@ -591,8 +592,6 @@ q--; } } - - first = last + 1; } outline->flags ^= FT_OUTLINE_REVERSE_FILL; @@ -941,7 +940,7 @@ points = outline->points; - first = 0; + last = -1; for ( c = 0; c < outline->n_contours; c++ ) { FT_Vector in, out, anchor, shift; @@ -949,8 +948,9 @@ FT_Int i, j, k; - l_in = 0; - last = outline->contours[c]; + first = last + 1; + last = outline->contours[c]; + l_in = 0; /* pacify compiler */ in.x = in.y = anchor.x = anchor.y = 0; @@ -1037,8 +1037,6 @@ in = out; l_in = l_out; } - - first = last + 1; } return FT_Err_Ok; @@ -1054,7 +1052,7 @@ FT_Int xshift, yshift; FT_Vector* points; FT_Vector v_prev, v_cur; - FT_Int c, n, first; + FT_Int c, n, first, last; FT_Pos area = 0; @@ -1086,11 +1084,11 @@ points = outline->points; - first = 0; + last = -1; for ( c = 0; c < outline->n_contours; c++ ) { - FT_Int last = outline->contours[c]; - + first = last + 1; + last = outline->contours[c]; v_prev.x = points[last].x >> xshift; v_prev.y = points[last].y >> yshift; @@ -1106,8 +1104,6 @@ v_prev = v_cur; } - - first = last + 1; } if ( area > 0 ) diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftstream.c b/src/java.desktop/share/native/libfreetype/src/base/ftstream.c index 05c5637578b..64826acebe5 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftstream.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftstream.c @@ -141,7 +141,9 @@ if ( read_bytes > count ) read_bytes = count; - FT_MEM_COPY( buffer, stream->base + pos, read_bytes ); + /* Allow "reading" zero bytes without UB even if buffer is NULL */ + if ( count ) + FT_MEM_COPY( buffer, stream->base + pos, read_bytes ); } stream->pos = pos + read_bytes; @@ -178,7 +180,9 @@ if ( read_bytes > count ) read_bytes = count; - FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes ); + /* Allow "reading" zero bytes without UB even if buffer is NULL */ + if ( count ) + FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes ); } stream->pos += read_bytes; diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftstroke.c b/src/java.desktop/share/native/libfreetype/src/base/ftstroke.c index db358e772ed..92f1e43080f 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftstroke.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftstroke.c @@ -2055,7 +2055,9 @@ FT_Error error; FT_Int n; /* index of contour in outline */ - FT_UInt first; /* index of first point in contour */ + FT_Int first; /* index of first point in contour */ + FT_Int last; /* index of last point in contour */ + FT_Int tag; /* current point's state */ @@ -2067,22 +2069,17 @@ FT_Stroker_Rewind( stroker ); - first = 0; - + last = -1; for ( n = 0; n < outline->n_contours; n++ ) { - FT_UInt last; /* index of last point in contour */ - - - last = (FT_UInt)outline->contours[n]; - limit = outline->points + last; + first = last + 1; + last = outline->contours[n]; /* skip empty points; we don't stroke these */ if ( last <= first ) - { - first = last + 1; continue; - } + + limit = outline->points + last; v_start = outline->points[first]; v_last = outline->points[last]; @@ -2231,8 +2228,6 @@ if ( error ) goto Exit; } - - first = last + 1; } return FT_Err_Ok; diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftsynth.c b/src/java.desktop/share/native/libfreetype/src/base/ftsynth.c index 6ec25e13e47..f32edd3388b 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftsynth.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftsynth.c @@ -97,9 +97,18 @@ FT_EXPORT_DEF( void ) FT_GlyphSlot_Embolden( FT_GlyphSlot slot ) + { + FT_GlyphSlot_AdjustWeight( slot, 0x0AAA, 0x0AAA ); + } + + + FT_EXPORT_DEF( void ) + FT_GlyphSlot_AdjustWeight( FT_GlyphSlot slot, + FT_Fixed xdelta, + FT_Fixed ydelta ) { FT_Library library; - FT_Face face; + FT_Size size; FT_Error error; FT_Pos xstr, ystr; @@ -108,16 +117,15 @@ return; library = slot->library; - face = slot->face; + size = slot->face->size; if ( slot->format != FT_GLYPH_FORMAT_OUTLINE && slot->format != FT_GLYPH_FORMAT_BITMAP ) return; - /* some reasonable strength */ - xstr = FT_MulFix( face->units_per_EM, - face->size->metrics.y_scale ) / 24; - ystr = xstr; + /* express deltas in pixels in 26.6 format */ + xstr = (FT_Pos)size->metrics.x_ppem * xdelta / 1024; + ystr = (FT_Pos)size->metrics.y_ppem * ydelta / 1024; if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) FT_Outline_EmboldenXY( &slot->outline, xstr, ystr ); diff --git a/src/java.desktop/share/native/libfreetype/src/base/ftsystem.c b/src/java.desktop/share/native/libfreetype/src/base/ftsystem.c index fcd289d19f4..61c99e36357 100644 --- a/src/java.desktop/share/native/libfreetype/src/base/ftsystem.c +++ b/src/java.desktop/share/native/libfreetype/src/base/ftsystem.c @@ -206,7 +206,7 @@ * The number of bytes to read from the stream. * * @Return: - * The number of bytes actually read. If `count' is zero (this is, + * The number of bytes actually read. If `count' is zero (that is, * the function is used for seeking), a non-zero return value * indicates an error. */ @@ -219,7 +219,7 @@ FT_FILE* file; - if ( !count && offset > stream->size ) + if ( offset > stream->size && !count ) return 1; file = STREAM_FILE( stream ); @@ -227,6 +227,11 @@ if ( stream->pos != offset ) ft_fseek( file, (long)offset, SEEK_SET ); + /* Avoid calling `fread` with `buffer=NULL` and `count=0`, */ + /* which is undefined behaviour. */ + if ( !count ) + return 0; + return (unsigned long)ft_fread( buffer, 1, count, file ); } diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffcmap.c b/src/java.desktop/share/native/libfreetype/src/cff/cffcmap.c index 6ed31432227..10d287bc81f 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffcmap.c +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffcmap.c @@ -32,9 +32,10 @@ /*************************************************************************/ FT_CALLBACK_DEF( FT_Error ) - cff_cmap_encoding_init( CFF_CMapStd cmap, - FT_Pointer pointer ) + cff_cmap_encoding_init( FT_CMap cmap, + FT_Pointer pointer ) { + CFF_CMapStd cffcmap = (CFF_CMapStd)cmap; TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); CFF_Font cff = (CFF_Font)face->extra.data; CFF_Encoding encoding = &cff->encoding; @@ -42,63 +43,56 @@ FT_UNUSED( pointer ); - cmap->gids = encoding->codes; + cffcmap->gids = encoding->codes; return 0; } FT_CALLBACK_DEF( void ) - cff_cmap_encoding_done( CFF_CMapStd cmap ) + cff_cmap_encoding_done( FT_CMap cmap ) { - cmap->gids = NULL; + CFF_CMapStd cffcmap = (CFF_CMapStd)cmap; + + + cffcmap->gids = NULL; } FT_CALLBACK_DEF( FT_UInt ) - cff_cmap_encoding_char_index( CFF_CMapStd cmap, - FT_UInt32 char_code ) + cff_cmap_encoding_char_index( FT_CMap cmap, + FT_UInt32 char_code ) { - FT_UInt result = 0; + CFF_CMapStd cffcmap = (CFF_CMapStd)cmap; + FT_UInt result = 0; if ( char_code < 256 ) - result = cmap->gids[char_code]; + result = cffcmap->gids[char_code]; return result; } - FT_CALLBACK_DEF( FT_UInt32 ) - cff_cmap_encoding_char_next( CFF_CMapStd cmap, - FT_UInt32 *pchar_code ) + FT_CALLBACK_DEF( FT_UInt ) + cff_cmap_encoding_char_next( FT_CMap cmap, + FT_UInt32 *pchar_code ) { - FT_UInt result = 0; - FT_UInt32 char_code = *pchar_code; + CFF_CMapStd cffcmap = (CFF_CMapStd)cmap; + FT_UInt result = 0; + FT_UInt32 char_code = *pchar_code; - *pchar_code = 0; - - if ( char_code < 255 ) + while ( char_code < 255 ) { - FT_UInt code = (FT_UInt)( char_code + 1 ); - - - for (;;) + result = cffcmap->gids[++char_code]; + if ( result ) { - if ( code >= 256 ) - break; - - result = cmap->gids[code]; - if ( result != 0 ) - { - *pchar_code = code; - break; - } - - code++; + *pchar_code = char_code; + break; } } + return result; } @@ -130,9 +124,10 @@ /*************************************************************************/ FT_CALLBACK_DEF( const char* ) - cff_sid_to_glyph_name( TT_Face face, + cff_sid_to_glyph_name( void* face_, /* TT_Face */ FT_UInt idx ) { + TT_Face face = (TT_Face)face_; CFF_Font cff = (CFF_Font)face->extra.data; CFF_Charset charset = &cff->charset; FT_UInt sid = charset->sids[idx]; @@ -143,14 +138,15 @@ FT_CALLBACK_DEF( FT_Error ) - cff_cmap_unicode_init( PS_Unicodes unicodes, + cff_cmap_unicode_init( FT_CMap cmap, /* PS_Unicodes */ FT_Pointer pointer ) { - TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); - CFF_Font cff = (CFF_Font)face->extra.data; - CFF_Charset charset = &cff->charset; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); + CFF_Font cff = (CFF_Font)face->extra.data; + CFF_Charset charset = &cff->charset; + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; FT_UNUSED( pointer ); @@ -166,17 +162,18 @@ return psnames->unicodes_init( memory, unicodes, cff->num_glyphs, - (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name, + &cff_sid_to_glyph_name, (PS_FreeGlyphNameFunc)NULL, (FT_Pointer)face ); } FT_CALLBACK_DEF( void ) - cff_cmap_unicode_done( PS_Unicodes unicodes ) + cff_cmap_unicode_done( FT_CMap cmap ) /* PS_Unicodes */ { - FT_Face face = FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); + PS_Unicodes unicodes = (PS_Unicodes)cmap; + FT_Face face = FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); FT_FREE( unicodes->maps ); @@ -185,25 +182,27 @@ FT_CALLBACK_DEF( FT_UInt ) - cff_cmap_unicode_char_index( PS_Unicodes unicodes, - FT_UInt32 char_code ) + cff_cmap_unicode_char_index( FT_CMap cmap, /* PS_Unicodes */ + FT_UInt32 char_code ) { - TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); - CFF_Font cff = (CFF_Font)face->extra.data; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + CFF_Font cff = (CFF_Font)face->extra.data; + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; return psnames->unicodes_char_index( unicodes, char_code ); } - FT_CALLBACK_DEF( FT_UInt32 ) - cff_cmap_unicode_char_next( PS_Unicodes unicodes, - FT_UInt32 *pchar_code ) + FT_CALLBACK_DEF( FT_UInt ) + cff_cmap_unicode_char_next( FT_CMap cmap, /* PS_Unicodes */ + FT_UInt32 *pchar_code ) { - TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); - CFF_Font cff = (CFF_Font)face->extra.data; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + CFF_Font cff = (CFF_Font)face->extra.data; + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; return psnames->unicodes_char_next( unicodes, pchar_code ); diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffdrivr.c b/src/java.desktop/share/native/libfreetype/src/cff/cffdrivr.c index 4e2e0e00deb..9898d625ca4 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffdrivr.c +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffdrivr.c @@ -108,20 +108,20 @@ * They can be implemented by format-specific interfaces. */ FT_CALLBACK_DEF( FT_Error ) - cff_get_kerning( FT_Face ttface, /* TT_Face */ + cff_get_kerning( FT_Face face, /* CFF_Face */ FT_UInt left_glyph, FT_UInt right_glyph, FT_Vector* kerning ) { - TT_Face face = (TT_Face)ttface; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + CFF_Face cffface = (CFF_Face)face; + SFNT_Service sfnt = (SFNT_Service)cffface->sfnt; kerning->x = 0; kerning->y = 0; if ( sfnt ) - kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph ); + kerning->x = sfnt->get_kerning( cffface, left_glyph, right_glyph ); return FT_Err_Ok; } @@ -158,23 +158,23 @@ * FreeType error code. 0 means success. */ FT_CALLBACK_DEF( FT_Error ) - cff_glyph_load( FT_GlyphSlot cffslot, /* CFF_GlyphSlot */ - FT_Size cffsize, /* CFF_Size */ + cff_glyph_load( FT_GlyphSlot slot, /* CFF_GlyphSlot */ + FT_Size size, /* CFF_Size */ FT_UInt glyph_index, FT_Int32 load_flags ) { FT_Error error; - CFF_GlyphSlot slot = (CFF_GlyphSlot)cffslot; - CFF_Size size = (CFF_Size)cffsize; + CFF_GlyphSlot cffslot = (CFF_GlyphSlot)slot; + CFF_Size cffsize = (CFF_Size)size; - if ( !slot ) + if ( !cffslot ) return FT_THROW( Invalid_Slot_Handle ); FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index )); /* check whether we want a scaled outline or bitmap */ - if ( !size ) + if ( !cffsize ) load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; /* reset the size object if necessary */ @@ -184,12 +184,12 @@ if ( size ) { /* these two objects must have the same parent */ - if ( cffsize->face != cffslot->face ) + if ( size->face != slot->face ) return FT_THROW( Invalid_Face_Handle ); } /* now load the glyph outline if necessary */ - error = cff_slot_load( slot, size, glyph_index, load_flags ); + error = cff_slot_load( cffslot, cffsize, glyph_index, load_flags ); /* force drop-out mode to 2 - irrelevant now */ /* slot->outline.dropout_mode = 2; */ @@ -216,7 +216,7 @@ /* it is no longer necessary that those values are identical to */ /* the values in the `CFF' table */ - TT_Face ttface = (TT_Face)face; + CFF_Face cffface = (CFF_Face)face; FT_Short dummy; @@ -225,7 +225,7 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT /* no fast retrieval for blended MM fonts without VVAR table */ if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) && - !( ttface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ) + !( cffface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ) return FT_THROW( Unimplemented_Feature ); #endif @@ -233,7 +233,7 @@ /* otherwise we extract the info from the CFF glyphstrings */ /* (instead of synthesizing a global value using the `OS/2' */ /* table) */ - if ( !ttface->vertical_info ) + if ( !cffface->vertical_info ) goto Missing_Table; for ( nn = 0; nn < count; nn++ ) @@ -241,11 +241,11 @@ FT_UShort ah; - ( (SFNT_Service)ttface->sfnt )->get_metrics( ttface, - 1, - start + nn, - &dummy, - &ah ); + ( (SFNT_Service)cffface->sfnt )->get_metrics( cffface, + 1, + start + nn, + &dummy, + &ah ); FT_TRACE5(( " idx %d: advance height %d font unit%s\n", start + nn, @@ -259,12 +259,12 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT /* no fast retrieval for blended MM fonts without HVAR table */ if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) && - !( ttface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ) + !( cffface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ) return FT_THROW( Unimplemented_Feature ); #endif /* check whether we have data from the `hmtx' table at all */ - if ( !ttface->horizontal.number_Of_HMetrics ) + if ( !cffface->horizontal.number_Of_HMetrics ) goto Missing_Table; for ( nn = 0; nn < count; nn++ ) @@ -272,11 +272,11 @@ FT_UShort aw; - ( (SFNT_Service)ttface->sfnt )->get_metrics( ttface, - 0, - start + nn, - &dummy, - &aw ); + ( (SFNT_Service)cffface->sfnt )->get_metrics( cffface, + 0, + start + nn, + &dummy, + &aw ); FT_TRACE5(( " idx %d: advance width %d font unit%s\n", start + nn, @@ -312,13 +312,14 @@ * */ - static FT_Error - cff_get_glyph_name( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_glyph_name( FT_Face face, /* CFF_Face */ FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ) { - CFF_Font font = (CFF_Font)face->extra.data; + CFF_Face cffface = (CFF_Face)face; + CFF_Font font = (CFF_Font)cffface->extra.data; FT_String* gname; FT_UShort sid; FT_Error error; @@ -338,10 +339,7 @@ if ( service && service->get_name ) - return service->get_name( FT_FACE( face ), - glyph_index, - buffer, - buffer_max ); + return service->get_name( face, glyph_index, buffer, buffer_max ); else { FT_ERROR(( "cff_get_glyph_name:" @@ -366,7 +364,7 @@ /* first, locate the sid in the charset table */ sid = font->charset.sids[glyph_index]; - /* now, lookup the name itself */ + /* now, look up the name itself */ gname = cff_index_get_sid_string( font, sid ); if ( gname ) @@ -379,21 +377,19 @@ } - static FT_UInt - cff_get_name_index( CFF_Face face, + FT_CALLBACK_DEF( FT_UInt ) + cff_get_name_index( FT_Face face, /* CFF_Face */ const FT_String* glyph_name ) { - CFF_Font cff; - CFF_Charset charset; + CFF_Face cffface = (CFF_Face)face; + CFF_Font cff = (CFF_Font)cffface->extra.data; + CFF_Charset charset = &cff->charset; FT_Service_PsCMaps psnames; FT_String* name; FT_UShort sid; FT_UInt i; - cff = (CFF_FontRec *)face->extra.data; - charset = &cff->charset; - /* CFF2 table does not have glyph names; */ /* we need to use `post' table method */ if ( cff->version_major == 2 ) @@ -408,7 +404,7 @@ if ( service && service->name_index ) - return service->name_index( FT_FACE( face ), glyph_name ); + return service->name_index( face, glyph_name ); else { FT_ERROR(( "cff_get_name_index:" @@ -446,8 +442,8 @@ FT_DEFINE_SERVICE_GLYPHDICTREC( cff_service_glyph_dict, - (FT_GlyphDict_GetNameFunc) cff_get_glyph_name, /* get_name */ - (FT_GlyphDict_NameIndexFunc)cff_get_name_index /* name_index */ + cff_get_glyph_name, /* FT_GlyphDict_GetNameFunc get_name */ + cff_get_name_index /* FT_GlyphDict_NameIndexFunc name_index */ ) @@ -456,25 +452,32 @@ * */ - static FT_Int + FT_CALLBACK_DEF( FT_Int ) cff_ps_has_glyph_names( FT_Face face ) { return ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) > 0; } - static FT_Error - cff_ps_get_font_info( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_ps_get_font_info( FT_Face face, /* CFF_Face */ PS_FontInfoRec* afont_info ) { - CFF_Font cff = (CFF_Font)face->extra.data; - FT_Error error = FT_Err_Ok; + CFF_Face cffface = (CFF_Face)face; + CFF_Font cff = (CFF_Font)cffface->extra.data; + FT_Error error = FT_Err_Ok; + if ( cffface->is_cff2 ) + { + error = FT_THROW( Invalid_Argument ); + goto Fail; + } + if ( cff && !cff->font_info ) { CFF_FontRecDict dict = &cff->top_font.font_dict; - FT_Memory memory = face->root.memory; + FT_Memory memory = FT_FACE_MEMORY( face ); PS_FontInfoRec* font_info = NULL; @@ -507,18 +510,19 @@ } - static FT_Error - cff_ps_get_font_extra( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_ps_get_font_extra( FT_Face face, /* CFF_Face */ PS_FontExtraRec* afont_extra ) { - CFF_Font cff = (CFF_Font)face->extra.data; - FT_Error error = FT_Err_Ok; + CFF_Face cffface = (CFF_Face)face; + CFF_Font cff = (CFF_Font)cffface->extra.data; + FT_Error error = FT_Err_Ok; if ( cff && !cff->font_extra ) { CFF_FontRecDict dict = &cff->top_font.font_dict; - FT_Memory memory = face->root.memory; + FT_Memory memory = FT_FACE_MEMORY( face ); PS_FontExtraRec* font_extra = NULL; FT_String* embedded_postscript; @@ -588,13 +592,13 @@ FT_DEFINE_SERVICE_PSINFOREC( cff_service_ps_info, - (PS_GetFontInfoFunc) cff_ps_get_font_info, /* ps_get_font_info */ - (PS_GetFontExtraFunc) cff_ps_get_font_extra, /* ps_get_font_extra */ - (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, /* ps_has_glyph_names */ + cff_ps_get_font_info, /* PS_GetFontInfoFunc ps_get_font_info */ + cff_ps_get_font_extra, /* PS_GetFontExtraFunc ps_get_font_extra */ + cff_ps_has_glyph_names, /* PS_HasGlyphNamesFunc ps_has_glyph_names */ /* unsupported with CFF fonts */ - (PS_GetFontPrivateFunc)NULL, /* ps_get_font_private */ + NULL, /* PS_GetFontPrivateFunc ps_get_font_private */ /* not implemented */ - (PS_GetFontValueFunc) NULL /* ps_get_font_value */ + NULL /* PS_GetFontValueFunc ps_get_font_value */ ) @@ -603,17 +607,18 @@ * */ - static const char* - cff_get_ps_name( CFF_Face face ) + FT_CALLBACK_DEF( const char* ) + cff_get_ps_name( FT_Face face ) /* CFF_Face */ { - CFF_Font cff = (CFF_Font)face->extra.data; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + CFF_Face cffface = (CFF_Face)face; + CFF_Font cff = (CFF_Font)cffface->extra.data; + SFNT_Service sfnt = (SFNT_Service)cffface->sfnt; /* following the OpenType specification 1.7, we return the name stored */ /* in the `name' table for a CFF wrapped into an SFNT container */ - if ( FT_IS_SFNT( FT_FACE( face ) ) && sfnt ) + if ( FT_IS_SFNT( face ) && sfnt ) { FT_Library library = FT_FACE_LIBRARY( face ); FT_Module sfnt_module = FT_Get_Module( library, "sfnt" ); @@ -625,17 +630,17 @@ if ( service && service->get_ps_font_name ) - return service->get_ps_font_name( FT_FACE( face ) ); + return service->get_ps_font_name( face ); } - return (const char*)cff->font_name; + return cff ? (const char*)cff->font_name : NULL; } FT_DEFINE_SERVICE_PSFONTNAMEREC( cff_service_ps_name, - (FT_PsName_GetFunc)cff_get_ps_name /* get_ps_font_name */ + cff_get_ps_name /* FT_PsName_GetFunc get_ps_font_name */ ) @@ -649,7 +654,7 @@ * Otherwise call the service function in the sfnt module. * */ - static FT_Error + FT_CALLBACK_DEF( FT_Error ) cff_get_cmap_info( FT_CharMap charmap, TT_CMapInfo *cmap_info ) { @@ -683,7 +688,7 @@ FT_DEFINE_SERVICE_TTCMAPSREC( cff_service_get_cmap_info, - (TT_CMap_Info_GetFunc)cff_get_cmap_info /* get_cmap_info */ + cff_get_cmap_info /* TT_CMap_Info_GetFunc get_cmap_info */ ) @@ -691,14 +696,15 @@ * CID INFO SERVICE * */ - static FT_Error - cff_get_ros( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_ros( FT_Face face, /* FT_Face */ const char* *registry, const char* *ordering, FT_Int *supplement ) { - FT_Error error = FT_Err_Ok; - CFF_Font cff = (CFF_Font)face->extra.data; + FT_Error error = FT_Err_Ok; + CFF_Face cffface = (CFF_Face)face; + CFF_Font cff = (CFF_Font)cffface->extra.data; if ( cff ) @@ -748,12 +754,13 @@ } - static FT_Error - cff_get_is_cid( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_is_cid( FT_Face face, /* CFF_Face */ FT_Bool *is_cid ) { - FT_Error error = FT_Err_Ok; - CFF_Font cff = (CFF_Font)face->extra.data; + FT_Error error = FT_Err_Ok; + CFF_Face cffface = (CFF_Face)face; + CFF_Font cff = (CFF_Font)cffface->extra.data; *is_cid = 0; @@ -771,16 +778,15 @@ } - static FT_Error - cff_get_cid_from_glyph_index( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_cid_from_glyph_index( FT_Face face, /* CFF_Face */ FT_UInt glyph_index, FT_UInt *cid ) { - FT_Error error = FT_Err_Ok; - CFF_Font cff; - + FT_Error error = FT_Err_Ok; + CFF_Face cffface = (CFF_Face)face; + CFF_Font cff = (CFF_Font)cffface->extra.data; - cff = (CFF_Font)face->extra.data; if ( cff ) { @@ -814,12 +820,12 @@ FT_DEFINE_SERVICE_CIDREC( cff_service_cid_info, - (FT_CID_GetRegistryOrderingSupplementFunc) - cff_get_ros, /* get_ros */ - (FT_CID_GetIsInternallyCIDKeyedFunc) - cff_get_is_cid, /* get_is_cid */ - (FT_CID_GetCIDFromGlyphIndexFunc) - cff_get_cid_from_glyph_index /* get_cid_from_glyph_index */ + cff_get_ros, + /* FT_CID_GetRegistryOrderingSupplementFunc get_ros */ + cff_get_is_cid, + /* FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid */ + cff_get_cid_from_glyph_index + /* FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index */ ) @@ -831,9 +837,9 @@ FT_DEFINE_SERVICE_PROPERTIESREC( cff_service_properties, - (FT_Properties_SetFunc)ps_property_set, /* set_property */ - (FT_Properties_GetFunc)ps_property_get ) /* get_property */ - + ps_property_set, /* FT_Properties_SetFunc set_property */ + ps_property_get /* FT_Properties_GetFunc get_property */ + ) #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT @@ -842,160 +848,195 @@ * */ - static FT_Error - cff_set_mm_blend( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_set_mm_blend( FT_Face face, /* CFF_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->set_mm_blend( FT_FACE( face ), num_coords, coords ); + return mm->set_mm_blend( face, num_coords, coords ); } - static FT_Error - cff_get_mm_blend( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_mm_blend( FT_Face face, /* CFF_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->get_mm_blend( FT_FACE( face ), num_coords, coords ); + return mm->get_mm_blend( face, num_coords, coords ); } - static FT_Error - cff_set_mm_weightvector( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_set_mm_weightvector( FT_Face face, /* CFF_Face */ FT_UInt len, FT_Fixed* weightvector ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->set_mm_weightvector( FT_FACE( face ), len, weightvector ); + return mm->set_mm_weightvector( face, len, weightvector ); } - static FT_Error - cff_get_mm_weightvector( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_mm_weightvector( FT_Face face, /* CFF_Face */ FT_UInt* len, FT_Fixed* weightvector ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->get_mm_weightvector( FT_FACE( face ), len, weightvector ); + return mm->get_mm_weightvector( face, len, weightvector ); } - static FT_Error - cff_get_mm_var( CFF_Face face, + FT_CALLBACK_DEF( void ) + cff_construct_ps_name( FT_Face face ) /* CFF_Face */ + { + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; + + + mm->construct_ps_name( face ); + } + + + FT_CALLBACK_DEF( FT_Error ) + cff_get_mm_var( FT_Face face, /* CFF_Face */ FT_MM_Var* *master ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->get_mm_var( FT_FACE( face ), master ); + return mm->get_mm_var( face, master ); } - static FT_Error - cff_set_var_design( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_set_var_design( FT_Face face, /* CFF_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->set_var_design( FT_FACE( face ), num_coords, coords ); + return mm->set_var_design( face, num_coords, coords ); } - static FT_Error - cff_get_var_design( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_var_design( FT_Face face, /* CFF_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->get_var_design( FT_FACE( face ), num_coords, coords ); + return mm->get_var_design( face, num_coords, coords ); } - static FT_Error - cff_set_instance( CFF_Face face, - FT_UInt instance_index ) + FT_CALLBACK_DEF( FT_Error ) + cff_set_named_instance( FT_Face face, /* CFF_Face */ + FT_UInt instance_index ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->set_instance( FT_FACE( face ), instance_index ); + return mm->set_named_instance( face, instance_index ); } - static FT_Error - cff_load_item_variation_store( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_get_default_named_instance( FT_Face face, /* CFF_Face */ + FT_UInt *instance_index ) + { + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; + + + return mm->get_default_named_instance( face, instance_index ); + } + + + FT_CALLBACK_DEF( FT_Error ) + cff_load_item_variation_store( FT_Face face, /* CFF_Face */ FT_ULong offset, GX_ItemVarStore itemStore ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->load_item_var_store( FT_FACE(face), offset, itemStore ); + return mm->load_item_var_store( face, offset, itemStore ); } - static FT_Error - cff_load_delta_set_index_mapping( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_load_delta_set_index_mapping( FT_Face face, /* CFF_Face */ FT_ULong offset, GX_DeltaSetIdxMap map, GX_ItemVarStore itemStore, FT_ULong table_len ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->load_delta_set_idx_map( FT_FACE( face ), offset, map, + return mm->load_delta_set_idx_map( face, offset, map, itemStore, table_len ); } - static FT_Int - cff_get_item_delta( CFF_Face face, + FT_CALLBACK_DEF( FT_Int ) + cff_get_item_delta( FT_Face face, /* CFF_Face */ GX_ItemVarStore itemStore, FT_UInt outerIndex, FT_UInt innerIndex ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->get_item_delta( FT_FACE( face ), itemStore, - outerIndex, innerIndex ); + return mm->get_item_delta( face, itemStore, outerIndex, innerIndex ); } - static void - cff_done_item_variation_store( CFF_Face face, + FT_CALLBACK_DEF( void ) + cff_done_item_variation_store( FT_Face face, /* CFF_Face */ GX_ItemVarStore itemStore ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - mm->done_item_var_store( FT_FACE( face ), itemStore ); + mm->done_item_var_store( face, itemStore ); } - static void - cff_done_delta_set_index_map( CFF_Face face, + FT_CALLBACK_DEF( void ) + cff_done_delta_set_index_map( FT_Face face, /* CFF_Face */ GX_DeltaSetIdxMap deltaSetIdxMap ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - mm->done_delta_set_idx_map( FT_FACE ( face ), deltaSetIdxMap ); + mm->done_delta_set_idx_map( face, deltaSetIdxMap ); } @@ -1003,36 +1044,35 @@ FT_DEFINE_SERVICE_MULTIMASTERSREC( cff_service_multi_masters, - (FT_Get_MM_Func) NULL, /* get_mm */ - (FT_Set_MM_Design_Func) NULL, /* set_mm_design */ - (FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */ - (FT_Get_MM_Blend_Func) cff_get_mm_blend, /* get_mm_blend */ - (FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */ - (FT_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */ - (FT_Get_Var_Design_Func)cff_get_var_design, /* get_var_design */ - (FT_Set_Instance_Func) cff_set_instance, /* set_instance */ - (FT_Set_MM_WeightVector_Func) - cff_set_mm_weightvector, - /* set_mm_weightvector */ - (FT_Get_MM_WeightVector_Func) - cff_get_mm_weightvector, - /* get_mm_weightvector */ - (FT_Var_Load_Delta_Set_Idx_Map_Func) - cff_load_delta_set_index_mapping, - /* load_delta_set_idx_map */ - (FT_Var_Load_Item_Var_Store_Func) - cff_load_item_variation_store, - /* load_item_variation_store */ - (FT_Var_Get_Item_Delta_Func) - cff_get_item_delta, /* get_item_delta */ - (FT_Var_Done_Item_Var_Store_Func) - cff_done_item_variation_store, - /* done_item_variation_store */ - (FT_Var_Done_Delta_Set_Idx_Map_Func) - cff_done_delta_set_index_map, - /* done_delta_set_index_map */ - (FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */ - (FT_Done_Blend_Func) cff_done_blend /* done_blend */ + NULL, /* FT_Get_MM_Func get_mm */ + NULL, /* FT_Set_MM_Design_Func set_mm_design */ + cff_set_mm_blend, /* FT_Set_MM_Blend_Func set_mm_blend */ + cff_get_mm_blend, /* FT_Get_MM_Blend_Func get_mm_blend */ + cff_get_mm_var, /* FT_Get_MM_Var_Func get_mm_var */ + cff_set_var_design, /* FT_Set_Var_Design_Func set_var_design */ + cff_get_var_design, /* FT_Get_Var_Design_Func get_var_design */ + cff_set_named_instance, + /* FT_Set_Named_Instance_Func set_named_instance */ + cff_get_default_named_instance, + /* FT_Get_Default_Named_Instance_Func get_default_named_instance */ + cff_set_mm_weightvector, + /* FT_Set_MM_WeightVector_Func set_mm_weightvector */ + cff_get_mm_weightvector, + /* FT_Get_MM_WeightVector_Func get_mm_weightvector */ + cff_construct_ps_name, + /* FT_Construct_PS_Name_Func construct_ps_name */ + cff_load_delta_set_index_mapping, + /* FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map */ + cff_load_item_variation_store, + /* FT_Var_Load_Item_Var_Store_Func load_item_variation_store */ + cff_get_item_delta, + /* FT_Var_Get_Item_Delta_Func get_item_delta */ + cff_done_item_variation_store, + /* FT_Var_Done_Item_Var_Store_Func done_item_variation_store */ + cff_done_delta_set_index_map, + /* FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_index_map */ + cff_get_var_blend, /* FT_Get_Var_Blend_Func get_var_blend */ + cff_done_blend /* FT_Done_Blend_Func done_blend */ ) @@ -1041,41 +1081,46 @@ * */ - static FT_Error - cff_hadvance_adjust( CFF_Face face, + FT_CALLBACK_DEF( FT_Error ) + cff_hadvance_adjust( FT_Face face, /* CFF_Face */ FT_UInt gindex, FT_Int *avalue ) { - FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MetricsVariations + var = (FT_Service_MetricsVariations)cffface->tt_var; - return var->hadvance_adjust( FT_FACE( face ), gindex, avalue ); + return var->hadvance_adjust( face, gindex, avalue ); } - static void - cff_metrics_adjust( CFF_Face face ) + FT_CALLBACK_DEF( void ) + cff_metrics_adjust( FT_Face face ) /* CFF_Face */ { - FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MetricsVariations + var = (FT_Service_MetricsVariations)cffface->tt_var; - var->metrics_adjust( FT_FACE( face ) ); + var->metrics_adjust( face ); } FT_DEFINE_SERVICE_METRICSVARIATIONSREC( cff_service_metrics_variations, - (FT_HAdvance_Adjust_Func)cff_hadvance_adjust, /* hadvance_adjust */ - (FT_LSB_Adjust_Func) NULL, /* lsb_adjust */ - (FT_RSB_Adjust_Func) NULL, /* rsb_adjust */ + cff_hadvance_adjust, /* FT_HAdvance_Adjust_Func hadvance_adjust */ + NULL, /* FT_LSB_Adjust_Func lsb_adjust */ + NULL, /* FT_RSB_Adjust_Func rsb_adjust */ - (FT_VAdvance_Adjust_Func)NULL, /* vadvance_adjust */ - (FT_TSB_Adjust_Func) NULL, /* tsb_adjust */ - (FT_BSB_Adjust_Func) NULL, /* bsb_adjust */ - (FT_VOrg_Adjust_Func) NULL, /* vorg_adjust */ + NULL, /* FT_VAdvance_Adjust_Func vadvance_adjust */ + NULL, /* FT_TSB_Adjust_Func tsb_adjust */ + NULL, /* FT_BSB_Adjust_Func bsb_adjust */ + NULL, /* FT_VOrg_Adjust_Func vorg_adjust */ - (FT_Metrics_Adjust_Func) cff_metrics_adjust /* metrics_adjust */ + cff_metrics_adjust, /* FT_Metrics_Adjust_Func metrics_adjust */ + NULL /* FT_Size_Reset_Func size_reset */ ) #endif @@ -1088,11 +1133,11 @@ FT_DEFINE_SERVICE_CFFLOADREC( cff_service_cff_load, - (FT_Get_Standard_Encoding_Func)cff_get_standard_encoding, - (FT_Load_Private_Dict_Func) cff_load_private_dict, - (FT_FD_Select_Get_Func) cff_fd_select_get, - (FT_Blend_Check_Vector_Func) cff_blend_check_vector, - (FT_Blend_Build_Vector_Func) cff_blend_build_vector + cff_get_standard_encoding, /* FT_Get_Standard_Encoding_Func get_standard_encoding */ + cff_load_private_dict, /* FT_Load_Private_Dict_Func load_private_dict */ + cff_fd_select_get, /* FT_FD_Select_Get_Func fd_select_get */ + cff_blend_check_vector, /* FT_Blend_Check_Vector_Func blend_check_vector */ + cff_blend_build_vector /* FT_Blend_Build_Vector_Func blend_build_vector */ ) diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffgload.c b/src/java.desktop/share/native/libfreetype/src/cff/cffgload.c index cfa0aaf2b69..c483d1d1a59 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffgload.c +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffgload.c @@ -356,14 +356,16 @@ #ifdef FT_CONFIG_OPTION_SVG /* check for OT-SVG */ - if ( ( load_flags & FT_LOAD_COLOR ) && face->svg ) + if ( ( load_flags & FT_LOAD_NO_SVG ) == 0 && + ( load_flags & FT_LOAD_COLOR ) && + face->svg ) { /* * We load the SVG document and try to grab the advances from the * table. For the bearings we rely on the presetting hook to do that. */ - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + SFNT_Service sfnt = (SFNT_Service)face->sfnt; if ( size && (size->root.metrics.x_ppem < 1 || diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffload.c b/src/java.desktop/share/native/libfreetype/src/cff/cffload.c index 4b8c6e16c58..af79082e98c 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffload.c +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffload.c @@ -400,7 +400,7 @@ /* Allocate a table containing pointers to an index's elements. */ /* The `pool' argument makes this function convert the index */ - /* entries to C-style strings (this is, null-terminated). */ + /* entries to C-style strings (that is, null-terminated). */ static FT_Error cff_index_get_pointers( CFF_Index idx, FT_Byte*** table, @@ -1361,14 +1361,15 @@ for ( i = 0; i < numBlends; i++ ) { const FT_Int32* weight = &blend->BV[1]; - FT_UInt32 sum; + FT_Fixed sum; - /* convert inputs to 16.16 fixed-point */ - sum = cff_parse_num( parser, &parser->stack[i + base] ) * 0x10000; + /* convert inputs to 16.16 fixed point */ + sum = cff_parse_fixed( parser, &parser->stack[i + base] ); for ( j = 1; j < blend->lenBV; j++ ) - sum += cff_parse_num( parser, &parser->stack[delta++] ) * *weight++; + sum += FT_MulFix( cff_parse_fixed( parser, &parser->stack[delta++] ), + *weight++ ); /* point parser stack to new value on blend_stack */ parser->stack[i + base] = subFont->blend_top; @@ -1589,16 +1590,17 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_LOCAL_DEF( FT_Error ) - cff_get_var_blend( CFF_Face face, + cff_get_var_blend( FT_Face face, /* CFF_Face */ FT_UInt *num_coords, FT_Fixed* *coords, FT_Fixed* *normalizedcoords, FT_MM_Var* *mm_var ) { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - return mm->get_var_blend( FT_FACE( face ), + return mm->get_var_blend( face, num_coords, coords, normalizedcoords, @@ -1607,13 +1609,14 @@ FT_LOCAL_DEF( void ) - cff_done_blend( CFF_Face face ) + cff_done_blend( FT_Face face ) /* CFF_Face */ { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; + CFF_Face cffface = (CFF_Face)face; + FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm; - if (mm) - mm->done_blend( FT_FACE( face ) ); + if ( mm ) + mm->done_blend( face ); } #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ @@ -1650,13 +1653,6 @@ goto Exit; } - /* Zero out the code to gid/sid mappings. */ - for ( j = 0; j < 256; j++ ) - { - encoding->sids [j] = 0; - encoding->codes[j] = 0; - } - /* Note: The encoding table in a CFF font is indexed by glyph index; */ /* the first encoded glyph index is 1. Hence, we read the character */ /* code (`glyph_code') at index j and make the assignment: */ @@ -1671,6 +1667,10 @@ if ( offset > 1 ) { + /* Zero out the code to gid/sid mappings. */ + FT_ARRAY_ZERO( encoding->sids, 256 ); + FT_ARRAY_ZERO( encoding->codes, 256 ); + encoding->offset = base_offset + offset; /* we need to parse the table to determine its size */ @@ -2012,7 +2012,7 @@ /* Top and Font DICTs are not allowed to have blend operators. */ error = cff_parser_init( &parser, code, - &subfont->font_dict, + top, font->library, stackSize, 0, diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffload.h b/src/java.desktop/share/native/libfreetype/src/cff/cffload.h index 5a41cdebc8e..b5286b0c8cb 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffload.h +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffload.h @@ -105,14 +105,14 @@ FT_BEGIN_HEADER #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_LOCAL( FT_Error ) - cff_get_var_blend( CFF_Face face, + cff_get_var_blend( FT_Face face, FT_UInt *num_coords, FT_Fixed* *coords, FT_Fixed* *normalizedcoords, FT_MM_Var* *mm_var ); FT_LOCAL( void ) - cff_done_blend( CFF_Face face ); + cff_done_blend( FT_Face face ); #endif diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffobjs.c b/src/java.desktop/share/native/libfreetype/src/cff/cffobjs.c index 40cd9bf9173..6d08620c487 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffobjs.c +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffobjs.c @@ -69,8 +69,8 @@ FT_Module module; - module = FT_Get_Module( size->root.face->driver->root.library, - "pshinter" ); + module = FT_Get_Module( font->library, "pshinter" ); + return ( module && pshinter && pshinter->get_globals_funcs ) ? pshinter->get_globals_funcs( module ) : 0; @@ -182,8 +182,7 @@ goto Exit; cff_make_private_dict( &font->top_font, &priv ); - error = funcs->create( cffsize->face->memory, &priv, - &internal->topfont ); + error = funcs->create( memory, &priv, &internal->topfont ); if ( error ) goto Exit; @@ -193,8 +192,7 @@ cff_make_private_dict( sub, &priv ); - error = funcs->create( cffsize->face->memory, &priv, - &internal->subfonts[i - 1] ); + error = funcs->create( memory, &priv, &internal->subfonts[i - 1] ); if ( error ) goto Exit; } @@ -381,8 +379,7 @@ FT_Module module; - module = FT_Get_Module( slot->face->driver->root.library, - "pshinter" ); + module = FT_Get_Module( slot->library, "pshinter" ); if ( module ) { T2_Hints_Funcs funcs; @@ -722,22 +719,15 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT { - FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm; - FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var; - FT_UInt instance_index = (FT_UInt)face_index >> 16; if ( FT_HAS_MULTIPLE_MASTERS( cffface ) && - mm && instance_index > 0 ) { - error = mm->set_instance( cffface, instance_index ); + error = FT_Set_Named_Instance( cffface, instance_index ); if ( error ) goto Exit; - - if ( var ) - var->metrics_adjust( cffface ); } } #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ @@ -1160,7 +1150,7 @@ } #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - cff_done_blend( face ); + cff_done_blend( cffface ); face->blend = NULL; #endif } diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffparse.c b/src/java.desktop/share/native/libfreetype/src/cff/cffparse.c index e16206fd553..3b076704cf7 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffparse.c +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffparse.c @@ -63,10 +63,7 @@ /* allocate the stack buffer */ if ( FT_QNEW_ARRAY( parser->stack, stackSize ) ) - { - FT_FREE( parser->stack ); goto Exit; - } parser->stackSize = stackSize; parser->top = parser->stack; /* empty stack */ @@ -76,23 +73,6 @@ } -#ifdef CFF_CONFIG_OPTION_OLD_ENGINE - static void - finalize_t2_strings( FT_Memory memory, - void* data, - void* user ) - { - CFF_T2_String t2 = (CFF_T2_String)data; - - - FT_UNUSED( user ); - - memory->free( memory, t2->start ); - memory->free( memory, data ); - } -#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ - - FT_LOCAL_DEF( void ) cff_parser_done( CFF_Parser parser ) { @@ -102,63 +82,19 @@ FT_FREE( parser->stack ); #ifdef CFF_CONFIG_OPTION_OLD_ENGINE - FT_List_Finalize( &parser->t2_strings, - finalize_t2_strings, - memory, - NULL ); + FT_List_Finalize( &parser->t2_strings, NULL, memory, NULL ); #endif } - /* Assuming `first >= last'. */ - - static FT_Error - cff_parser_within_limits( CFF_Parser parser, - FT_Byte* first, - FT_Byte* last ) - { -#ifndef CFF_CONFIG_OPTION_OLD_ENGINE - - /* Fast path for regular FreeType builds with the "new" engine; */ - /* `first >= parser->start' can be assumed. */ - - FT_UNUSED( first ); - - return last < parser->limit ? FT_Err_Ok : FT_THROW( Invalid_Argument ); - -#else /* CFF_CONFIG_OPTION_OLD_ENGINE */ - - FT_ListNode node; - - - if ( first >= parser->start && - last < parser->limit ) - return FT_Err_Ok; - - node = parser->t2_strings.head; - - while ( node ) - { - CFF_T2_String t2 = (CFF_T2_String)node->data; - - - if ( first >= t2->start && - last < t2->limit ) - return FT_Err_Ok; - - node = node->next; - } - - return FT_THROW( Invalid_Argument ); - -#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ - } - + /* The parser limit checks in the next two functions are supposed */ + /* to detect the immediate crossing of the stream boundary. They */ + /* shall not be triggered from the distant t2_strings buffers. */ /* read an integer */ static FT_Long - cff_parse_integer( CFF_Parser parser, - FT_Byte* start ) + cff_parse_integer( FT_Byte* start, + FT_Byte* limit ) { FT_Byte* p = start; FT_Int v = *p++; @@ -167,14 +103,14 @@ if ( v == 28 ) { - if ( cff_parser_within_limits( parser, p, p + 1 ) ) + if ( p + 2 > limit && limit >= p ) goto Bad; val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] ); } else if ( v == 29 ) { - if ( cff_parser_within_limits( parser, p, p + 3 ) ) + if ( p + 4 > limit && limit >= p ) goto Bad; val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) | @@ -188,14 +124,14 @@ } else if ( v < 251 ) { - if ( cff_parser_within_limits( parser, p, p ) ) + if ( p + 1 > limit && limit >= p ) goto Bad; val = ( v - 247 ) * 256 + p[0] + 108; } else { - if ( cff_parser_within_limits( parser, p, p ) ) + if ( p + 1 > limit && limit >= p ) goto Bad; val = -( v - 251 ) * 256 - p[0] - 108; @@ -244,10 +180,10 @@ /* read a real */ static FT_Fixed - cff_parse_real( CFF_Parser parser, - FT_Byte* start, - FT_Long power_ten, - FT_Long* scaling ) + cff_parse_real( FT_Byte* start, + FT_Byte* limit, + FT_Long power_ten, + FT_Long* scaling ) { FT_Byte* p = start; FT_Int nib; @@ -282,7 +218,7 @@ p++; /* Make sure we don't read past the end. */ - if ( cff_parser_within_limits( parser, p, p ) ) + if ( p + 1 > limit && limit >= p ) goto Bad; } @@ -319,7 +255,7 @@ p++; /* Make sure we don't read past the end. */ - if ( cff_parser_within_limits( parser, p, p ) ) + if ( p + 1 > limit && limit >= p ) goto Bad; } @@ -358,7 +294,7 @@ p++; /* Make sure we don't read past the end. */ - if ( cff_parser_within_limits( parser, p, p ) ) + if ( p + 1 > limit && limit >= p ) goto Bad; } @@ -525,7 +461,7 @@ if ( **d == 30 ) { /* binary-coded decimal is truncated to integer */ - return cff_parse_real( parser, *d, 0, NULL ) >> 16; + return cff_parse_real( *d, parser->limit, 0, NULL ) >> 16; } else if ( **d == 255 ) @@ -551,7 +487,7 @@ } else - return cff_parse_integer( parser, *d ); + return cff_parse_integer( *d, parser->limit ); } @@ -562,15 +498,33 @@ FT_Long scaling ) { if ( **d == 30 ) - return cff_parse_real( parser, *d, scaling, NULL ); + return cff_parse_real( *d, parser->limit, scaling, NULL ); + else if ( **d == 255 ) + { + FT_Fixed val = ( ( ( (FT_UInt32)*( d[0] + 1 ) << 24 ) | + ( (FT_UInt32)*( d[0] + 2 ) << 16 ) | + ( (FT_UInt32)*( d[0] + 3 ) << 8 ) | + (FT_UInt32)*( d[0] + 4 ) ) ); + + if ( scaling ) + { + if ( FT_ABS( val ) > power_ten_limits[scaling] ) + { + FT_TRACE4(( "!!!OVERFLOW:!!!" )); + return val > 0 ? 0x7FFFFFFFL : -0x7FFFFFFFL; + } + val *= power_tens[scaling]; + } + return val; + } else { - FT_Long val = cff_parse_integer( parser, *d ); + FT_Long val = cff_parse_integer( *d, parser->limit ); if ( scaling ) { - if ( FT_ABS( val ) > power_ten_limits[scaling] ) + if ( ( FT_ABS( val ) << 16 ) > power_ten_limits[scaling] ) { val = val > 0 ? 0x7FFFFFFFL : -0x7FFFFFFFL; goto Overflow; @@ -600,7 +554,7 @@ /* read a floating point number, either integer or real */ - static FT_Fixed + FT_LOCAL_DEF( FT_Fixed ) cff_parse_fixed( CFF_Parser parser, FT_Byte** d ) { @@ -630,14 +584,14 @@ FT_ASSERT( scaling ); if ( **d == 30 ) - return cff_parse_real( parser, *d, 0, scaling ); + return cff_parse_real( *d, parser->limit, 0, scaling ); else { FT_Long number; FT_Int integer_length; - number = cff_parse_integer( parser, d[0] ); + number = cff_parse_integer( *d, parser->limit ); if ( number > 0x7FFFL ) { @@ -686,7 +640,7 @@ dict->has_font_matrix = TRUE; - /* We expect a well-formed font matrix, this is, the matrix elements */ + /* We expect a well-formed font matrix, that is, the matrix elements */ /* `xx' and `yy' are of approximately the same magnitude. To avoid */ /* loss of precision, we use the magnitude of the largest matrix */ /* element to scale all other elements. The scaling factor is then */ @@ -1264,11 +1218,8 @@ FT_Byte* charstring_base; FT_ULong charstring_len; - FT_Fixed* stack; - FT_ListNode node; - CFF_T2_String t2; - FT_Fixed t2_size; - FT_Byte* q; + FT_Fixed* stack; + FT_Byte* q = NULL; charstring_base = ++p; @@ -1309,39 +1260,18 @@ /* Now copy the stack data in the temporary decoder object, */ /* converting it back to charstring number representations */ /* (this is ugly, I know). */ + /* The maximum required size is 5 bytes per stack element. */ + if ( FT_QALLOC( q, (FT_Long)( 2 * sizeof ( FT_ListNode ) ) + + 5 * ( decoder.top - decoder.stack ) ) ) + goto Exit; - node = (FT_ListNode)memory->alloc( memory, - sizeof ( FT_ListNodeRec ) ); - if ( !node ) - goto Out_Of_Memory_Error; - - FT_List_Add( &parser->t2_strings, node ); - - t2 = (CFF_T2_String)memory->alloc( memory, - sizeof ( CFF_T2_StringRec ) ); - if ( !t2 ) - goto Out_Of_Memory_Error; - - node->data = t2; - - /* `5' is the conservative upper bound of required bytes per stack */ - /* element. */ - - t2_size = 5 * ( decoder.top - decoder.stack ); - - q = (FT_Byte*)memory->alloc( memory, t2_size ); - if ( !q ) - goto Out_Of_Memory_Error; - - t2->start = q; - t2->limit = q + t2_size; + FT_List_Add( &parser->t2_strings, (FT_ListNode)q ); - stack = decoder.stack; + q += 2 * sizeof ( FT_ListNode ); - while ( stack < decoder.top ) + for ( stack = decoder.stack; stack < decoder.top; stack++ ) { - FT_ULong num; - FT_Bool neg; + FT_Long num = *stack; if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize ) @@ -1349,69 +1279,37 @@ *parser->top++ = q; - if ( *stack < 0 ) - { - num = (FT_ULong)NEG_LONG( *stack ); - neg = 1; - } - else - { - num = (FT_ULong)*stack; - neg = 0; - } - if ( num & 0xFFFFU ) { - if ( neg ) - num = (FT_ULong)-num; - *q++ = 255; - *q++ = ( num & 0xFF000000U ) >> 24; - *q++ = ( num & 0x00FF0000U ) >> 16; - *q++ = ( num & 0x0000FF00U ) >> 8; - *q++ = num & 0x000000FFU; + *q++ = (FT_Byte)( ( num >> 24 ) & 0xFF ); + *q++ = (FT_Byte)( ( num >> 16 ) & 0xFF ); + *q++ = (FT_Byte)( ( num >> 8 ) & 0xFF ); + *q++ = (FT_Byte)( ( num ) & 0xFF ); } else { num >>= 16; - if ( neg ) + if ( -107 <= num && num <= 107 ) + *q++ = (FT_Byte)( num + 139 ); + else if ( 108 <= num && num <= 1131 ) { - if ( num <= 107 ) - *q++ = (FT_Byte)( 139 - num ); - else if ( num <= 1131 ) - { - *q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 251 ); - *q++ = (FT_Byte)( ( num - 108 ) & 0xFF ); - } - else - { - num = (FT_ULong)-num; - - *q++ = 28; - *q++ = (FT_Byte)( num >> 8 ); - *q++ = (FT_Byte)( num & 0xFF ); - } + *q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 247 ); + *q++ = (FT_Byte)( ( num - 108 ) & 0xFF ); + } + else if ( -1131 <= num && num <= -108 ) + { + *q++ = (FT_Byte)( ( ( -num - 108 ) >> 8 ) + 251 ); + *q++ = (FT_Byte)( ( -num - 108) & 0xFF ); } else { - if ( num <= 107 ) - *q++ = (FT_Byte)( num + 139 ); - else if ( num <= 1131 ) - { - *q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 247 ); - *q++ = (FT_Byte)( ( num - 108 ) & 0xFF ); - } - else - { - *q++ = 28; - *q++ = (FT_Byte)( num >> 8 ); - *q++ = (FT_Byte)( num & 0xFF ); - } + *q++ = 28; + *q++ = (FT_Byte)( num >> 8 ); + *q++ = (FT_Byte)( num & 0xFF ); } } - - stack++; } } #endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ @@ -1598,12 +1496,6 @@ Exit: return error; -#ifdef CFF_CONFIG_OPTION_OLD_ENGINE - Out_Of_Memory_Error: - error = FT_THROW( Out_Of_Memory ); - goto Exit; -#endif - Stack_Overflow: error = FT_THROW( Invalid_Argument ); goto Exit; diff --git a/src/java.desktop/share/native/libfreetype/src/cff/cffparse.h b/src/java.desktop/share/native/libfreetype/src/cff/cffparse.h index 58d59fa4ac5..418caacc68c 100644 --- a/src/java.desktop/share/native/libfreetype/src/cff/cffparse.h +++ b/src/java.desktop/share/native/libfreetype/src/cff/cffparse.h @@ -76,6 +76,10 @@ FT_BEGIN_HEADER cff_parse_num( CFF_Parser parser, FT_Byte** d ); + FT_LOCAL( FT_Fixed ) + cff_parse_fixed( CFF_Parser parser, + FT_Byte** d ); + FT_LOCAL( FT_Error ) cff_parser_init( CFF_Parser parser, FT_UInt code, @@ -133,15 +137,6 @@ FT_BEGIN_HEADER FT_END_HEADER -#ifdef CFF_CONFIG_OPTION_OLD_ENGINE - typedef struct CFF_T2_String_ - { - FT_Byte* start; - FT_Byte* limit; - - } CFF_T2_StringRec, *CFF_T2_String; -#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ - #endif /* CFFPARSE_H_ */ diff --git a/src/java.desktop/share/native/libfreetype/src/cid/cidgload.c b/src/java.desktop/share/native/libfreetype/src/cid/cidgload.c index ba4b7565d54..eaca765ad06 100644 --- a/src/java.desktop/share/native/libfreetype/src/cid/cidgload.c +++ b/src/java.desktop/share/native/libfreetype/src/cid/cidgload.c @@ -40,6 +40,117 @@ #define FT_COMPONENT cidgload + /* + * A helper function to compute FD number (`fd_select`), the offset to the + * head of the glyph data (`off1`), and the offset to the and of the glyph + * data (`off2`). + * + * The number how many times `cid_get_offset` is invoked can be controlled + * by the number of non-NULL arguments. If `fd_select` is non-NULL but + * `off1` and `off2` are NULL, `cid_get_offset` is invoked only for + * `fd_select`; `off1` and `off2` are not validated. + * + */ + FT_LOCAL_DEF( FT_Error ) + cid_compute_fd_and_offsets( CID_Face face, + FT_UInt glyph_index, + FT_ULong* fd_select_p, + FT_ULong* off1_p, + FT_ULong* off2_p ) + { + FT_Error error = FT_Err_Ok; + + CID_FaceInfo cid = &face->cid; + FT_Stream stream = face->cid_stream; + FT_UInt entry_len = cid->fd_bytes + cid->gd_bytes; + + FT_Byte* p; + FT_Bool need_frame_exit = 0; + FT_ULong fd_select, off1, off2; + + + /* For ordinary fonts, read the CID font dictionary index */ + /* and charstring offset from the CIDMap. */ + + if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset + + glyph_index * entry_len ) || + FT_FRAME_ENTER( 2 * entry_len ) ) + goto Exit; + + need_frame_exit = 1; + + p = (FT_Byte*)stream->cursor; + fd_select = cid_get_offset( &p, cid->fd_bytes ); + off1 = cid_get_offset( &p, cid->gd_bytes ); + + p += cid->fd_bytes; + off2 = cid_get_offset( &p, cid->gd_bytes ); + + if ( fd_select_p ) + *fd_select_p = fd_select; + if ( off1_p ) + *off1_p = off1; + if ( off2_p ) + *off2_p = off2; + + if ( fd_select >= cid->num_dicts ) + { + /* + * fd_select == 0xFF is often used to indicate that the CID + * has no charstring to be rendered, similar to GID = 0xFFFF + * in TrueType fonts. + */ + if ( ( cid->fd_bytes == 1 && fd_select == 0xFFU ) || + ( cid->fd_bytes == 2 && fd_select == 0xFFFFU ) ) + { + FT_TRACE1(( "cid_load_glyph: fail for glyph index %d:\n", + glyph_index )); + FT_TRACE1(( " FD number %ld is the maximum\n", + fd_select )); + FT_TRACE1(( " integer fitting into %d byte%s\n", + cid->fd_bytes, cid->fd_bytes == 1 ? "" : "s" )); + } + else + { + FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n", + glyph_index )); + FT_TRACE0(( " FD number %ld is larger\n", + fd_select )); + FT_TRACE0(( " than number of dictionaries (%d)\n", + cid->num_dicts )); + } + + error = FT_THROW( Invalid_Offset ); + goto Exit; + } + else if ( off2 > stream->size ) + { + FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n", + glyph_index )); + FT_TRACE0(( " end of the glyph data\n" )); + FT_TRACE0(( " is beyond the data stream\n" )); + + error = FT_THROW( Invalid_Offset ); + goto Exit; + } + else if ( off1 > off2 ) + { + FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n", + glyph_index )); + FT_TRACE0(( " the end position of glyph data\n" )); + FT_TRACE0(( " is set before the start position\n" )); + + error = FT_THROW( Invalid_Offset ); + } + + Exit: + if ( need_frame_exit ) + FT_FRAME_EXIT(); + + return error; + } + + FT_CALLBACK_DEF( FT_Error ) cid_load_glyph( T1_Decoder decoder, FT_UInt glyph_index ) @@ -97,34 +208,14 @@ else #endif /* FT_CONFIG_OPTION_INCREMENTAL */ - - /* For ordinary fonts read the CID font dictionary index */ - /* and charstring offset from the CIDMap. */ { - FT_UInt entry_len = cid->fd_bytes + cid->gd_bytes; FT_ULong off1, off2; - if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset + - glyph_index * entry_len ) || - FT_FRAME_ENTER( 2 * entry_len ) ) - goto Exit; - - p = (FT_Byte*)stream->cursor; - fd_select = cid_get_offset( &p, cid->fd_bytes ); - off1 = cid_get_offset( &p, cid->gd_bytes ); - p += cid->fd_bytes; - off2 = cid_get_offset( &p, cid->gd_bytes ); - FT_FRAME_EXIT(); - - if ( fd_select >= cid->num_dicts || - off2 > stream->size || - off1 > off2 ) - { - FT_TRACE0(( "cid_load_glyph: invalid glyph stream offsets\n" )); - error = FT_THROW( Invalid_Offset ); + error = cid_compute_fd_and_offsets( face, glyph_index, + &fd_select, &off1, &off2 ); + if ( error ) goto Exit; - } glyph_length = off2 - off1; @@ -161,7 +252,9 @@ cs_offset = decoder->lenIV >= 0 ? (FT_UInt)decoder->lenIV : 0; if ( cs_offset > glyph_length ) { - FT_TRACE0(( "cid_load_glyph: invalid glyph stream offsets\n" )); + FT_TRACE0(( "cid_load_glyph: fail for glyph_index=%d, " + "offset to the charstring is beyond glyph length\n", + glyph_index )); error = FT_THROW( Invalid_Offset ); goto Exit; } diff --git a/src/java.desktop/share/native/libfreetype/src/cid/cidgload.h b/src/java.desktop/share/native/libfreetype/src/cid/cidgload.h index 97954d418ff..edd6229234c 100644 --- a/src/java.desktop/share/native/libfreetype/src/cid/cidgload.h +++ b/src/java.desktop/share/native/libfreetype/src/cid/cidgload.h @@ -42,6 +42,14 @@ FT_BEGIN_HEADER FT_Int32 load_flags ); + FT_LOCAL( FT_Error ) + cid_compute_fd_and_offsets( CID_Face face, + FT_UInt glyph_index, + FT_ULong* fd_select_p, + FT_ULong* off1_p, + FT_ULong* off2_p ); + + FT_END_HEADER #endif /* CIDGLOAD_H_ */ diff --git a/src/java.desktop/share/native/libfreetype/src/cid/cidload.c b/src/java.desktop/share/native/libfreetype/src/cid/cidload.c index 26daa5da7f6..a7da8ea39d5 100644 --- a/src/java.desktop/share/native/libfreetype/src/cid/cidload.c +++ b/src/java.desktop/share/native/libfreetype/src/cid/cidload.c @@ -155,23 +155,24 @@ FT_CALLBACK_DEF( void ) - cid_parse_font_matrix( CID_Face face, - CID_Parser* parser ) + cid_parse_font_matrix( FT_Face face, /* CID_Face */ + void* parser_ ) { + CID_Face cidface = (CID_Face)face; + CID_Parser* parser = (CID_Parser*)parser_; CID_FaceDict dict; - FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; FT_Fixed temp_scale; - if ( parser->num_dict < face->cid.num_dicts ) + if ( parser->num_dict < cidface->cid.num_dicts ) { FT_Matrix* matrix; FT_Vector* offset; FT_Int result; - dict = face->cid.font_dicts + parser->num_dict; + dict = cidface->cid.font_dicts + parser->num_dict; matrix = &dict->font_matrix; offset = &dict->font_offset; @@ -204,7 +205,7 @@ if ( temp_scale != 0x10000L ) { /* set units per EM based on FontMatrix values */ - root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); + face->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); temp[0] = FT_DivFix( temp[0], temp_scale ); temp[1] = FT_DivFix( temp[1], temp_scale ); @@ -237,13 +238,15 @@ FT_CALLBACK_DEF( void ) - parse_fd_array( CID_Face face, - CID_Parser* parser ) + parse_fd_array( FT_Face face, /* CID_Face */ + void* parser_ ) { - CID_FaceInfo cid = &face->cid; - FT_Memory memory = face->root.memory; - FT_Stream stream = parser->stream; - FT_Error error = FT_Err_Ok; + CID_Face cidface = (CID_Face)face; + CID_Parser* parser = (CID_Parser*)parser_; + CID_FaceInfo cid = &cidface->cid; + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Stream stream = parser->stream; + FT_Error error = FT_Err_Ok; FT_Long num_dicts, max_dicts; @@ -313,18 +316,20 @@ /* By mistake, `expansion_factor' appears both in PS_PrivateRec */ /* and CID_FaceDictRec (both are public header files and can't */ - /* changed). We simply copy the value. */ + /* be thus changed). We simply copy the value. */ FT_CALLBACK_DEF( void ) - parse_expansion_factor( CID_Face face, - CID_Parser* parser ) + parse_expansion_factor( FT_Face face, /* CID_Face */ + void* parser_ ) { + CID_Face cidface = (CID_Face)face; + CID_Parser* parser = (CID_Parser*)parser_; CID_FaceDict dict; - if ( parser->num_dict < face->cid.num_dicts ) + if ( parser->num_dict < cidface->cid.num_dicts ) { - dict = face->cid.font_dicts + parser->num_dict; + dict = cidface->cid.font_dicts + parser->num_dict; dict->expansion_factor = cid_parser_to_fixed( parser, 0 ); dict->private_dict.expansion_factor = dict->expansion_factor; @@ -341,11 +346,15 @@ /* to catch it for producing better trace output. */ FT_CALLBACK_DEF( void ) - parse_font_name( CID_Face face, - CID_Parser* parser ) + parse_font_name( FT_Face face, /* CID_Face */ + void* parser_ ) { #ifdef FT_DEBUG_LEVEL_TRACE - if ( parser->num_dict < face->cid.num_dicts ) + CID_Face cidface = (CID_Face)face; + CID_Parser* parser = (CID_Parser*)parser_; + + + if ( parser->num_dict < cidface->cid.num_dicts ) { T1_TokenRec token; FT_UInt len; @@ -361,7 +370,7 @@ } #else FT_UNUSED( face ); - FT_UNUSED( parser ); + FT_UNUSED( parser_ ); #endif return; diff --git a/src/java.desktop/share/native/libfreetype/src/cid/cidobjs.c b/src/java.desktop/share/native/libfreetype/src/cid/cidobjs.c index 06b2139a93d..f698a419289 100644 --- a/src/java.desktop/share/native/libfreetype/src/cid/cidobjs.c +++ b/src/java.desktop/share/native/libfreetype/src/cid/cidobjs.c @@ -69,8 +69,7 @@ FT_Module module; - module = FT_Get_Module( slot->face->driver->root.library, - "pshinter" ); + module = FT_Get_Module( slot->library, "pshinter" ); if ( module ) { T1_Hints_Funcs funcs; @@ -268,7 +267,8 @@ * * @Input: * stream :: - * The source font stream. + * Dummy argument for compatibility with the `FT_Face_InitFunc` API. + * Ignored. The stream should be passed through `face->root.stream`. * * face_index :: * The index of the font face in the resource. @@ -375,6 +375,14 @@ if ( info->is_fixed_pitch ) cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + /* + * For the sfnt-wrapped CID fonts for MacOS, currently, + * its `cmap' tables are ignored, and the content in + * its `CID ' table is treated the same as naked CID-keyed + * font. See ft_lookup_PS_in_sfnt_stream(). + */ + cidface->face_flags |= FT_FACE_FLAG_CID_KEYED; + /* XXX: TODO: add kerning with .afm support */ /* get style name -- be careful, some broken fonts only */ diff --git a/src/java.desktop/share/native/libfreetype/src/cid/cidparse.c b/src/java.desktop/share/native/libfreetype/src/cid/cidparse.c index 16889db9b6f..171a886215a 100644 --- a/src/java.desktop/share/native/libfreetype/src/cid/cidparse.c +++ b/src/java.desktop/share/native/libfreetype/src/cid/cidparse.c @@ -214,18 +214,24 @@ cur <= limit - STARTDATA_LEN && ft_strncmp( (char*)cur, STARTDATA, STARTDATA_LEN ) == 0 ) { - if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 ) - { - FT_Long tmp = ft_strtol( (const char *)arg2, NULL, 10 ); + T1_TokenRec type_token; + FT_Long binary_length; - if ( tmp < 0 ) + parser->root.cursor = arg1; + cid_parser_to_token( parser, &type_token ); + if ( type_token.limit - type_token.start == 5 && + ft_memcmp( (char*)type_token.start, "(Hex)", 5 ) == 0 ) + { + parser->root.cursor = arg2; + binary_length = cid_parser_to_int( parser ); + if ( binary_length < 0 ) { FT_ERROR(( "cid_parser_new: invalid length of hex data\n" )); error = FT_THROW( Invalid_File_Format ); } else - parser->binary_length = (FT_ULong)tmp; + parser->binary_length = (FT_ULong)binary_length; } goto Exit; diff --git a/src/java.desktop/share/native/libfreetype/src/cid/cidriver.c b/src/java.desktop/share/native/libfreetype/src/cid/cidriver.c index f7499237d73..99e7b118395 100644 --- a/src/java.desktop/share/native/libfreetype/src/cid/cidriver.c +++ b/src/java.desktop/share/native/libfreetype/src/cid/cidriver.c @@ -48,10 +48,11 @@ * */ - static const char* - cid_get_postscript_name( CID_Face face ) + FT_CALLBACK_DEF( const char* ) + cid_get_postscript_name( FT_Face face ) /* CID_Face */ { - const char* result = face->cid.cid_font_name; + CID_Face cidface = (CID_Face)face; + const char* result = cidface->cid.cid_font_name; if ( result && result[0] == '/' ) @@ -72,34 +73,36 @@ * */ - static FT_Error - cid_ps_get_font_info( FT_Face face, + FT_CALLBACK_DEF( FT_Error ) + cid_ps_get_font_info( FT_Face face, /* CID_Face */ PS_FontInfoRec* afont_info ) { - *afont_info = ((CID_Face)face)->cid.font_info; + *afont_info = ( (CID_Face)face )->cid.font_info; return FT_Err_Ok; } - static FT_Error - cid_ps_get_font_extra( FT_Face face, - PS_FontExtraRec* afont_extra ) + + FT_CALLBACK_DEF( FT_Error ) + cid_ps_get_font_extra( FT_Face face, /* CID_Face */ + PS_FontExtraRec* afont_extra ) { - *afont_extra = ((CID_Face)face)->font_extra; + *afont_extra = ( (CID_Face)face )->font_extra; return FT_Err_Ok; } + static const FT_Service_PsInfoRec cid_service_ps_info = { - (PS_GetFontInfoFunc) cid_ps_get_font_info, /* ps_get_font_info */ - (PS_GetFontExtraFunc) cid_ps_get_font_extra, /* ps_get_font_extra */ + cid_ps_get_font_info, /* PS_GetFontInfoFunc ps_get_font_info */ + cid_ps_get_font_extra, /* PS_GetFontExtraFunc ps_get_font_extra */ /* unsupported with CID fonts */ - (PS_HasGlyphNamesFunc) NULL, /* ps_has_glyph_names */ + NULL, /* PS_HasGlyphNamesFunc ps_has_glyph_names */ /* unsupported */ - (PS_GetFontPrivateFunc)NULL, /* ps_get_font_private */ + NULL, /* PS_GetFontPrivateFunc ps_get_font_private */ /* not implemented */ - (PS_GetFontValueFunc) NULL /* ps_get_font_value */ + NULL /* PS_GetFontValueFunc ps_get_font_value */ }; @@ -107,13 +110,14 @@ * CID INFO SERVICE * */ - static FT_Error - cid_get_ros( CID_Face face, + FT_CALLBACK_DEF( FT_Error ) + cid_get_ros( FT_Face face, /* CID_Face */ const char* *registry, const char* *ordering, FT_Int *supplement ) { - CID_FaceInfo cid = &face->cid; + CID_Face cidface = (CID_Face)face; + CID_FaceInfo cid = &cidface->cid; if ( registry ) @@ -129,32 +133,48 @@ } - static FT_Error - cid_get_is_cid( CID_Face face, + FT_CALLBACK_DEF( FT_Error ) + cid_get_is_cid( FT_Face face, /* CID_Face */ FT_Bool *is_cid ) { FT_Error error = FT_Err_Ok; FT_UNUSED( face ); + /* + * XXX: If the ROS is Adobe-Identity-H or -V, + * the font has no reliable information about + * its glyph collection. Should we not set + * *is_cid in such cases? + */ if ( is_cid ) - *is_cid = 1; /* cid driver is only used for CID keyed fonts */ + *is_cid = 1; return error; } - static FT_Error - cid_get_cid_from_glyph_index( CID_Face face, + FT_CALLBACK_DEF( FT_Error ) + cid_get_cid_from_glyph_index( FT_Face face, /* CID_Face */ FT_UInt glyph_index, FT_UInt *cid ) { - FT_Error error = FT_Err_Ok; - FT_UNUSED( face ); - - - if ( cid ) - *cid = glyph_index; /* identity mapping */ + FT_Error error = FT_Err_Ok; + CID_Face cidface = (CID_Face)face; + + + /* + * Currently, FreeType does not support incrementally-defined, CID-keyed + * fonts that store the glyph description data in a `/GlyphDirectory` + * array or dictionary. Fonts loaded by the incremental loading feature + * are thus not handled here. + */ + error = cid_compute_fd_and_offsets( cidface, glyph_index, + NULL, NULL, NULL ); + if ( error ) + *cid = 0; + else + *cid = glyph_index; return error; } @@ -162,12 +182,12 @@ static const FT_Service_CIDRec cid_service_cid_info = { - (FT_CID_GetRegistryOrderingSupplementFunc) - cid_get_ros, /* get_ros */ - (FT_CID_GetIsInternallyCIDKeyedFunc) - cid_get_is_cid, /* get_is_cid */ - (FT_CID_GetCIDFromGlyphIndexFunc) - cid_get_cid_from_glyph_index /* get_cid_from_glyph_index */ + cid_get_ros, + /* FT_CID_GetRegistryOrderingSupplementFunc get_ros */ + cid_get_is_cid, + /* FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid */ + cid_get_cid_from_glyph_index + /* FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index */ }; @@ -179,9 +199,9 @@ FT_DEFINE_SERVICE_PROPERTIESREC( cid_service_properties, - (FT_Properties_SetFunc)ps_property_set, /* set_property */ - (FT_Properties_GetFunc)ps_property_get ) /* get_property */ - + ps_property_set, /* FT_Properties_SetFunc set_property */ + ps_property_get /* FT_Properties_GetFunc get_property */ + ) /* * SERVICE LIST @@ -209,7 +229,6 @@ } - FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec t1cid_driver_class = { diff --git a/src/java.desktop/share/native/libfreetype/src/psaux/afmparse.c b/src/java.desktop/share/native/libfreetype/src/psaux/afmparse.c index 68f95698e65..db08941def7 100644 --- a/src/java.desktop/share/native/libfreetype/src/psaux/afmparse.c +++ b/src/java.desktop/share/native/libfreetype/src/psaux/afmparse.c @@ -1086,7 +1086,7 @@ #else /* T1_CONFIG_OPTION_NO_AFM */ /* ANSI C doesn't like empty source files */ - typedef int _afm_parse_dummy; + typedef int afm_parse_dummy_; #endif /* T1_CONFIG_OPTION_NO_AFM */ diff --git a/src/java.desktop/share/native/libfreetype/src/psaux/cffdecode.c b/src/java.desktop/share/native/libfreetype/src/psaux/cffdecode.c index 2cd91c96f35..562d17d2216 100644 --- a/src/java.desktop/share/native/libfreetype/src/psaux/cffdecode.c +++ b/src/java.desktop/share/native/libfreetype/src/psaux/cffdecode.c @@ -2153,7 +2153,7 @@ decoder->locals_bias ); - FT_TRACE4(( " callsubr (idx %d, entering level %ld)\n", + FT_TRACE4(( " callsubr (idx %d, entering level %td)\n", idx, zone - decoder->zones + 1 )); @@ -2197,7 +2197,7 @@ decoder->globals_bias ); - FT_TRACE4(( " callgsubr (idx %d, entering level %ld)\n", + FT_TRACE4(( " callgsubr (idx %d, entering level %td)\n", idx, zone - decoder->zones + 1 )); @@ -2236,7 +2236,7 @@ break; case cff_op_return: - FT_TRACE4(( " return (leaving level %ld)\n", + FT_TRACE4(( " return (leaving level %td)\n", decoder->zone - decoder->zones )); if ( decoder->zone <= decoder->zones ) diff --git a/src/java.desktop/share/native/libfreetype/src/psaux/pshints.c b/src/java.desktop/share/native/libfreetype/src/psaux/pshints.c index 6f44d0adbb7..7bd08a9c9bf 100644 --- a/src/java.desktop/share/native/libfreetype/src/psaux/pshints.c +++ b/src/java.desktop/share/native/libfreetype/src/psaux/pshints.c @@ -310,7 +310,7 @@ CF2_Hint hint = &hintmap->edge[i]; - FT_TRACE6(( " %3ld %7.2f %7.2f %5d %s%s%s%s\n", + FT_TRACE6(( " %3zu %7.2f %7.2f %5d %s%s%s%s\n", hint->index, hint->csCoord / 65536.0, hint->dsCoord / ( hint->scale * 1.0 ), diff --git a/src/java.desktop/share/native/libfreetype/src/psaux/t1cmap.c b/src/java.desktop/share/native/libfreetype/src/psaux/t1cmap.c index bf0a393b456..c4bcf599ea3 100644 --- a/src/java.desktop/share/native/libfreetype/src/psaux/t1cmap.c +++ b/src/java.desktop/share/native/libfreetype/src/psaux/t1cmap.c @@ -50,8 +50,11 @@ FT_CALLBACK_DEF( void ) - t1_cmap_std_done( T1_CMapStd cmap ) + t1_cmap_std_done( FT_CMap cmap_ ) /* T1_CMapStd */ { + T1_CMapStd cmap = (T1_CMapStd)cmap_; + + cmap->num_glyphs = 0; cmap->glyph_names = NULL; cmap->sid_to_string = NULL; @@ -60,10 +63,11 @@ FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_std_char_index( T1_CMapStd cmap, - FT_UInt32 char_code ) + t1_cmap_std_char_index( FT_CMap cmap, /* T1_CMapStd */ + FT_UInt32 char_code ) { - FT_UInt result = 0; + T1_CMapStd t1cmap = (T1_CMapStd)cmap; + FT_UInt result = 0; if ( char_code < 256 ) @@ -73,13 +77,13 @@ /* convert character code to Adobe SID string */ - code = cmap->code_to_sid[char_code]; - glyph_name = cmap->sid_to_string( code ); + code = t1cmap->code_to_sid[char_code]; + glyph_name = t1cmap->sid_to_string( code ); /* look for the corresponding glyph name */ - for ( n = 0; n < cmap->num_glyphs; n++ ) + for ( n = 0; n < t1cmap->num_glyphs; n++ ) { - const char* gname = cmap->glyph_names[n]; + const char* gname = t1cmap->glyph_names[n]; if ( gname && gname[0] == glyph_name[0] && @@ -95,9 +99,9 @@ } - FT_CALLBACK_DEF( FT_UInt32 ) - t1_cmap_std_char_next( T1_CMapStd cmap, - FT_UInt32 *pchar_code ) + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_std_char_next( FT_CMap cmap, + FT_UInt32 *pchar_code ) { FT_UInt result = 0; FT_UInt32 char_code = *pchar_code + 1; @@ -120,13 +124,14 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_standard_init( T1_CMapStd cmap, + t1_cmap_standard_init( FT_CMap cmap, /* T1_CMapStd */ FT_Pointer pointer ) { + T1_CMapStd t1cmap = (T1_CMapStd)cmap; FT_UNUSED( pointer ); - t1_cmap_std_init( cmap, 0 ); + t1_cmap_std_init( t1cmap, 0 ); return 0; } @@ -150,13 +155,14 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_expert_init( T1_CMapStd cmap, + t1_cmap_expert_init( FT_CMap cmap, /* T1_CMapStd */ FT_Pointer pointer ) { + T1_CMapStd t1cmap = (T1_CMapStd)cmap; FT_UNUSED( pointer ); - t1_cmap_std_init( cmap, 1 ); + t1_cmap_std_init( t1cmap, 1 ); return 0; } @@ -188,20 +194,21 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_custom_init( T1_CMapCustom cmap, - FT_Pointer pointer ) + t1_cmap_custom_init( FT_CMap cmap, /* T1_CMapCustom */ + FT_Pointer pointer ) { - T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); - T1_Encoding encoding = &face->type1.encoding; + T1_CMapCustom t1cmap = (T1_CMapCustom)cmap; + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + T1_Encoding encoding = &face->type1.encoding; FT_UNUSED( pointer ); - cmap->first = (FT_UInt)encoding->code_first; - cmap->count = (FT_UInt)encoding->code_last - cmap->first; - cmap->indices = encoding->char_index; + t1cmap->first = (FT_UInt)encoding->code_first; + t1cmap->count = (FT_UInt)encoding->code_last - t1cmap->first; + t1cmap->indices = encoding->char_index; - FT_ASSERT( cmap->indices ); + FT_ASSERT( t1cmap->indices ); FT_ASSERT( encoding->code_first <= encoding->code_last ); return 0; @@ -209,45 +216,50 @@ FT_CALLBACK_DEF( void ) - t1_cmap_custom_done( T1_CMapCustom cmap ) + t1_cmap_custom_done( FT_CMap cmap ) /* T1_CMapCustom */ { - cmap->indices = NULL; - cmap->first = 0; - cmap->count = 0; + T1_CMapCustom t1cmap = (T1_CMapCustom)cmap; + + + t1cmap->indices = NULL; + t1cmap->first = 0; + t1cmap->count = 0; } FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_custom_char_index( T1_CMapCustom cmap, - FT_UInt32 char_code ) + t1_cmap_custom_char_index( FT_CMap cmap, /* T1_CMapCustom */ + FT_UInt32 char_code ) { - FT_UInt result = 0; + T1_CMapCustom t1cmap = (T1_CMapCustom)cmap; + FT_UInt result = 0; - if ( ( char_code >= cmap->first ) && - ( char_code < ( cmap->first + cmap->count ) ) ) - result = cmap->indices[char_code]; + if ( char_code >= t1cmap->first && + char_code < ( t1cmap->first + t1cmap->count ) ) + result = t1cmap->indices[char_code]; return result; } - FT_CALLBACK_DEF( FT_UInt32 ) - t1_cmap_custom_char_next( T1_CMapCustom cmap, - FT_UInt32 *pchar_code ) + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_custom_char_next( FT_CMap cmap, /* T1_CMapCustom */ + FT_UInt32 *pchar_code ) { - FT_UInt result = 0; - FT_UInt32 char_code = *pchar_code; + T1_CMapCustom t1cmap = (T1_CMapCustom)cmap; + FT_UInt result = 0; + FT_UInt32 char_code = *pchar_code; char_code++; - if ( char_code < cmap->first ) - char_code = cmap->first; + if ( char_code < t1cmap->first ) + char_code = t1cmap->first; - for ( ; char_code < ( cmap->first + cmap->count ); char_code++ ) + for ( ; char_code < ( t1cmap->first + t1cmap->count ); char_code++ ) { - result = cmap->indices[char_code]; + result = t1cmap->indices[char_code]; if ( result != 0 ) goto Exit; } @@ -287,20 +299,24 @@ /*************************************************************************/ FT_CALLBACK_DEF( const char * ) - psaux_get_glyph_name( T1_Face face, + psaux_get_glyph_name( void* face_, FT_UInt idx ) { + T1_Face face = (T1_Face)face_; + + return face->type1.glyph_names[idx]; } FT_CALLBACK_DEF( FT_Error ) - t1_cmap_unicode_init( PS_Unicodes unicodes, - FT_Pointer pointer ) + t1_cmap_unicode_init( FT_CMap cmap, /* PS_Unicodes */ + FT_Pointer pointer ) { - T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; FT_UNUSED( pointer ); @@ -311,17 +327,18 @@ return psnames->unicodes_init( memory, unicodes, (FT_UInt)face->type1.num_glyphs, - (PS_GetGlyphNameFunc)&psaux_get_glyph_name, + &psaux_get_glyph_name, (PS_FreeGlyphNameFunc)NULL, (FT_Pointer)face ); } FT_CALLBACK_DEF( void ) - t1_cmap_unicode_done( PS_Unicodes unicodes ) + t1_cmap_unicode_done( FT_CMap cmap ) /* PS_Unicodes */ { - FT_Face face = FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); + PS_Unicodes unicodes = (PS_Unicodes)cmap; + FT_Face face = FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); FT_FREE( unicodes->maps ); @@ -330,23 +347,25 @@ FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_unicode_char_index( PS_Unicodes unicodes, - FT_UInt32 char_code ) + t1_cmap_unicode_char_index( FT_CMap cmap, /* PS_Unicodes */ + FT_UInt32 char_code ) { - T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; return psnames->unicodes_char_index( unicodes, char_code ); } - FT_CALLBACK_DEF( FT_UInt32 ) - t1_cmap_unicode_char_next( PS_Unicodes unicodes, - FT_UInt32 *pchar_code ) + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_unicode_char_next( FT_CMap cmap, /* PS_Unicodes */ + FT_UInt32 *pchar_code ) { - T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; return psnames->unicodes_char_next( unicodes, pchar_code ); diff --git a/src/java.desktop/share/native/libfreetype/src/psaux/t1decode.c b/src/java.desktop/share/native/libfreetype/src/psaux/t1decode.c index bfed45b53a3..4b6b969bcb9 100644 --- a/src/java.desktop/share/native/libfreetype/src/psaux/t1decode.c +++ b/src/java.desktop/share/native/libfreetype/src/psaux/t1decode.c @@ -520,7 +520,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( bol ) { - FT_TRACE5(( " (%ld)", decoder->top - decoder->stack )); + FT_TRACE5(( " (%td)", decoder->top - decoder->stack )); bol = FALSE; } #endif @@ -1165,7 +1165,7 @@ if ( top - decoder->stack != num_args ) FT_TRACE0(( "t1_decoder_parse_charstrings:" " too much operands on the stack" - " (seen %ld, expected %d)\n", + " (seen %td, expected %d)\n", top - decoder->stack, num_args )); break; } diff --git a/src/java.desktop/share/native/libfreetype/src/pshinter/pshalgo.c b/src/java.desktop/share/native/libfreetype/src/pshinter/pshalgo.c index a7f321291a9..4f622e1e440 100644 --- a/src/java.desktop/share/native/libfreetype/src/pshinter/pshalgo.c +++ b/src/java.desktop/share/native/libfreetype/src/pshinter/pshalgo.c @@ -516,7 +516,7 @@ if ( !psh_hint_is_fitted( parent ) ) psh_hint_align( parent, globals, dimension, glyph ); - /* keep original relation between hints, this is, use the */ + /* keep original relation between hints, that is, use the */ /* scaled distance between the centers of the hints to */ /* compute the new position */ par_org_center = parent->org_pos + ( parent->org_len >> 1 ); diff --git a/src/java.desktop/share/native/libfreetype/src/pshinter/pshmod.c b/src/java.desktop/share/native/libfreetype/src/pshinter/pshmod.c index a12e4856601..974a99e0186 100644 --- a/src/java.desktop/share/native/libfreetype/src/pshinter/pshmod.c +++ b/src/java.desktop/share/native/libfreetype/src/pshinter/pshmod.c @@ -37,8 +37,11 @@ /* finalize module */ FT_CALLBACK_DEF( void ) - ps_hinter_done( PS_Hinter_Module module ) + ps_hinter_done( FT_Module module_ ) /* PS_Hinter_Module */ { + PS_Hinter_Module module = (PS_Hinter_Module)module_; + + module->t1_funcs.hints = NULL; module->t2_funcs.hints = NULL; @@ -48,8 +51,10 @@ /* initialize module, create hints recorder and the interface */ FT_CALLBACK_DEF( FT_Error ) - ps_hinter_init( PS_Hinter_Module module ) + ps_hinter_init( FT_Module module_ ) /* PS_Hinter_Module */ { + PS_Hinter_Module module = (PS_Hinter_Module)module_; + FT_Memory memory = module->root.memory; void* ph = &module->ps_hints; diff --git a/src/java.desktop/share/native/libfreetype/src/pshinter/pshrec.c b/src/java.desktop/share/native/libfreetype/src/pshinter/pshrec.c index 58c8cf1b486..680e6d01358 100644 --- a/src/java.desktop/share/native/libfreetype/src/pshinter/pshrec.c +++ b/src/java.desktop/share/native/libfreetype/src/pshinter/pshrec.c @@ -851,10 +851,11 @@ /* add one Type1 counter stem to the current hints table */ static void - ps_hints_t1stem3( PS_Hints hints, + ps_hints_t1stem3( T1_Hints hints_, /* PS_Hints */ FT_UInt dimension, FT_Fixed* stems ) { + PS_Hints hints = (PS_Hints)hints_; FT_Error error = FT_Err_Ok; @@ -914,9 +915,10 @@ /* reset hints (only with Type 1 hints) */ static void - ps_hints_t1reset( PS_Hints hints, + ps_hints_t1reset( T1_Hints hints_, /* PS_Hints */ FT_UInt end_point ) { + PS_Hints hints = (PS_Hints)hints_; FT_Error error = FT_Err_Ok; @@ -953,11 +955,12 @@ /* Type2 "hintmask" operator, add a new hintmask to each direction */ static void - ps_hints_t2mask( PS_Hints hints, + ps_hints_t2mask( T2_Hints hints_, /* PS_Hints */ FT_UInt end_point, FT_UInt bit_count, const FT_Byte* bytes ) { + PS_Hints hints = (PS_Hints)hints_; FT_Error error; @@ -999,10 +1002,11 @@ static void - ps_hints_t2counter( PS_Hints hints, + ps_hints_t2counter( T2_Hints hints_, /* PS_Hints */ FT_UInt bit_count, const FT_Byte* bytes ) { + PS_Hints hints = (PS_Hints)hints_; FT_Error error; @@ -1087,6 +1091,13 @@ ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_1 ); } + static FT_Error + t1_hints_close( T1_Hints hints, + FT_UInt end_point ) + { + return ps_hints_close( (PS_Hints)hints, end_point ); + } + static void t1_hints_stem( T1_Hints hints, FT_UInt dimension, @@ -1102,17 +1113,27 @@ } + static FT_Error + t1_hints_apply( T1_Hints hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ) + { + return ps_hints_apply( (PS_Hints)hints, outline, globals, hint_mode ); + } + + FT_LOCAL_DEF( void ) t1_hints_funcs_init( T1_Hints_FuncsRec* funcs ) { FT_ZERO( funcs ); funcs->open = (T1_Hints_OpenFunc) t1_hints_open; - funcs->close = (T1_Hints_CloseFunc) ps_hints_close; + funcs->close = (T1_Hints_CloseFunc) t1_hints_close; funcs->stem = (T1_Hints_SetStemFunc) t1_hints_stem; funcs->stem3 = (T1_Hints_SetStem3Func)ps_hints_t1stem3; funcs->reset = (T1_Hints_ResetFunc) ps_hints_t1reset; - funcs->apply = (T1_Hints_ApplyFunc) ps_hints_apply; + funcs->apply = (T1_Hints_ApplyFunc) t1_hints_apply; } @@ -1131,6 +1152,14 @@ } + static FT_Error + t2_hints_close( T2_Hints hints, + FT_UInt end_point ) + { + return ps_hints_close( (PS_Hints)hints, end_point ); + } + + static void t2_hints_stems( T2_Hints hints, FT_UInt dimension, @@ -1168,17 +1197,27 @@ } + static FT_Error + t2_hints_apply( T2_Hints hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ) + { + return ps_hints_apply( (PS_Hints)hints, outline, globals, hint_mode ); + } + + FT_LOCAL_DEF( void ) t2_hints_funcs_init( T2_Hints_FuncsRec* funcs ) { FT_ZERO( funcs ); - funcs->open = (T2_Hints_OpenFunc) t2_hints_open; - funcs->close = (T2_Hints_CloseFunc) ps_hints_close; - funcs->stems = (T2_Hints_StemsFunc) t2_hints_stems; - funcs->hintmask= (T2_Hints_MaskFunc) ps_hints_t2mask; - funcs->counter = (T2_Hints_CounterFunc)ps_hints_t2counter; - funcs->apply = (T2_Hints_ApplyFunc) ps_hints_apply; + funcs->open = (T2_Hints_OpenFunc) t2_hints_open; + funcs->close = (T2_Hints_CloseFunc) t2_hints_close; + funcs->stems = (T2_Hints_StemsFunc) t2_hints_stems; + funcs->hintmask = (T2_Hints_MaskFunc) ps_hints_t2mask; + funcs->counter = (T2_Hints_CounterFunc)ps_hints_t2counter; + funcs->apply = (T2_Hints_ApplyFunc) t2_hints_apply; } diff --git a/src/java.desktop/share/native/libfreetype/src/psnames/psmodule.c b/src/java.desktop/share/native/libfreetype/src/psnames/psmodule.c index db454e558eb..8203a0465d2 100644 --- a/src/java.desktop/share/native/libfreetype/src/psnames/psmodule.c +++ b/src/java.desktop/share/native/libfreetype/src/psnames/psmodule.c @@ -57,7 +57,7 @@ /* the name, as in `A.swash' or `e.final'; in this case, the */ /* VARIANT_BIT is set in the return value. */ /* */ - static FT_UInt32 + FT_CALLBACK_DEF( FT_UInt32 ) ps_unicode_value( const char* glyph_name ) { /* If the name begins with `uni', then the glyph name may be a */ @@ -309,7 +309,7 @@ /* Build a table that maps Unicode values to glyph indices. */ - static FT_Error + FT_CALLBACK_DEF( FT_Error ) ps_unicodes_init( FT_Memory memory, PS_Unicodes table, FT_UInt num_glyphs, @@ -408,7 +408,7 @@ } - static FT_UInt + FT_CALLBACK_DEF( FT_UInt ) ps_unicodes_char_index( PS_Unicodes table, FT_UInt32 unicode ) { @@ -453,7 +453,7 @@ } - static FT_UInt32 + FT_CALLBACK_DEF( FT_UInt ) ps_unicodes_char_next( PS_Unicodes table, FT_UInt32 *unicode ) { @@ -518,7 +518,7 @@ #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ - static const char* + FT_CALLBACK_DEF( const char* ) ps_get_macintosh_name( FT_UInt name_index ) { if ( name_index >= FT_NUM_MAC_NAMES ) @@ -528,7 +528,7 @@ } - static const char* + FT_CALLBACK_DEF( const char* ) ps_get_standard_strings( FT_UInt sid ) { if ( sid >= FT_NUM_SID_NAMES ) @@ -543,13 +543,13 @@ FT_DEFINE_SERVICE_PSCMAPSREC( pscmaps_interface, - (PS_Unicode_ValueFunc) ps_unicode_value, /* unicode_value */ - (PS_Unicodes_InitFunc) ps_unicodes_init, /* unicodes_init */ - (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, /* unicodes_char_index */ - (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, /* unicodes_char_next */ + ps_unicode_value, /* PS_Unicode_ValueFunc unicode_value */ + ps_unicodes_init, /* PS_Unicodes_InitFunc unicodes_init */ + ps_unicodes_char_index, /* PS_Unicodes_CharIndexFunc unicodes_char_index */ + ps_unicodes_char_next, /* PS_Unicodes_CharNextFunc unicodes_char_next */ - (PS_Macintosh_NameFunc) ps_get_macintosh_name, /* macintosh_name */ - (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, /* adobe_std_strings */ + ps_get_macintosh_name, /* PS_Macintosh_NameFunc macintosh_name */ + ps_get_standard_strings, /* PS_Adobe_Std_StringsFunc adobe_std_strings */ t1_standard_encoding, /* adobe_std_encoding */ t1_expert_encoding /* adobe_expert_encoding */ @@ -560,13 +560,13 @@ FT_DEFINE_SERVICE_PSCMAPSREC( pscmaps_interface, - NULL, /* unicode_value */ - NULL, /* unicodes_init */ - NULL, /* unicodes_char_index */ - NULL, /* unicodes_char_next */ + NULL, /* PS_Unicode_ValueFunc unicode_value */ + NULL, /* PS_Unicodes_InitFunc unicodes_init */ + NULL, /* PS_Unicodes_CharIndexFunc unicodes_char_index */ + NULL, /* PS_Unicodes_CharNextFunc unicodes_char_next */ - (PS_Macintosh_NameFunc) ps_get_macintosh_name, /* macintosh_name */ - (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, /* adobe_std_strings */ + ps_get_macintosh_name, /* PS_Macintosh_NameFunc macintosh_name */ + ps_get_standard_strings, /* PS_Adobe_Std_StringsFunc adobe_std_strings */ t1_standard_encoding, /* adobe_std_encoding */ t1_expert_encoding /* adobe_expert_encoding */ @@ -612,9 +612,9 @@ PUT_PS_NAMES_SERVICE( (void*)&pscmaps_interface ), /* module specific interface */ - (FT_Module_Constructor)NULL, /* module_init */ - (FT_Module_Destructor) NULL, /* module_done */ - (FT_Module_Requester) PUT_PS_NAMES_SERVICE( psnames_get_service ) /* get_interface */ + NULL, /* FT_Module_Constructor module_init */ + NULL, /* FT_Module_Destructor module_done */ + PUT_PS_NAMES_SERVICE( psnames_get_service ) /* FT_Module_Requester get_interface */ ) diff --git a/src/java.desktop/share/native/libfreetype/src/raster/ftraster.c b/src/java.desktop/share/native/libfreetype/src/raster/ftraster.c index 67cbfd5d9b7..192ca0701a2 100644 --- a/src/java.desktop/share/native/libfreetype/src/raster/ftraster.c +++ b/src/java.desktop/share/native/libfreetype/src/raster/ftraster.c @@ -1742,9 +1742,9 @@ * SUCCESS on success, FAILURE on error. */ static Bool - Decompose_Curve( RAS_ARGS UShort first, - UShort last, - Int flipped ) + Decompose_Curve( RAS_ARGS Int first, + Int last, + Int flipped ) { FT_Vector v_last; FT_Vector v_control; @@ -1969,8 +1969,8 @@ static Bool Convert_Glyph( RAS_ARGS Int flipped ) { - Int i; - UInt start; + Int i; + Int first, last; ras.fProfile = NULL; @@ -1985,8 +1985,7 @@ ras.cProfile->offset = ras.top; ras.num_Profs = 0; - start = 0; - + last = -1; for ( i = 0; i < ras.outline.n_contours; i++ ) { PProfile lastProfile; @@ -1996,12 +1995,11 @@ ras.state = Unknown_State; ras.gProfile = NULL; - if ( Decompose_Curve( RAS_VARS (UShort)start, - (UShort)ras.outline.contours[i], - flipped ) ) - return FAILURE; + first = last + 1; + last = ras.outline.contours[i]; - start = (UShort)ras.outline.contours[i] + 1; + if ( Decompose_Curve( RAS_VARS first, last, flipped ) ) + return FAILURE; /* we must now check whether the extreme arcs join or not */ if ( FRAC( ras.lastY ) == 0 && @@ -3167,9 +3165,12 @@ static int - ft_black_new( FT_Memory memory, - black_PRaster *araster ) + ft_black_new( void* memory_, /* FT_Memory */ + FT_Raster *araster_ ) /* black_PRaster */ { + FT_Memory memory = (FT_Memory)memory_; + black_PRaster *araster = (black_PRaster*)araster_; + FT_Error error; black_PRaster raster = NULL; @@ -3184,9 +3185,10 @@ static void - ft_black_done( black_PRaster raster ) + ft_black_done( FT_Raster raster_ ) /* black_PRaster */ { - FT_Memory memory = (FT_Memory)raster->memory; + black_PRaster raster = (black_PRaster)raster_; + FT_Memory memory = (FT_Memory)raster->memory; FT_FREE( raster ); @@ -3281,11 +3283,11 @@ FT_GLYPH_FORMAT_OUTLINE, - (FT_Raster_New_Func) ft_black_new, /* raster_new */ - (FT_Raster_Reset_Func) ft_black_reset, /* raster_reset */ - (FT_Raster_Set_Mode_Func)ft_black_set_mode, /* raster_set_mode */ - (FT_Raster_Render_Func) ft_black_render, /* raster_render */ - (FT_Raster_Done_Func) ft_black_done /* raster_done */ + ft_black_new, /* FT_Raster_New_Func raster_new */ + ft_black_reset, /* FT_Raster_Reset_Func raster_reset */ + ft_black_set_mode, /* FT_Raster_Set_Mode_Func raster_set_mode */ + ft_black_render, /* FT_Raster_Render_Func raster_render */ + ft_black_done /* FT_Raster_Done_Func raster_done */ ) diff --git a/src/java.desktop/share/native/libfreetype/src/raster/ftrend1.c b/src/java.desktop/share/native/libfreetype/src/raster/ftrend1.c index 0b5d8671478..6d442b1ff8c 100644 --- a/src/java.desktop/share/native/libfreetype/src/raster/ftrend1.c +++ b/src/java.desktop/share/native/libfreetype/src/raster/ftrend1.c @@ -27,8 +27,11 @@ /* initialize renderer -- init its raster */ static FT_Error - ft_raster1_init( FT_Renderer render ) + ft_raster1_init( FT_Module module ) /* FT_Renderer */ { + FT_Renderer render = (FT_Renderer)module; + + render->clazz->raster_class->raster_reset( render->raster, NULL, 0 ); return FT_Err_Ok; @@ -188,18 +191,18 @@ NULL, /* module specific interface */ - (FT_Module_Constructor)ft_raster1_init, /* module_init */ - (FT_Module_Destructor) NULL, /* module_done */ - (FT_Module_Requester) NULL, /* get_interface */ + ft_raster1_init, /* FT_Module_Constructor module_init */ + NULL, /* FT_Module_Destructor module_done */ + NULL, /* FT_Module_Requester get_interface */ FT_GLYPH_FORMAT_OUTLINE, - (FT_Renderer_RenderFunc) ft_raster1_render, /* render_glyph */ - (FT_Renderer_TransformFunc)ft_raster1_transform, /* transform_glyph */ - (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, /* get_glyph_cbox */ - (FT_Renderer_SetModeFunc) ft_raster1_set_mode, /* set_mode */ + ft_raster1_render, /* FT_Renderer_RenderFunc render_glyph */ + ft_raster1_transform, /* FT_Renderer_TransformFunc transform_glyph */ + ft_raster1_get_cbox, /* FT_Renderer_GetCBoxFunc get_glyph_cbox */ + ft_raster1_set_mode, /* FT_Renderer_SetModeFunc set_mode */ - (FT_Raster_Funcs*)&ft_standard_raster /* raster_class */ + &ft_standard_raster /* FT_Raster_Funcs* raster_class */ ) diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/pngshim.c b/src/java.desktop/share/native/libfreetype/src/sfnt/pngshim.c index 423b07b02a5..33712162e00 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/pngshim.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/pngshim.c @@ -406,10 +406,7 @@ switch ( color_type ) { - default: - /* Shouldn't happen, but ... */ - FALL_THROUGH; - + default: /* Shouldn't happen, but ... */ case PNG_COLOR_TYPE_RGB_ALPHA: png_set_read_user_transform_fn( png, premultiply_data ); break; @@ -457,7 +454,7 @@ #else /* !(TT_CONFIG_OPTION_EMBEDDED_BITMAPS && FT_CONFIG_OPTION_USE_PNG) */ /* ANSI C doesn't like empty source files */ - typedef int _pngshim_dummy; + typedef int pngshim_dummy_; #endif /* !(TT_CONFIG_OPTION_EMBEDDED_BITMAPS && FT_CONFIG_OPTION_USE_PNG) */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/sfdriver.c b/src/java.desktop/share/native/libfreetype/src/sfnt/sfdriver.c index 762883db542..0925940b03f 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/sfdriver.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/sfdriver.c @@ -79,41 +79,57 @@ * */ - static void* - get_sfnt_table( TT_Face face, + FT_CALLBACK_DEF( FT_Error ) + sfnt_load_table( FT_Face face, /* TT_Face */ + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ) + { + TT_Face ttface = (TT_Face)face; + + + return tt_face_load_any( ttface, tag, offset, buffer, length ); + } + + + FT_CALLBACK_DEF( void* ) + get_sfnt_table( FT_Face face, /* TT_Face */ FT_Sfnt_Tag tag ) { + TT_Face ttface = (TT_Face)face; + void* table; switch ( tag ) { case FT_SFNT_HEAD: - table = &face->header; + table = &ttface->header; break; case FT_SFNT_HHEA: - table = &face->horizontal; + table = &ttface->horizontal; break; case FT_SFNT_VHEA: - table = face->vertical_info ? &face->vertical : NULL; + table = ttface->vertical_info ? &ttface->vertical : NULL; break; case FT_SFNT_OS2: - table = ( face->os2.version == 0xFFFFU ) ? NULL : &face->os2; + table = ( ttface->os2.version == 0xFFFFU ) ? NULL : &ttface->os2; break; case FT_SFNT_POST: - table = &face->postscript; + table = &ttface->postscript; break; case FT_SFNT_MAXP: - table = &face->max_profile; + table = &ttface->max_profile; break; case FT_SFNT_PCLT: - table = face->pclt.Version ? &face->pclt : NULL; + table = ttface->pclt.Version ? &ttface->pclt : NULL; break; default: @@ -124,26 +140,29 @@ } - static FT_Error - sfnt_table_info( TT_Face face, + FT_CALLBACK_DEF( FT_Error ) + sfnt_table_info( FT_Face face, /* TT_Face */ FT_UInt idx, FT_ULong *tag, FT_ULong *offset, FT_ULong *length ) { + TT_Face ttface = (TT_Face)face; + + if ( !offset || !length ) return FT_THROW( Invalid_Argument ); if ( !tag ) - *length = face->num_tables; + *length = ttface->num_tables; else { - if ( idx >= face->num_tables ) + if ( idx >= ttface->num_tables ) return FT_THROW( Table_Missing ); - *tag = face->dir_tables[idx].Tag; - *offset = face->dir_tables[idx].Offset; - *length = face->dir_tables[idx].Length; + *tag = ttface->dir_tables[idx].Tag; + *offset = ttface->dir_tables[idx].Offset; + *length = ttface->dir_tables[idx].Length; } return FT_Err_Ok; @@ -153,9 +172,9 @@ FT_DEFINE_SERVICE_SFNT_TABLEREC( sfnt_service_sfnt_table, - (FT_SFNT_TableLoadFunc)tt_face_load_any, /* load_table */ - (FT_SFNT_TableGetFunc) get_sfnt_table, /* get_table */ - (FT_SFNT_TableInfoFunc)sfnt_table_info /* table_info */ + sfnt_load_table, /* FT_SFNT_TableLoadFunc load_table */ + get_sfnt_table, /* FT_SFNT_TableGetFunc get_table */ + sfnt_table_info /* FT_SFNT_TableInfoFunc table_info */ ) @@ -166,7 +185,7 @@ * */ - static FT_Error + FT_CALLBACK_DEF( FT_Error ) sfnt_get_glyph_name( FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, @@ -184,7 +203,7 @@ } - static FT_UInt + FT_CALLBACK_DEF( FT_UInt ) sfnt_get_name_index( FT_Face face, const FT_String* glyph_name ) { @@ -221,8 +240,8 @@ FT_DEFINE_SERVICE_GLYPHDICTREC( sfnt_service_glyph_dict, - (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, /* get_name */ - (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index /* name_index */ + sfnt_get_glyph_name, /* FT_GlyphDict_GetNameFunc get_name */ + sfnt_get_name_index /* FT_GlyphDict_NameIndexFunc name_index */ ) #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ @@ -523,15 +542,14 @@ FT_TRACE0(( "get_win_string:" " Character 0x%X invalid in PS name string\n", ((unsigned)p[0])*256 + (unsigned)p[1] )); - break; + continue; } } - if ( !len ) - *r = '\0'; + *r = '\0'; FT_FRAME_EXIT(); - if ( !len ) + if ( r != result ) return result; get_win_string_error: @@ -580,15 +598,14 @@ FT_TRACE0(( "get_apple_string:" " Character `%c' (0x%X) invalid in PS name string\n", *p, *p )); - break; + continue; } } - if ( !len ) - *r = '\0'; + *r = '\0'; FT_FRAME_EXIT(); - if ( !len ) + if ( r != result ) return result; get_apple_string_error: @@ -602,7 +619,7 @@ } - static FT_Bool + FT_CALLBACK_DEF( FT_Bool ) sfnt_get_name_id( TT_Face face, FT_UShort id, FT_Int *win, @@ -819,9 +836,9 @@ if ( !found ) { - /* as a last resort we try the family name; note that this is */ - /* not in the Adobe TechNote, but GX fonts (which predate the */ - /* TechNote) benefit from this behaviour */ + /* according to the 'name' documentation in the OpenType */ + /* specification the font family name is to be used if the */ + /* typographic family name is missing, so let's do that */ found = sfnt_get_name_id( face, TT_NAME_ID_FONT_FAMILY, &win, @@ -853,6 +870,10 @@ { FT_TRACE0(( "sfnt_get_var_ps_name:" " No valid PS name prefix for font instances found\n" )); + /* XXX It probably makes sense to never let this fail */ + /* since an arbitrary prefix should work, too. */ + /* On the other hand, it is very unlikely that */ + /* we ever reach this code at all. */ return NULL; } @@ -1041,47 +1062,49 @@ #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ - static const char* - sfnt_get_ps_name( TT_Face face ) + FT_CALLBACK_DEF( const char* ) + sfnt_get_ps_name( FT_Face face ) /* TT_Face */ { + TT_Face ttface = (TT_Face)face; + FT_Int found, win, apple; const char* result = NULL; - if ( face->postscript_name ) - return face->postscript_name; + if ( ttface->postscript_name ) + return ttface->postscript_name; #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( face->blend && - ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) || - FT_IS_VARIATION( FT_FACE( face ) ) ) ) + if ( ttface->blend && + ( FT_IS_NAMED_INSTANCE( face ) || + FT_IS_VARIATION( face ) ) ) { - face->postscript_name = sfnt_get_var_ps_name( face ); - return face->postscript_name; + ttface->postscript_name = sfnt_get_var_ps_name( ttface ); + return ttface->postscript_name; } #endif /* scan the name table to see whether we have a Postscript name here, */ /* either in Macintosh or Windows platform encodings */ - found = sfnt_get_name_id( face, TT_NAME_ID_PS_NAME, &win, &apple ); + found = sfnt_get_name_id( ttface, TT_NAME_ID_PS_NAME, &win, &apple ); if ( !found ) return NULL; /* prefer Windows entries over Apple */ if ( win != -1 ) - result = get_win_string( face->root.memory, - face->name_table.stream, - face->name_table.names + win, + result = get_win_string( FT_FACE_MEMORY( face ), + ttface->name_table.stream, + ttface->name_table.names + win, sfnt_is_postscript, 1 ); if ( !result && apple != -1 ) - result = get_apple_string( face->root.memory, - face->name_table.stream, - face->name_table.names + apple, + result = get_apple_string( FT_FACE_MEMORY( face ), + ttface->name_table.stream, + ttface->name_table.names + apple, sfnt_is_postscript, 1 ); - face->postscript_name = result; + ttface->postscript_name = result; return result; } @@ -1090,7 +1113,7 @@ FT_DEFINE_SERVICE_PSFONTNAMEREC( sfnt_service_ps_name, - (FT_PsName_GetFunc)sfnt_get_ps_name /* get_ps_font_name */ + sfnt_get_ps_name /* FT_PsName_GetFunc get_ps_font_name */ ) @@ -1100,14 +1123,14 @@ FT_DEFINE_SERVICE_TTCMAPSREC( tt_service_get_cmap_info, - (TT_CMap_Info_GetFunc)tt_get_cmap_info /* get_cmap_info */ + tt_get_cmap_info /* TT_CMap_Info_GetFunc get_cmap_info */ ) #ifdef TT_CONFIG_OPTION_BDF static FT_Error - sfnt_get_charset_id( TT_Face face, + sfnt_get_charset_id( FT_Face face, const char* *acharset_encoding, const char* *acharset_registry ) { @@ -1145,8 +1168,8 @@ FT_DEFINE_SERVICE_BDFRec( sfnt_service_bdf, - (FT_BDF_GetCharsetIdFunc)sfnt_get_charset_id, /* get_charset_id */ - (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop /* get_property */ + sfnt_get_charset_id, /* FT_BDF_GetCharsetIdFunc get_charset_id */ + tt_face_find_bdf_prop /* FT_BDF_GetPropertyFunc get_property */ ) @@ -1337,9 +1360,9 @@ (const void*)&sfnt_interface, /* module specific interface */ - (FT_Module_Constructor)NULL, /* module_init */ - (FT_Module_Destructor) NULL, /* module_done */ - (FT_Module_Requester) sfnt_get_interface /* get_interface */ + NULL, /* FT_Module_Constructor module_init */ + NULL, /* FT_Module_Destructor module_done */ + sfnt_get_interface /* FT_Module_Requester get_interface */ ) diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.c b/src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.c index e018934ccaa..f5d66ef8403 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.c @@ -534,17 +534,23 @@ 0 ); } - if ( !face->var ) + if ( !face->tt_var ) { /* we want the metrics variations interface */ /* from the `truetype' module only */ FT_Module tt_module = FT_Get_Module( library, "truetype" ); - face->var = ft_module_get_service( tt_module, - FT_SERVICE_ID_METRICS_VARIATIONS, - 0 ); + face->tt_var = ft_module_get_service( tt_module, + FT_SERVICE_ID_METRICS_VARIATIONS, + 0 ); } + + if ( !face->face_var ) + face->face_var = ft_module_get_service( + &face->root.driver->root, + FT_SERVICE_ID_METRICS_VARIATIONS, + 0 ); #endif FT_TRACE2(( "SFNT driver\n" )); @@ -692,6 +698,9 @@ instance_offset += instance_size; } + /* named instance indices start with value 1 */ + face->var_default_named_instance = i + 1; + if ( i == num_instances ) { /* no default instance in named instance table; */ @@ -1054,6 +1063,16 @@ GET_NAME( FONT_SUBFAMILY, &face->root.style_name ); } +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + { + FT_Memory memory = face->root.memory; + + + if ( FT_STRDUP( face->non_var_style_name, face->root.style_name ) ) + goto Exit; + } +#endif + /* now set up root fields */ { FT_Face root = &face->root; @@ -1221,7 +1240,7 @@ if ( count > 0 ) { - FT_Memory memory = face->root.stream->memory; + FT_Memory memory = face->root.memory; FT_UShort em_size = face->header.Units_Per_EM; FT_Short avgwidth = face->os2.xAvgCharWidth; FT_Size_Metrics metrics; @@ -1500,6 +1519,7 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_FREE( face->var_postscript_prefix ); + FT_FREE( face->non_var_style_name ); #endif /* freeing glyph color palette data */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff.c b/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff.c index 9559bf34214..7c0ce2205e6 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff.c @@ -426,7 +426,7 @@ #else /* !FT_CONFIG_OPTION_USE_ZLIB */ /* ANSI C doesn't like empty source files */ - typedef int _sfwoff_dummy; + typedef int sfwoff_dummy_; #endif /* !FT_CONFIG_OPTION_USE_ZLIB */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff2.c b/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff2.c index 7a01977f866..2be44a347ad 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff2.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/sfwoff2.c @@ -36,6 +36,8 @@ #undef FT_COMPONENT #define FT_COMPONENT sfwoff2 + /* An arbitrary, heuristic size limit (67MByte) for expanded WOFF2 data. */ +#define MAX_SFNT_SIZE ( 1 << 26 ) #define READ_255USHORT( var ) FT_SET_ERROR( Read255UShort( stream, &var ) ) @@ -2180,9 +2182,8 @@ else sfnt_size = woff2.totalSfntSize; - /* Value 1<<26 = 67108864 is heuristic. */ - if (sfnt_size >= (1 << 26)) - sfnt_size = 1 << 26; + if ( sfnt_size >= MAX_SFNT_SIZE ) + sfnt_size = MAX_SFNT_SIZE; #ifdef FT_DEBUG_LEVEL_TRACE if ( sfnt_size != woff2.totalSfntSize ) @@ -2257,10 +2258,15 @@ goto Exit; } - if ( woff2.uncompressed_size > sfnt_size ) + /* We must not blindly trust `uncompressed_size` since its */ + /* value might be corrupted. If it is too large, reject the */ + /* font. In other words, we don't accept a WOFF2 font that */ + /* expands to something larger than MAX_SFNT_SIZE. If ever */ + /* necessary, this limit can be easily adjusted. */ + if ( woff2.uncompressed_size > MAX_SFNT_SIZE ) { - FT_ERROR(( "woff2_open_font: SFNT table lengths are too large.\n" )); - error = FT_THROW( Invalid_Table ); + FT_ERROR(( "Uncompressed font too large.\n" )); + error = FT_THROW( Array_Too_Large ); goto Exit; } @@ -2378,7 +2384,7 @@ #else /* !FT_CONFIG_OPTION_USE_BROTLI */ /* ANSI C doesn't like empty source files */ - typedef int _sfwoff2_dummy; + typedef int sfwoff2_dummy_; #endif /* !FT_CONFIG_OPTION_USE_BROTLI */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.c b/src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.c index 820cd08e6d5..9ba25dcbc13 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.c @@ -59,10 +59,14 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap_init( TT_CMap cmap, - FT_Byte* table ) + tt_cmap_init( FT_CMap cmap, /* TT_CMap */ + void* table_ ) { - cmap->data = table; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = (FT_Byte*)table_; + + + ttcmap->data = table; return FT_Err_Ok; } @@ -128,21 +132,23 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap0_char_index( TT_CMap cmap, + tt_cmap0_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; return char_code < 256 ? table[6 + char_code] : 0; } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap0_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap0_char_next( FT_CMap cmap, /* TT_CMap */ FT_UInt32 *pchar_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt32 charcode = *pchar_code; FT_UInt32 result = 0; FT_UInt gindex = 0; @@ -165,10 +171,11 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap0_get_info( TT_CMap cmap, + tt_cmap0_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 4; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 4; cmap_info->format = 0; @@ -453,10 +460,11 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap2_char_index( TT_CMap cmap, + tt_cmap2_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt result = 0; FT_Byte* subheader; @@ -491,11 +499,12 @@ } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap2_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap2_char_next( FT_CMap cmap, /* TT_CMap */ FT_UInt32 *pcharcode ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt gindex = 0; FT_UInt32 result = 0; FT_UInt32 charcode = *pcharcode + 1; @@ -579,10 +588,11 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap2_get_info( TT_CMap cmap, + tt_cmap2_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 4; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 4; cmap_info->format = 2; @@ -706,18 +716,20 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap4_init( TT_CMap4 cmap, - FT_Byte* table ) + tt_cmap4_init( FT_CMap cmap, /* TT_CMap4 */ + void* table_ ) { + TT_CMap4 ttcmap = (TT_CMap4)cmap; + FT_Byte* table = (FT_Byte*)table_; FT_Byte* p; - cmap->cmap.data = table; + ttcmap->cmap.data = table; - p = table + 6; - cmap->num_ranges = FT_PEEK_USHORT( p ) >> 1; - cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL; - cmap->cur_gindex = 0; + p = table + 6; + ttcmap->num_ranges = FT_PEEK_USHORT( p ) >> 1; + ttcmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL; + ttcmap->cur_gindex = 0; return FT_Err_Ok; } @@ -755,7 +767,7 @@ cmap->cur_start == 0xFFFFU && cmap->cur_end == 0xFFFFU ) { - TT_Face face = (TT_Face)cmap->cmap.cmap.charmap.face; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); FT_Byte* limit = face->cmap_table + face->cmap_size; @@ -788,15 +800,12 @@ static void tt_cmap4_next( TT_CMap4 cmap ) { - TT_Face face = (TT_Face)cmap->cmap.cmap.charmap.face; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); FT_Byte* limit = face->cmap_table + face->cmap_size; FT_UInt charcode; - if ( cmap->cur_charcode >= 0xFFFFUL ) - goto Fail; - charcode = (FT_UInt)cmap->cur_charcode + 1; if ( charcode < cmap->cur_start ) @@ -882,7 +891,6 @@ charcode = cmap->cur_start; } - Fail: cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL; cmap->cur_gindex = 0; } @@ -1097,32 +1105,26 @@ FT_UInt32* pcharcode, FT_Bool next ) { - TT_Face face = (TT_Face)cmap->cmap.charmap.face; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); FT_Byte* limit = face->cmap_table + face->cmap_size; FT_UInt num_segs2, start, end, offset; FT_Int delta; FT_UInt i, num_segs; - FT_UInt32 charcode = *pcharcode; + FT_UInt32 charcode = *pcharcode + next; FT_UInt gindex = 0; FT_Byte* p; FT_Byte* q; p = cmap->data + 6; - num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); - - num_segs = num_segs2 >> 1; + num_segs = TT_PEEK_USHORT( p ) >> 1; if ( !num_segs ) return 0; - if ( next ) - charcode++; - - if ( charcode > 0xFFFFU ) - return 0; + num_segs2 = num_segs << 1; /* linear search */ p = cmap->data + 14; /* ends table */ @@ -1232,37 +1234,30 @@ FT_UInt32* pcharcode, FT_Bool next ) { - TT_Face face = (TT_Face)cmap->cmap.charmap.face; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); FT_Byte* limit = face->cmap_table + face->cmap_size; FT_UInt num_segs2, start, end, offset; FT_Int delta; FT_UInt max, min, mid, num_segs; - FT_UInt charcode = (FT_UInt)*pcharcode; + FT_UInt charcode = (FT_UInt)*pcharcode + next; FT_UInt gindex = 0; FT_Byte* p; p = cmap->data + 6; - num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); + num_segs = TT_PEEK_USHORT( p ) >> 1; - if ( !num_segs2 ) + if ( !num_segs ) return 0; - num_segs = num_segs2 >> 1; - - /* make compiler happy */ - mid = num_segs; - end = 0xFFFFU; - - if ( next ) - charcode++; + num_segs2 = num_segs << 1; min = 0; max = num_segs; /* binary search */ - while ( min < max ) + do { mid = ( min + max ) >> 1; p = cmap->data + 14 + mid * 2; @@ -1445,6 +1440,7 @@ break; } } + while ( min < max ); if ( next ) { @@ -1454,12 +1450,8 @@ /* if `charcode' is not in any segment, then `mid' is */ /* the segment nearest to `charcode' */ - if ( charcode > end ) - { - mid++; - if ( mid == num_segs ) - return 0; - } + if ( charcode > end && ++mid == num_segs ) + return 0; if ( tt_cmap4_set_range( cmap4, mid ) ) { @@ -1474,7 +1466,6 @@ cmap4->cur_gindex = gindex; else { - cmap4->cur_charcode = charcode; tt_cmap4_next( cmap4 ); gindex = cmap4->cur_gindex; } @@ -1489,31 +1480,35 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap4_char_index( TT_CMap cmap, + tt_cmap4_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { + TT_CMap ttcmap = (TT_CMap)cmap; + + if ( char_code >= 0x10000UL ) return 0; - if ( cmap->flags & TT_CMAP_FLAG_UNSORTED ) - return tt_cmap4_char_map_linear( cmap, &char_code, 0 ); + if ( ttcmap->flags & TT_CMAP_FLAG_UNSORTED ) + return tt_cmap4_char_map_linear( ttcmap, &char_code, 0 ); else - return tt_cmap4_char_map_binary( cmap, &char_code, 0 ); + return tt_cmap4_char_map_binary( ttcmap, &char_code, 0 ); } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap4_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap4_char_next( FT_CMap cmap, /* TT_CMap */ FT_UInt32 *pchar_code ) { + TT_CMap ttcmap = (TT_CMap)cmap; FT_UInt gindex; if ( *pchar_code >= 0xFFFFU ) return 0; - if ( cmap->flags & TT_CMAP_FLAG_UNSORTED ) - gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 ); + if ( ttcmap->flags & TT_CMAP_FLAG_UNSORTED ) + gindex = tt_cmap4_char_map_linear( ttcmap, pchar_code, 1 ); else { TT_CMap4 cmap4 = (TT_CMap4)cmap; @@ -1528,7 +1523,7 @@ *pchar_code = cmap4->cur_charcode; } else - gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 ); + gindex = tt_cmap4_char_map_binary( ttcmap, pchar_code, 1 ); } return gindex; @@ -1536,10 +1531,11 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap4_get_info( TT_CMap cmap, + tt_cmap4_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 4; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 4; cmap_info->format = 4; @@ -1640,10 +1636,11 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap6_char_index( TT_CMap cmap, + tt_cmap6_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt result = 0; FT_Byte* p = table + 6; FT_UInt start = TT_NEXT_USHORT( p ); @@ -1661,11 +1658,12 @@ } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap6_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap6_char_next( FT_CMap cmap, /* TT_CMap */ FT_UInt32 *pchar_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt32 result = 0; FT_UInt32 char_code = *pchar_code + 1; FT_UInt gindex = 0; @@ -1706,10 +1704,11 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap6_get_info( TT_CMap cmap, + tt_cmap6_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 4; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 4; cmap_info->format = 6; @@ -1900,10 +1899,11 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap8_char_index( TT_CMap cmap, + tt_cmap8_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt result = 0; FT_Byte* p = table + 8204; FT_UInt32 num_groups = TT_NEXT_ULONG( p ); @@ -1932,15 +1932,16 @@ } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap8_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap8_char_next( FT_CMap cmap, /* TT_CMap */ FT_UInt32 *pchar_code ) { - FT_Face face = cmap->cmap.charmap.face; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Face face = FT_CMAP_FACE( cmap ); FT_UInt32 result = 0; FT_UInt32 char_code; FT_UInt gindex = 0; - FT_Byte* table = cmap->data; + FT_Byte* table = ttcmap->data; FT_Byte* p = table + 8204; FT_UInt32 num_groups = TT_NEXT_ULONG( p ); FT_UInt32 start, end, start_id; @@ -2000,10 +2001,11 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap8_get_info( TT_CMap cmap, + tt_cmap8_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 8; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 8; cmap_info->format = 8; @@ -2104,10 +2106,11 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap10_char_index( TT_CMap cmap, + tt_cmap10_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt result = 0; FT_Byte* p = table + 12; FT_UInt32 start = TT_NEXT_ULONG( p ); @@ -2130,11 +2133,12 @@ } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap10_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap10_char_next( FT_CMap cmap, /* TT_CMap */ FT_UInt32 *pchar_code ) { - FT_Byte* table = cmap->data; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* table = ttcmap->data; FT_UInt32 char_code; FT_UInt gindex = 0; FT_Byte* p = table + 12; @@ -2172,10 +2176,11 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap10_get_info( TT_CMap cmap, + tt_cmap10_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 8; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 8; cmap_info->format = 10; @@ -2253,15 +2258,19 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap12_init( TT_CMap12 cmap, - FT_Byte* table ) + tt_cmap12_init( FT_CMap cmap, /* TT_CMap12 */ + void* table_ ) { - cmap->cmap.data = table; + TT_CMap12 ttcmap = (TT_CMap12)cmap; + FT_Byte* table = (FT_Byte*)table_; + - table += 12; - cmap->num_groups = FT_PEEK_ULONG( table ); + ttcmap->cmap.data = table; - cmap->valid = 0; + table += 12; + ttcmap->num_groups = FT_PEEK_ULONG( table ); + + ttcmap->valid = 0; return FT_Err_Ok; } @@ -2331,23 +2340,21 @@ /* cmap->cur_group should be set up properly by caller */ /* */ static void - tt_cmap12_next( TT_CMap12 cmap ) + tt_cmap12_next( FT_CMap cmap ) /* TT_CMap12 */ { - FT_Face face = cmap->cmap.cmap.charmap.face; - FT_Byte* p; - FT_ULong start, end, start_id, char_code; - FT_ULong n; - FT_UInt gindex; - + TT_CMap12 ttcmap = (TT_CMap12)cmap; + FT_Face face = FT_CMAP_FACE( cmap ); + FT_Byte* p; + FT_ULong start, end, start_id, char_code; + FT_ULong n; + FT_UInt gindex; - if ( cmap->cur_charcode >= 0xFFFFFFFFUL ) - goto Fail; - char_code = cmap->cur_charcode + 1; + char_code = ttcmap->cur_charcode + 1; - for ( n = cmap->cur_group; n < cmap->num_groups; n++ ) + for ( n = ttcmap->cur_group; n < ttcmap->num_groups; n++ ) { - p = cmap->cmap.data + 16 + 12 * n; + p = ttcmap->cmap.data + 16 + 12 * n; start = TT_NEXT_ULONG( p ); end = TT_NEXT_ULONG( p ); start_id = TT_PEEK_ULONG( p ); @@ -2379,16 +2386,16 @@ if ( gindex >= (FT_UInt)face->num_glyphs ) continue; - cmap->cur_charcode = char_code; - cmap->cur_gindex = gindex; - cmap->cur_group = n; + ttcmap->cur_charcode = char_code; + ttcmap->cur_gindex = gindex; + ttcmap->cur_group = n; return; } } Fail: - cmap->valid = 0; + ttcmap->valid = 0; } @@ -2400,7 +2407,7 @@ FT_UInt gindex = 0; FT_Byte* p = cmap->data + 12; FT_UInt32 num_groups = TT_PEEK_ULONG( p ); - FT_UInt32 char_code = *pchar_code; + FT_UInt32 char_code = *pchar_code + next; FT_UInt32 start, end, start_id; FT_UInt32 max, min, mid; @@ -2408,23 +2415,11 @@ if ( !num_groups ) return 0; - /* make compiler happy */ - mid = num_groups; - end = 0xFFFFFFFFUL; - - if ( next ) - { - if ( char_code >= 0xFFFFFFFFUL ) - return 0; - - char_code++; - } - min = 0; max = num_groups; /* binary search */ - while ( min < max ) + do { mid = ( min + max ) >> 1; p = cmap->data + 16 + 12 * mid; @@ -2448,22 +2443,19 @@ break; } } + while ( min < max ); if ( next ) { - FT_Face face = cmap->cmap.charmap.face; + FT_Face face = FT_CMAP_FACE( cmap ); TT_CMap12 cmap12 = (TT_CMap12)cmap; /* if `char_code' is not in any group, then `mid' is */ /* the group nearest to `char_code' */ - if ( char_code > end ) - { - mid++; - if ( mid == num_groups ) - return 0; - } + if ( char_code > end && ++mid == num_groups ) + return 0; cmap12->valid = 1; cmap12->cur_charcode = char_code; @@ -2474,7 +2466,7 @@ if ( !gindex ) { - tt_cmap12_next( cmap12 ); + tt_cmap12_next( FT_CMAP( cmap12 ) ); if ( cmap12->valid ) gindex = cmap12->cur_gindex; @@ -2490,25 +2482,28 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap12_char_index( TT_CMap cmap, + tt_cmap12_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { - return tt_cmap12_char_map_binary( cmap, &char_code, 0 ); + return tt_cmap12_char_map_binary( (TT_CMap)cmap, &char_code, 0 ); } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap12_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap12_char_next( FT_CMap cmap, /* TT_CMap12 */ FT_UInt32 *pchar_code ) { TT_CMap12 cmap12 = (TT_CMap12)cmap; FT_UInt gindex; + if ( *pchar_code >= 0xFFFFFFFFUL ) + return 0; + /* no need to search */ if ( cmap12->valid && cmap12->cur_charcode == *pchar_code ) { - tt_cmap12_next( cmap12 ); + tt_cmap12_next( FT_CMAP( cmap12 ) ); if ( cmap12->valid ) { gindex = cmap12->cur_gindex; @@ -2518,17 +2513,18 @@ gindex = 0; } else - gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 ); + gindex = tt_cmap12_char_map_binary( (TT_CMap)cmap, pchar_code, 1 ); return gindex; } FT_CALLBACK_DEF( FT_Error ) - tt_cmap12_get_info( TT_CMap cmap, + tt_cmap12_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 8; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 8; cmap_info->format = 12; @@ -2606,15 +2602,19 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap13_init( TT_CMap13 cmap, - FT_Byte* table ) + tt_cmap13_init( FT_CMap cmap, /* TT_CMap13 */ + void* table_ ) { - cmap->cmap.data = table; + TT_CMap13 ttcmap = (TT_CMap13)cmap; + FT_Byte* table = (FT_Byte*)table_; + + + ttcmap->cmap.data = table; - table += 12; - cmap->num_groups = FT_PEEK_ULONG( table ); + table += 12; + ttcmap->num_groups = FT_PEEK_ULONG( table ); - cmap->valid = 0; + ttcmap->valid = 0; return FT_Err_Ok; } @@ -2679,23 +2679,21 @@ /* cmap->cur_group should be set up properly by caller */ /* */ static void - tt_cmap13_next( TT_CMap13 cmap ) + tt_cmap13_next( FT_CMap cmap ) /* TT_CMap13 */ { - FT_Face face = cmap->cmap.cmap.charmap.face; - FT_Byte* p; - FT_ULong start, end, glyph_id, char_code; - FT_ULong n; - FT_UInt gindex; - + TT_CMap13 ttcmap = (TT_CMap13)cmap; + FT_Face face = FT_CMAP_FACE( cmap ); + FT_Byte* p; + FT_ULong start, end, glyph_id, char_code; + FT_ULong n; + FT_UInt gindex; - if ( cmap->cur_charcode >= 0xFFFFFFFFUL ) - goto Fail; - char_code = cmap->cur_charcode + 1; + char_code = ttcmap->cur_charcode + 1; - for ( n = cmap->cur_group; n < cmap->num_groups; n++ ) + for ( n = ttcmap->cur_group; n < ttcmap->num_groups; n++ ) { - p = cmap->cmap.data + 16 + 12 * n; + p = ttcmap->cmap.data + 16 + 12 * n; start = TT_NEXT_ULONG( p ); end = TT_NEXT_ULONG( p ); glyph_id = TT_PEEK_ULONG( p ); @@ -2709,17 +2707,16 @@ if ( gindex && gindex < (FT_UInt)face->num_glyphs ) { - cmap->cur_charcode = char_code; - cmap->cur_gindex = gindex; - cmap->cur_group = n; + ttcmap->cur_charcode = char_code; + ttcmap->cur_gindex = gindex; + ttcmap->cur_group = n; return; } } } - Fail: - cmap->valid = 0; + ttcmap->valid = 0; } @@ -2731,7 +2728,7 @@ FT_UInt gindex = 0; FT_Byte* p = cmap->data + 12; FT_UInt32 num_groups = TT_PEEK_ULONG( p ); - FT_UInt32 char_code = *pchar_code; + FT_UInt32 char_code = *pchar_code + next; FT_UInt32 start, end; FT_UInt32 max, min, mid; @@ -2739,23 +2736,11 @@ if ( !num_groups ) return 0; - /* make compiler happy */ - mid = num_groups; - end = 0xFFFFFFFFUL; - - if ( next ) - { - if ( char_code >= 0xFFFFFFFFUL ) - return 0; - - char_code++; - } - min = 0; max = num_groups; /* binary search */ - while ( min < max ) + do { mid = ( min + max ) >> 1; p = cmap->data + 16 + 12 * mid; @@ -2774,6 +2759,7 @@ break; } } + while ( min < max ); if ( next ) { @@ -2784,12 +2770,8 @@ /* if `char_code' is not in any group, then `mid' is */ /* the group nearest to `char_code' */ - if ( char_code > end ) - { - mid++; - if ( mid == num_groups ) - return 0; - } + if ( char_code > end && ++mid == num_groups ) + return 0; cmap13->valid = 1; cmap13->cur_charcode = char_code; @@ -2800,7 +2782,7 @@ if ( !gindex ) { - tt_cmap13_next( cmap13 ); + tt_cmap13_next( FT_CMAP( cmap13 ) ); if ( cmap13->valid ) gindex = cmap13->cur_gindex; @@ -2816,25 +2798,28 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap13_char_index( TT_CMap cmap, + tt_cmap13_char_index( FT_CMap cmap, /* TT_CMap */ FT_UInt32 char_code ) { - return tt_cmap13_char_map_binary( cmap, &char_code, 0 ); + return tt_cmap13_char_map_binary( (TT_CMap)cmap, &char_code, 0 ); } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap13_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap13_char_next( FT_CMap cmap, /* TT_CMap13 */ FT_UInt32 *pchar_code ) { TT_CMap13 cmap13 = (TT_CMap13)cmap; FT_UInt gindex; + if ( *pchar_code >= 0xFFFFFFFFUL ) + return 0; + /* no need to search */ if ( cmap13->valid && cmap13->cur_charcode == *pchar_code ) { - tt_cmap13_next( cmap13 ); + tt_cmap13_next( FT_CMAP( cmap13 ) ); if ( cmap13->valid ) { gindex = cmap13->cur_gindex; @@ -2844,17 +2829,18 @@ gindex = 0; } else - gindex = tt_cmap13_char_map_binary( cmap, pchar_code, 1 ); + gindex = tt_cmap13_char_map_binary( (TT_CMap)cmap, pchar_code, 1 ); return gindex; } FT_CALLBACK_DEF( FT_Error ) - tt_cmap13_get_info( TT_CMap cmap, + tt_cmap13_get_info( FT_CharMap cmap, /* TT_CMap */ TT_CMapInfo *cmap_info ) { - FT_Byte* p = cmap->data + 8; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = ttcmap->data + 8; cmap_info->format = 13; @@ -2969,14 +2955,15 @@ FT_CALLBACK_DEF( void ) - tt_cmap14_done( TT_CMap14 cmap ) + tt_cmap14_done( FT_CMap cmap ) /* TT_CMap14 */ { - FT_Memory memory = cmap->memory; + TT_CMap14 ttcmap = (TT_CMap14)cmap; + FT_Memory memory = ttcmap->memory; - cmap->max_results = 0; - if ( memory && cmap->results ) - FT_FREE( cmap->results ); + ttcmap->max_results = 0; + if ( memory && ttcmap->results ) + FT_FREE( ttcmap->results ); } @@ -3004,15 +2991,19 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap14_init( TT_CMap14 cmap, - FT_Byte* table ) + tt_cmap14_init( FT_CMap cmap, /* TT_CMap14 */ + void* table_ ) { - cmap->cmap.data = table; + TT_CMap14 ttcmap = (TT_CMap14)cmap; + FT_Byte* table = (FT_Byte*)table_; + - table += 6; - cmap->num_selectors = FT_PEEK_ULONG( table ); - cmap->max_results = 0; - cmap->results = NULL; + ttcmap->cmap.data = table; + + table += 6; + ttcmap->num_selectors = FT_PEEK_ULONG( table ); + ttcmap->max_results = 0; + ttcmap->results = NULL; return FT_Err_Ok; } @@ -3142,7 +3133,7 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap14_char_index( TT_CMap cmap, + tt_cmap14_char_index( FT_CMap cmap, FT_UInt32 char_code ) { FT_UNUSED( cmap ); @@ -3153,8 +3144,8 @@ } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap14_char_next( TT_CMap cmap, + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap14_char_next( FT_CMap cmap, FT_UInt32 *pchar_code ) { FT_UNUSED( cmap ); @@ -3166,7 +3157,7 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap14_get_info( TT_CMap cmap, + tt_cmap14_get_info( FT_CharMap cmap, TT_CMapInfo *cmap_info ) { FT_UNUSED( cmap ); @@ -3280,12 +3271,16 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap14_char_var_index( TT_CMap cmap, - TT_CMap ucmap, + tt_cmap14_char_var_index( FT_CMap cmap, /* TT_CMap */ + FT_CMap ucmap, /* TT_CMap */ FT_UInt32 charcode, FT_UInt32 variantSelector ) { - FT_Byte* p = tt_cmap14_find_variant( cmap->data + 6, variantSelector ); + TT_CMap ttcmap = (TT_CMap)cmap; + TT_CMap ttucmap = (TT_CMap)ucmap; + + FT_Byte* p = tt_cmap14_find_variant( ttcmap->data + 6, + variantSelector ); FT_ULong defOff; FT_ULong nondefOff; @@ -3296,16 +3291,16 @@ defOff = TT_NEXT_ULONG( p ); nondefOff = TT_PEEK_ULONG( p ); - if ( defOff != 0 && - tt_cmap14_char_map_def_binary( cmap->data + defOff, charcode ) ) + if ( defOff != 0 && + tt_cmap14_char_map_def_binary( ttcmap->data + defOff, charcode ) ) { /* This is the default variant of this charcode. GID not stored */ /* here; stored in the normal Unicode charmap instead. */ - return ucmap->cmap.clazz->char_index( &ucmap->cmap, charcode ); + return ttucmap->cmap.clazz->char_index( &ttucmap->cmap, charcode ); } if ( nondefOff != 0 ) - return tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff, + return tt_cmap14_char_map_nondef_binary( ttcmap->data + nondefOff, charcode ); return 0; @@ -3313,11 +3308,13 @@ FT_CALLBACK_DEF( FT_Int ) - tt_cmap14_char_var_isdefault( TT_CMap cmap, + tt_cmap14_char_var_isdefault( FT_CMap cmap, /* TT_CMap */ FT_UInt32 charcode, FT_UInt32 variantSelector ) { - FT_Byte* p = tt_cmap14_find_variant( cmap->data + 6, variantSelector ); + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte* p = tt_cmap14_find_variant( ttcmap->data + 6, + variantSelector ); FT_ULong defOff; FT_ULong nondefOff; @@ -3328,13 +3325,13 @@ defOff = TT_NEXT_ULONG( p ); nondefOff = TT_NEXT_ULONG( p ); - if ( defOff != 0 && - tt_cmap14_char_map_def_binary( cmap->data + defOff, charcode ) ) + if ( defOff != 0 && + tt_cmap14_char_map_def_binary( ttcmap->data + defOff, charcode ) ) return 1; - if ( nondefOff != 0 && - tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff, - charcode ) != 0 ) + if ( nondefOff != 0 && + tt_cmap14_char_map_nondef_binary( ttcmap->data + nondefOff, + charcode ) != 0 ) return 0; return -1; @@ -3342,12 +3339,13 @@ FT_CALLBACK_DEF( FT_UInt32* ) - tt_cmap14_variants( TT_CMap cmap, + tt_cmap14_variants( FT_CMap cmap, /* TT_CMap14 */ FT_Memory memory ) { + TT_CMap ttcmap = (TT_CMap)cmap; TT_CMap14 cmap14 = (TT_CMap14)cmap; FT_UInt32 count = cmap14->num_selectors; - FT_Byte* p = cmap->data + 10; + FT_Byte* p = ttcmap->data + 10; FT_UInt32* result; FT_UInt32 i; @@ -3368,13 +3366,14 @@ FT_CALLBACK_DEF( FT_UInt32 * ) - tt_cmap14_char_variants( TT_CMap cmap, + tt_cmap14_char_variants( FT_CMap cmap, /* TT_CMap14 */ FT_Memory memory, FT_UInt32 charCode ) { - TT_CMap14 cmap14 = (TT_CMap14) cmap; + TT_CMap ttcmap = (TT_CMap)cmap; + TT_CMap14 cmap14 = (TT_CMap14)cmap; FT_UInt32 count = cmap14->num_selectors; - FT_Byte* p = cmap->data + 10; + FT_Byte* p = ttcmap->data + 10; FT_UInt32* q; @@ -3388,12 +3387,12 @@ FT_ULong nondefOff = TT_NEXT_ULONG( p ); - if ( ( defOff != 0 && - tt_cmap14_char_map_def_binary( cmap->data + defOff, - charCode ) ) || - ( nondefOff != 0 && - tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff, - charCode ) != 0 ) ) + if ( ( defOff != 0 && + tt_cmap14_char_map_def_binary( ttcmap->data + defOff, + charCode ) ) || + ( nondefOff != 0 && + tt_cmap14_char_map_nondef_binary( ttcmap->data + nondefOff, + charCode ) != 0 ) ) { q[0] = varSel; q++; @@ -3489,15 +3488,16 @@ FT_CALLBACK_DEF( FT_UInt32 * ) - tt_cmap14_variant_chars( TT_CMap cmap, + tt_cmap14_variant_chars( FT_CMap cmap, /* TT_CMap */ FT_Memory memory, FT_UInt32 variantSelector ) { - FT_Byte *p = tt_cmap14_find_variant( cmap->data + 6, - variantSelector ); - FT_Int i; - FT_ULong defOff; - FT_ULong nondefOff; + TT_CMap ttcmap = (TT_CMap)cmap; + FT_Byte *p = tt_cmap14_find_variant( ttcmap->data + 6, + variantSelector ); + FT_Int i; + FT_ULong defOff; + FT_ULong nondefOff; if ( !p ) @@ -3510,16 +3510,16 @@ return NULL; if ( defOff == 0 ) - return tt_cmap14_get_nondef_chars( cmap, cmap->data + nondefOff, + return tt_cmap14_get_nondef_chars( ttcmap, ttcmap->data + nondefOff, memory ); else if ( nondefOff == 0 ) - return tt_cmap14_get_def_chars( cmap, cmap->data + defOff, + return tt_cmap14_get_def_chars( ttcmap, ttcmap->data + defOff, memory ); else { /* Both a default and a non-default glyph set? That's probably not */ /* good font design, but the spec allows for it... */ - TT_CMap14 cmap14 = (TT_CMap14) cmap; + TT_CMap14 cmap14 = (TT_CMap14)cmap; FT_UInt32 numRanges; FT_UInt32 numMappings; FT_UInt32 duni; @@ -3531,18 +3531,18 @@ FT_UInt32 *ret; - p = cmap->data + nondefOff; - dp = cmap->data + defOff; + p = ttcmap->data + nondefOff; + dp = ttcmap->data + defOff; numMappings = (FT_UInt32)TT_NEXT_ULONG( p ); dcnt = tt_cmap14_def_char_count( dp ); numRanges = (FT_UInt32)TT_NEXT_ULONG( dp ); if ( numMappings == 0 ) - return tt_cmap14_get_def_chars( cmap, cmap->data + defOff, + return tt_cmap14_get_def_chars( ttcmap, ttcmap->data + defOff, memory ); if ( dcnt == 0 ) - return tt_cmap14_get_nondef_chars( cmap, cmap->data + nondefOff, + return tt_cmap14_get_nondef_chars( ttcmap, ttcmap->data + nondefOff, memory ); if ( tt_cmap14_ensure( cmap14, ( dcnt + numMappings + 1 ), memory ) ) @@ -3664,9 +3664,10 @@ #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES FT_CALLBACK_DEF( const char * ) - tt_get_glyph_name( TT_Face face, + tt_get_glyph_name( void* face_, /* TT_Face */ FT_UInt idx ) { + TT_Face face = (TT_Face)face_; FT_String* PSname = NULL; @@ -3677,12 +3678,13 @@ FT_CALLBACK_DEF( FT_Error ) - tt_cmap_unicode_init( PS_Unicodes unicodes, - FT_Pointer pointer ) + tt_cmap_unicode_init( FT_CMap cmap, /* PS_Unicodes */ + FT_Pointer pointer ) { - TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; FT_UNUSED( pointer ); @@ -3693,17 +3695,18 @@ return psnames->unicodes_init( memory, unicodes, face->root.num_glyphs, - (PS_GetGlyphNameFunc)&tt_get_glyph_name, + &tt_get_glyph_name, (PS_FreeGlyphNameFunc)NULL, (FT_Pointer)face ); } FT_CALLBACK_DEF( void ) - tt_cmap_unicode_done( PS_Unicodes unicodes ) + tt_cmap_unicode_done( FT_CMap cmap ) /* PS_Unicodes */ { - FT_Face face = FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); + PS_Unicodes unicodes = (PS_Unicodes)cmap; + FT_Face face = FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); FT_FREE( unicodes->maps ); @@ -3712,23 +3715,25 @@ FT_CALLBACK_DEF( FT_UInt ) - tt_cmap_unicode_char_index( PS_Unicodes unicodes, - FT_UInt32 char_code ) + tt_cmap_unicode_char_index( FT_CMap cmap, /* PS_Unicodes */ + FT_UInt32 char_code ) { - TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; return psnames->unicodes_char_index( unicodes, char_code ); } - FT_CALLBACK_DEF( FT_UInt32 ) - tt_cmap_unicode_char_next( PS_Unicodes unicodes, - FT_UInt32 *pchar_code ) + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap_unicode_char_next( FT_CMap cmap, /* PS_Unicodes */ + FT_UInt32 *pchar_code ) { - TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + PS_Unicodes unicodes = (PS_Unicodes)cmap; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; return psnames->unicodes_char_next( unicodes, pchar_code ); @@ -3883,7 +3888,7 @@ tt_get_cmap_info( FT_CharMap charmap, TT_CMapInfo *cmap_info ) { - FT_CMap cmap = (FT_CMap)charmap; + FT_CMap cmap = FT_CMAP( charmap ); TT_CMap_Class clazz = (TT_CMap_Class)cmap->clazz; diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/ttcolr.c b/src/java.desktop/share/native/libfreetype/src/sfnt/ttcolr.c index 5d98dcab8ff..281e7135eea 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttcolr.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttcolr.c @@ -229,7 +229,7 @@ base_glyphs_offset_v1 = FT_NEXT_ULONG( p ); - if ( base_glyphs_offset_v1 + 4 >= table_size ) + if ( base_glyphs_offset_v1 >= table_size - 4 ) goto InvalidTable; p1 = (FT_Byte*)( table + base_glyphs_offset_v1 ); @@ -249,7 +249,7 @@ if ( layer_offset_v1 ) { - if ( layer_offset_v1 + 4 >= table_size ) + if ( layer_offset_v1 >= table_size - 4 ) goto InvalidTable; p1 = (FT_Byte*)( table + layer_offset_v1 ); @@ -699,7 +699,7 @@ item_deltas ) ) return 0; - apaint->u.solid.color.alpha += item_deltas[0]; + apaint->u.solid.color.alpha += (FT_F2Dot14)item_deltas[0]; } #endif @@ -1646,7 +1646,7 @@ return 0; color_stop->stop_offset += F2DOT14_TO_FIXED( item_deltas[0] ); - color_stop->color.alpha += item_deltas[1]; + color_stop->color.alpha += (FT_F2Dot14)item_deltas[1]; } #else FT_UNUSED( var_index_base ); @@ -1914,7 +1914,7 @@ #else /* !TT_CONFIG_OPTION_COLOR_LAYERS */ /* ANSI C doesn't like empty source files */ - typedef int _tt_colr_dummy; + typedef int tt_colr_dummy_; #endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/ttcpal.c b/src/java.desktop/share/native/libfreetype/src/sfnt/ttcpal.c index 4279bc0bd10..46ae08596f3 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttcpal.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttcpal.c @@ -303,7 +303,7 @@ #else /* !TT_CONFIG_OPTION_COLOR_LAYERS */ /* ANSI C doesn't like empty source files */ - typedef int _tt_cpal_dummy; + typedef int tt_cpal_dummy_; #endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/ttload.c b/src/java.desktop/share/native/libfreetype/src/sfnt/ttload.c index 14f625c8243..7b44e9cd2e7 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttload.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttload.c @@ -504,6 +504,13 @@ FT_FRAME_EXIT(); + if ( !valid_entries ) + { + FT_TRACE2(( "tt_face_load_font_dir: no valid tables found\n" )); + error = FT_THROW( Unknown_File_Format ); + goto Exit; + } + FT_TRACE2(( "table directory loaded\n" )); FT_TRACE2(( "\n" )); diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/ttmtx.c b/src/java.desktop/share/native/libfreetype/src/sfnt/ttmtx.c index 5e53e6dd4a3..38ee9ae728a 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttmtx.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttmtx.c @@ -239,7 +239,7 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_Service_MetricsVariations var = - (FT_Service_MetricsVariations)face->var; + (FT_Service_MetricsVariations)face->tt_var; #endif diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.c b/src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.c index 0e17c6f34ae..1dfad4298bd 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.c @@ -156,86 +156,66 @@ static FT_Error - load_format_20( TT_Face face, - FT_Stream stream, - FT_ULong post_len ) + load_format_20( TT_Post_Names names, + FT_Stream stream, + FT_UShort num_glyphs, + FT_ULong post_len ) { FT_Memory memory = stream->memory; FT_Error error; - FT_Int num_glyphs; - FT_UShort num_names; + FT_UShort n; + FT_UShort num_names = 0; FT_UShort* glyph_indices = NULL; - FT_Char** name_strings = NULL; - FT_Byte* strings = NULL; + FT_Byte** name_strings = NULL; + FT_Byte* q; - if ( FT_READ_USHORT( num_glyphs ) ) - goto Exit; - - /* UNDOCUMENTED! The number of glyphs in this table can be smaller */ - /* than the value in the maxp table (cf. cyberbit.ttf). */ - - /* There already exist fonts which have more than 32768 glyph names */ - /* in this table, so the test for this threshold has been dropped. */ - - if ( num_glyphs > face->max_profile.numGlyphs || - (FT_ULong)num_glyphs * 2UL > post_len - 2 ) + if ( (FT_ULong)num_glyphs * 2 > post_len ) { error = FT_THROW( Invalid_File_Format ); goto Exit; } - /* load the indices */ - { - FT_Int n; - - - if ( FT_QNEW_ARRAY( glyph_indices, num_glyphs ) || - FT_FRAME_ENTER( num_glyphs * 2L ) ) - goto Fail; - - for ( n = 0; n < num_glyphs; n++ ) - glyph_indices[n] = FT_GET_USHORT(); + /* load the indices and note their maximum */ + if ( FT_QNEW_ARRAY( glyph_indices, num_glyphs ) || + FT_FRAME_ENTER( num_glyphs * 2 ) ) + goto Fail; - FT_FRAME_EXIT(); - } + q = (FT_Byte*)stream->cursor; - /* compute number of names stored in table */ + for ( n = 0; n < num_glyphs; n++ ) { - FT_Int n; + FT_UShort idx = FT_NEXT_USHORT( q ); - num_names = 0; + if ( idx > num_names ) + num_names = idx; - for ( n = 0; n < num_glyphs; n++ ) - { - FT_Int idx; + glyph_indices[n] = idx; + } + FT_FRAME_EXIT(); - idx = glyph_indices[n]; - if ( idx >= 258 ) - { - idx -= 257; - if ( idx > num_names ) - num_names = (FT_UShort)idx; - } - } - } + /* compute number of names stored in the table */ + num_names = num_names > 257 ? num_names - 257 : 0; /* now load the name strings */ if ( num_names ) { - FT_UShort n; FT_ULong p; + FT_Byte* strings; - post_len -= (FT_ULong)num_glyphs * 2UL + 2; + post_len -= (FT_ULong)num_glyphs * 2; + + if ( FT_QALLOC( name_strings, num_names * sizeof ( FT_Byte* ) + + post_len + 1 ) ) + goto Fail; - if ( FT_QALLOC( strings, post_len + 1 ) || - FT_STREAM_READ( strings, post_len ) || - FT_QNEW_ARRAY( name_strings, num_names ) ) + strings = (FT_Byte*)( name_strings + num_names ); + if ( FT_STREAM_READ( strings, post_len ) ) goto Fail; /* convert from Pascal- to C-strings and set pointers */ @@ -251,7 +231,7 @@ } strings[p] = 0; - name_strings[n] = (FT_Char*)strings + p + 1; + name_strings[n] = strings + p + 1; p += len + 1; } strings[post_len] = 0; @@ -259,40 +239,24 @@ /* deal with missing or insufficient string data */ if ( n < num_names ) { - if ( post_len == 0 ) - { - /* fake empty string */ - if ( FT_QREALLOC( strings, 1, 2 ) ) - goto Fail; - - post_len = 1; - strings[post_len] = 0; - } + FT_TRACE4(( "load_format_20: %hu PostScript names are truncated\n", + num_names - n )); - FT_ERROR(( "load_format_20:" - " all entries in post table are already parsed," - " using NULL names for gid %d - %d\n", - n, num_names - 1 )); for ( ; n < num_names; n++ ) - name_strings[n] = (FT_Char*)strings + post_len; + name_strings[n] = strings + post_len; } } /* all right, set table fields and exit successfully */ - { - TT_Post_20 table = &face->postscript_names.names.format_20; - + names->num_glyphs = num_glyphs; + names->num_names = num_names; + names->glyph_indices = glyph_indices; + names->glyph_names = name_strings; - table->num_glyphs = (FT_UShort)num_glyphs; - table->num_names = (FT_UShort)num_names; - table->glyph_indices = glyph_indices; - table->glyph_names = name_strings; - } return FT_Err_Ok; Fail: FT_FREE( name_strings ); - FT_FREE( strings ); FT_FREE( glyph_indices ); Exit: @@ -301,66 +265,55 @@ static FT_Error - load_format_25( TT_Face face, - FT_Stream stream, - FT_ULong post_len ) + load_format_25( TT_Post_Names names, + FT_Stream stream, + FT_UShort num_glyphs, + FT_ULong post_len ) { FT_Memory memory = stream->memory; FT_Error error; - FT_Int num_glyphs; - FT_Char* offset_table = NULL; - - FT_UNUSED( post_len ); + FT_UShort n; + FT_UShort* glyph_indices = NULL; + FT_Byte* q; - if ( FT_READ_USHORT( num_glyphs ) ) - goto Exit; - - /* check the number of glyphs */ - if ( num_glyphs > face->max_profile.numGlyphs || - num_glyphs > 258 || - num_glyphs < 1 ) + /* check the number of glyphs, including the theoretical limit */ + if ( num_glyphs > post_len || + num_glyphs > 258 + 128 ) { error = FT_THROW( Invalid_File_Format ); goto Exit; } - if ( FT_QNEW_ARRAY( offset_table, num_glyphs ) || - FT_STREAM_READ( offset_table, num_glyphs ) ) + /* load the indices and check their Mac range */ + if ( FT_QNEW_ARRAY( glyph_indices, num_glyphs ) || + FT_FRAME_ENTER( num_glyphs ) ) goto Fail; - /* now check the offset table */ - { - FT_Int n; + q = (FT_Byte*)stream->cursor; + for ( n = 0; n < num_glyphs; n++ ) + { + FT_Int idx = n + FT_NEXT_CHAR( q ); - for ( n = 0; n < num_glyphs; n++ ) - { - FT_Long idx = (FT_Long)n + offset_table[n]; + if ( idx < 0 || idx > 257 ) + idx = 0; - if ( idx < 0 || idx > num_glyphs ) - { - error = FT_THROW( Invalid_File_Format ); - goto Fail; - } - } + glyph_indices[n] = (FT_UShort)idx; } - /* OK, set table fields and exit successfully */ - { - TT_Post_25 table = &face->postscript_names.names.format_25; - + FT_FRAME_EXIT(); - table->num_glyphs = (FT_UShort)num_glyphs; - table->offsets = offset_table; - } + /* OK, set table fields and exit successfully */ + names->num_glyphs = num_glyphs; + names->glyph_indices = glyph_indices; return FT_Err_Ok; Fail: - FT_FREE( offset_table ); + FT_FREE( glyph_indices ); Exit: return error; @@ -370,37 +323,37 @@ static FT_Error load_post_names( TT_Face face ) { - FT_Stream stream; - FT_Error error; - FT_Fixed format; + FT_Error error = FT_Err_Ok; + FT_Stream stream = face->root.stream; + FT_Fixed format = face->postscript.FormatType; FT_ULong post_len; + FT_UShort num_glyphs; - /* get a stream for the face's resource */ - stream = face->root.stream; - /* seek to the beginning of the PS names table */ error = face->goto_table( face, TTAG_post, stream, &post_len ); if ( error ) goto Exit; - format = face->postscript.FormatType; - - /* go to beginning of subtable */ - if ( FT_STREAM_SKIP( 32 ) ) + /* UNDOCUMENTED! The number of glyphs in this table can be smaller */ + /* than the value in the maxp table (cf. cyberbit.ttf). */ + if ( post_len < 34 || + FT_STREAM_SKIP( 32 ) || + FT_READ_USHORT( num_glyphs ) || + num_glyphs > face->max_profile.numGlyphs || + num_glyphs == 0 ) goto Exit; - /* now read postscript table */ - if ( format == 0x00020000L && post_len >= 34 ) - error = load_format_20( face, stream, post_len - 32 ); - else if ( format == 0x00025000L && post_len >= 34 ) - error = load_format_25( face, stream, post_len - 32 ); - else - error = FT_THROW( Invalid_File_Format ); - - face->postscript_names.loaded = 1; + /* now read postscript names data */ + if ( format == 0x00020000L ) + error = load_format_20( &face->postscript_names, stream, + num_glyphs, post_len - 34 ); + else if ( format == 0x00025000L ) + error = load_format_25( &face->postscript_names, stream, + num_glyphs, post_len - 34 ); Exit: + face->postscript_names.loaded = 1; /* even if failed */ return error; } @@ -410,39 +363,20 @@ { FT_Memory memory = face->root.memory; TT_Post_Names names = &face->postscript_names; - FT_Fixed format; - if ( names->loaded ) + if ( names->num_glyphs ) { - format = face->postscript.FormatType; - - if ( format == 0x00020000L ) - { - TT_Post_20 table = &names->names.format_20; - - - FT_FREE( table->glyph_indices ); - table->num_glyphs = 0; - - if ( table->num_names ) - { - table->glyph_names[0]--; - FT_FREE( table->glyph_names[0] ); - - FT_FREE( table->glyph_names ); - table->num_names = 0; - } - } - else if ( format == 0x00025000L ) - { - TT_Post_25 table = &names->names.format_25; - + FT_FREE( names->glyph_indices ); + names->num_glyphs = 0; + } - FT_FREE( table->offsets ); - table->num_glyphs = 0; - } + if ( names->num_names ) + { + FT_FREE( names->glyph_names ); + names->num_names = 0; } + names->loaded = 0; } @@ -478,7 +412,6 @@ FT_String** PSname ) { FT_Error error; - TT_Post_Names names; FT_Fixed format; #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES @@ -498,8 +431,6 @@ return FT_THROW( Unimplemented_Feature ); #endif - names = &face->postscript_names; - /* `.notdef' by default */ *PSname = MAC_NAME( 0 ); @@ -510,9 +441,10 @@ if ( idx < 258 ) /* paranoid checking */ *PSname = MAC_NAME( idx ); } - else if ( format == 0x00020000L ) + else if ( format == 0x00020000L || + format == 0x00025000L ) { - TT_Post_20 table = &names->names.format_20; + TT_Post_Names names = &face->postscript_names; if ( !names->loaded ) @@ -522,43 +454,29 @@ goto End; } - if ( idx < (FT_UInt)table->num_glyphs ) + if ( idx < (FT_UInt)names->num_glyphs ) { - FT_UShort name_index = table->glyph_indices[idx]; + FT_UShort name_index = names->glyph_indices[idx]; if ( name_index < 258 ) *PSname = MAC_NAME( name_index ); - else - *PSname = (FT_String*)table->glyph_names[name_index - 258]; - } - } - else if ( format == 0x00025000L ) - { - TT_Post_25 table = &names->names.format_25; - - - if ( !names->loaded ) - { - error = load_post_names( face ); - if ( error ) - goto End; + else /* only for version 2.0 */ + *PSname = (FT_String*)names->glyph_names[name_index - 258]; } - - if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */ - *PSname = MAC_NAME( (FT_Int)idx + table->offsets[idx] ); } /* nothing to do for format == 0x00030000L */ End: + /* post format errors ignored */ return FT_Err_Ok; } #else /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ /* ANSI C doesn't like empty source files */ - typedef int _tt_post_dummy; + typedef int tt_post_dummy_; #endif /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.c b/src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.c index 3c069551315..03f90a628d6 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.c @@ -1677,7 +1677,7 @@ #else /* !TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ /* ANSI C doesn't like empty source files */ - typedef int _tt_sbit_dummy; + typedef int tt_sbit_dummy_; #endif /* !TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ diff --git a/src/java.desktop/share/native/libfreetype/src/sfnt/woff2tags.c b/src/java.desktop/share/native/libfreetype/src/sfnt/woff2tags.c index 7a0a351f06c..eeedd9906be 100644 --- a/src/java.desktop/share/native/libfreetype/src/sfnt/woff2tags.c +++ b/src/java.desktop/share/native/libfreetype/src/sfnt/woff2tags.c @@ -111,7 +111,7 @@ #else /* !FT_CONFIG_OPTION_USE_BROTLI */ /* ANSI C doesn't like empty source files */ - typedef int _woff2tags_dummy; + typedef int woff2tags_dummy_; #endif /* !FT_CONFIG_OPTION_USE_BROTLI */ diff --git a/src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c b/src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c index d9f20eef131..0918272f870 100644 --- a/src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c +++ b/src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c @@ -1006,10 +1006,11 @@ typedef ptrdiff_t FT_PtrDist; * * For other cases, using binary splits is actually slightly faster. */ -#if defined( __SSE2__ ) || \ - defined( __x86_64__ ) || \ - defined( _M_AMD64 ) || \ - ( defined( _M_IX86_FP ) && _M_IX86_FP >= 2 ) +#if ( defined( __SSE2__ ) || \ + defined( __x86_64__ ) || \ + defined( _M_AMD64 ) || \ + ( defined( _M_IX86_FP ) && _M_IX86_FP >= 2 ) ) && \ + !defined( __VMS ) # define FT_SSE2 1 #else # define FT_SSE2 0 @@ -1427,8 +1428,10 @@ typedef ptrdiff_t FT_PtrDist; static int gray_move_to( const FT_Vector* to, - gray_PWorker worker ) + void* worker_ ) /* gray_PWorker */ { + gray_PWorker worker = (gray_PWorker)worker_; + TPos x, y; @@ -1446,8 +1449,11 @@ typedef ptrdiff_t FT_PtrDist; static int gray_line_to( const FT_Vector* to, - gray_PWorker worker ) + void* worker_ ) /* gray_PWorker */ { + gray_PWorker worker = (gray_PWorker)worker_; + + gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) ); return 0; } @@ -1456,8 +1462,11 @@ typedef ptrdiff_t FT_PtrDist; static int gray_conic_to( const FT_Vector* control, const FT_Vector* to, - gray_PWorker worker ) + void* worker_ ) /* gray_PWorker */ { + gray_PWorker worker = (gray_PWorker)worker_; + + gray_render_conic( RAS_VAR_ control, to ); return 0; } @@ -1467,8 +1476,11 @@ typedef ptrdiff_t FT_PtrDist; gray_cubic_to( const FT_Vector* control1, const FT_Vector* control2, const FT_Vector* to, - gray_PWorker worker ) + void* worker_ ) /* gray_PWorker */ { + gray_PWorker worker = (gray_PWorker)worker_; + + gray_render_cubic( RAS_VAR_ control1, control2, to ); return 0; } @@ -1666,6 +1678,8 @@ typedef ptrdiff_t FT_PtrDist; int n; /* index of contour in outline */ int first; /* index of first point in contour */ + int last; /* index of last point in contour */ + char tag; /* current point's state */ int shift; @@ -1680,18 +1694,17 @@ typedef ptrdiff_t FT_PtrDist; shift = func_interface->shift; delta = func_interface->delta; - first = 0; + last = -1; for ( n = 0; n < outline->n_contours; n++ ) { - int last; /* index of last point in contour */ - - - FT_TRACE5(( "FT_Outline_Decompose: Outline %d\n", n )); + FT_TRACE5(( "FT_Outline_Decompose: Contour %d\n", n )); + first = last + 1; last = outline->contours[n]; - if ( last < 0 ) + if ( last < first ) goto Invalid_Outline; + limit = outline->points + last; v_start = outline->points[first]; @@ -1874,11 +1887,9 @@ typedef ptrdiff_t FT_PtrDist; v_start.x / 64.0, v_start.y / 64.0 )); error = func_interface->line_to( &v_start, user ); - Close: + Close: if ( error ) goto Exit; - - first = last + 1; } FT_TRACE5(( "FT_Outline_Decompose: Done\n", n )); @@ -1923,7 +1934,7 @@ typedef ptrdiff_t FT_PtrDist; if ( continued ) FT_Trace_Enable(); - FT_TRACE7(( "band [%d..%d]: %ld cell%s remaining/\n", + FT_TRACE7(( "band [%d..%d]: %td cell%s remaining/\n", ras.min_ey, ras.max_ey, ras.cell_null - ras.cell_free, @@ -2156,9 +2167,12 @@ typedef ptrdiff_t FT_PtrDist; #else /* !STANDALONE_ */ static int - gray_raster_new( FT_Memory memory, - gray_PRaster* araster ) + gray_raster_new( void* memory_, + FT_Raster* araster_ ) { + FT_Memory memory = (FT_Memory)memory_; + gray_PRaster* araster = (gray_PRaster*)araster_; + FT_Error error; gray_PRaster raster = NULL; diff --git a/src/java.desktop/share/native/libfreetype/src/smooth/ftsmooth.c b/src/java.desktop/share/native/libfreetype/src/smooth/ftsmooth.c index cdbc78c3e53..9b0e8886cb3 100644 --- a/src/java.desktop/share/native/libfreetype/src/smooth/ftsmooth.c +++ b/src/java.desktop/share/native/libfreetype/src/smooth/ftsmooth.c @@ -87,8 +87,10 @@ /* initialize renderer -- init its raster */ static FT_Error - ft_smooth_init( FT_Renderer render ) + ft_smooth_init( FT_Module module ) /* FT_Renderer */ { + FT_Renderer render = (FT_Renderer)module; + FT_Vector* sub = render->root.library->lcd_geometry; @@ -111,8 +113,10 @@ ft_smooth_lcd_spans( int y, int count, const FT_Span* spans, - TOrigin* target ) + void* target_ ) /* TOrigin* */ { + TOrigin* target = (TOrigin*)target_; + unsigned char* dst_line = target->origin - y * target->pitch; unsigned char* dst; unsigned short w; @@ -141,7 +145,7 @@ /* Set up direct rendering to record them on each third byte. */ params.source = outline; params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT; - params.gray_spans = (FT_SpanFunc)ft_smooth_lcd_spans; + params.gray_spans = ft_smooth_lcd_spans; params.user = ⌖ params.clip_box.xMin = 0; @@ -256,8 +260,11 @@ /* initialize renderer -- init its raster */ static FT_Error - ft_smooth_init( FT_Renderer render ) + ft_smooth_init( FT_Module module ) /* FT_Renderer */ { + FT_Renderer render = (FT_Renderer)module; + + /* set up default LCD filtering */ FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT ); @@ -340,8 +347,11 @@ ft_smooth_overlap_spans( int y, int count, const FT_Span* spans, - TOrigin* target ) + void* target_ ) { + TOrigin* target = (TOrigin*)target_; + + unsigned char* dst = target->origin - ( y / SCALE ) * target->pitch; unsigned short x; unsigned int cover, sum; @@ -386,7 +396,7 @@ /* Set up direct rendering to average oversampled spans. */ params.source = outline; params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT; - params.gray_spans = (FT_SpanFunc)ft_smooth_overlap_spans; + params.gray_spans = ft_smooth_overlap_spans; params.user = ⌖ params.clip_box.xMin = 0; diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttdriver.c b/src/java.desktop/share/native/libfreetype/src/truetype/ttdriver.c index 4bea63ef843..d1496fec7fa 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttdriver.c +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttdriver.c @@ -57,7 +57,7 @@ * PROPERTY SERVICE * */ - static FT_Error + FT_CALLBACK_DEF( FT_Error ) tt_property_set( FT_Module module, /* TT_Driver */ const char* property_name, const void* value, @@ -93,17 +93,22 @@ interpreter_version = *iv; } - if ( interpreter_version == TT_INTERPRETER_VERSION_35 -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - || interpreter_version == TT_INTERPRETER_VERSION_38 -#endif + switch ( interpreter_version ) + { + case TT_INTERPRETER_VERSION_35: + driver->interpreter_version = TT_INTERPRETER_VERSION_35; + break; + + case TT_INTERPRETER_VERSION_38: + case TT_INTERPRETER_VERSION_40: #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - || interpreter_version == TT_INTERPRETER_VERSION_40 + driver->interpreter_version = TT_INTERPRETER_VERSION_40; + break; #endif - ) - driver->interpreter_version = interpreter_version; - else + + default: error = FT_ERR( Unimplemented_Feature ); + } return error; } @@ -114,10 +119,10 @@ } - static FT_Error + FT_CALLBACK_DEF( FT_Error ) tt_property_get( FT_Module module, /* TT_Driver */ const char* property_name, - const void* value ) + void* value ) { FT_Error error = FT_Err_Ok; TT_Driver driver = (TT_Driver)module; @@ -144,8 +149,8 @@ FT_DEFINE_SERVICE_PROPERTIESREC( tt_service_properties, - (FT_Properties_SetFunc)tt_property_set, /* set_property */ - (FT_Properties_GetFunc)tt_property_get /* get_property */ + tt_property_set, /* FT_Properties_SetFunc set_property */ + tt_property_get /* FT_Properties_GetFunc get_property */ ) @@ -198,35 +203,35 @@ * * They can be implemented by format-specific interfaces. */ - static FT_Error - tt_get_kerning( FT_Face ttface, /* TT_Face */ + FT_CALLBACK_DEF( FT_Error ) + tt_get_kerning( FT_Face face, /* TT_Face */ FT_UInt left_glyph, FT_UInt right_glyph, FT_Vector* kerning ) { - TT_Face face = (TT_Face)ttface; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + TT_Face ttface = (TT_Face)face; + SFNT_Service sfnt = (SFNT_Service)ttface->sfnt; kerning->x = 0; kerning->y = 0; if ( sfnt ) - kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph ); + kerning->x = sfnt->get_kerning( ttface, left_glyph, right_glyph ); return 0; } - static FT_Error - tt_get_advances( FT_Face ttface, + FT_CALLBACK_DEF( FT_Error ) + tt_get_advances( FT_Face face, /* TT_Face */ FT_UInt start, FT_UInt count, FT_Int32 flags, FT_Fixed *advances ) { FT_UInt nn; - TT_Face face = (TT_Face)ttface; + TT_Face ttface = (TT_Face)face; /* XXX: TODO: check for sbits */ @@ -235,8 +240,8 @@ { #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT /* no fast retrieval for blended MM fonts without VVAR table */ - if ( ( FT_IS_NAMED_INSTANCE( ttface ) || FT_IS_VARIATION( ttface ) ) && - !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ) + if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) && + !( ttface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ) return FT_THROW( Unimplemented_Feature ); #endif @@ -247,7 +252,7 @@ /* since we don't need `tsb', we use zero for `yMax' parameter */ - TT_Get_VMetrics( face, start + nn, 0, &tsb, &ah ); + TT_Get_VMetrics( ttface, start + nn, 0, &tsb, &ah ); advances[nn] = ah; } } @@ -255,8 +260,8 @@ { #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT /* no fast retrieval for blended MM fonts without HVAR table */ - if ( ( FT_IS_NAMED_INSTANCE( ttface ) || FT_IS_VARIATION( ttface ) ) && - !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ) + if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) && + !( ttface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ) return FT_THROW( Unimplemented_Feature ); #endif @@ -266,7 +271,7 @@ FT_UShort aw; - TT_Get_HMetrics( face, start + nn, &lsb, &aw ); + TT_Get_HMetrics( ttface, start + nn, &lsb, &aw ); advances[nn] = aw; } } @@ -290,7 +295,7 @@ #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - static FT_Error + FT_CALLBACK_DEF( FT_Error ) tt_size_select( FT_Size size, FT_ULong strike_index ) { @@ -306,7 +311,7 @@ /* use the scaled metrics, even when tt_size_reset fails */ FT_Select_Metrics( size->face, strike_index ); - tt_size_reset( ttsize, 0 ); /* ignore return value */ + tt_size_reset( ttsize ); /* ignore return value */ } else { @@ -327,7 +332,7 @@ #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - static FT_Error + FT_CALLBACK_DEF( FT_Error ) tt_size_request( FT_Size size, FT_Size_Request req ) { @@ -367,7 +372,7 @@ if ( FT_IS_SCALABLE( size->face ) ) { - error = tt_size_reset( ttsize, 0 ); + error = tt_size_reset( ttsize ); #ifdef TT_USE_BYTECODE_INTERPRETER /* for the `MPS' bytecode instruction we need the point size */ @@ -426,15 +431,15 @@ * @Return: * FreeType error code. 0 means success. */ - static FT_Error - tt_glyph_load( FT_GlyphSlot ttslot, /* TT_GlyphSlot */ - FT_Size ttsize, /* TT_Size */ + FT_CALLBACK_DEF( FT_Error ) + tt_glyph_load( FT_GlyphSlot slot, /* TT_GlyphSlot */ + FT_Size size, /* TT_Size */ FT_UInt glyph_index, FT_Int32 load_flags ) { - TT_GlyphSlot slot = (TT_GlyphSlot)ttslot; - TT_Size size = (TT_Size)ttsize; - FT_Face face = ttslot->face; + TT_GlyphSlot ttslot = (TT_GlyphSlot)slot; + TT_Size ttsize = (TT_Size)size; + FT_Face face = ttslot->face; FT_Error error; @@ -476,12 +481,12 @@ } /* use hinted metrics only if we load a glyph with hinting */ - size->metrics = ( load_flags & FT_LOAD_NO_HINTING ) - ? &ttsize->metrics - : &size->hinted_metrics; + ttsize->metrics = ( load_flags & FT_LOAD_NO_HINTING ) + ? &size->metrics + : &ttsize->hinted_metrics; /* now fill in the glyph slot with outline/bitmap/layered */ - error = TT_Load_Glyph( size, slot, glyph_index, load_flags ); + error = TT_Load_Glyph( ttsize, ttslot, glyph_index, load_flags ); /* force drop-out mode to 2 - irrelevant now */ /* slot->outline.dropout_mode = 2; */ @@ -507,49 +512,47 @@ FT_DEFINE_SERVICE_MULTIMASTERSREC( tt_service_gx_multi_masters, - (FT_Get_MM_Func) NULL, /* get_mm */ - (FT_Set_MM_Design_Func) NULL, /* set_mm_design */ - (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */ - (FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */ - (FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */ - (FT_Set_Var_Design_Func)TT_Set_Var_Design, /* set_var_design */ - (FT_Get_Var_Design_Func)TT_Get_Var_Design, /* get_var_design */ - (FT_Set_Instance_Func) TT_Set_Named_Instance, /* set_instance */ - (FT_Set_MM_WeightVector_Func) - NULL, /* set_mm_weightvector */ - (FT_Get_MM_WeightVector_Func) - NULL, /* get_mm_weightvector */ - (FT_Var_Load_Delta_Set_Idx_Map_Func) - tt_var_load_delta_set_index_mapping, - /* load_delta_set_idx_map */ - (FT_Var_Load_Item_Var_Store_Func) - tt_var_load_item_variation_store, - /* load_item_variation_store */ - (FT_Var_Get_Item_Delta_Func) - tt_var_get_item_delta, /* get_item_delta */ - (FT_Var_Done_Item_Var_Store_Func) - tt_var_done_item_variation_store, - /* done_item_variation_store */ - (FT_Var_Done_Delta_Set_Idx_Map_Func) - tt_var_done_delta_set_index_map, - /* done_delta_set_index_map */ - (FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */ - (FT_Done_Blend_Func) tt_done_blend /* done_blend */ + NULL, /* FT_Get_MM_Func get_mm */ + NULL, /* FT_Set_MM_Design_Func set_mm_design */ + TT_Set_MM_Blend, /* FT_Set_MM_Blend_Func set_mm_blend */ + TT_Get_MM_Blend, /* FT_Get_MM_Blend_Func get_mm_blend */ + TT_Get_MM_Var, /* FT_Get_MM_Var_Func get_mm_var */ + TT_Set_Var_Design, /* FT_Set_Var_Design_Func set_var_design */ + TT_Get_Var_Design, /* FT_Get_Var_Design_Func get_var_design */ + TT_Set_Named_Instance, /* FT_Set_Named_Instance_Func set_named_instance */ + TT_Get_Default_Named_Instance, + /* FT_Get_Default_Named_Instance_Func get_default_named_instance */ + NULL, /* FT_Set_MM_WeightVector_Func set_mm_weightvector */ + NULL, /* FT_Get_MM_WeightVector_Func get_mm_weightvector */ + + tt_construct_ps_name, /* FT_Construct_PS_Name_Func construct_ps_name */ + tt_var_load_delta_set_index_mapping, + /* FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map */ + tt_var_load_item_variation_store, + /* FT_Var_Load_Item_Var_Store_Func load_item_variation_store */ + tt_var_get_item_delta, /* FT_Var_Get_Item_Delta_Func get_item_delta */ + tt_var_done_item_variation_store, + /* FT_Var_Done_Item_Var_Store_Func done_item_variation_store */ + tt_var_done_delta_set_index_map, + /* FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_index_map */ + tt_get_var_blend, /* FT_Get_Var_Blend_Func get_var_blend */ + tt_done_blend /* FT_Done_Blend_Func done_blend */ ) FT_DEFINE_SERVICE_METRICSVARIATIONSREC( tt_service_metrics_variations, - (FT_HAdvance_Adjust_Func)tt_hadvance_adjust, /* hadvance_adjust */ - (FT_LSB_Adjust_Func) NULL, /* lsb_adjust */ - (FT_RSB_Adjust_Func) NULL, /* rsb_adjust */ + tt_hadvance_adjust, /* FT_HAdvance_Adjust_Func hadvance_adjust */ + NULL, /* FT_LSB_Adjust_Func lsb_adjust */ + NULL, /* FT_RSB_Adjust_Func rsb_adjust */ - (FT_VAdvance_Adjust_Func)tt_vadvance_adjust, /* vadvance_adjust */ - (FT_TSB_Adjust_Func) NULL, /* tsb_adjust */ - (FT_BSB_Adjust_Func) NULL, /* bsb_adjust */ - (FT_VOrg_Adjust_Func) NULL, /* vorg_adjust */ + tt_vadvance_adjust, /* FT_VAdvance_Adjust_Func vadvance_adjust */ + NULL, /* FT_TSB_Adjust_Func tsb_adjust */ + NULL, /* FT_BSB_Adjust_Func bsb_adjust */ + NULL, /* FT_VOrg_Adjust_Func vorg_adjust */ - (FT_Metrics_Adjust_Func) tt_apply_mvar /* metrics_adjust */ + tt_apply_mvar, /* FT_Metrics_Adjust_Func metrics_adjust */ + tt_size_reset_height /* FT_Size_Reset_Func size_reset */ ) #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttgload.c b/src/java.desktop/share/native/libfreetype/src/truetype/ttgload.c index d33bdad6427..dc427e8a116 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttgload.c +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttgload.c @@ -35,7 +35,6 @@ #endif #include "tterrors.h" -#include "ttsubpix.h" /************************************************************************** @@ -152,9 +151,6 @@ FT_UInt glyph_index ) { TT_Face face = loader->face; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face ); -#endif FT_Error error; FT_Stream stream = loader->stream; @@ -183,20 +179,6 @@ loader->top_bearing = top_bearing; loader->vadvance = advance_height; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 && - loader->exec ) - { - loader->exec->sph_tweak_flags = 0; - - /* This may not be the right place for this, but it works... */ - /* Note that we have to unconditionally load the tweaks since */ - /* it is possible that glyphs individually switch ClearType's */ - /* backward compatibility mode on and off. */ - sph_set_tweaks( loader, glyph_index ); - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - #ifdef FT_CONFIG_OPTION_INCREMENTAL /* With the incremental interface, these values are set by */ /* a call to `tt_get_metrics_incremental'. */ @@ -362,17 +344,16 @@ FT_Byte* p = load->cursor; FT_Byte* limit = load->limit; FT_GlyphLoader gloader = load->gloader; + FT_Outline* outline = &gloader->current.outline; FT_Int n_contours = load->n_contours; - FT_Outline* outline; - FT_UShort n_ins; FT_Int n_points; + FT_UShort n_ins; FT_Byte *flag, *flag_limit; FT_Byte c, count; FT_Vector *vec, *vec_limit; FT_Pos x, y; - FT_Short *cont, *cont_limit, prev_cont; - FT_Int xy_size = 0; + FT_Short *cont, *cont_limit, last; /* check that we can add the contours to the glyph */ @@ -380,41 +361,27 @@ if ( error ) goto Fail; - /* reading the contours' endpoints & number of points */ - cont = gloader->current.outline.contours; - cont_limit = cont + n_contours; - /* check space for contours array + instructions count */ - if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit ) + if ( n_contours >= 0xFFF || p + 2 * n_contours + 2 > limit ) goto Invalid_Outline; - prev_cont = FT_NEXT_SHORT( p ); - - if ( n_contours > 0 ) - cont[0] = prev_cont; - - if ( prev_cont < 0 ) - goto Invalid_Outline; + /* reading the contours' endpoints & number of points */ + cont = outline->contours; + cont_limit = cont + n_contours; - for ( cont++; cont < cont_limit; cont++ ) + last = -1; + for ( ; cont < cont_limit; cont++ ) { - cont[0] = FT_NEXT_SHORT( p ); - if ( cont[0] <= prev_cont ) - { - /* unordered contours: this is invalid */ - goto Invalid_Outline; - } - prev_cont = cont[0]; - } + *cont = FT_NEXT_SHORT( p ); - n_points = 0; - if ( n_contours > 0 ) - { - n_points = cont[-1] + 1; - if ( n_points < 0 ) + if ( *cont <= last ) goto Invalid_Outline; + + last = *cont; } + n_points = last + 1; + FT_TRACE5(( " # of points: %d\n", n_points )); /* note that we will add four phantom points later */ @@ -422,59 +389,48 @@ if ( error ) goto Fail; - /* reading the bytecode instructions */ - load->glyph->control_len = 0; - load->glyph->control_data = NULL; - - if ( p + 2 > limit ) - goto Invalid_Outline; - + /* space checked above */ n_ins = FT_NEXT_USHORT( p ); FT_TRACE5(( " Instructions size: %u\n", n_ins )); + /* check instructions size */ + if ( p + n_ins > limit ) + { + FT_TRACE1(( "TT_Load_Simple_Glyph: excessive instruction count\n" )); + error = FT_THROW( Too_Many_Hints ); + goto Fail; + } + #ifdef TT_USE_BYTECODE_INTERPRETER if ( IS_HINTED( load->load_flags ) ) { - FT_ULong tmp; + TT_ExecContext exec = load->exec; + FT_Memory memory = exec->memory; - /* check instructions size */ - if ( ( limit - p ) < n_ins ) - { - FT_TRACE1(( "TT_Load_Simple_Glyph: instruction count mismatch\n" )); - error = FT_THROW( Too_Many_Hints ); - goto Fail; - } + if ( exec->glyphSize ) + FT_FREE( exec->glyphIns ); + exec->glyphSize = 0; /* we don't trust `maxSizeOfInstructions' in the `maxp' table */ - /* and thus update the bytecode array size by ourselves */ - - tmp = load->exec->glyphSize; - error = Update_Max( load->exec->memory, - &tmp, - sizeof ( FT_Byte ), - (void*)&load->exec->glyphIns, - n_ins ); - - load->exec->glyphSize = (FT_UInt)tmp; - if ( error ) - return error; + /* and thus allocate the bytecode array size by ourselves */ + if ( n_ins ) + { + if ( FT_QNEW_ARRAY( exec->glyphIns, n_ins ) ) + return error; - load->glyph->control_len = n_ins; - load->glyph->control_data = load->exec->glyphIns; + FT_MEM_COPY( exec->glyphIns, p, (FT_Long)n_ins ); - if ( n_ins ) - FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins ); + exec->glyphSize = n_ins; + } } #endif /* TT_USE_BYTECODE_INTERPRETER */ p += n_ins; - outline = &gloader->current.outline; - /* reading the point tags */ flag = (FT_Byte*)outline->tags; flag_limit = flag + n_points; @@ -512,9 +468,6 @@ flag = (FT_Byte*)outline->tags; x = 0; - if ( p + xy_size > limit ) - goto Invalid_Outline; - for ( ; vec < vec_limit; vec++, flag++ ) { FT_Pos delta = 0; @@ -544,7 +497,7 @@ /* reading the Y coordinates */ - vec = gloader->current.outline.points; + vec = outline->points; vec_limit = vec + n_points; flag = (FT_Byte*)outline->tags; y = 0; @@ -827,8 +780,7 @@ TT_Hint_Glyph( TT_Loader loader, FT_Bool is_composite ) { -#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \ - defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL TT_Face face = loader->face; TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face ); #endif @@ -836,35 +788,34 @@ TT_GlyphZone zone = &loader->zone; #ifdef TT_USE_BYTECODE_INTERPRETER - FT_Long n_ins; + TT_ExecContext exec = loader->exec; + FT_Long n_ins = exec->glyphSize; #else FT_UNUSED( is_composite ); #endif #ifdef TT_USE_BYTECODE_INTERPRETER - n_ins = loader->glyph->control_len; - /* save original point positions in `org' array */ if ( n_ins > 0 ) FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points ); /* Reset graphics state. */ - loader->exec->GS = loader->size->GS; + exec->GS = loader->size->GS; /* XXX: UNDOCUMENTED! Hinting instructions of a composite glyph */ /* completely refer to the (already) hinted subglyphs. */ if ( is_composite ) { - loader->exec->metrics.x_scale = 1 << 16; - loader->exec->metrics.y_scale = 1 << 16; + exec->metrics.x_scale = 1 << 16; + exec->metrics.y_scale = 1 << 16; FT_ARRAY_COPY( zone->orus, zone->cur, zone->n_points ); } else { - loader->exec->metrics.x_scale = loader->size->metrics->x_scale; - loader->exec->metrics.y_scale = loader->size->metrics->y_scale; + exec->metrics.x_scale = loader->size->metrics->x_scale; + exec->metrics.y_scale = loader->size->metrics->y_scale; } #endif @@ -884,53 +835,37 @@ { FT_Error error; - FT_GlyphLoader gloader = loader->gloader; - FT_Outline current_outline = gloader->current.outline; - - TT_Set_CodeRange( loader->exec, tt_coderange_glyph, - loader->exec->glyphIns, n_ins ); + TT_Set_CodeRange( exec, tt_coderange_glyph, exec->glyphIns, n_ins ); - loader->exec->is_composite = is_composite; - loader->exec->pts = *zone; + exec->is_composite = is_composite; + exec->pts = *zone; - error = TT_Run_Context( loader->exec ); - if ( error && loader->exec->pedantic_hinting ) + error = TT_Run_Context( exec ); + if ( error && exec->pedantic_hinting ) return error; /* store drop-out mode in bits 5-7; set bit 2 also as a marker */ - current_outline.tags[0] |= - ( loader->exec->GS.scan_type << 5 ) | FT_CURVE_TAG_HAS_SCANMODE; + loader->gloader->current.outline.tags[0] |= + ( exec->GS.scan_type << 5 ) | FT_CURVE_TAG_HAS_SCANMODE; } #endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* Save possibly modified glyph phantom points unless in v40 backward */ /* compatibility mode, where no movement on the x axis means no reason */ /* to change bearings or advance widths. */ - if ( !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && - loader->exec->backward_compatibility ) ) - { -#endif - loader->pp1 = zone->cur[zone->n_points - 4]; - loader->pp2 = zone->cur[zone->n_points - 3]; - loader->pp3 = zone->cur[zone->n_points - 2]; - loader->pp4 = zone->cur[zone->n_points - 1]; + #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - } + if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && + exec->backward_compatibility ) + return FT_Err_Ok; #endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) - { - if ( loader->exec->sph_tweak_flags & SPH_TWEAK_DEEMBOLDEN ) - FT_Outline_EmboldenXY( &loader->gloader->current.outline, -24, 0 ); - - else if ( loader->exec->sph_tweak_flags & SPH_TWEAK_EMBOLDEN ) - FT_Outline_EmboldenXY( &loader->gloader->current.outline, 24, 0 ); - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + loader->pp1 = zone->cur[zone->n_points - 4]; + loader->pp2 = zone->cur[zone->n_points - 3]; + loader->pp3 = zone->cur[zone->n_points - 2]; + loader->pp4 = zone->cur[zone->n_points - 1]; return FT_Err_Ok; } @@ -949,10 +884,10 @@ static FT_Error TT_Process_Simple_Glyph( TT_Loader loader ) { - FT_GlyphLoader gloader = loader->gloader; - FT_Error error = FT_Err_Ok; - FT_Outline* outline; - FT_Int n_points; + FT_Error error = FT_Err_Ok; + FT_GlyphLoader gloader = loader->gloader; + FT_Outline* outline = &gloader->current.outline; + FT_Int n_points = outline->n_points; #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_Memory memory = loader->face->root.memory; @@ -960,11 +895,7 @@ #endif - outline = &gloader->current.outline; - n_points = outline->n_points; - /* set phantom points */ - outline->points[n_points ] = loader->pp1; outline->points[n_points + 1] = loader->pp2; outline->points[n_points + 2] = loader->pp3; @@ -976,7 +907,7 @@ if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) ) { - if ( FT_NEW_ARRAY( unrounded, n_points ) ) + if ( FT_QNEW_ARRAY( unrounded, n_points ) ) goto Exit; /* Deltas apply to the unscaled data. */ @@ -998,16 +929,6 @@ } { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - TT_Face face = loader->face; - TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face ); - - FT_String* family = face->root.family_name; - FT_UInt ppem = loader->size->metrics->x_ppem; - FT_String* style = face->root.style_name; - FT_UInt x_scale_factor = 1000; -#endif - FT_Vector* vec = outline->points; FT_Vector* limit = outline->points + n_points; @@ -1017,52 +938,6 @@ FT_Bool do_scale = FALSE; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) - { - /* scale, but only if enabled and only if TT hinting is being used */ - if ( IS_HINTED( loader->load_flags ) ) - x_scale_factor = sph_test_tweak_x_scaling( face, - family, - ppem, - style, - loader->glyph_index ); - /* scale the glyph */ - if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 || - x_scale_factor != 1000 ) - { - x_scale = FT_MulDiv( loader->size->metrics->x_scale, - (FT_Long)x_scale_factor, 1000 ); - y_scale = loader->size->metrics->y_scale; - - /* compensate for any scaling by de/emboldening; */ - /* the amount was determined via experimentation */ - if ( x_scale_factor != 1000 && ppem > 11 ) - { -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - FT_Vector* orig_points = outline->points; - - - if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) ) - outline->points = unrounded; -#endif - FT_Outline_EmboldenXY( outline, - FT_MulFix( 1280 * ppem, - 1000 - x_scale_factor ), - 0 ); -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) ) - outline->points = orig_points; -#endif - } - do_scale = TRUE; - } - } - else - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - { /* scale the glyph */ if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) @@ -1331,12 +1206,12 @@ FT_UInt start_contour ) { FT_Error error; - FT_Outline* outline; + FT_Outline* outline = &loader->gloader->base.outline; + FT_Stream stream = loader->stream; + FT_UShort n_ins; FT_UInt i; - outline = &loader->gloader->base.outline; - /* make room for phantom points */ error = FT_GLYPHLOADER_CHECK_POINTS( loader->gloader, outline->n_points + 4, @@ -1352,10 +1227,13 @@ #ifdef TT_USE_BYTECODE_INTERPRETER { - FT_Stream stream = loader->stream; - FT_UShort n_ins, max_ins; - FT_ULong tmp; + TT_ExecContext exec = loader->exec; + FT_Memory memory = exec->memory; + + if ( exec->glyphSize ) + FT_FREE( exec->glyphIns ); + exec->glyphSize = 0; /* TT_Load_Composite_Glyph only gives us the offset of instructions */ /* so we read them here */ @@ -1365,39 +1243,24 @@ FT_TRACE5(( " Instructions size = %hu\n", n_ins )); - /* check it */ - max_ins = loader->face->max_profile.maxSizeOfInstructions; - if ( n_ins > max_ins ) - { - /* don't trust `maxSizeOfInstructions'; */ - /* only do a rough safety check */ - if ( n_ins > loader->byte_len ) - { - FT_TRACE1(( "TT_Process_Composite_Glyph:" - " too many instructions (%hu) for glyph with length %u\n", - n_ins, loader->byte_len )); - return FT_THROW( Too_Many_Hints ); - } - - tmp = loader->exec->glyphSize; - error = Update_Max( loader->exec->memory, - &tmp, - sizeof ( FT_Byte ), - (void*)&loader->exec->glyphIns, - n_ins ); + if ( !n_ins ) + return FT_Err_Ok; - loader->exec->glyphSize = (FT_UShort)tmp; - if ( error ) - return error; + /* don't trust `maxSizeOfInstructions'; */ + /* only do a rough safety check */ + if ( n_ins > loader->byte_len ) + { + FT_TRACE1(( "TT_Process_Composite_Glyph:" + " too many instructions (%hu) for glyph with length %u\n", + n_ins, loader->byte_len )); + return FT_THROW( Too_Many_Hints ); } - else if ( n_ins == 0 ) - return FT_Err_Ok; - if ( FT_STREAM_READ( loader->exec->glyphIns, n_ins ) ) + if ( FT_QNEW_ARRAY( exec->glyphIns, n_ins ) || + FT_STREAM_READ( exec->glyphIns, n_ins ) ) return error; - loader->glyph->control_data = loader->exec->glyphIns; - loader->glyph->control_len = n_ins; + exec->glyphSize = n_ins; } #endif @@ -1501,45 +1364,31 @@ static void tt_loader_set_pp( TT_Loader loader ) { - FT_Bool subpixel_hinting = 0; - FT_Bool grayscale = 0; - FT_Bool use_aw_2 = 0; - -#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING - TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( loader->face ); -#endif - - -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) - { - subpixel_hinting = loader->exec ? loader->exec->subpixel_hinting - : 0; - grayscale = loader->exec ? loader->exec->grayscale - : 0; - } -#endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 ) - { - subpixel_hinting = loader->exec ? loader->exec->subpixel_hinting_lean - : 0; - grayscale = loader->exec ? loader->exec->grayscale_cleartype - : 0; - } -#endif - - use_aw_2 = FT_BOOL( subpixel_hinting && grayscale ); - loader->pp1.x = loader->bbox.xMin - loader->left_bearing; loader->pp1.y = 0; loader->pp2.x = loader->pp1.x + loader->advance; loader->pp2.y = 0; - loader->pp3.x = use_aw_2 ? loader->advance / 2 : 0; + loader->pp3.x = 0; loader->pp3.y = loader->bbox.yMax + loader->top_bearing; - loader->pp4.x = use_aw_2 ? loader->advance / 2 : 0; + loader->pp4.x = 0; loader->pp4.y = loader->pp3.y - loader->vadvance; + +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL + { + TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( loader->face ); + + + if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && + loader->exec && + loader->exec->subpixel_hinting_lean && + loader->exec->grayscale_cleartype ) + { + loader->pp3.x = loader->advance / 2; + loader->pp4.x = loader->advance / 2; + } + } +#endif } @@ -1662,8 +1511,14 @@ else #endif /* FT_CONFIG_OPTION_INCREMENTAL */ + { + FT_ULong len; + - offset = tt_face_get_location( face, glyph_index, &loader->byte_len ); + offset = tt_face_get_location( FT_FACE( face ), glyph_index, &len ); + + loader->byte_len = (FT_UInt)len; + } if ( loader->byte_len > 0 ) { @@ -1889,10 +1744,7 @@ short i, limit; FT_SubGlyph subglyph; - FT_Outline outline; - FT_Vector* points = NULL; - char* tags = NULL; - short* contours = NULL; + FT_Outline outline = { 0, 0, NULL, NULL, NULL, 0 }; FT_Vector* unrounded = NULL; @@ -1900,18 +1752,14 @@ /* construct an outline structure for */ /* communication with `TT_Vary_Apply_Glyph_Deltas' */ - outline.n_contours = outline.n_points = limit; - - outline.points = NULL; - outline.tags = NULL; - outline.contours = NULL; - - if ( FT_NEW_ARRAY( points, limit + 4 ) || - FT_NEW_ARRAY( tags, limit + 4 ) || - FT_NEW_ARRAY( contours, limit + 4 ) || - FT_NEW_ARRAY( unrounded, limit + 4 ) ) + if ( FT_QNEW_ARRAY( outline.points, limit + 4 ) || + FT_QNEW_ARRAY( outline.tags, limit ) || + FT_QNEW_ARRAY( outline.contours, limit ) || + FT_QNEW_ARRAY( unrounded, limit + 4 ) ) goto Exit1; + outline.n_contours = outline.n_points = limit; + subglyph = gloader->current.subglyphs; for ( i = 0; i < limit; i++, subglyph++ ) @@ -1919,20 +1767,16 @@ /* applying deltas for anchor points doesn't make sense, */ /* but we don't have to specially check this since */ /* unused delta values are zero anyways */ - points[i].x = subglyph->arg1; - points[i].y = subglyph->arg2; - tags[i] = 1; - contours[i] = i; + outline.points[i].x = subglyph->arg1; + outline.points[i].y = subglyph->arg2; + outline.tags[i] = ON_CURVE_POINT; + outline.contours[i] = i; } - points[i++] = loader->pp1; - points[i++] = loader->pp2; - points[i++] = loader->pp3; - points[i ] = loader->pp4; - - outline.points = points; - outline.tags = tags; - outline.contours = contours; + outline.points[i++] = loader->pp1; + outline.points[i++] = loader->pp2; + outline.points[i++] = loader->pp3; + outline.points[i ] = loader->pp4; /* this call provides additional offsets */ /* for each component's translation */ @@ -1947,8 +1791,8 @@ { if ( subglyph->flags & ARGS_ARE_XY_VALUES ) { - subglyph->arg1 = (FT_Int16)points[i].x; - subglyph->arg2 = (FT_Int16)points[i].y; + subglyph->arg1 = (FT_Int16)outline.points[i].x; + subglyph->arg2 = (FT_Int16)outline.points[i].y; } } @@ -2332,8 +2176,7 @@ #ifdef TT_USE_BYTECODE_INTERPRETER FT_Error error; FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); -#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \ - defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( glyph->face ); #endif #endif @@ -2353,20 +2196,6 @@ FT_Bool grayscale_cleartype; #endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - FT_Bool subpixel_hinting = FALSE; - -#if 0 - /* not used yet */ - FT_Bool compatible_widths; - FT_Bool symmetrical_smoothing; - FT_Bool bgr; - FT_Bool vertical_lcd; - FT_Bool subpixel_positioned; - FT_Bool gray_cleartype; -#endif -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - FT_Bool reexecute = FALSE; @@ -2386,6 +2215,9 @@ if ( !exec ) return FT_THROW( Could_Not_Find_Context ); + grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != + FT_RENDER_MODE_MONO ); + #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 ) { @@ -2402,6 +2234,7 @@ FT_BOOL( subpixel_hinting_lean && ( load_flags & FT_LOAD_TARGET_LCD_V ) ); + grayscale = FT_BOOL( grayscale && !subpixel_hinting_lean ); } else { @@ -2411,111 +2244,11 @@ } #endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) - { - subpixel_hinting = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) != - FT_RENDER_MODE_MONO ) && - SPH_OPTION_SET_SUBPIXEL ); - - if ( subpixel_hinting ) - grayscale = FALSE; - else if ( SPH_OPTION_SET_GRAYSCALE ) - { - grayscale = TRUE; - subpixel_hinting = FALSE; - } - else - grayscale = FALSE; - - if ( FT_IS_TRICKY( glyph->face ) ) - subpixel_hinting = FALSE; - - exec->ignore_x_mode = subpixel_hinting || grayscale; - exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; - if ( exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 ) - exec->rasterizer_version = TT_INTERPRETER_VERSION_35; - -#if 1 - exec->compatible_widths = SPH_OPTION_SET_COMPATIBLE_WIDTHS; - exec->symmetrical_smoothing = TRUE; - exec->bgr = FALSE; - exec->vertical_lcd = FALSE; - exec->subpixel_positioned = TRUE; - exec->gray_cleartype = FALSE; -#else /* 0 */ - exec->compatible_widths = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - TT_LOAD_COMPATIBLE_WIDTHS ); - exec->symmetrical_smoothing = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - TT_LOAD_SYMMETRICAL_SMOOTHING ); - exec->bgr = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - TT_LOAD_BGR ); - exec->vertical_lcd = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - TT_LOAD_VERTICAL_LCD ); - exec->subpixel_positioned = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - TT_LOAD_SUBPIXEL_POSITIONED ); - exec->gray_cleartype = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - TT_LOAD_GRAY_CLEARTYPE ); -#endif /* 0 */ - - } - else - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 ) - grayscale = FT_BOOL( !subpixel_hinting_lean && - FT_LOAD_TARGET_MODE( load_flags ) != - FT_RENDER_MODE_MONO ); - else -#endif - grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != - FT_RENDER_MODE_MONO ); - error = TT_Load_Context( exec, face, size ); if ( error ) return error; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) - { - /* a change from mono to subpixel rendering (and vice versa) */ - /* requires a re-execution of the CVT program */ - if ( subpixel_hinting != exec->subpixel_hinting ) - { - FT_TRACE4(( "tt_loader_init: subpixel hinting change," - " re-executing `prep' table\n" )); - - exec->subpixel_hinting = subpixel_hinting; - reexecute = TRUE; - } - - /* a change from mono to grayscale rendering (and vice versa) */ - /* requires a re-execution of the CVT program */ - if ( grayscale != exec->grayscale ) - { - FT_TRACE4(( "tt_loader_init: grayscale hinting change," - " re-executing `prep' table\n" )); - - exec->grayscale = grayscale; - reexecute = TRUE; - } - } - else - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - { - #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 ) { @@ -2573,14 +2306,6 @@ if ( exec->GS.instruct_control & 2 ) exec->GS = tt_default_graphics_state; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* check whether we have a font hinted for ClearType -- */ - /* note that this flag can also be modified in a glyph's bytecode */ - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 && - exec->GS.instruct_control & 4 ) - exec->ignore_x_mode = FALSE; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* * Toggle backward compatibility according to what font wants, except @@ -2616,13 +2341,6 @@ #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && exec->backward_compatibility ) && -#endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - !( driver->interpreter_version == TT_INTERPRETER_VERSION_38 && - !SPH_OPTION_BITMAP_WIDTHS && - FT_LOAD_TARGET_MODE( loader->load_flags ) != - FT_RENDER_MODE_MONO && - exec->compatible_widths ) && #endif !face->postscript.isFixedPitch ) { @@ -2857,7 +2575,9 @@ #ifdef FT_CONFIG_OPTION_SVG /* check for OT-SVG */ - if ( ( load_flags & FT_LOAD_COLOR ) && face->svg ) + if ( ( load_flags & FT_LOAD_NO_SVG ) == 0 && + ( load_flags & FT_LOAD_COLOR ) && + face->svg ) { SFNT_Service sfnt = (SFNT_Service)face->sfnt; @@ -2955,6 +2675,9 @@ if ( IS_HINTED( load_flags ) ) { + glyph->control_data = loader.exec->glyphIns; + glyph->control_len = loader.exec->glyphSize; + if ( loader.exec->GS.scan_control ) { /* convert scan conversion mode to FT_OUTLINE_XXX flags */ diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c b/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c index fc957320c84..9d149ea365c 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -465,7 +466,7 @@ if ( store_offset ) { error = tt_var_load_item_variation_store( - face, + FT_FACE( face ), table_offset + store_offset, &table->itemStore ); if ( error ) @@ -475,7 +476,7 @@ if ( axisMap_offset ) { error = tt_var_load_delta_set_index_mapping( - face, + FT_FACE( face ), table_offset + axisMap_offset, &table->axisMap, &table->itemStore, @@ -492,10 +493,11 @@ FT_LOCAL_DEF( FT_Error ) - tt_var_load_item_variation_store( TT_Face face, + tt_var_load_item_variation_store( FT_Face face, /* TT_Face */ FT_ULong offset, GX_ItemVarStore itemStore ) { + TT_Face ttface = (TT_Face)face; FT_Stream stream = FT_FACE_STREAM( face ); FT_Memory memory = stream->memory; @@ -507,10 +509,10 @@ FT_UShort axis_count; FT_UInt region_count; - FT_UInt i, j, k; + FT_UInt i, j; FT_Bool long_words; - GX_Blend blend = face->blend; + GX_Blend blend = ttface->blend; FT_ULong* dataOffsetArray = NULL; @@ -619,9 +621,10 @@ { GX_ItemVarData varData = &itemStore->varData[i]; - FT_UInt item_count; - FT_UInt word_delta_count; - FT_UInt region_idx_count; + FT_UInt item_count; + FT_UShort word_delta_count; + FT_UInt region_idx_count; + FT_UInt per_region_size; if ( FT_STREAM_SEEK( offset + dataOffsetArray[i] ) ) @@ -658,6 +661,8 @@ if ( FT_NEW_ARRAY( varData->regionIndices, region_idx_count ) ) goto Exit; varData->regionIdxCount = region_idx_count; + varData->wordDeltaCount = word_delta_count; + varData->longWords = long_words; for ( j = 0; j < varData->regionIdxCount; j++ ) { @@ -673,37 +678,22 @@ } } - /* Parse delta set. */ - /* */ - /* On input, deltas are (word_delta_count + region_idx_count) bytes */ - /* each if `long_words` isn't set, and twice as much otherwise. */ - /* */ - /* On output, deltas are expanded to `region_idx_count` shorts each. */ - if ( FT_NEW_ARRAY( varData->deltaSet, item_count * region_idx_count ) ) - goto Exit; - varData->itemCount = item_count; + per_region_size = word_delta_count + region_idx_count; + if ( long_words ) + per_region_size *= 2; - for ( j = 0; j < item_count * region_idx_count; ) + if ( FT_NEW_ARRAY( varData->deltaSet, per_region_size * item_count ) ) + goto Exit; + if ( FT_Stream_Read( stream, + varData->deltaSet, + per_region_size * item_count ) ) { - if ( long_words ) - { - for ( k = 0; k < word_delta_count; k++, j++ ) - if ( FT_READ_LONG( varData->deltaSet[j] ) ) - goto Exit; - for ( ; k < region_idx_count; k++, j++ ) - if ( FT_READ_SHORT( varData->deltaSet[j] ) ) - goto Exit; - } - else - { - for ( k = 0; k < word_delta_count; k++, j++ ) - if ( FT_READ_SHORT( varData->deltaSet[j] ) ) - goto Exit; - for ( ; k < region_idx_count; k++, j++ ) - if ( FT_READ_CHAR( varData->deltaSet[j] ) ) - goto Exit; - } + FT_TRACE2(( "deltaSet read failed." )); + error = FT_THROW( Invalid_Table ); + goto Exit; } + + varData->itemCount = item_count; } Exit: @@ -714,7 +704,7 @@ FT_LOCAL_DEF( FT_Error ) - tt_var_load_delta_set_index_mapping( TT_Face face, + tt_var_load_delta_set_index_mapping( FT_Face face, /* TT_Face */ FT_ULong offset, GX_DeltaSetIdxMap map, GX_ItemVarStore itemStore, @@ -941,7 +931,7 @@ } error = tt_var_load_item_variation_store( - face, + FT_FACE( face ), table_offset + store_offset, &table->itemStore ); if ( error ) @@ -950,7 +940,7 @@ if ( widthMap_offset ) { error = tt_var_load_delta_set_index_mapping( - face, + FT_FACE( face ), table_offset + widthMap_offset, &table->widthMap, &table->itemStore, @@ -992,24 +982,30 @@ FT_LOCAL_DEF( FT_ItemVarDelta ) - tt_var_get_item_delta( TT_Face face, + tt_var_get_item_delta( FT_Face face, /* TT_Face */ GX_ItemVarStore itemStore, FT_UInt outerIndex, FT_UInt innerIndex ) { + TT_Face ttface = (TT_Face)face; FT_Stream stream = FT_FACE_STREAM( face ); FT_Memory memory = stream->memory; FT_Error error = FT_Err_Ok; GX_ItemVarData varData; - FT_ItemVarDelta* deltaSet; + FT_ItemVarDelta* deltaSet = NULL; + FT_ItemVarDelta deltaSetStack[16]; + + FT_Fixed* scalars = NULL; + FT_Fixed scalarsStack[16]; FT_UInt master, j; - FT_Fixed* scalars = NULL; - FT_ItemVarDelta returnValue; + FT_ItemVarDelta returnValue = 0; + FT_UInt per_region_size; + FT_Byte* bytes; - if ( !face->blend || !face->blend->normalizedcoords ) + if ( !ttface->blend || !ttface->blend->normalizedcoords ) return 0; /* OpenType 1.8.4+: No variation data for this item */ @@ -1023,15 +1019,48 @@ if ( outerIndex >= itemStore->dataCount ) return 0; /* Out of range. */ - varData = &itemStore->varData[outerIndex]; - deltaSet = FT_OFFSET( varData->deltaSet, - varData->regionIdxCount * innerIndex ); + varData = &itemStore->varData[outerIndex]; if ( innerIndex >= varData->itemCount ) return 0; /* Out of range. */ - if ( FT_QNEW_ARRAY( scalars, varData->regionIdxCount ) ) - return 0; + if ( varData->regionIdxCount < 16 ) + { + deltaSet = deltaSetStack; + scalars = scalarsStack; + } + else + { + if ( FT_QNEW_ARRAY( deltaSet, varData->regionIdxCount ) ) + goto Exit; + if ( FT_QNEW_ARRAY( scalars, varData->regionIdxCount ) ) + goto Exit; + } + + /* Parse delta set. */ + /* */ + /* Deltas are (word_delta_count + region_idx_count) bytes each */ + /* if `longWords` isn't set, and twice as much otherwise. */ + per_region_size = varData->wordDeltaCount + varData->regionIdxCount; + if ( varData->longWords ) + per_region_size *= 2; + + bytes = varData->deltaSet + per_region_size * innerIndex; + + if ( varData->longWords ) + { + for ( master = 0; master < varData->wordDeltaCount; master++ ) + deltaSet[master] = FT_NEXT_LONG( bytes ); + for ( ; master < varData->regionIdxCount; master++ ) + deltaSet[master] = FT_NEXT_SHORT( bytes ); + } + else + { + for ( master = 0; master < varData->wordDeltaCount; master++ ) + deltaSet[master] = FT_NEXT_SHORT( bytes ); + for ( ; master < varData->regionIdxCount; master++ ) + deltaSet[master] = FT_NEXT_CHAR( bytes ); + } /* outer loop steps through master designs to be blended */ for ( master = 0; master < varData->regionIdxCount; master++ ) @@ -1060,27 +1089,27 @@ else if ( axis->peakCoord == 0 ) continue; - else if ( face->blend->normalizedcoords[j] == axis->peakCoord ) + else if ( ttface->blend->normalizedcoords[j] == axis->peakCoord ) continue; /* ignore this region if coords are out of range */ - else if ( face->blend->normalizedcoords[j] <= axis->startCoord || - face->blend->normalizedcoords[j] >= axis->endCoord ) + else if ( ttface->blend->normalizedcoords[j] <= axis->startCoord || + ttface->blend->normalizedcoords[j] >= axis->endCoord ) { scalar = 0; break; } /* cumulative product of all the axis scalars */ - else if ( face->blend->normalizedcoords[j] < axis->peakCoord ) + else if ( ttface->blend->normalizedcoords[j] < axis->peakCoord ) scalar = FT_MulDiv( scalar, - face->blend->normalizedcoords[j] - axis->startCoord, + ttface->blend->normalizedcoords[j] - axis->startCoord, axis->peakCoord - axis->startCoord ); else scalar = FT_MulDiv( scalar, - axis->endCoord - face->blend->normalizedcoords[j], + axis->endCoord - ttface->blend->normalizedcoords[j], axis->endCoord - axis->peakCoord ); } /* per-axis loop */ @@ -1106,7 +1135,11 @@ */ returnValue = FT_MulAddFix( scalars, deltaSet, varData->regionIdxCount ); - FT_FREE( scalars ); + Exit: + if ( scalars != scalarsStack ) + FT_FREE( scalars ); + if ( deltaSet != deltaSetStack ) + FT_FREE( deltaSet ); return returnValue; } @@ -1206,7 +1239,7 @@ innerIndex = gindex; } - delta = tt_var_get_item_delta( face, + delta = tt_var_get_item_delta( FT_FACE( face ), &table->itemStore, outerIndex, innerIndex ); @@ -1229,20 +1262,20 @@ FT_LOCAL_DEF( FT_Error ) - tt_hadvance_adjust( TT_Face face, + tt_hadvance_adjust( FT_Face face, /* TT_Face */ FT_UInt gindex, FT_Int *avalue ) { - return tt_hvadvance_adjust( face, gindex, avalue, 0 ); + return tt_hvadvance_adjust( (TT_Face)face, gindex, avalue, 0 ); } FT_LOCAL_DEF( FT_Error ) - tt_vadvance_adjust( TT_Face face, + tt_vadvance_adjust( FT_Face face, /* TT_Face */ FT_UInt gindex, FT_Int *avalue ) { - return tt_hvadvance_adjust( face, gindex, avalue, 1 ); + return tt_hvadvance_adjust( (TT_Face)face, gindex, avalue, 1 ); } @@ -1389,7 +1422,7 @@ records_offset = FT_STREAM_POS(); error = tt_var_load_item_variation_store( - face, + FT_FACE( face ), table_offset + store_offset, &blend->mvar_table->itemStore ); if ( error ) @@ -1462,15 +1495,14 @@ static FT_Error - tt_size_reset_iterator( FT_ListNode node, + ft_size_reset_iterator( FT_ListNode node, void* user ) { - TT_Size size = (TT_Size)node->data; - - FT_UNUSED( user ); + FT_Size size = (FT_Size)node->data; + FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)user; - tt_size_reset( size, 1 ); + var->size_reset( size ); return FT_Err_Ok; } @@ -1489,16 +1521,19 @@ * The font face. */ FT_LOCAL_DEF( void ) - tt_apply_mvar( TT_Face face ) + tt_apply_mvar( FT_Face face ) /* TT_Face */ { - GX_Blend blend = face->blend; + TT_Face ttface = (TT_Face)face; + + GX_Blend blend = ttface->blend; GX_Value value, limit; + FT_Short mvar_hasc_delta = 0; FT_Short mvar_hdsc_delta = 0; FT_Short mvar_hlgp_delta = 0; - if ( !( face->variation_support & TT_FACE_FLAG_VAR_MVAR ) ) + if ( !( ttface->variation_support & TT_FACE_FLAG_VAR_MVAR ) ) return; value = blend->mvar_table->values; @@ -1506,7 +1541,7 @@ for ( ; value < limit; value++ ) { - FT_Short* p = ft_var_get_value_pointer( face, value->tag ); + FT_Short* p = ft_var_get_value_pointer( ttface, value->tag ); FT_Int delta; @@ -1543,7 +1578,8 @@ /* adjust all derived values */ { - FT_Face root = &face->root; + FT_Service_MetricsVariations var = + (FT_Service_MetricsVariations)ttface->face_var; /* * Apply the deltas of hasc, hdsc and hlgp to the FT_Face's ascender, @@ -1571,24 +1607,25 @@ * whether they were actually changed or the font had the OS/2 table's * fsSelection's bit 7 (USE_TYPO_METRICS) set. */ - FT_Short current_line_gap = root->height - root->ascender + - root->descender; + FT_Short current_line_gap = face->height - face->ascender + + face->descender; - root->ascender = root->ascender + mvar_hasc_delta; - root->descender = root->descender + mvar_hdsc_delta; - root->height = root->ascender - root->descender + + face->ascender = face->ascender + mvar_hasc_delta; + face->descender = face->descender + mvar_hdsc_delta; + face->height = face->ascender - face->descender + current_line_gap + mvar_hlgp_delta; - root->underline_position = face->postscript.underlinePosition - - face->postscript.underlineThickness / 2; - root->underline_thickness = face->postscript.underlineThickness; + face->underline_position = ttface->postscript.underlinePosition - + ttface->postscript.underlineThickness / 2; + face->underline_thickness = ttface->postscript.underlineThickness; - /* iterate over all FT_Size objects and call `tt_size_reset' */ - /* to propagate the metrics changes */ - FT_List_Iterate( &root->sizes_list, - tt_size_reset_iterator, - NULL ); + /* iterate over all FT_Size objects and call `var->size_reset' */ + /* to propagate the metrics changes */ + if ( var && var->size_reset ) + FT_List_Iterate( &face->sizes_list, + ft_size_reset_iterator, + (void*)var ); } } @@ -2099,7 +2136,7 @@ innerIndex = table->axisMap.innerIndex[idx]; } - delta = tt_var_get_item_delta( face, + delta = tt_var_get_item_delta( FT_FACE( face ), &table->itemStore, outerIndex, innerIndex ); @@ -2261,11 +2298,12 @@ * FreeType error code. 0 means success. */ FT_LOCAL_DEF( FT_Error ) - TT_Get_MM_Var( TT_Face face, + TT_Get_MM_Var( FT_Face face, /* TT_Face */ FT_MM_Var* *master ) { - FT_Stream stream = face->root.stream; - FT_Memory memory = face->root.memory; + TT_Face ttface = (TT_Face)face; + FT_Stream stream = FT_FACE_STREAM( face ); + FT_Memory memory = FT_FACE_MEMORY( face ); FT_ULong table_len; FT_Error error = FT_Err_Ok; FT_ULong fvar_start = 0; @@ -2329,19 +2367,19 @@ /* the default instance, which might be missing in the table of named */ /* instances (in 'fvar'). This value is validated in `sfobjs.c` and */ /* may be reset to 0 if consistency checks fail. */ - num_instances = (FT_UInt)face->root.style_flags >> 16; + num_instances = (FT_UInt)face->style_flags >> 16; /* read the font data and set up the internal representation */ /* if not already done */ - need_init = !face->blend; + need_init = !ttface->blend; if ( need_init ) { FT_TRACE2(( "FVAR " )); - if ( FT_SET_ERROR( face->goto_table( face, TTAG_fvar, - stream, &table_len ) ) ) + if ( FT_SET_ERROR( ttface->goto_table( ttface, TTAG_fvar, + stream, &table_len ) ) ) { FT_TRACE1(( "is missing\n" )); goto Exit; @@ -2374,14 +2412,14 @@ fvar_head.axisCount, fvar_head.axisCount == 1 ? "is" : "es" )); - if ( FT_NEW( face->blend ) ) + if ( FT_NEW( ttface->blend ) ) goto Exit; - num_axes = fvar_head.axisCount; - face->blend->num_axis = num_axes; + num_axes = fvar_head.axisCount; + ttface->blend->num_axis = num_axes; } else - num_axes = face->blend->num_axis; + num_axes = ttface->blend->num_axis; /* prepare storage area for MM data; this cannot overflow */ /* 32-bit arithmetic because of the size limits used in the */ @@ -2410,16 +2448,16 @@ if ( need_init ) { - face->blend->mmvar_len = mmvar_size + - axis_flags_size + - axis_size + - namedstyle_size + - next_coords_size + - next_name_size; - - if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) ) + ttface->blend->mmvar_len = mmvar_size + + axis_flags_size + + axis_size + + namedstyle_size + + next_coords_size + + next_name_size; + + if ( FT_ALLOC( mmvar, ttface->blend->mmvar_len ) ) goto Exit; - face->blend->mmvar = mmvar; + ttface->blend->mmvar = mmvar; /* set up pointers and offsets into the `mmvar' array; */ /* the data gets filled in later on */ @@ -2525,27 +2563,27 @@ /* named instance coordinates are stored as design coordinates; */ /* we have to convert them to normalized coordinates also */ - if ( FT_NEW_ARRAY( face->blend->normalized_stylecoords, + if ( FT_NEW_ARRAY( ttface->blend->normalized_stylecoords, num_axes * num_instances ) ) goto Exit; - if ( fvar_head.instanceCount && !face->blend->avar_loaded ) + if ( fvar_head.instanceCount && !ttface->blend->avar_loaded ) { FT_ULong offset = FT_STREAM_POS(); - ft_var_load_avar( face ); + ft_var_load_avar( ttface ); if ( FT_STREAM_SEEK( offset ) ) goto Exit; } - FT_TRACE5(( "%d instance%s\n", + FT_TRACE5(( "%d named instance%s\n", fvar_head.instanceCount, fvar_head.instanceCount == 1 ? "" : "s" )); ns = mmvar->namedstyle; - nsc = face->blend->normalized_stylecoords; + nsc = ttface->blend->normalized_stylecoords; for ( i = 0; i < fvar_head.instanceCount; i++, ns++ ) { /* PostScript names add 2 bytes to the instance record size */ @@ -2568,7 +2606,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE { - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + SFNT_Service sfnt = (SFNT_Service)ttface->sfnt; FT_String* strname = NULL; FT_String* psname = NULL; @@ -2580,7 +2618,7 @@ if ( ns->strid != 0xFFFF ) { - (void)sfnt->get_name( face, + (void)sfnt->get_name( ttface, (FT_UShort)ns->strid, &strname ); if ( strname && !ft_strcmp( strname, ".notdef" ) ) @@ -2589,7 +2627,7 @@ if ( ns->psid != 0xFFFF ) { - (void)sfnt->get_name( face, + (void)sfnt->get_name( ttface, (FT_UShort)ns->psid, &psname ); if ( psname && !ft_strcmp( psname, ".notdef" ) ) @@ -2598,7 +2636,7 @@ (void)FT_STREAM_SEEK( pos ); - FT_TRACE5(( " instance %d (%s%s%s, %s%s%s)\n", + FT_TRACE5(( " named instance %d (%s%s%s, %s%s%s)\n", i, strname ? "name: `" : "", strname ? strname : "unnamed", @@ -2612,7 +2650,7 @@ } #endif /* FT_DEBUG_LEVEL_TRACE */ - ft_var_to_normalized( face, num_axes, ns->coords, nsc ); + ft_var_to_normalized( ttface, num_axes, ns->coords, nsc ); nsc += num_axes; FT_FRAME_EXIT(); @@ -2620,15 +2658,17 @@ if ( num_instances != fvar_head.instanceCount ) { - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + SFNT_Service sfnt = (SFNT_Service)ttface->sfnt; FT_Int found, dummy1, dummy2; FT_UInt strid = ~0U; - /* the default instance is missing in array the */ - /* of named instances; try to synthesize an entry */ - found = sfnt->get_name_id( face, + /* The default instance is missing in array the */ + /* of named instances; try to synthesize an entry. */ + /* If this fails, `default_named_instance` remains */ + /* at value zero, which doesn't do any harm. */ + found = sfnt->get_name_id( ttface, TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY, &dummy1, &dummy2 ); @@ -2636,7 +2676,7 @@ strid = TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY; else { - found = sfnt->get_name_id( face, + found = sfnt->get_name_id( ttface, TT_NAME_ID_FONT_SUBFAMILY, &dummy1, &dummy2 ); @@ -2646,7 +2686,7 @@ if ( found ) { - found = sfnt->get_name_id( face, + found = sfnt->get_name_id( ttface, TT_NAME_ID_PS_NAME, &dummy1, &dummy2 ); @@ -2655,6 +2695,9 @@ FT_TRACE5(( "TT_Get_MM_Var:" " Adding default instance to named instances\n" )); + /* named instance indices start with value 1 */ + ttface->var_default_named_instance = num_instances; + ns = &mmvar->namedstyle[fvar_head.instanceCount]; ns->strid = strid; @@ -2668,7 +2711,7 @@ } } - ft_var_load_mvar( face ); + ft_var_load_mvar( ttface ); } /* fill the output array if requested */ @@ -2678,9 +2721,9 @@ FT_UInt n; - if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) ) + if ( FT_ALLOC( mmvar, ttface->blend->mmvar_len ) ) goto Exit; - FT_MEM_COPY( mmvar, face->blend->mmvar, face->blend->mmvar_len ); + FT_MEM_COPY( mmvar, ttface->blend->mmvar, ttface->blend->mmvar_len ); axis_flags = (FT_UShort*)( (char*)mmvar + mmvar_size ); @@ -2756,7 +2799,7 @@ if ( !face->blend ) { - if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) ) + if ( FT_SET_ERROR( TT_Get_MM_Var( FT_FACE( face ), NULL ) ) ) goto Exit; } @@ -2841,26 +2884,29 @@ } } - if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ) + if ( !have_diff ) { - FT_UInt instance_index = (FT_UInt)face->root.face_index >> 16; + if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ) + { + FT_UInt instance_index = (FT_UInt)face->root.face_index >> 16; - c = blend->normalizedcoords + i; - n = blend->normalized_stylecoords + - ( instance_index - 1 ) * mmvar->num_axis + - i; + c = blend->normalizedcoords + i; + n = blend->normalized_stylecoords + + ( instance_index - 1 ) * mmvar->num_axis + + i; - for ( j = i; j < mmvar->num_axis; j++, n++, c++ ) - if ( *c != *n ) - have_diff = 1; - } - else - { - c = blend->normalizedcoords + i; - for ( j = i; j < mmvar->num_axis; j++, c++ ) - if ( *c != 0 ) - have_diff = 1; + for ( j = i; j < mmvar->num_axis; j++, n++, c++ ) + if ( *c != *n ) + have_diff = 1; + } + else + { + c = blend->normalizedcoords + i; + for ( j = i; j < mmvar->num_axis; j++, c++ ) + if ( *c != 0 ) + have_diff = 1; + } } /* return value -1 indicates `no change' */ @@ -2924,9 +2970,6 @@ } } - /* enforce recomputation of the PostScript name; */ - FT_FREE( face->postscript_name ); - Exit: return error; } @@ -2958,26 +3001,15 @@ * An array of `num_coords', each between [-1,1]. * * @Return: - * FreeType error code. 0 means success. + * FreeType error code. 0 means success, -1 means success and unchanged + * axis values. */ FT_LOCAL_DEF( FT_Error ) - TT_Set_MM_Blend( TT_Face face, + TT_Set_MM_Blend( FT_Face face, /* TT_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Error error; - - - error = tt_set_mm_blend( face, num_coords, coords, 1 ); - if ( error ) - return error; - - if ( num_coords ) - face->root.face_flags |= FT_FACE_FLAG_VARIATION; - else - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; - - return FT_Err_Ok; + return tt_set_mm_blend( (TT_Face)face, num_coords, coords, 1 ); } @@ -3005,31 +3037,34 @@ * An array of `num_coords', each between [-1,1]. * * @Return: - * FreeType error code. 0 means success. + * FreeType error code. 0 means success, -1 means success and unchanged + * axis values. */ FT_LOCAL_DEF( FT_Error ) - TT_Get_MM_Blend( TT_Face face, + TT_Get_MM_Blend( FT_Face face, /* TT_Face */ FT_UInt num_coords, FT_Fixed* coords ) { + TT_Face ttface = (TT_Face)face; + FT_Error error = FT_Err_Ok; GX_Blend blend; FT_UInt i, nc; - if ( !face->blend ) + if ( !ttface->blend ) { if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) ) return error; } - blend = face->blend; + blend = ttface->blend; if ( !blend->coords ) { /* select default instance coordinates */ /* if no instance is selected yet */ - if ( FT_SET_ERROR( tt_set_mm_blend( face, 0, NULL, 1 ) ) ) + if ( FT_SET_ERROR( tt_set_mm_blend( ttface, 0, NULL, 1 ) ) ) return error; } @@ -3042,7 +3077,7 @@ nc = blend->num_axis; } - if ( face->doblend ) + if ( ttface->doblend ) { for ( i = 0; i < nc; i++ ) coords[i] = blend->normalizedcoords[i]; @@ -3089,15 +3124,16 @@ * FreeType error code. 0 means success. */ FT_LOCAL_DEF( FT_Error ) - TT_Set_Var_Design( TT_Face face, + TT_Set_Var_Design( FT_Face face, /* TT_Face */ FT_UInt num_coords, FT_Fixed* coords ) { + TT_Face ttface = (TT_Face)face; FT_Error error = FT_Err_Ok; GX_Blend blend; FT_MM_Var* mmvar; FT_UInt i; - FT_Memory memory = face->root.memory; + FT_Memory memory = FT_FACE_MEMORY( face ); FT_Fixed* c; FT_Fixed* n; @@ -3106,13 +3142,13 @@ FT_Bool have_diff = 0; - if ( !face->blend ) + if ( !ttface->blend ) { if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) ) goto Exit; } - blend = face->blend; + blend = ttface->blend; mmvar = blend->mmvar; if ( num_coords > mmvar->num_axis ) @@ -3140,13 +3176,13 @@ } } - if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ) + if ( FT_IS_NAMED_INSTANCE( face ) ) { FT_UInt instance_index; FT_Var_Named_Style* named_style; - instance_index = (FT_UInt)face->root.face_index >> 16; + instance_index = (FT_UInt)face->face_index >> 16; named_style = mmvar->namedstyle + instance_index - 1; n = named_style->coords + num_coords; @@ -3183,22 +3219,17 @@ if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) ) goto Exit; - if ( !face->blend->avar_loaded ) - ft_var_load_avar( face ); + if ( !ttface->blend->avar_loaded ) + ft_var_load_avar( ttface ); FT_TRACE5(( "TT_Set_Var_Design:\n" )); FT_TRACE5(( " normalized design coordinates:\n" )); - ft_var_to_normalized( face, num_coords, blend->coords, normalized ); + ft_var_to_normalized( ttface, num_coords, blend->coords, normalized ); - error = tt_set_mm_blend( face, mmvar->num_axis, normalized, 0 ); + error = tt_set_mm_blend( ttface, mmvar->num_axis, normalized, 0 ); if ( error ) goto Exit; - if ( num_coords ) - face->root.face_flags |= FT_FACE_FLAG_VARIATION; - else - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; - Exit: FT_FREE( normalized ); return error; @@ -3231,28 +3262,29 @@ * FreeType error code. 0~means success. */ FT_LOCAL_DEF( FT_Error ) - TT_Get_Var_Design( TT_Face face, + TT_Get_Var_Design( FT_Face face, /* TT_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Error error = FT_Err_Ok; + TT_Face ttface = (TT_Face)face; + FT_Error error = FT_Err_Ok; GX_Blend blend; FT_UInt i, nc; - if ( !face->blend ) + if ( !ttface->blend ) { if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) ) return error; } - blend = face->blend; + blend = ttface->blend; if ( !blend->coords ) { /* select default instance coordinates */ /* if no instance is selected yet */ - if ( FT_SET_ERROR( tt_set_mm_blend( face, 0, NULL, 1 ) ) ) + if ( FT_SET_ERROR( tt_set_mm_blend( ttface, 0, NULL, 1 ) ) ) return error; } @@ -3265,7 +3297,7 @@ nc = blend->num_axis; } - if ( face->doblend ) + if ( ttface->doblend ) { for ( i = 0; i < nc; i++ ) coords[i] = blend->coords[i]; @@ -3301,29 +3333,33 @@ * Value 0 indicates to not use an instance. * * @Return: - * FreeType error code. 0~means success. + * FreeType error code. 0~means success, -1 means success and unchanged + * axis values. */ FT_LOCAL_DEF( FT_Error ) - TT_Set_Named_Instance( TT_Face face, + TT_Set_Named_Instance( FT_Face face, /* TT_Face */ FT_UInt instance_index ) { + TT_Face ttface = (TT_Face)face; FT_Error error; GX_Blend blend; FT_MM_Var* mmvar; + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_UInt num_instances; - if ( !face->blend ) + if ( !ttface->blend ) { if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) ) goto Exit; } - blend = face->blend; + blend = ttface->blend; mmvar = blend->mmvar; - num_instances = (FT_UInt)face->root.style_flags >> 16; + num_instances = (FT_UInt)face->style_flags >> 16; /* `instance_index' starts with value 1, thus `>' */ if ( instance_index > num_instances ) @@ -3334,8 +3370,7 @@ if ( instance_index > 0 ) { - FT_Memory memory = face->root.memory; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + SFNT_Service sfnt = (SFNT_Service)ttface->sfnt; FT_Var_Named_Style* named_style; FT_String* style_name; @@ -3343,40 +3378,89 @@ named_style = mmvar->namedstyle + instance_index - 1; - error = sfnt->get_name( face, + error = sfnt->get_name( ttface, (FT_UShort)named_style->strid, &style_name ); if ( error ) goto Exit; /* set (or replace) style name */ - FT_FREE( face->root.style_name ); - face->root.style_name = style_name; + FT_FREE( face->style_name ); + face->style_name = style_name; /* finally, select the named instance */ error = TT_Set_Var_Design( face, mmvar->num_axis, named_style->coords ); - if ( error ) - { - /* internal error code -1 means `no change' */ - if ( error == -1 ) - error = FT_Err_Ok; - goto Exit; - } } else + { + /* restore non-VF style name */ + FT_FREE( face->style_name ); + if ( FT_STRDUP( face->style_name, ttface->non_var_style_name ) ) + goto Exit; error = TT_Set_Var_Design( face, 0, NULL ); + } + + Exit: + return error; + } + + + /************************************************************************** + * + * @Function: + * TT_Get_Default_Named_Instance + * + * @Description: + * Get the default named instance. + * + * @Input: + * face :: + * A handle to the source face. + * + * @Output: + * instance_index :: + * The default named instance index. + * + * @Return: + * FreeType error code. 0~means success. + */ + FT_LOCAL_DEF( FT_Error ) + TT_Get_Default_Named_Instance( FT_Face face, + FT_UInt *instance_index ) + { + TT_Face ttface = (TT_Face)face; + FT_Error error = FT_Err_Ok; - face->root.face_index = ( instance_index << 16 ) | - ( face->root.face_index & 0xFFFFL ); - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; + + if ( !ttface->blend ) + { + if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) ) + goto Exit; + } + + *instance_index = ttface->var_default_named_instance; Exit: return error; } + /* This function triggers (lazy) recomputation of the `postscript_name` */ + /* field in `TT_Face`. */ + + FT_LOCAL_DEF( void ) + tt_construct_ps_name( FT_Face face ) + { + TT_Face ttface = (TT_Face)face; + FT_Memory memory = FT_FACE_MEMORY( face ); + + + FT_FREE( ttface->postscript_name ); + } + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -4409,22 +4493,25 @@ * the MM machinery in case it isn't loaded yet. */ FT_LOCAL_DEF( FT_Error ) - tt_get_var_blend( TT_Face face, + tt_get_var_blend( FT_Face face, /* TT_Face */ FT_UInt *num_coords, FT_Fixed* *coords, FT_Fixed* *normalizedcoords, FT_MM_Var* *mm_var ) { - if ( face->blend ) + TT_Face ttface = (TT_Face)face; + + + if ( ttface->blend ) { if ( num_coords ) - *num_coords = face->blend->num_axis; + *num_coords = ttface->blend->num_axis; if ( coords ) - *coords = face->blend->coords; + *coords = ttface->blend->coords; if ( normalizedcoords ) - *normalizedcoords = face->blend->normalizedcoords; + *normalizedcoords = ttface->blend->normalizedcoords; if ( mm_var ) - *mm_var = face->blend->mmvar; + *mm_var = ttface->blend->mmvar; } else { @@ -4441,7 +4528,7 @@ FT_LOCAL_DEF( void ) - tt_var_done_item_variation_store( TT_Face face, + tt_var_done_item_variation_store( FT_Face face, GX_ItemVarStore itemStore ) { FT_Memory memory = FT_FACE_MEMORY( face ); @@ -4470,7 +4557,7 @@ FT_LOCAL_DEF( void ) - tt_var_done_delta_set_index_map( TT_Face face, + tt_var_done_delta_set_index_map( FT_Face face, GX_DeltaSetIdxMap deltaSetIdxMap ) { FT_Memory memory = FT_FACE_MEMORY( face ); @@ -4490,10 +4577,11 @@ * Free the blend internal data structure. */ FT_LOCAL_DEF( void ) - tt_done_blend( TT_Face face ) + tt_done_blend( FT_Face face ) { + TT_Face ttface = (TT_Face)face; FT_Memory memory = FT_FACE_MEMORY( face ); - GX_Blend blend = face->blend; + GX_Blend blend = ttface->blend; if ( blend ) @@ -4565,7 +4653,7 @@ #else /* !TT_CONFIG_OPTION_GX_VAR_SUPPORT */ /* ANSI C doesn't like empty source files */ - typedef int _tt_gxvar_dummy; + typedef int tt_gxvar_dummy_; #endif /* !TT_CONFIG_OPTION_GX_VAR_SUPPORT */ diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.h b/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.h index 4fec980dcc0..e3da6d1705c 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.h +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.h @@ -347,33 +347,40 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) - TT_Set_MM_Blend( TT_Face face, + TT_Set_MM_Blend( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) - TT_Get_MM_Blend( TT_Face face, + TT_Get_MM_Blend( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) - TT_Set_Var_Design( TT_Face face, + TT_Set_Var_Design( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) - TT_Get_MM_Var( TT_Face face, + TT_Get_MM_Var( FT_Face face, FT_MM_Var* *master ); FT_LOCAL( FT_Error ) - TT_Get_Var_Design( TT_Face face, + TT_Get_Var_Design( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) - TT_Set_Named_Instance( TT_Face face, + TT_Set_Named_Instance( FT_Face face, FT_UInt instance_index ); + FT_LOCAL( FT_Error ) + TT_Get_Default_Named_Instance( FT_Face face, + FT_UInt *instance_index ); + + FT_LOCAL( void ) + tt_construct_ps_name( FT_Face face ); + FT_LOCAL( FT_Error ) tt_face_vary_cvt( TT_Face face, FT_Stream stream ); @@ -385,55 +392,54 @@ FT_BEGIN_HEADER FT_Vector* unrounded ); FT_LOCAL( FT_Error ) - tt_hadvance_adjust( TT_Face face, + tt_hadvance_adjust( FT_Face face, FT_UInt gindex, FT_Int *adelta ); FT_LOCAL( FT_Error ) - tt_vadvance_adjust( TT_Face face, + tt_vadvance_adjust( FT_Face face, FT_UInt gindex, FT_Int *adelta ); FT_LOCAL( void ) - tt_apply_mvar( TT_Face face ); - + tt_apply_mvar( FT_Face face ); FT_LOCAL( FT_Error ) - tt_var_load_item_variation_store( TT_Face face, + tt_var_load_item_variation_store( FT_Face face, FT_ULong offset, GX_ItemVarStore itemStore ); FT_LOCAL( FT_Error ) - tt_var_load_delta_set_index_mapping( TT_Face face, + tt_var_load_delta_set_index_mapping( FT_Face face, FT_ULong offset, GX_DeltaSetIdxMap map, GX_ItemVarStore itemStore, FT_ULong table_len ); FT_LOCAL( FT_ItemVarDelta ) - tt_var_get_item_delta( TT_Face face, + tt_var_get_item_delta( FT_Face face, GX_ItemVarStore itemStore, FT_UInt outerIndex, FT_UInt innerIndex ); FT_LOCAL( void ) - tt_var_done_item_variation_store( TT_Face face, + tt_var_done_item_variation_store( FT_Face face, GX_ItemVarStore itemStore ); FT_LOCAL( void ) - tt_var_done_delta_set_index_map( TT_Face face, + tt_var_done_delta_set_index_map( FT_Face face, GX_DeltaSetIdxMap deltaSetIdxMap ); FT_LOCAL( FT_Error ) - tt_get_var_blend( TT_Face face, + tt_get_var_blend( FT_Face face, FT_UInt *num_coords, FT_Fixed* *coords, FT_Fixed* *normalizedcoords, FT_MM_Var* *mm_var ); FT_LOCAL( void ) - tt_done_blend( TT_Face face ); + tt_done_blend( FT_Face face ); #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.c b/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.c index 4fcfaa3e430..79df4555d94 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.c +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.c @@ -29,7 +29,6 @@ #include "ttinterp.h" #include "tterrors.h" -#include "ttsubpix.h" #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #include "ttgxvar.h" #endif @@ -52,12 +51,6 @@ ( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \ TT_INTERPRETER_VERSION_35 ) -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY -#define SUBPIXEL_HINTING_INFINALITY \ - ( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \ - TT_INTERPRETER_VERSION_38 ) -#endif - #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL #define SUBPIXEL_HINTING_MINIMAL \ ( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \ @@ -275,57 +268,6 @@ } - /************************************************************************** - * - * @Function: - * Update_Max - * - * @Description: - * Checks the size of a buffer and reallocates it if necessary. - * - * @Input: - * memory :: - * A handle to the parent memory object. - * - * multiplier :: - * The size in bytes of each element in the buffer. - * - * new_max :: - * The new capacity (size) of the buffer. - * - * @InOut: - * size :: - * The address of the buffer's current size expressed - * in elements. - * - * buff :: - * The address of the buffer base pointer. - * - * @Return: - * FreeType error code. 0 means success. - */ - FT_LOCAL_DEF( FT_Error ) - Update_Max( FT_Memory memory, - FT_ULong* size, - FT_ULong multiplier, - void* _pbuff, - FT_ULong new_max ) - { - FT_Error error; - void** pbuff = (void**)_pbuff; - - - if ( *size < new_max ) - { - if ( FT_QREALLOC( *pbuff, *size * multiplier, new_max * multiplier ) ) - return error; - *size = new_max; - } - - return FT_Err_Ok; - } - - /************************************************************************** * * @Function: @@ -359,9 +301,9 @@ TT_Size size ) { FT_Int i; - FT_ULong tmp; TT_MaxProfile* maxp; FT_Error error; + FT_Memory memory = exec->memory; exec->face = face; @@ -406,25 +348,15 @@ /* XXX: We reserve a little more elements on the stack to deal safely */ /* with broken fonts like arialbs, courbs, timesbs, etc. */ - tmp = (FT_ULong)exec->stackSize; - error = Update_Max( exec->memory, - &tmp, - sizeof ( FT_F26Dot6 ), - (void*)&exec->stack, - maxp->maxStackElements + 32 ); - exec->stackSize = (FT_Long)tmp; - if ( error ) + if ( FT_QRENEW_ARRAY( exec->stack, + exec->stackSize, + maxp->maxStackElements + 32 ) ) return error; + exec->stackSize = maxp->maxStackElements + 32; - tmp = (FT_ULong)exec->glyphSize; - error = Update_Max( exec->memory, - &tmp, - sizeof ( FT_Byte ), - (void*)&exec->glyphIns, - maxp->maxSizeOfInstructions ); - exec->glyphSize = (FT_UInt)tmp; - if ( error ) - return error; + /* free previous glyph code range */ + FT_FREE( exec->glyphIns ); + exec->glyphSize = 0; exec->pts.n_points = 0; exec->pts.n_contours = 0; @@ -1530,14 +1462,16 @@ if ( exc->iniRange == tt_coderange_glyph && exc->cvt != exc->glyfCvt ) { - exc->error = Update_Max( exc->memory, - &exc->glyfCvtSize, - sizeof ( FT_Long ), - (void*)&exc->glyfCvt, - exc->cvtSize ); - if ( exc->error ) + FT_Memory memory = exc->memory; + FT_Error error; + + + FT_MEM_QRENEW_ARRAY( exc->glyfCvt, exc->glyfCvtSize, exc->cvtSize ); + exc->error = error; + if ( error ) return; + exc->glyfCvtSize = exc->cvtSize; FT_ARRAY_COPY( exc->glyfCvt, exc->cvt, exc->glyfCvtSize ); exc->cvt = exc->glyfCvt; } @@ -1744,17 +1678,6 @@ if ( v != 0 ) { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - ( !exc->ignore_x_mode || - ( exc->sph_tweak_flags & SPH_TWEAK_ALLOW_X_DMOVE ) ) ) - zone->cur[point].x = ADD_LONG( zone->cur[point].x, - FT_MulDiv( distance, - v, - exc->F_dot_P ) ); - else -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* Exception to the post-IUP curfew: Allow the x component of */ /* diagonal moves, but only post-IUP. DejaVu tries to adjust */ @@ -1860,12 +1783,6 @@ FT_UShort point, FT_F26Dot6 distance ) { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && !exc->ignore_x_mode ) - zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance ); - else -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility ) zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance ); @@ -3069,28 +2986,7 @@ args[0] = 0; } else - { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* subpixel hinting - avoid Typeman Dstroke and */ - /* IStroke and Vacuform rounds */ - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - ( ( I == 24 && - ( exc->face->sph_found_func_flags & - ( SPH_FDEF_SPACING_1 | - SPH_FDEF_SPACING_2 ) ) ) || - ( I == 22 && - ( exc->sph_in_func_flags & - SPH_FDEF_TYPEMAN_STROKES ) ) || - ( I == 8 && - ( exc->face->sph_found_func_flags & - SPH_FDEF_VACUFORM_ROUND_1 ) && - exc->iup_called ) ) ) - args[0] = 0; - else -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - args[0] = exc->storage[I]; - } + args[0] = exc->storage[I]; } @@ -3117,18 +3013,18 @@ if ( exc->iniRange == tt_coderange_glyph && exc->storage != exc->glyfStorage ) { - FT_ULong tmp = (FT_ULong)exc->glyfStoreSize; + FT_Memory memory = exc->memory; + FT_Error error; - exc->error = Update_Max( exc->memory, - &tmp, - sizeof ( FT_Long ), - (void*)&exc->glyfStorage, - exc->storeSize ); - exc->glyfStoreSize = (FT_UShort)tmp; - if ( exc->error ) + FT_MEM_QRENEW_ARRAY( exc->glyfStorage, + exc->glyfStoreSize, + exc->storeSize ); + exc->error = error; + if ( error ) return; + exc->glyfStoreSize = exc->storeSize; FT_ARRAY_COPY( exc->glyfStorage, exc->storage, exc->glyfStoreSize ); exc->storage = exc->glyfStorage; } @@ -3604,106 +3500,6 @@ TT_DefRecord* rec; TT_DefRecord* limit; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* arguments to opcodes are skipped by `SKIP_Code' */ - FT_Byte opcode_pattern[9][12] = { - /* #0 inline delta function 1 */ - { - 0x4B, /* PPEM */ - 0x53, /* GTEQ */ - 0x23, /* SWAP */ - 0x4B, /* PPEM */ - 0x51, /* LTEQ */ - 0x5A, /* AND */ - 0x58, /* IF */ - 0x38, /* SHPIX */ - 0x1B, /* ELSE */ - 0x21, /* POP */ - 0x21, /* POP */ - 0x59 /* EIF */ - }, - /* #1 inline delta function 2 */ - { - 0x4B, /* PPEM */ - 0x54, /* EQ */ - 0x58, /* IF */ - 0x38, /* SHPIX */ - 0x1B, /* ELSE */ - 0x21, /* POP */ - 0x21, /* POP */ - 0x59 /* EIF */ - }, - /* #2 diagonal stroke function */ - { - 0x20, /* DUP */ - 0x20, /* DUP */ - 0xB0, /* PUSHB_1 */ - /* 1 */ - 0x60, /* ADD */ - 0x46, /* GC_cur */ - 0xB0, /* PUSHB_1 */ - /* 64 */ - 0x23, /* SWAP */ - 0x42 /* WS */ - }, - /* #3 VacuFormRound function */ - { - 0x45, /* RCVT */ - 0x23, /* SWAP */ - 0x46, /* GC_cur */ - 0x60, /* ADD */ - 0x20, /* DUP */ - 0xB0 /* PUSHB_1 */ - /* 38 */ - }, - /* #4 TTFautohint bytecode (old) */ - { - 0x20, /* DUP */ - 0x64, /* ABS */ - 0xB0, /* PUSHB_1 */ - /* 32 */ - 0x60, /* ADD */ - 0x66, /* FLOOR */ - 0x23, /* SWAP */ - 0xB0 /* PUSHB_1 */ - }, - /* #5 spacing function 1 */ - { - 0x01, /* SVTCA_x */ - 0xB0, /* PUSHB_1 */ - /* 24 */ - 0x43, /* RS */ - 0x58 /* IF */ - }, - /* #6 spacing function 2 */ - { - 0x01, /* SVTCA_x */ - 0x18, /* RTG */ - 0xB0, /* PUSHB_1 */ - /* 24 */ - 0x43, /* RS */ - 0x58 /* IF */ - }, - /* #7 TypeMan Talk DiagEndCtrl function */ - { - 0x01, /* SVTCA_x */ - 0x20, /* DUP */ - 0xB0, /* PUSHB_1 */ - /* 3 */ - 0x25, /* CINDEX */ - }, - /* #8 TypeMan Talk Align */ - { - 0x06, /* SPVTL */ - 0x7D, /* RDTG */ - }, - }; - FT_UShort opcode_patterns = 9; - FT_UShort opcode_pointer[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - FT_UShort opcode_size[9] = { 12, 8, 8, 6, 7, 4, 5, 4, 2 }; - FT_UShort i; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - /* FDEF is only allowed in `prep' or `fpgm' */ if ( exc->iniRange == tt_coderange_glyph ) @@ -3748,136 +3544,15 @@ rec->opc = (FT_UInt16)n; rec->start = exc->IP + 1; rec->active = TRUE; - rec->inline_delta = FALSE; - rec->sph_fdef_flags = 0x0000; if ( n > exc->maxFunc ) exc->maxFunc = (FT_UInt16)n; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* We don't know for sure these are typeman functions, */ - /* however they are only active when RS 22 is called */ - if ( n >= 64 && n <= 66 ) - rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_STROKES; -#endif - /* Now skip the whole function definition. */ /* We don't allow nested IDEFS & FDEFs. */ while ( SkipCode( exc ) == SUCCESS ) { - -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - if ( SUBPIXEL_HINTING_INFINALITY ) - { - for ( i = 0; i < opcode_patterns; i++ ) - { - if ( opcode_pointer[i] < opcode_size[i] && - exc->opcode == opcode_pattern[i][opcode_pointer[i]] ) - { - opcode_pointer[i] += 1; - - if ( opcode_pointer[i] == opcode_size[i] ) - { - FT_TRACE6(( "sph: Function %d, opcode ptrn: %ld, %s %s\n", - i, n, - exc->face->root.family_name, - exc->face->root.style_name )); - - switch ( i ) - { - case 0: - rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_1; - exc->face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_1; - break; - - case 1: - rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_2; - exc->face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_2; - break; - - case 2: - switch ( n ) - { - /* needs to be implemented still */ - case 58: - rec->sph_fdef_flags |= SPH_FDEF_DIAGONAL_STROKE; - exc->face->sph_found_func_flags |= SPH_FDEF_DIAGONAL_STROKE; - } - break; - - case 3: - switch ( n ) - { - case 0: - rec->sph_fdef_flags |= SPH_FDEF_VACUFORM_ROUND_1; - exc->face->sph_found_func_flags |= SPH_FDEF_VACUFORM_ROUND_1; - } - break; - - case 4: - /* probably not necessary to detect anymore */ - rec->sph_fdef_flags |= SPH_FDEF_TTFAUTOHINT_1; - exc->face->sph_found_func_flags |= SPH_FDEF_TTFAUTOHINT_1; - break; - - case 5: - switch ( n ) - { - case 0: - case 1: - case 2: - case 4: - case 7: - case 8: - rec->sph_fdef_flags |= SPH_FDEF_SPACING_1; - exc->face->sph_found_func_flags |= SPH_FDEF_SPACING_1; - } - break; - - case 6: - switch ( n ) - { - case 0: - case 1: - case 2: - case 4: - case 7: - case 8: - rec->sph_fdef_flags |= SPH_FDEF_SPACING_2; - exc->face->sph_found_func_flags |= SPH_FDEF_SPACING_2; - } - break; - - case 7: - rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL; - exc->face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL; - break; - - case 8: -#if 0 - rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL; - exc->face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL; -#endif - break; - } - opcode_pointer[i] = 0; - } - } - - else - opcode_pointer[i] = 0; - } - - /* Set sph_compatibility_mode only when deltas are detected */ - exc->face->sph_compatibility_mode = - ( ( exc->face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) | - ( exc->face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ); - } - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - switch ( exc->opcode ) { case 0x89: /* IDEF */ @@ -3905,10 +3580,6 @@ TT_CallRec* pRec; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - exc->sph_in_func_flags = 0x0000; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - if ( exc->callTop <= 0 ) /* We encountered an ENDF without a call */ { exc->error = FT_THROW( ENDF_In_Exec_Stream ); @@ -3996,17 +3667,6 @@ if ( !def->active ) goto Fail; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - ( ( exc->iup_called && - ( exc->sph_tweak_flags & SPH_TWEAK_NO_CALL_AFTER_IUP ) ) || - ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) ) ) - goto Fail; - else - exc->sph_in_func_flags = def->sph_fdef_flags; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - /* check the call stack */ if ( exc->callTop >= exc->callSize ) { @@ -4084,15 +3744,6 @@ if ( !def->active ) goto Fail; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) ) - goto Fail; - else - exc->sph_in_func_flags = def->sph_fdef_flags; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - /* check stack */ if ( exc->callTop >= exc->callSize ) { @@ -4998,14 +4649,6 @@ } } -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* Disable Type 2 Vacuform Rounds - e.g. Arial Narrow */ - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - ( D < 0 ? NEG_LONG( D ) : D ) == 64 ) - D += 1; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - args[0] = D; } @@ -5267,13 +4910,6 @@ /* except to change the subpixel flags temporarily */ else if ( exc->iniRange == tt_coderange_glyph && K == 3 ) { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* INSTCTRL modifying flag 3 also has an effect */ - /* outside of the CVT program */ - if ( SUBPIXEL_HINTING_INFINALITY ) - exc->ignore_x_mode = !FT_BOOL( L == 4 ); -#endif - #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL /* Native ClearType fonts sign a waiver that turns off all backward */ /* compatibility hacks and lets them program points to the grid like */ @@ -5605,12 +5241,6 @@ } } else -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* doesn't follow Cleartype spec but produces better result */ - if ( SUBPIXEL_HINTING_INFINALITY && exc->ignore_x_mode ) - Move_Zp2_Point( exc, point, 0, dy, TRUE ); - else -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ Move_Zp2_Point( exc, point, dx, dy, TRUE ); exc->GS.loop--; @@ -5771,76 +5401,6 @@ } } else -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode ) - { - FT_Int B1, B2; - - - /* If not using ignore_x_mode rendering, allow ZP2 move. */ - /* If inline deltas aren't allowed, skip ZP2 move. */ - /* If using ignore_x_mode rendering, allow ZP2 point move if: */ - /* - freedom vector is y and sph_compatibility_mode is off */ - /* - the glyph is composite and the move is in the Y direction */ - /* - the glyph is specifically set to allow SHPIX moves */ - /* - the move is on a previously Y-touched point */ - - /* save point for later comparison */ - B1 = exc->zp2.cur[point].y; - - if ( exc->face->sph_compatibility_mode ) - { - if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) - dy = FT_PIX_ROUND( B1 + dy ) - B1; - - /* skip post-iup deltas */ - if ( exc->iup_called && - ( ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) || - ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) ) - goto Skip; - - if ( !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) && - ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) || - ( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) || - ( exc->sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) ) - Move_Zp2_Point( exc, point, 0, dy, TRUE ); - - /* save new point */ - if ( exc->GS.freeVector.y != 0 ) - { - B2 = exc->zp2.cur[point].y; - - /* reverse any disallowed moves */ - if ( ( B1 & 63 ) == 0 && - ( B2 & 63 ) != 0 && - B1 != B2 ) - Move_Zp2_Point( exc, point, 0, NEG_LONG( dy ), TRUE ); - } - } - else if ( exc->GS.freeVector.y != 0 ) - { - Move_Zp2_Point( exc, point, dx, dy, TRUE ); - - /* save new point */ - B2 = exc->zp2.cur[point].y; - - /* reverse any disallowed moves */ - if ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && - ( B1 & 63 ) != 0 && - ( B2 & 63 ) != 0 && - B1 != B2 ) - Move_Zp2_Point( exc, - point, - NEG_LONG( dx ), - NEG_LONG( dy ), - TRUE ); - } - else if ( exc->sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL ) - Move_Zp2_Point( exc, point, dx, dy, TRUE ); - } - else -#endif #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL if ( SUBPIXEL_HINTING_MINIMAL && exc->backward_compatibility ) @@ -5860,9 +5420,6 @@ #endif Move_Zp2_Point( exc, point, dx, dy, TRUE ); -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - Skip: -#endif exc->GS.loop--; } @@ -5907,28 +5464,6 @@ distance = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 ); -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* subpixel hinting - make MSIRP respect CVT cut-in; */ - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 ) - { - FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin; - FT_F26Dot6 delta; - - - if ( !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - control_value_cutin = 0; - - delta = SUB_LONG( distance, args[1] ); - if ( delta < 0 ) - delta = NEG_LONG( delta ); - - if ( delta >= control_value_cutin ) - distance = args[1]; - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - exc->func_move( exc, &exc->zp1, point, @@ -5969,14 +5504,7 @@ if ( ( exc->opcode & 1 ) != 0 ) { cur_dist = FAST_PROJECT( &exc->zp0.cur[point] ); -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 ) - distance = SUB_LONG( Round_None( exc, cur_dist, 3 ), cur_dist ); - else -#endif - distance = SUB_LONG( exc->func_round( exc, cur_dist, 3 ), cur_dist ); + distance = SUB_LONG( exc->func_round( exc, cur_dist, 3 ), cur_dist ); } else distance = 0; @@ -6039,27 +5567,12 @@ if ( exc->GS.gep0 == 0 ) /* If in twilight zone */ { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* Only adjust if not in sph_compatibility_mode or ignore_x_mode. */ - /* Determined via experimentation and may be incorrect... */ - if ( !( SUBPIXEL_HINTING_INFINALITY && - ( exc->ignore_x_mode && - exc->face->sph_compatibility_mode ) ) ) -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - exc->zp0.org[point].x = TT_MulFix14( distance, + exc->zp0.org[point].x = TT_MulFix14( distance, exc->GS.freeVector.x ); exc->zp0.org[point].y = TT_MulFix14( distance, exc->GS.freeVector.y ); exc->zp0.cur[point] = exc->zp0.org[point]; } -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - ( exc->sph_tweak_flags & SPH_TWEAK_MIAP_HACK ) && - distance > 0 && - exc->GS.freeVector.y != 0 ) - distance = 0; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ org_dist = FAST_PROJECT( &exc->zp0.cur[point] ); @@ -6069,15 +5582,6 @@ FT_F26Dot6 delta; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - exc->GS.freeVector.y == 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - control_value_cutin = 0; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - delta = SUB_LONG( distance, org_dist ); if ( delta < 0 ) delta = NEG_LONG( delta ); @@ -6085,14 +5589,7 @@ if ( delta > control_value_cutin ) distance = org_dist; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 ) - distance = Round_None( exc, distance, 3 ); - else -#endif - distance = exc->func_round( exc, distance, 3 ); + distance = exc->func_round( exc, distance, 3 ); } exc->func_move( exc, &exc->zp0, point, SUB_LONG( distance, org_dist ) ); @@ -6185,14 +5682,7 @@ if ( ( exc->opcode & 4 ) != 0 ) { -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 ) - distance = Round_None( exc, org_dist, exc->opcode & 3 ); - else -#endif - distance = exc->func_round( exc, org_dist, exc->opcode & 3 ); + distance = exc->func_round( exc, org_dist, exc->opcode & 3 ); } else distance = Round_None( exc, org_dist, exc->opcode & 3 ); @@ -6204,14 +5694,6 @@ FT_F26Dot6 minimum_distance = exc->GS.minimum_distance; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - minimum_distance = 0; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - if ( org_dist >= 0 ) { if ( distance < minimum_distance ) @@ -6354,41 +5836,7 @@ distance = exc->func_round( exc, cvt_dist, exc->opcode & 3 ); } else - { - -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /* do cvt cut-in always in MIRP for sph */ - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.gep0 == exc->GS.gep1 ) - { - FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin; - - - if ( exc->GS.freeVector.x != 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - control_value_cutin = 0; - - if ( exc->GS.freeVector.y != 0 && - ( exc->sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) ) - { - if ( cur_dist < -64 ) - cvt_dist -= 16; - else if ( cur_dist > 64 && cur_dist < 84 ) - cvt_dist += 32; - } - - delta = SUB_LONG( cvt_dist, org_dist ); - if ( delta < 0 ) - delta = NEG_LONG( delta ); - - if ( delta > control_value_cutin ) - cvt_dist = org_dist; - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - distance = Round_None( exc, cvt_dist, exc->opcode & 3 ); - } /* minimum distance test */ @@ -6397,14 +5845,6 @@ FT_F26Dot6 minimum_distance = exc->GS.minimum_distance; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - minimum_distance = 0; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - if ( org_dist >= 0 ) { if ( distance < minimum_distance ) @@ -6417,51 +5857,10 @@ } } -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.y != 0 ) - { - FT_Int B1, B2; - - - B1 = exc->zp1.cur[point].y; - - /* Round moves if necessary */ - if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) - distance = FT_PIX_ROUND( B1 + distance - cur_dist ) - B1 + cur_dist; - - if ( ( exc->opcode & 16 ) == 0 && - ( exc->opcode & 8 ) == 0 && - ( exc->sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) ) - distance += 64; - - exc->func_move( exc, - &exc->zp1, - point, - SUB_LONG( distance, cur_dist ) ); - - B2 = exc->zp1.cur[point].y; - - /* Reverse move if necessary */ - if ( ( exc->face->sph_compatibility_mode && - ( B1 & 63 ) == 0 && - ( B2 & 63 ) != 0 ) || - ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && - ( B1 & 63 ) != 0 && - ( B2 & 63 ) != 0 ) ) - exc->func_move( exc, - &exc->zp1, - point, - SUB_LONG( cur_dist, distance ) ); - } - else -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - - exc->func_move( exc, - &exc->zp1, - point, - SUB_LONG( distance, cur_dist ) ); + exc->func_move( exc, + &exc->zp1, + point, + SUB_LONG( distance, cur_dist ) ); Fail: exc->GS.rp1 = exc->GS.rp0; @@ -6486,17 +5885,6 @@ FT_F26Dot6 distance; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->iup_called && - ( exc->sph_tweak_flags & SPH_TWEAK_NO_ALIGNRP_AFTER_IUP ) ) - { - exc->error = FT_THROW( Invalid_Reference ); - goto Fail; - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - if ( exc->top < exc->GS.loop || BOUNDS( exc->GS.rp0, exc->zp0.n_points ) ) { @@ -7055,16 +6443,6 @@ contour = 0; point = 0; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode ) - { - exc->iup_called = TRUE; - if ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_IUP ) - return; - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - do { end_point = exc->pts.contours[contour] - exc->pts.first_point; @@ -7137,14 +6515,6 @@ FT_Long B; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->iup_called && - ( exc->sph_tweak_flags & SPH_TWEAK_NO_DELTAP_AFTER_IUP ) ) - goto Fail; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - P = (FT_ULong)exc->func_cur_ppem( exc ); nump = (FT_ULong)args[0]; /* some points theoretically may occur more than once, thus UShort isn't enough */ @@ -7197,87 +6567,21 @@ B++; B *= 1L << ( 6 - exc->GS.delta_shift ); -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY ) +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL + /* See `ttinterp.h' for details on backward compatibility */ + /* mode. */ + if ( SUBPIXEL_HINTING_MINIMAL && + exc->backward_compatibility ) { - /* - * Allow delta move if - * - * - not using ignore_x_mode rendering, - * - glyph is specifically set to allow it, or - * - glyph is composite and freedom vector is not in subpixel - * direction. - */ - if ( !exc->ignore_x_mode || - ( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) || - ( exc->is_composite && exc->GS.freeVector.y != 0 ) ) + if ( !( exc->iupx_called && exc->iupy_called ) && + ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) || + ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) ) exc->func_move( exc, &exc->zp0, A, B ); - - /* Otherwise, apply subpixel hinting and compatibility mode */ - /* rules, always skipping deltas in subpixel direction. */ - else if ( exc->ignore_x_mode && exc->GS.freeVector.y != 0 ) - { - FT_UShort B1, B2; - - - /* save the y value of the point now; compare after move */ - B1 = (FT_UShort)exc->zp0.cur[A].y; - - /* Standard subpixel hinting: Allow y move for y-touched */ - /* points. This messes up DejaVu ... */ - if ( !exc->face->sph_compatibility_mode && - ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) - exc->func_move( exc, &exc->zp0, A, B ); - - /* compatibility mode */ - else if ( exc->face->sph_compatibility_mode && - !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) ) - { - if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) - B = FT_PIX_ROUND( B1 + B ) - B1; - - /* Allow delta move if using sph_compatibility_mode, */ - /* IUP has not been called, and point is touched on Y. */ - if ( !exc->iup_called && - ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) - exc->func_move( exc, &exc->zp0, A, B ); - } - - B2 = (FT_UShort)exc->zp0.cur[A].y; - - /* Reverse this move if it results in a disallowed move */ - if ( exc->GS.freeVector.y != 0 && - ( ( exc->face->sph_compatibility_mode && - ( B1 & 63 ) == 0 && - ( B2 & 63 ) != 0 ) || - ( ( exc->sph_tweak_flags & - SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP ) && - ( B1 & 63 ) != 0 && - ( B2 & 63 ) != 0 ) ) ) - exc->func_move( exc, &exc->zp0, A, NEG_LONG( B ) ); - } } else -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - - { - -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - /* See `ttinterp.h' for details on backward compatibility */ - /* mode. */ - if ( SUBPIXEL_HINTING_MINIMAL && - exc->backward_compatibility ) - { - if ( !( exc->iupx_called && exc->iupy_called ) && - ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) || - ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) ) - exc->func_move( exc, &exc->zp0, A, B ); - } - else #endif - exc->func_move( exc, &exc->zp0, A, B ); - } + exc->func_move( exc, &exc->zp0, A, B ); } } else @@ -7380,14 +6684,6 @@ * GETINFO[]: GET INFOrmation * Opcode range: 0x88 * Stack: uint32 --> uint32 - * - * XXX: UNDOCUMENTED: Selector bits higher than 9 are currently (May - * 2015) not documented in the OpenType specification. - * - * Selector bit 11 is incorrectly described as bit 8, while the - * real meaning of bit 8 (vertical LCD subpixels) stays - * undocumented. The same mistake can be found in Greg Hitchcock's - * whitepaper. */ static void Ins_GETINFO( TT_ExecContext exc, @@ -7399,31 +6695,8 @@ K = 0; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - /********************************* - * RASTERIZER VERSION - * Selector Bit: 0 - * Return Bit(s): 0-7 - */ - if ( SUBPIXEL_HINTING_INFINALITY && - ( args[0] & 1 ) != 0 && - exc->subpixel_hinting ) - { - if ( exc->ignore_x_mode ) - { - /* if in ClearType backward compatibility mode, */ - /* we sometimes change the TrueType version dynamically */ - K = exc->rasterizer_version; - FT_TRACE6(( "Setting rasterizer version %d\n", - exc->rasterizer_version )); - } - else - K = TT_INTERPRETER_VERSION_38; - } - else -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - if ( ( args[0] & 1 ) != 0 ) - K = driver->interpreter_version; + if ( ( args[0] & 1 ) != 0 ) + K = driver->interpreter_version; /********************************* * GLYPH ROTATED @@ -7446,8 +6719,6 @@ * VARIATION GLYPH * Selector Bit: 3 * Return Bit(s): 10 - * - * XXX: UNDOCUMENTED! */ if ( (args[0] & 8 ) != 0 && exc->face->blend ) K |= 1 << 10; @@ -7522,89 +6793,6 @@ } #endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - if ( SUBPIXEL_HINTING_INFINALITY && - exc->rasterizer_version >= TT_INTERPRETER_VERSION_35 ) - { - - if ( exc->rasterizer_version >= 37 ) - { - /********************************* - * HINTING FOR SUBPIXEL - * Selector Bit: 6 - * Return Bit(s): 13 - */ - if ( ( args[0] & 64 ) != 0 && exc->subpixel_hinting ) - K |= 1 << 13; - - /********************************* - * COMPATIBLE WIDTHS ENABLED - * Selector Bit: 7 - * Return Bit(s): 14 - * - * Functionality still needs to be added - */ - if ( ( args[0] & 128 ) != 0 && exc->compatible_widths ) - K |= 1 << 14; - - /********************************* - * VERTICAL LCD SUBPIXELS? - * Selector Bit: 8 - * Return Bit(s): 15 - * - * Functionality still needs to be added - */ - if ( ( args[0] & 256 ) != 0 && exc->vertical_lcd ) - K |= 1 << 15; - - /********************************* - * HINTING FOR BGR? - * Selector Bit: 9 - * Return Bit(s): 16 - * - * Functionality still needs to be added - */ - if ( ( args[0] & 512 ) != 0 && exc->bgr ) - K |= 1 << 16; - - if ( exc->rasterizer_version >= 38 ) - { - /********************************* - * SUBPIXEL POSITIONED? - * Selector Bit: 10 - * Return Bit(s): 17 - * - * Functionality still needs to be added - */ - if ( ( args[0] & 1024 ) != 0 && exc->subpixel_positioned ) - K |= 1 << 17; - - /********************************* - * SYMMETRICAL SMOOTHING - * Selector Bit: 11 - * Return Bit(s): 18 - * - * Functionality still needs to be added - */ - if ( ( args[0] & 2048 ) != 0 && exc->symmetrical_smoothing ) - K |= 1 << 18; - - /********************************* - * GRAY CLEARTYPE - * Selector Bit: 12 - * Return Bit(s): 19 - * - * Functionality still needs to be added - */ - if ( ( args[0] & 4096 ) != 0 && exc->gray_cleartype ) - K |= 1 << 19; - } - } - } - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - args[0] = K; } @@ -7739,25 +6927,14 @@ /* documentation is in ttinterp.h */ FT_EXPORT_DEF( FT_Error ) - TT_RunIns( TT_ExecContext exc ) + TT_RunIns( void* exec ) { + TT_ExecContext exc = (TT_ExecContext)exec; + FT_ULong ins_counter = 0; /* executed instructions counter */ FT_ULong num_twilight_points; FT_UShort i; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - FT_Byte opcode_pattern[1][2] = { - /* #8 TypeMan Talk Align */ - { - 0x06, /* SPVTL */ - 0x7D, /* RDTG */ - }, - }; - FT_UShort opcode_patterns = 1; - FT_UShort opcode_pointer[1] = { 0 }; - FT_UShort opcode_size[1] = { 1 }; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - /* We restrict the number of twilight points to a reasonable, */ /* heuristic value to avoid slow execution of malformed bytecode. */ @@ -7835,9 +7012,6 @@ Compute_Round( exc, (FT_Byte)exc->GS.round_state ); /* These flags cancel execution of some opcodes after IUP is called */ -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - exc->iup_called = FALSE; -#endif #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL exc->iupx_called = FALSE; exc->iupy_called = FALSE; @@ -7906,7 +7080,7 @@ /* a variable number of arguments */ /* it is the job of the application to `activate' GX handling, */ - /* this is, calling any of the GX API functions on the current */ + /* that is, calling any of the GX API functions on the current */ /* font to select a variation instance */ if ( exc->face->blend ) exc->new_top = exc->args + exc->face->blend->num_axis; @@ -7927,39 +7101,6 @@ exc->step_ins = TRUE; exc->error = FT_Err_Ok; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - if ( SUBPIXEL_HINTING_INFINALITY ) - { - for ( i = 0; i < opcode_patterns; i++ ) - { - if ( opcode_pointer[i] < opcode_size[i] && - exc->opcode == opcode_pattern[i][opcode_pointer[i]] ) - { - opcode_pointer[i] += 1; - - if ( opcode_pointer[i] == opcode_size[i] ) - { - FT_TRACE6(( "sph: opcode ptrn: %d, %s %s\n", - i, - exc->face->root.family_name, - exc->face->root.style_name )); - - switch ( i ) - { - case 0: - break; - } - opcode_pointer[i] = 0; - } - } - else - opcode_pointer[i] = 0; - } - } - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - { FT_Long* args = exc->stack + exc->args; FT_Byte opcode = exc->opcode; @@ -8466,7 +7607,7 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT case 0x91: /* it is the job of the application to `activate' GX handling, */ - /* this is, calling any of the GX API functions on the current */ + /* that is, calling any of the GX API functions on the current */ /* font to select a variation instance */ if ( exc->face->blend ) Ins_GETVARIATION( exc, args ); @@ -8604,7 +7745,7 @@ #else /* !TT_USE_BYTECODE_INTERPRETER */ /* ANSI C doesn't like empty source files */ - typedef int _tt_interp_dummy; + typedef int tt_interp_dummy_; #endif /* !TT_USE_BYTECODE_INTERPRETER */ diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.h b/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.h index c54c053b29e..e98e258fe7e 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.h +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.h @@ -98,48 +98,6 @@ FT_BEGIN_HEADER } TT_CallRec, *TT_CallStack; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - /************************************************************************** - * - * These structures define rules used to tweak subpixel hinting for - * various fonts. "", 0, "", NULL value indicates to match any value. - */ - -#define SPH_MAX_NAME_SIZE 32 -#define SPH_MAX_CLASS_MEMBERS 100 - - typedef struct SPH_TweakRule_ - { - const char family[SPH_MAX_NAME_SIZE]; - const FT_UInt ppem; - const char style[SPH_MAX_NAME_SIZE]; - const FT_ULong glyph; - - } SPH_TweakRule; - - - typedef struct SPH_ScaleRule_ - { - const char family[SPH_MAX_NAME_SIZE]; - const FT_UInt ppem; - const char style[SPH_MAX_NAME_SIZE]; - const FT_ULong glyph; - const FT_ULong scale; - - } SPH_ScaleRule; - - - typedef struct SPH_Font_Class_ - { - const char name[SPH_MAX_NAME_SIZE]; - const char member[SPH_MAX_CLASS_MEMBERS][SPH_MAX_NAME_SIZE]; - - } SPH_Font_Class; - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - - /************************************************************************** * * The main structure for the interpreter which collects all necessary @@ -399,38 +357,6 @@ FT_BEGIN_HEADER FT_Bool grayscale_cleartype; #endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */ -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - TT_Round_Func func_round_sphn; /* subpixel rounding function */ - - FT_Bool subpixel_hinting; /* Using subpixel hinting? */ - FT_Bool ignore_x_mode; /* Standard rendering mode for */ - /* subpixel hinting. On if gray */ - /* or subpixel hinting is on. */ - - /* The following 6 aren't fully implemented but here for MS rasterizer */ - /* compatibility. */ - FT_Bool compatible_widths; /* compatible widths? */ - FT_Bool symmetrical_smoothing; /* symmetrical_smoothing? */ - FT_Bool bgr; /* bgr instead of rgb? */ - FT_Bool vertical_lcd; /* long side of LCD subpixel */ - /* rectangles is horizontal */ - FT_Bool subpixel_positioned; /* subpixel positioned */ - /* (DirectWrite ClearType)? */ - FT_Bool gray_cleartype; /* ClearType hinting but */ - /* grayscale rendering */ - - FT_Int rasterizer_version; /* MS rasterizer version */ - - FT_Bool iup_called; /* IUP called for glyph? */ - - FT_ULong sph_tweak_flags; /* flags to control */ - /* hint tweaks */ - - FT_ULong sph_in_func_flags; /* flags to indicate if in */ - /* special functions */ - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - /* We maintain two counters (in addition to the instruction counter) */ /* that act as loop detectors for LOOPCALL and jump opcodes with */ /* negative arguments. */ @@ -460,14 +386,6 @@ FT_BEGIN_HEADER FT_LOCAL( void ) TT_Clear_CodeRange( TT_ExecContext exec, FT_Int range ); - - - FT_LOCAL( FT_Error ) - Update_Max( FT_Memory memory, - FT_ULong* size, - FT_ULong multiplier, - void* _pbuff, - FT_ULong new_max ); #endif /* TT_USE_BYTECODE_INTERPRETER */ @@ -536,7 +454,7 @@ FT_BEGIN_HEADER * invoked by the TrueType debugger. */ FT_EXPORT( FT_Error ) - TT_RunIns( TT_ExecContext exec ); + TT_RunIns( void* exec ); FT_END_HEADER diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c b/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c index 4a8873fd8c8..5b56af711df 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c @@ -312,7 +312,8 @@ #define TRICK_SFNT_IDS_NUM_FACES 31 static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES] - [TRICK_SFNT_IDS_PER_FACE] = { + [TRICK_SFNT_IDS_PER_FACE] = + { #define TRICK_SFNT_ID_cvt 0 #define TRICK_SFNT_ID_fpgm 1 @@ -581,7 +582,7 @@ FT_Bool result = FALSE; TT_Face face = (TT_Face)ttface; - FT_UInt asize; + FT_ULong asize; FT_ULong i; FT_ULong glyph_index = 0; FT_UInt count = 0; @@ -589,7 +590,7 @@ for( i = 0; i < face->num_locations; i++ ) { - tt_face_get_location( face, i, &asize ); + tt_face_get_location( ttface, i, &asize ); if ( asize > 0 ) { count += 1; @@ -777,7 +778,6 @@ } #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - { FT_UInt instance_index = (FT_UInt)face_index >> 16; @@ -785,14 +785,11 @@ if ( FT_HAS_MULTIPLE_MASTERS( ttface ) && instance_index > 0 ) { - error = TT_Set_Named_Instance( face, instance_index ); + error = FT_Set_Named_Instance( ttface, instance_index ); if ( error ) goto Exit; - - tt_apply_mvar( face ); } } - #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ /* initialize standard glyph loading routines */ @@ -858,7 +855,7 @@ face->cvt_program_size = 0; #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - tt_done_blend( face ); + tt_done_blend( ttface ); face->blend = NULL; #endif } @@ -1338,39 +1335,29 @@ /************************************************************************** * * @Function: - * tt_size_reset + * tt_size_reset_height * * @Description: - * Reset a TrueType size when resolutions and character dimensions - * have been changed. + * Recompute a TrueType size's ascender, descender, and height + * when resolutions and character dimensions have been changed. + * Used for variation fonts as an iterator function. * * @Input: - * size :: - * A handle to the target size object. - * - * only_height :: - * Only recompute ascender, descender, and height; - * this flag is used for variation fonts where - * `tt_size_reset' is used as an iterator function. + * ft_size :: + * A handle to the target TT_Size object. This function will be called + * through a `FT_Size_Reset_Func` pointer which takes `FT_Size`. This + * function must take `FT_Size` as a result. The passed `FT_Size` is + * expected to point to a `TT_Size`. */ FT_LOCAL_DEF( FT_Error ) - tt_size_reset( TT_Size size, - FT_Bool only_height ) + tt_size_reset_height( FT_Size ft_size ) { - TT_Face face; - FT_Size_Metrics* size_metrics; - - - face = (TT_Face)size->root.face; - - /* nothing to do for CFF2 */ - if ( face->is_cff2 ) - return FT_Err_Ok; + TT_Size size = (TT_Size)ft_size; + TT_Face face = (TT_Face)size->root.face; + FT_Size_Metrics* size_metrics = &size->hinted_metrics; size->ttmetrics.valid = FALSE; - size_metrics = &size->hinted_metrics; - /* copy the result from base layer */ *size_metrics = size->root.metrics; @@ -1397,12 +1384,34 @@ size->ttmetrics.valid = TRUE; - if ( only_height ) - { - /* we must not recompute the scaling values here since */ - /* `tt_size_reset' was already called (with only_height = 0) */ - return FT_Err_Ok; - } + return FT_Err_Ok; + } + + + /************************************************************************** + * + * @Function: + * tt_size_reset + * + * @Description: + * Reset a TrueType size when resolutions and character dimensions + * have been changed. + * + * @Input: + * size :: + * A handle to the target size object. + */ + FT_LOCAL_DEF( FT_Error ) + tt_size_reset( TT_Size size ) + { + FT_Error error; + TT_Face face = (TT_Face)size->root.face; + FT_Size_Metrics* size_metrics = &size->hinted_metrics; + + + error = tt_size_reset_height( (FT_Size)size ); + if ( error ) + return error; if ( face->header.Flags & 8 ) { @@ -1472,9 +1481,6 @@ TT_Driver driver = (TT_Driver)ttdriver; driver->interpreter_version = TT_INTERPRETER_VERSION_35; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - driver->interpreter_version = TT_INTERPRETER_VERSION_38; -#endif #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL driver->interpreter_version = TT_INTERPRETER_VERSION_40; #endif diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.h b/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.h index bc6fbe7f196..40eb37b4c43 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.h +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.h @@ -162,8 +162,6 @@ FT_BEGIN_HEADER FT_Long end; /* where does it end? */ FT_UInt opc; /* function #, or instruction code */ FT_Bool active; /* is it active? */ - FT_Bool inline_delta; /* is function that defines inline delta? */ - FT_ULong sph_fdef_flags; /* flags to identify special functions */ } TT_DefRecord, *TT_DefArray; @@ -391,8 +389,10 @@ FT_BEGIN_HEADER #endif /* TT_USE_BYTECODE_INTERPRETER */ FT_LOCAL( FT_Error ) - tt_size_reset( TT_Size size, - FT_Bool only_height ); + tt_size_reset_height( FT_Size size ); + + FT_LOCAL( FT_Error ) + tt_size_reset( TT_Size size ); /************************************************************************** diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.c b/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.c index e08bf309e3c..54a64c7b462 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.c +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.c @@ -180,10 +180,11 @@ FT_LOCAL_DEF( FT_ULong ) - tt_face_get_location( TT_Face face, - FT_UInt gindex, - FT_UInt *asize ) + tt_face_get_location( FT_Face face, /* TT_Face */ + FT_UInt gindex, + FT_ULong *asize ) { + TT_Face ttface = (TT_Face)face; FT_ULong pos1, pos2; FT_Byte* p; FT_Byte* p_limit; @@ -191,12 +192,12 @@ pos1 = pos2 = 0; - if ( gindex < face->num_locations ) + if ( gindex < ttface->num_locations ) { - if ( face->header.Index_To_Loc_Format != 0 ) + if ( ttface->header.Index_To_Loc_Format != 0 ) { - p = face->glyph_locations + gindex * 4; - p_limit = face->glyph_locations + face->num_locations * 4; + p = ttface->glyph_locations + gindex * 4; + p_limit = ttface->glyph_locations + ttface->num_locations * 4; pos1 = FT_NEXT_ULONG( p ); pos2 = pos1; @@ -206,8 +207,8 @@ } else { - p = face->glyph_locations + gindex * 2; - p_limit = face->glyph_locations + face->num_locations * 2; + p = ttface->glyph_locations + gindex * 2; + p_limit = ttface->glyph_locations + ttface->num_locations * 2; pos1 = FT_NEXT_USHORT( p ); pos2 = pos1; @@ -221,30 +222,30 @@ } /* Check broken location data. */ - if ( pos1 > face->glyf_len ) + if ( pos1 > ttface->glyf_len ) { FT_TRACE1(( "tt_face_get_location:" " too large offset (0x%08lx) found for glyph index %d,\n", pos1, gindex )); FT_TRACE1(( " " " exceeding the end of `glyf' table (0x%08lx)\n", - face->glyf_len )); + ttface->glyf_len )); *asize = 0; return 0; } - if ( pos2 > face->glyf_len ) + if ( pos2 > ttface->glyf_len ) { /* We try to sanitize the last `loca' entry. */ - if ( gindex == face->num_locations - 2 ) + if ( gindex == ttface->num_locations - 2 ) { FT_TRACE1(( "tt_face_get_location:" " too large size (%ld bytes) found for glyph index %d,\n", pos2 - pos1, gindex )); FT_TRACE1(( " " " truncating at the end of `glyf' table to %ld bytes\n", - face->glyf_len - pos1 )); - pos2 = face->glyf_len; + ttface->glyf_len - pos1 )); + pos2 = ttface->glyf_len; } else { @@ -253,7 +254,7 @@ pos2, gindex + 1 )); FT_TRACE1(( " " " exceeding the end of `glyf' table (0x%08lx)\n", - face->glyf_len )); + ttface->glyf_len )); *asize = 0; return 0; } @@ -268,9 +269,9 @@ /* We get (intentionally) a wrong, non-zero result in case the */ /* `glyf' table is missing. */ if ( pos2 >= pos1 ) - *asize = (FT_UInt)( pos2 - pos1 ); + *asize = (FT_ULong)( pos2 - pos1 ); else - *asize = (FT_UInt)( face->glyf_len - pos1 ); + *asize = (FT_ULong)( ttface->glyf_len - pos1 ); return pos1; } diff --git a/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.h b/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.h index 939e02fe4f1..ed229fa4616 100644 --- a/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.h +++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttpload.h @@ -31,9 +31,9 @@ FT_BEGIN_HEADER FT_Stream stream ); FT_LOCAL( FT_ULong ) - tt_face_get_location( TT_Face face, - FT_UInt gindex, - FT_UInt *asize ); + tt_face_get_location( FT_Face face, + FT_UInt gindex, + FT_ULong *asize ); FT_LOCAL( void ) tt_face_done_loca( TT_Face face ); diff --git a/src/java.desktop/share/native/libfreetype/src/type1/t1afm.c b/src/java.desktop/share/native/libfreetype/src/type1/t1afm.c index 608582c9a57..d9b9398b013 100644 --- a/src/java.desktop/share/native/libfreetype/src/type1/t1afm.c +++ b/src/java.desktop/share/native/libfreetype/src/type1/t1afm.c @@ -405,7 +405,7 @@ #else /* T1_CONFIG_OPTION_NO_AFM */ /* ANSI C doesn't like empty source files */ - typedef int _t1_afm_dummy; + typedef int t1_afm_dummy_; #endif /* T1_CONFIG_OPTION_NO_AFM */ diff --git a/src/java.desktop/share/native/libfreetype/src/type1/t1driver.c b/src/java.desktop/share/native/libfreetype/src/type1/t1driver.c index ded3b264e85..a4cdf372a9e 100644 --- a/src/java.desktop/share/native/libfreetype/src/type1/t1driver.c +++ b/src/java.desktop/share/native/libfreetype/src/type1/t1driver.c @@ -56,28 +56,32 @@ * */ - static FT_Error - t1_get_glyph_name( T1_Face face, + FT_CALLBACK_DEF( FT_Error ) + t1_get_glyph_name( FT_Face face, /* T1_Face */ FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ) { - FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max ); + T1_Face t1face = (T1_Face)face; + + + FT_STRCPYN( buffer, t1face->type1.glyph_names[glyph_index], buffer_max ); return FT_Err_Ok; } - static FT_UInt - t1_get_name_index( T1_Face face, + FT_CALLBACK_DEF( FT_UInt ) + t1_get_name_index( FT_Face face, /* T1_Face */ const FT_String* glyph_name ) { - FT_Int i; + T1_Face t1face = (T1_Face)face; + FT_Int i; - for ( i = 0; i < face->type1.num_glyphs; i++ ) + for ( i = 0; i < t1face->type1.num_glyphs; i++ ) { - FT_String* gname = face->type1.glyph_names[i]; + FT_String* gname = t1face->type1.glyph_names[i]; if ( !ft_strcmp( glyph_name, gname ) ) @@ -90,8 +94,8 @@ static const FT_Service_GlyphDictRec t1_service_glyph_dict = { - (FT_GlyphDict_GetNameFunc) t1_get_glyph_name, /* get_name */ - (FT_GlyphDict_NameIndexFunc)t1_get_name_index /* name_index */ + t1_get_glyph_name, /* FT_GlyphDict_GetNameFunc get_name */ + t1_get_name_index /* FT_GlyphDict_NameIndexFunc name_index */ }; @@ -101,9 +105,12 @@ */ static const char* - t1_get_ps_name( T1_Face face ) + t1_get_ps_name( FT_Face face ) /* T1_Face */ { - return (const char*) face->type1.font_name; + T1_Face t1face = (T1_Face)face; + + + return (const char*) t1face->type1.font_name; } @@ -121,30 +128,28 @@ #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT static const FT_Service_MultiMastersRec t1_service_multi_masters = { - (FT_Get_MM_Func) T1_Get_Multi_Master, /* get_mm */ - (FT_Set_MM_Design_Func) T1_Set_MM_Design, /* set_mm_design */ - (FT_Set_MM_Blend_Func) T1_Set_MM_Blend, /* set_mm_blend */ - (FT_Get_MM_Blend_Func) T1_Get_MM_Blend, /* get_mm_blend */ - (FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */ - (FT_Set_Var_Design_Func)T1_Set_Var_Design, /* set_var_design */ - (FT_Get_Var_Design_Func)T1_Get_Var_Design, /* get_var_design */ - (FT_Set_Instance_Func) T1_Reset_MM_Blend, /* set_instance */ - (FT_Set_MM_WeightVector_Func) - T1_Set_MM_WeightVector, /* set_mm_weightvector */ - (FT_Get_MM_WeightVector_Func) - T1_Get_MM_WeightVector, /* get_mm_weightvector */ - (FT_Var_Load_Delta_Set_Idx_Map_Func) - NULL, /* load_delta_set_idx_map */ - (FT_Var_Load_Item_Var_Store_Func) - NULL, /* load_item_variation_store */ - (FT_Var_Get_Item_Delta_Func) - NULL, /* get_item_delta */ - (FT_Var_Done_Item_Var_Store_Func) - NULL, /* done_item_variation_store */ - (FT_Var_Done_Delta_Set_Idx_Map_Func) - NULL, /* done_delta_set_index_map */ - (FT_Get_Var_Blend_Func) NULL, /* get_var_blend */ - (FT_Done_Blend_Func) T1_Done_Blend /* done_blend */ + T1_Get_Multi_Master, /* FT_Get_MM_Func get_mm */ + T1_Set_MM_Design, /* FT_Set_MM_Design_Func set_mm_design */ + T1_Set_MM_Blend, /* FT_Set_MM_Blend_Func set_mm_blend */ + T1_Get_MM_Blend, /* FT_Get_MM_Blend_Func get_mm_blend */ + T1_Get_MM_Var, /* FT_Get_MM_Var_Func get_mm_var */ + T1_Set_Var_Design, /* FT_Set_Var_Design_Func set_var_design */ + T1_Get_Var_Design, /* FT_Get_Var_Design_Func get_var_design */ + T1_Reset_MM_Blend, /* FT_Set_Named_Instance_Func set_named_instance */ + NULL, /* FT_Get_Default_Named_Instance_Func get_default_named_instance */ + T1_Set_MM_WeightVector, + /* FT_Set_MM_WeightVector_Func set_mm_weightvector */ + T1_Get_MM_WeightVector, + /* FT_Get_MM_WeightVector_Func get_mm_weightvector */ + + NULL, /* FT_Construct_PS_Name_Func construct_ps_name */ + NULL, /* FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map */ + NULL, /* FT_Var_Load_Item_Var_Store_Func load_item_variation_store */ + NULL, /* FT_Var_Get_Item_Delta_Func get_item_delta */ + NULL, /* FT_Var_Done_Item_Var_Store_Func done_item_variation_store */ + NULL, /* FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_index_map */ + NULL, /* FT_Get_Var_Blend_Func get_var_blend */ + T1_Done_Blend /* FT_Done_Blend_Func done_blend */ }; #endif @@ -632,11 +637,11 @@ static const FT_Service_PsInfoRec t1_service_ps_info = { - (PS_GetFontInfoFunc) t1_ps_get_font_info, /* ps_get_font_info */ - (PS_GetFontExtraFunc) t1_ps_get_font_extra, /* ps_get_font_extra */ - (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names, /* ps_has_glyph_names */ - (PS_GetFontPrivateFunc)t1_ps_get_font_private, /* ps_get_font_private */ - (PS_GetFontValueFunc) t1_ps_get_font_value, /* ps_get_font_value */ + t1_ps_get_font_info, /* PS_GetFontInfoFunc ps_get_font_info */ + t1_ps_get_font_extra, /* PS_GetFontExtraFunc ps_get_font_extra */ + t1_ps_has_glyph_names, /* PS_HasGlyphNamesFunc ps_has_glyph_names */ + t1_ps_get_font_private, /* PS_GetFontPrivateFunc ps_get_font_private */ + t1_ps_get_font_value, /* PS_GetFontValueFunc ps_get_font_value */ }; @@ -656,9 +661,9 @@ FT_DEFINE_SERVICE_PROPERTIESREC( t1_service_properties, - (FT_Properties_SetFunc)ps_property_set, /* set_property */ - (FT_Properties_GetFunc)ps_property_get ) /* get_property */ - + ps_property_set, /* FT_Properties_SetFunc set_property */ + ps_property_get /* FT_Properties_GetFunc get_property */ + ) /* * SERVICE LIST diff --git a/src/java.desktop/share/native/libfreetype/src/type1/t1load.c b/src/java.desktop/share/native/libfreetype/src/type1/t1load.c index 5a1afd8d9f5..be7cd0fd5e9 100644 --- a/src/java.desktop/share/native/libfreetype/src/type1/t1load.c +++ b/src/java.desktop/share/native/libfreetype/src/type1/t1load.c @@ -73,7 +73,8 @@ #ifdef FT_CONFIG_OPTION_INCREMENTAL -#define IS_INCREMENTAL FT_BOOL( face->root.internal->incremental_interface ) +#define IS_INCREMENTAL \ + FT_BOOL( FT_FACE( face )->internal->incremental_interface ) #else #define IS_INCREMENTAL 0 #endif @@ -174,10 +175,11 @@ FT_LOCAL_DEF( FT_Error ) - T1_Get_Multi_Master( T1_Face face, + T1_Get_Multi_Master( FT_Face face, /* T1_Face */ FT_Multi_Master* master ) { - PS_Blend blend = face->blend; + T1_Face t1face = (T1_Face)face; + PS_Blend blend = t1face->blend; FT_UInt n; FT_Error error; @@ -225,11 +227,12 @@ for ( j = 1; j < axismap->num_points; j++ ) { if ( ncv <= axismap->blend_points[j] ) - return INT_TO_FIXED( axismap->design_points[j - 1] ) + - ( axismap->design_points[j] - axismap->design_points[j - 1] ) * - FT_DivFix( ncv - axismap->blend_points[j - 1], - axismap->blend_points[j] - - axismap->blend_points[j - 1] ); + return INT_TO_FIXED( axismap->design_points[j - 1] + + FT_MulDiv( ncv - axismap->blend_points[j - 1], + axismap->design_points[j] - + axismap->design_points[j - 1], + axismap->blend_points[j] - + axismap->blend_points[j - 1] ) ); } return INT_TO_FIXED( axismap->design_points[axismap->num_points - 1] ); @@ -284,16 +287,17 @@ * arguments needed by the GX var distortable fonts. */ FT_LOCAL_DEF( FT_Error ) - T1_Get_MM_Var( T1_Face face, + T1_Get_MM_Var( FT_Face face, /* T1_Face */ FT_MM_Var* *master ) { - FT_Memory memory = face->root.memory; - FT_MM_Var *mmvar = NULL; + T1_Face t1face = (T1_Face)face; + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_MM_Var *mmvar = NULL; FT_Multi_Master mmaster; FT_Error error; FT_UInt i; FT_Fixed axiscoords[T1_MAX_MM_AXIS]; - PS_Blend blend = face->blend; + PS_Blend blend = t1face->blend; FT_UShort* axis_flags; FT_Offset mmvar_size; @@ -319,9 +323,9 @@ sizeof ( FT_UShort ) ); axis_size = mmaster.num_axis * sizeof ( FT_Var_Axis ); - if ( FT_ALLOC( mmvar, mmvar_size + - axis_flags_size + - axis_size ) ) + if ( FT_QALLOC( mmvar, mmvar_size + + axis_flags_size + + axis_size ) ) goto Exit; mmvar->num_axis = mmaster.num_axis; @@ -332,8 +336,7 @@ /* to make `FT_Get_Var_Axis_Flags' work: the function expects that the */ /* values directly follow the data of `FT_MM_Var' */ axis_flags = (FT_UShort*)( (char*)mmvar + mmvar_size ); - for ( i = 0; i < mmaster.num_axis; i++ ) - axis_flags[i] = 0; + FT_ARRAY_ZERO( axis_flags, mmaster.num_axis ); mmvar->axis = (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size ); mmvar->namedstyle = NULL; @@ -438,32 +441,21 @@ FT_LOCAL_DEF( FT_Error ) - T1_Set_MM_Blend( T1_Face face, + T1_Set_MM_Blend( FT_Face face, /* T1_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Error error; - - - error = t1_set_mm_blend( face, num_coords, coords ); - if ( error ) - return error; - - if ( num_coords ) - face->root.face_flags |= FT_FACE_FLAG_VARIATION; - else - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; - - return FT_Err_Ok; + return t1_set_mm_blend( (T1_Face)face, num_coords, coords ); } FT_LOCAL_DEF( FT_Error ) - T1_Get_MM_Blend( T1_Face face, + T1_Get_MM_Blend( FT_Face face, /* T1_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - PS_Blend blend = face->blend; + T1_Face t1face = (T1_Face)face; + PS_Blend blend = t1face->blend; FT_Fixed axiscoords[4]; FT_UInt i, nc; @@ -494,11 +486,12 @@ FT_LOCAL_DEF( FT_Error ) - T1_Set_MM_WeightVector( T1_Face face, + T1_Set_MM_WeightVector( FT_Face face, /* T1_Face */ FT_UInt len, FT_Fixed* weightvector ) { - PS_Blend blend = face->blend; + T1_Face t1face = (T1_Face)face; + PS_Blend blend = t1face->blend; FT_UInt i, n; @@ -522,11 +515,6 @@ for ( ; i < blend->num_designs; i++ ) blend->weight_vector[i] = (FT_Fixed)0; - - if ( len ) - face->root.face_flags |= FT_FACE_FLAG_VARIATION; - else - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; } return FT_Err_Ok; @@ -534,11 +522,12 @@ FT_LOCAL_DEF( FT_Error ) - T1_Get_MM_WeightVector( T1_Face face, + T1_Get_MM_WeightVector( FT_Face face, /* T1_Face */ FT_UInt* len, FT_Fixed* weightvector ) { - PS_Blend blend = face->blend; + T1_Face t1face = (T1_Face)face; + PS_Blend blend = t1face->blend; FT_UInt i; @@ -563,12 +552,13 @@ FT_LOCAL_DEF( FT_Error ) - T1_Set_MM_Design( T1_Face face, + T1_Set_MM_Design( FT_Face face, /* T1_Face */ FT_UInt num_coords, FT_Long* coords ) { + T1_Face t1face = (T1_Face)face; FT_Error error; - PS_Blend blend = face->blend; + PS_Blend blend = t1face->blend; FT_UInt n; FT_Fixed final_blends[T1_MAX_MM_DESIGNS]; @@ -634,15 +624,10 @@ final_blends[n] = the_blend; } - error = t1_set_mm_blend( face, blend->num_axis, final_blends ); + error = t1_set_mm_blend( t1face, blend->num_axis, final_blends ); if ( error ) return error; - if ( num_coords ) - face->root.face_flags |= FT_FACE_FLAG_VARIATION; - else - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; - return FT_Err_Ok; } @@ -650,7 +635,7 @@ /* MM fonts don't have named instances, so only the design is reset */ FT_LOCAL_DEF( FT_Error ) - T1_Reset_MM_Blend( T1_Face face, + T1_Reset_MM_Blend( FT_Face face, FT_UInt instance_index ) { FT_UNUSED( instance_index ); @@ -665,7 +650,7 @@ * arguments needed by the GX var distortable fonts. */ FT_LOCAL_DEF( FT_Error ) - T1_Set_Var_Design( T1_Face face, + T1_Set_Var_Design( FT_Face face, /* T1_Face */ FT_UInt num_coords, FT_Fixed* coords ) { @@ -684,11 +669,12 @@ FT_LOCAL_DEF( FT_Error ) - T1_Get_Var_Design( T1_Face face, + T1_Get_Var_Design( FT_Face face, /* T1_Face */ FT_UInt num_coords, FT_Fixed* coords ) { - PS_Blend blend = face->blend; + T1_Face t1face = (T1_Face)face; + PS_Blend blend = t1face->blend; FT_Fixed axiscoords[4]; FT_UInt i, nc; @@ -720,10 +706,11 @@ FT_LOCAL_DEF( void ) - T1_Done_Blend( T1_Face face ) + T1_Done_Blend( FT_Face face ) /* T1_Face */ { - FT_Memory memory = face->root.memory; - PS_Blend blend = face->blend; + T1_Face t1face = (T1_Face)face; + FT_Memory memory = FT_FACE_MEMORY( face ); + PS_Blend blend = t1face->blend; if ( blend ) @@ -768,20 +755,22 @@ dmap->num_points = 0; } - FT_FREE( face->blend ); + FT_FREE( t1face->blend ); } } static void - parse_blend_axis_types( T1_Face face, - T1_Loader loader ) + parse_blend_axis_types( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; FT_Int n, num_axis; - FT_Error error = FT_Err_Ok; + FT_Error error = FT_Err_Ok; PS_Blend blend; - FT_Memory memory; + FT_Memory memory = FT_FACE_MEMORY( face ); /* take an array of objects */ @@ -801,14 +790,13 @@ } /* allocate blend if necessary */ - error = t1_allocate_blend( face, 0, (FT_UInt)num_axis ); + error = t1_allocate_blend( t1face, 0, (FT_UInt)num_axis ); if ( error ) goto Exit; FT_TRACE4(( " [" )); - blend = face->blend; - memory = face->root.memory; + blend = t1face->blend; /* each token is an immediate containing the name of the axis */ for ( n = 0; n < num_axis; n++ ) @@ -856,14 +844,16 @@ static void - parse_blend_design_positions( T1_Face face, - T1_Loader loader ) + parse_blend_design_positions( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; FT_Int num_designs; FT_Int num_axis = 0; /* make compiler happy */ T1_Parser parser = &loader->parser; - FT_Memory memory = face->root.memory; + FT_Memory memory = FT_FACE_MEMORY( face ); FT_Error error = FT_Err_Ok; FT_Fixed* design_pos[T1_MAX_MM_DESIGNS]; @@ -921,7 +911,7 @@ } num_axis = n_axis; - error = t1_allocate_blend( face, + error = t1_allocate_blend( t1face, (FT_UInt)num_designs, (FT_UInt)num_axis ); if ( error ) @@ -962,7 +952,7 @@ loader->parser.root.limit = old_limit; /* a valid BlendDesignPosition has been parsed */ - blend = face->blend; + blend = t1face->blend; if ( blend->design_pos[0] ) FT_FREE( blend->design_pos[0] ); @@ -980,9 +970,11 @@ static void - parse_blend_design_map( T1_Face face, - T1_Loader loader ) + parse_blend_design_map( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; FT_Error error = FT_Err_Ok; T1_Parser parser = &loader->parser; PS_Blend blend; @@ -990,7 +982,7 @@ FT_Int n, num_axis; FT_Byte* old_cursor; FT_Byte* old_limit; - FT_Memory memory = face->root.memory; + FT_Memory memory = FT_FACE_MEMORY( face ); T1_ToTokenArray( parser, axis_tokens, @@ -1011,10 +1003,10 @@ old_cursor = parser->root.cursor; old_limit = parser->root.limit; - error = t1_allocate_blend( face, 0, (FT_UInt)num_axis ); + error = t1_allocate_blend( t1face, 0, (FT_UInt)num_axis ); if ( error ) goto Exit; - blend = face->blend; + blend = t1face->blend; FT_TRACE4(( " [" )); @@ -1089,15 +1081,17 @@ static void - parse_weight_vector( T1_Face face, - T1_Loader loader ) + parse_weight_vector( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; FT_Int num_designs; FT_Error error = FT_Err_Ok; - FT_Memory memory = face->root.memory; + FT_Memory memory = FT_FACE_MEMORY( face ); T1_Parser parser = &loader->parser; - PS_Blend blend = face->blend; + PS_Blend blend = t1face->blend; T1_Token token; FT_Int n; FT_Byte* old_cursor; @@ -1122,10 +1116,10 @@ if ( !blend || !blend->num_designs ) { - error = t1_allocate_blend( face, (FT_UInt)num_designs, 0 ); + error = t1_allocate_blend( t1face, (FT_UInt)num_designs, 0 ); if ( error ) goto Exit; - blend = face->blend; + blend = t1face->blend; } else if ( blend->num_designs != (FT_UInt)num_designs ) { @@ -1173,11 +1167,15 @@ /* e.g., /BuildCharArray [0 0 0 0 0 0 0 0] def */ /* we're only interested in the number of array elements */ static void - parse_buildchar( T1_Face face, - T1_Loader loader ) + parse_buildchar( FT_Face face, /* T1_Face */ + void* loader_ ) { - face->len_buildchar = (FT_UInt)T1_ToFixedArray( &loader->parser, - 0, NULL, 0 ); + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; + + + t1face->len_buildchar = (FT_UInt)T1_ToFixedArray( &loader->parser, + 0, NULL, 0 ); #ifdef FT_DEBUG_LEVEL_TRACE { @@ -1185,7 +1183,7 @@ FT_TRACE4(( " [" )); - for ( i = 0; i < face->len_buildchar; i++ ) + for ( i = 0; i < t1face->len_buildchar; i++ ) FT_TRACE4(( " 0" )); FT_TRACE4(( "]\n" )); @@ -1335,9 +1333,10 @@ static void - parse_private( T1_Face face, - T1_Loader loader ) + parse_private( FT_Face face, + void* loader_ ) { + T1_Loader loader = (T1_Loader)loader_; FT_UNUSED( face ); loader->keywords_encountered |= T1_PRIVATE; @@ -1401,13 +1400,14 @@ /* and `/CharStrings' dictionaries. */ static void - t1_parse_font_matrix( T1_Face face, - T1_Loader loader ) + t1_parse_font_matrix( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; T1_Parser parser = &loader->parser; - FT_Matrix* matrix = &face->type1.font_matrix; - FT_Vector* offset = &face->type1.font_offset; - FT_Face root = (FT_Face)&face->root; + FT_Matrix* matrix = &t1face->type1.font_matrix; + FT_Vector* offset = &t1face->type1.font_offset; FT_Fixed temp[6]; FT_Fixed temp_scale; FT_Int result; @@ -1443,7 +1443,7 @@ if ( temp_scale != 0x10000L ) { /* set units per EM based on FontMatrix values */ - root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); + face->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); temp[0] = FT_DivFix( temp[0], temp_scale ); temp[1] = FT_DivFix( temp[1], temp_scale ); @@ -1471,14 +1471,16 @@ static void - parse_encoding( T1_Face face, - T1_Loader loader ) + parse_encoding( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; T1_Parser parser = &loader->parser; FT_Byte* cur; FT_Byte* limit = parser->root.limit; - PSAux_Service psaux = (PSAux_Service)face->psaux; + PSAux_Service psaux = (PSAux_Service)t1face->psaux; T1_Skip_Spaces( parser ); @@ -1494,7 +1496,7 @@ /* and we must load it now */ if ( ft_isdigit( *cur ) || *cur == '[' ) { - T1_Encoding encode = &face->type1.encoding; + T1_Encoding encode = &t1face->type1.encoding; FT_Int count, array_size, n; PS_Table char_table = &loader->encoding_table; FT_Memory memory = parser->root.memory; @@ -1676,7 +1678,7 @@ FT_TRACE4(( "]\n" )); #endif - face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; + t1face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; parser->root.cursor = cur; } @@ -1687,21 +1689,21 @@ if ( cur + 17 < limit && ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 ) { - face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD; + t1face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD; FT_TRACE4(( " StandardEncoding\n" )); } else if ( cur + 15 < limit && ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 ) { - face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT; + t1face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT; FT_TRACE4(( " ExpertEncoding\n" )); } else if ( cur + 18 < limit && ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 ) { - face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; + t1face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; FT_TRACE4(( " ISOLatin1Encoding\n" )); } @@ -1715,9 +1717,11 @@ static void - parse_subrs( T1_Face face, - T1_Loader loader ) + parse_subrs( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; T1_Parser parser = &loader->parser; PS_Table table = &loader->subrs; FT_Memory memory = parser->root.memory; @@ -1725,7 +1729,7 @@ FT_Int num_subrs; FT_UInt count; - PSAux_Service psaux = (PSAux_Service)face->psaux; + PSAux_Service psaux = (PSAux_Service)t1face->psaux; T1_Skip_Spaces( parser ); @@ -1769,7 +1773,7 @@ */ FT_TRACE0(( "parse_subrs: adjusting number of subroutines" - " (from %d to %ld)\n", + " (from %d to %zu)\n", num_subrs, ( parser->root.limit - parser->root.cursor ) >> 3 )); num_subrs = ( parser->root.limit - parser->root.cursor ) >> 3; @@ -1857,7 +1861,7 @@ /* */ /* thanks to Tom Kacvinsky for pointing this out */ /* */ - if ( face->type1.private_dict.lenIV >= 0 ) + if ( t1face->type1.private_dict.lenIV >= 0 ) { FT_Byte* temp = NULL; @@ -1865,7 +1869,7 @@ /* some fonts define empty subr records -- this is not totally */ /* compliant to the specification (which says they should at */ /* least contain a `return'), but we support them anyway */ - if ( size < (FT_ULong)face->type1.private_dict.lenIV ) + if ( size < (FT_ULong)t1face->type1.private_dict.lenIV ) { error = FT_THROW( Invalid_File_Format ); goto Fail; @@ -1876,9 +1880,11 @@ goto Fail; FT_MEM_COPY( temp, base, size ); psaux->t1_decrypt( temp, size, 4330 ); - size -= (FT_ULong)face->type1.private_dict.lenIV; - error = T1_Add_Table( table, (FT_Int)idx, - temp + face->type1.private_dict.lenIV, size ); + size -= (FT_ULong)t1face->type1.private_dict.lenIV; + error = T1_Add_Table( table, + (FT_Int)idx, + temp + t1face->type1.private_dict.lenIV, + size ); FT_FREE( temp ); } else @@ -1910,9 +1916,11 @@ static void - parse_charstrings( T1_Face face, - T1_Loader loader ) + parse_charstrings( FT_Face face, /* T1_Face */ + void* loader_ ) { + T1_Face t1face = (T1_Face)face; + T1_Loader loader = (T1_Loader)loader_; T1_Parser parser = &loader->parser; PS_Table code_table = &loader->charstrings; PS_Table name_table = &loader->glyph_names; @@ -1920,7 +1928,7 @@ FT_Memory memory = parser->root.memory; FT_Error error; - PSAux_Service psaux = (PSAux_Service)face->psaux; + PSAux_Service psaux = (PSAux_Service)t1face->psaux; FT_Byte* cur = parser->root.cursor; FT_Byte* limit = parser->root.limit; @@ -1940,7 +1948,7 @@ if ( num_glyphs > ( limit - cur ) >> 3 ) { FT_TRACE0(( "parse_charstrings: adjusting number of glyphs" - " (from %d to %ld)\n", + " (from %d to %zu)\n", num_glyphs, ( limit - cur ) >> 3 )); num_glyphs = ( limit - cur ) >> 3; } @@ -2069,13 +2077,13 @@ notdef_found = 1; } - if ( face->type1.private_dict.lenIV >= 0 && + if ( t1face->type1.private_dict.lenIV >= 0 && n < num_glyphs + TABLE_EXTEND ) { FT_Byte* temp = NULL; - if ( size <= (FT_ULong)face->type1.private_dict.lenIV ) + if ( size <= (FT_ULong)t1face->type1.private_dict.lenIV ) { error = FT_THROW( Invalid_File_Format ); goto Fail; @@ -2086,9 +2094,11 @@ goto Fail; FT_MEM_COPY( temp, base, size ); psaux->t1_decrypt( temp, size, 4330 ); - size -= (FT_ULong)face->type1.private_dict.lenIV; - error = T1_Add_Table( code_table, n, - temp + face->type1.private_dict.lenIV, size ); + size -= (FT_ULong)t1face->type1.private_dict.lenIV; + error = T1_Add_Table( code_table, + n, + temp + t1face->type1.private_dict.lenIV, + size ); FT_FREE( temp ); } else @@ -2570,7 +2580,7 @@ { FT_ERROR(( "T1_Open_Face:" " number-of-designs != 2 ^^ number-of-axes\n" )); - T1_Done_Blend( face ); + T1_Done_Blend( FT_FACE( face ) ); } if ( face->blend && @@ -2590,15 +2600,15 @@ /* font as a normal PS font */ if ( face->blend && ( !face->blend->num_designs || !face->blend->num_axis ) ) - T1_Done_Blend( face ); + T1_Done_Blend( FT_FACE( face ) ); /* the font may have no valid WeightVector */ if ( face->blend && !face->blend->weight_vector ) - T1_Done_Blend( face ); + T1_Done_Blend( FT_FACE( face ) ); /* the font may have no valid BlendDesignPositions */ if ( face->blend && !face->blend->design_pos[0] ) - T1_Done_Blend( face ); + T1_Done_Blend( FT_FACE( face ) ); /* the font may have no valid BlendDesignMap */ if ( face->blend ) @@ -2609,7 +2619,7 @@ for ( i = 0; i < face->blend->num_axis; i++ ) if ( !face->blend->design_map[i].num_points ) { - T1_Done_Blend( face ); + T1_Done_Blend( FT_FACE( face ) ); break; } } diff --git a/src/java.desktop/share/native/libfreetype/src/type1/t1load.h b/src/java.desktop/share/native/libfreetype/src/type1/t1load.h index f8511cccf60..d8c9d2d8abe 100644 --- a/src/java.desktop/share/native/libfreetype/src/type1/t1load.h +++ b/src/java.desktop/share/native/libfreetype/src/type1/t1load.h @@ -66,52 +66,52 @@ FT_BEGIN_HEADER #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT FT_LOCAL( FT_Error ) - T1_Get_Multi_Master( T1_Face face, + T1_Get_Multi_Master( FT_Face face, FT_Multi_Master* master ); FT_LOCAL( FT_Error ) - T1_Get_MM_Var( T1_Face face, + T1_Get_MM_Var( FT_Face face, FT_MM_Var* *master ); FT_LOCAL( FT_Error ) - T1_Set_MM_Blend( T1_Face face, + T1_Set_MM_Blend( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) - T1_Get_MM_Blend( T1_Face face, + T1_Get_MM_Blend( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) - T1_Set_MM_Design( T1_Face face, + T1_Set_MM_Design( FT_Face face, FT_UInt num_coords, FT_Long* coords ); FT_LOCAL( FT_Error ) - T1_Reset_MM_Blend( T1_Face face, + T1_Reset_MM_Blend( FT_Face face, FT_UInt instance_index ); FT_LOCAL( FT_Error ) - T1_Get_Var_Design( T1_Face face, + T1_Get_Var_Design( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) - T1_Set_Var_Design( T1_Face face, + T1_Set_Var_Design( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( void ) - T1_Done_Blend( T1_Face face ); + T1_Done_Blend( FT_Face face ); FT_LOCAL( FT_Error ) - T1_Set_MM_WeightVector( T1_Face face, + T1_Set_MM_WeightVector( FT_Face face, FT_UInt len, FT_Fixed* weightvector ); FT_LOCAL( FT_Error ) - T1_Get_MM_WeightVector( T1_Face face, + T1_Get_MM_WeightVector( FT_Face face, FT_UInt* len, FT_Fixed* weightvector ); diff --git a/src/java.desktop/share/native/libfreetype/src/type1/t1objs.c b/src/java.desktop/share/native/libfreetype/src/type1/t1objs.c index 1bb2f15f3a8..69e4fd5065e 100644 --- a/src/java.desktop/share/native/libfreetype/src/type1/t1objs.c +++ b/src/java.desktop/share/native/libfreetype/src/type1/t1objs.c @@ -167,8 +167,7 @@ FT_Module module; - module = FT_Get_Module( slot->face->driver->root.library, - "pshinter" ); + module = FT_Get_Module( slot->library, "pshinter" ); if ( module ) { T1_Hints_Funcs funcs; @@ -227,7 +226,7 @@ face->len_buildchar = 0; } - T1_Done_Blend( face ); + T1_Done_Blend( t1face ); face->blend = NULL; #endif @@ -290,7 +289,8 @@ * * @Input: * stream :: - * input stream where to load font data. + * Dummy argument for compatibility with the `FT_Face_InitFunc` API. + * Ignored. The stream should be passed through `face->root.stream`. * * face_index :: * The index of the font face in the resource. From 16554ae23cf66e19a74e9621ac491ec6e8ce3467 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 09:17:51 +0000 Subject: [PATCH 020/261] 8316392: compiler/interpreter/TestVerifyStackAfterDeopt.java failed with SIGBUS in PcDescContainer::find_pc_desc_internal Backport-of: 58af9aeeb07b7a392a8fbf04ef5cb2607b7b2462 --- src/hotspot/share/code/nmethod.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index ded61f98948..fb2e5bd78b0 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -394,6 +394,7 @@ PcDesc* PcDescCache::find_pc_desc(int pc_offset, bool approximate) { } void PcDescCache::add_pc_desc(PcDesc* pc_desc) { + MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, Thread::current());) NOT_PRODUCT(++pc_nmethod_stats.pc_desc_adds); // Update the LRU cache by shifting pc_desc forward. for (int i = 0; i < cache_size; i++) { @@ -2751,9 +2752,6 @@ void nmethod::decode2(outputStream* ost) const { AbstractDisassembler::show_block_comment()); #endif - // Decoding an nmethod can write to a PcDescCache (see PcDescCache::add_pc_desc) - MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, Thread::current());) - st->cr(); this->print(st); st->cr(); From 20625961d48f34f970dbc27fbbe2b11d51bd0e3a Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 09:21:42 +0000 Subject: [PATCH 021/261] 8320208: Update Public Suffix List to b5bf572 Backport-of: 2b4e99140a315d3da765b2edb031b38725a05f1c --- .../share/data/publicsuffixlist/VERSION | 4 +- .../publicsuffixlist/public_suffix_list.dat | 4168 ++++++++++++----- src/java.base/share/legal/public_suffix.md | 2 +- .../security/util/RegisteredDomain/tests.dat | 4 + 4 files changed, 2929 insertions(+), 1249 deletions(-) diff --git a/src/java.base/share/data/publicsuffixlist/VERSION b/src/java.base/share/data/publicsuffixlist/VERSION index 4ffc88dbd83..f86d2df03ca 100644 --- a/src/java.base/share/data/publicsuffixlist/VERSION +++ b/src/java.base/share/data/publicsuffixlist/VERSION @@ -1,2 +1,2 @@ -Github: https://raw.githubusercontent.com/publicsuffix/list/88467c960d6cdad2ca1623e892e5e17506bc269f/public_suffix_list.dat -Date: 2023-04-14 +Github: https://raw.githubusercontent.com/publicsuffix/list/b5bf572c52988dbe9d865b8f090ea819024a9936/public_suffix_list.dat +Date: 2023-11-09 diff --git a/src/java.base/share/data/publicsuffixlist/public_suffix_list.dat b/src/java.base/share/data/publicsuffixlist/public_suffix_list.dat index d9f0c71dbb4..fff6e9a494d 100644 --- a/src/java.base/share/data/publicsuffixlist/public_suffix_list.dat +++ b/src/java.base/share/data/publicsuffixlist/public_suffix_list.dat @@ -1059,22 +1059,11 @@ gouv.fr nom.fr prd.fr tm.fr -// Former "domaines sectoriels", still registration suffixes -aeroport.fr -avocat.fr +// Other SLDs now selfmanaged out of AFNIC range. Former "domaines sectoriels", still registration suffixes avoues.fr cci.fr -chambagri.fr -chirurgiens-dentistes.fr -experts-comptables.fr -geometre-expert.fr greta.fr huissier-justice.fr -medecin.fr -notaires.fr -pharmacien.fr -port.fr -veterinaire.fr // ga : https://en.wikipedia.org/wiki/.ga ga @@ -5146,52 +5135,60 @@ turystyka.pl // Government domains gov.pl ap.gov.pl +griw.gov.pl ic.gov.pl is.gov.pl -us.gov.pl kmpsp.gov.pl +konsulat.gov.pl kppsp.gov.pl -kwpsp.gov.pl -psp.gov.pl -wskr.gov.pl kwp.gov.pl +kwpsp.gov.pl +mup.gov.pl mw.gov.pl -ug.gov.pl -um.gov.pl -umig.gov.pl -ugim.gov.pl -upow.gov.pl -uw.gov.pl -starostwo.gov.pl +oia.gov.pl +oirm.gov.pl +oke.gov.pl +oow.gov.pl +oschr.gov.pl +oum.gov.pl pa.gov.pl +pinb.gov.pl +piw.gov.pl po.gov.pl +pr.gov.pl +psp.gov.pl psse.gov.pl pup.gov.pl rzgw.gov.pl sa.gov.pl +sdn.gov.pl +sko.gov.pl so.gov.pl sr.gov.pl -wsa.gov.pl -sko.gov.pl +starostwo.gov.pl +ug.gov.pl +ugim.gov.pl +um.gov.pl +umig.gov.pl +upow.gov.pl +uppo.gov.pl +us.gov.pl +uw.gov.pl uzs.gov.pl +wif.gov.pl wiih.gov.pl winb.gov.pl -pinb.gov.pl wios.gov.pl witd.gov.pl -wzmiuw.gov.pl -piw.gov.pl wiw.gov.pl -griw.gov.pl -wif.gov.pl -oum.gov.pl -sdn.gov.pl -zp.gov.pl -uppo.gov.pl -mup.gov.pl +wkz.gov.pl +wsa.gov.pl +wskr.gov.pl +wsse.gov.pl wuoz.gov.pl -konsulat.gov.pl -oirm.gov.pl +wzmiuw.gov.pl +zp.gov.pl +zpisdn.gov.pl // pl regional domains (http://www.dns.pl/english/index.html) augustow.pl babia-gora.pl @@ -5876,6 +5873,7 @@ kiev.ua kirovograd.ua km.ua kr.ua +kropyvnytskyi.ua krym.ua ks.ua kv.ua @@ -5883,6 +5881,7 @@ kyiv.ua lg.ua lt.ua lugansk.ua +luhansk.ua lutsk.ua lv.ua lviv.ua @@ -5906,11 +5905,13 @@ te.ua ternopil.ua uz.ua uzhgorod.ua +uzhhorod.ua vinnica.ua vinnytsia.ua vn.ua volyn.ua yalta.ua +zakarpattia.ua zaporizhzhe.ua zaporizhzhia.ua zhitomir.ua @@ -6022,7 +6023,6 @@ k12.ca.us k12.co.us k12.ct.us k12.dc.us -k12.de.us k12.fl.us k12.ga.us k12.gu.us @@ -6264,20 +6264,89 @@ k12.vi net.vi org.vi -// vn : https://www.dot.vn/vnnic/vnnic/domainregistration.jsp +// vn : https://www.vnnic.vn/en/domain/cctld-vn +// https://vnnic.vn/sites/default/files/tailieu/vn.cctld.domains.txt vn +ac.vn +ai.vn +biz.vn com.vn -net.vn -org.vn edu.vn gov.vn -int.vn -ac.vn -biz.vn +health.vn +id.vn info.vn +int.vn +io.vn name.vn +net.vn +org.vn pro.vn -health.vn + +// vn geographical names +angiang.vn +bacgiang.vn +backan.vn +baclieu.vn +bacninh.vn +baria-vungtau.vn +bentre.vn +binhdinh.vn +binhduong.vn +binhphuoc.vn +binhthuan.vn +camau.vn +cantho.vn +caobang.vn +daklak.vn +daknong.vn +danang.vn +dienbien.vn +dongnai.vn +dongthap.vn +gialai.vn +hagiang.vn +haiduong.vn +haiphong.vn +hanam.vn +hanoi.vn +hatinh.vn +haugiang.vn +hoabinh.vn +hungyen.vn +khanhhoa.vn +kiengiang.vn +kontum.vn +laichau.vn +lamdong.vn +langson.vn +laocai.vn +longan.vn +namdinh.vn +nghean.vn +ninhbinh.vn +ninhthuan.vn +phutho.vn +phuyen.vn +quangbinh.vn +quangnam.vn +quangngai.vn +quangninh.vn +quangtri.vn +soctrang.vn +sonla.vn +tayninh.vn +thaibinh.vn +thainguyen.vn +thanhhoa.vn +thanhphohochiminh.vn +thuathienhue.vn +tiengiang.vn +travinh.vn +tuyenquang.vn +vinhlong.vn +vinhphuc.vn +yenbai.vn // vu : https://en.wikipedia.org/wiki/.vu // http://www.vunic.vu/ @@ -6641,3447 +6710,4506 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-04-14T15:13:16Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-11-03T15:13:18Z // This list is auto-generated, don't edit it manually. -// aaa : 2015-02-26 American Automobile Association, Inc. +// aaa : American Automobile Association, Inc. +// https://www.iana.org/domains/root/db/aaa.html aaa -// aarp : 2015-05-21 AARP +// aarp : AARP +// https://www.iana.org/domains/root/db/aarp.html aarp -// abarth : 2015-07-30 Fiat Chrysler Automobiles N.V. -abarth - -// abb : 2014-10-24 ABB Ltd +// abb : ABB Ltd +// https://www.iana.org/domains/root/db/abb.html abb -// abbott : 2014-07-24 Abbott Laboratories, Inc. +// abbott : Abbott Laboratories, Inc. +// https://www.iana.org/domains/root/db/abbott.html abbott -// abbvie : 2015-07-30 AbbVie Inc. +// abbvie : AbbVie Inc. +// https://www.iana.org/domains/root/db/abbvie.html abbvie -// abc : 2015-07-30 Disney Enterprises, Inc. +// abc : Disney Enterprises, Inc. +// https://www.iana.org/domains/root/db/abc.html abc -// able : 2015-06-25 Able Inc. +// able : Able Inc. +// https://www.iana.org/domains/root/db/able.html able -// abogado : 2014-04-24 Registry Services, LLC +// abogado : Registry Services, LLC +// https://www.iana.org/domains/root/db/abogado.html abogado -// abudhabi : 2015-07-30 Abu Dhabi Systems and Information Centre +// abudhabi : Abu Dhabi Systems and Information Centre +// https://www.iana.org/domains/root/db/abudhabi.html abudhabi -// academy : 2013-11-07 Binky Moon, LLC +// academy : Binky Moon, LLC +// https://www.iana.org/domains/root/db/academy.html academy -// accenture : 2014-08-15 Accenture plc +// accenture : Accenture plc +// https://www.iana.org/domains/root/db/accenture.html accenture -// accountant : 2014-11-20 dot Accountant Limited +// accountant : dot Accountant Limited +// https://www.iana.org/domains/root/db/accountant.html accountant -// accountants : 2014-03-20 Binky Moon, LLC +// accountants : Binky Moon, LLC +// https://www.iana.org/domains/root/db/accountants.html accountants -// aco : 2015-01-08 ACO Severin Ahlmann GmbH & Co. KG +// aco : ACO Severin Ahlmann GmbH & Co. KG +// https://www.iana.org/domains/root/db/aco.html aco -// actor : 2013-12-12 Dog Beach, LLC +// actor : Dog Beach, LLC +// https://www.iana.org/domains/root/db/actor.html actor -// ads : 2014-12-04 Charleston Road Registry Inc. +// ads : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/ads.html ads -// adult : 2014-10-16 ICM Registry AD LLC +// adult : ICM Registry AD LLC +// https://www.iana.org/domains/root/db/adult.html adult -// aeg : 2015-03-19 Aktiebolaget Electrolux +// aeg : Aktiebolaget Electrolux +// https://www.iana.org/domains/root/db/aeg.html aeg -// aetna : 2015-05-21 Aetna Life Insurance Company +// aetna : Aetna Life Insurance Company +// https://www.iana.org/domains/root/db/aetna.html aetna -// afl : 2014-10-02 Australian Football League +// afl : Australian Football League +// https://www.iana.org/domains/root/db/afl.html afl -// africa : 2014-03-24 ZA Central Registry NPC trading as Registry.Africa +// africa : ZA Central Registry NPC trading as Registry.Africa +// https://www.iana.org/domains/root/db/africa.html africa -// agakhan : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation) +// agakhan : Fondation Aga Khan (Aga Khan Foundation) +// https://www.iana.org/domains/root/db/agakhan.html agakhan -// agency : 2013-11-14 Binky Moon, LLC +// agency : Binky Moon, LLC +// https://www.iana.org/domains/root/db/agency.html agency -// aig : 2014-12-18 American International Group, Inc. +// aig : American International Group, Inc. +// https://www.iana.org/domains/root/db/aig.html aig -// airbus : 2015-07-30 Airbus S.A.S. +// airbus : Airbus S.A.S. +// https://www.iana.org/domains/root/db/airbus.html airbus -// airforce : 2014-03-06 Dog Beach, LLC +// airforce : Dog Beach, LLC +// https://www.iana.org/domains/root/db/airforce.html airforce -// airtel : 2014-10-24 Bharti Airtel Limited +// airtel : Bharti Airtel Limited +// https://www.iana.org/domains/root/db/airtel.html airtel -// akdn : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation) +// akdn : Fondation Aga Khan (Aga Khan Foundation) +// https://www.iana.org/domains/root/db/akdn.html akdn -// alfaromeo : 2015-07-31 Fiat Chrysler Automobiles N.V. -alfaromeo - -// alibaba : 2015-01-15 Alibaba Group Holding Limited +// alibaba : Alibaba Group Holding Limited +// https://www.iana.org/domains/root/db/alibaba.html alibaba -// alipay : 2015-01-15 Alibaba Group Holding Limited +// alipay : Alibaba Group Holding Limited +// https://www.iana.org/domains/root/db/alipay.html alipay -// allfinanz : 2014-07-03 Allfinanz Deutsche Vermögensberatung Aktiengesellschaft +// allfinanz : Allfinanz Deutsche Vermögensberatung Aktiengesellschaft +// https://www.iana.org/domains/root/db/allfinanz.html allfinanz -// allstate : 2015-07-31 Allstate Fire and Casualty Insurance Company +// allstate : Allstate Fire and Casualty Insurance Company +// https://www.iana.org/domains/root/db/allstate.html allstate -// ally : 2015-06-18 Ally Financial Inc. +// ally : Ally Financial Inc. +// https://www.iana.org/domains/root/db/ally.html ally -// alsace : 2014-07-02 Region Grand Est +// alsace : Region Grand Est +// https://www.iana.org/domains/root/db/alsace.html alsace -// alstom : 2015-07-30 ALSTOM +// alstom : ALSTOM +// https://www.iana.org/domains/root/db/alstom.html alstom -// amazon : 2019-12-19 Amazon Registry Services, Inc. +// amazon : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/amazon.html amazon -// americanexpress : 2015-07-31 American Express Travel Related Services Company, Inc. +// americanexpress : American Express Travel Related Services Company, Inc. +// https://www.iana.org/domains/root/db/americanexpress.html americanexpress -// americanfamily : 2015-07-23 AmFam, Inc. +// americanfamily : AmFam, Inc. +// https://www.iana.org/domains/root/db/americanfamily.html americanfamily -// amex : 2015-07-31 American Express Travel Related Services Company, Inc. +// amex : American Express Travel Related Services Company, Inc. +// https://www.iana.org/domains/root/db/amex.html amex -// amfam : 2015-07-23 AmFam, Inc. +// amfam : AmFam, Inc. +// https://www.iana.org/domains/root/db/amfam.html amfam -// amica : 2015-05-28 Amica Mutual Insurance Company +// amica : Amica Mutual Insurance Company +// https://www.iana.org/domains/root/db/amica.html amica -// amsterdam : 2014-07-24 Gemeente Amsterdam +// amsterdam : Gemeente Amsterdam +// https://www.iana.org/domains/root/db/amsterdam.html amsterdam -// analytics : 2014-12-18 Campus IP LLC +// analytics : Campus IP LLC +// https://www.iana.org/domains/root/db/analytics.html analytics -// android : 2014-08-07 Charleston Road Registry Inc. +// android : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/android.html android -// anquan : 2015-01-08 Beijing Qihu Keji Co., Ltd. +// anquan : Beijing Qihu Keji Co., Ltd. +// https://www.iana.org/domains/root/db/anquan.html anquan -// anz : 2015-07-31 Australia and New Zealand Banking Group Limited +// anz : Australia and New Zealand Banking Group Limited +// https://www.iana.org/domains/root/db/anz.html anz -// aol : 2015-09-17 Oath Inc. +// aol : Oath Inc. +// https://www.iana.org/domains/root/db/aol.html aol -// apartments : 2014-12-11 Binky Moon, LLC +// apartments : Binky Moon, LLC +// https://www.iana.org/domains/root/db/apartments.html apartments -// app : 2015-05-14 Charleston Road Registry Inc. +// app : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/app.html app -// apple : 2015-05-14 Apple Inc. +// apple : Apple Inc. +// https://www.iana.org/domains/root/db/apple.html apple -// aquarelle : 2014-07-24 Aquarelle.com +// aquarelle : Aquarelle.com +// https://www.iana.org/domains/root/db/aquarelle.html aquarelle -// arab : 2015-11-12 League of Arab States +// arab : League of Arab States +// https://www.iana.org/domains/root/db/arab.html arab -// aramco : 2014-11-20 Aramco Services Company +// aramco : Aramco Services Company +// https://www.iana.org/domains/root/db/aramco.html aramco -// archi : 2014-02-06 Identity Digital Limited +// archi : Identity Digital Limited +// https://www.iana.org/domains/root/db/archi.html archi -// army : 2014-03-06 Dog Beach, LLC +// army : Dog Beach, LLC +// https://www.iana.org/domains/root/db/army.html army -// art : 2016-03-24 UK Creative Ideas Limited +// art : UK Creative Ideas Limited +// https://www.iana.org/domains/root/db/art.html art -// arte : 2014-12-11 Association Relative à la Télévision Européenne G.E.I.E. +// arte : Association Relative à la Télévision Européenne G.E.I.E. +// https://www.iana.org/domains/root/db/arte.html arte -// asda : 2015-07-31 Wal-Mart Stores, Inc. +// asda : Wal-Mart Stores, Inc. +// https://www.iana.org/domains/root/db/asda.html asda -// associates : 2014-03-06 Binky Moon, LLC +// associates : Binky Moon, LLC +// https://www.iana.org/domains/root/db/associates.html associates -// athleta : 2015-07-30 The Gap, Inc. +// athleta : The Gap, Inc. +// https://www.iana.org/domains/root/db/athleta.html athleta -// attorney : 2014-03-20 Dog Beach, LLC +// attorney : Dog Beach, LLC +// https://www.iana.org/domains/root/db/attorney.html attorney -// auction : 2014-03-20 Dog Beach, LLC +// auction : Dog Beach, LLC +// https://www.iana.org/domains/root/db/auction.html auction -// audi : 2015-05-21 AUDI Aktiengesellschaft +// audi : AUDI Aktiengesellschaft +// https://www.iana.org/domains/root/db/audi.html audi -// audible : 2015-06-25 Amazon Registry Services, Inc. +// audible : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/audible.html audible -// audio : 2014-03-20 XYZ.COM LLC +// audio : XYZ.COM LLC +// https://www.iana.org/domains/root/db/audio.html audio -// auspost : 2015-08-13 Australian Postal Corporation +// auspost : Australian Postal Corporation +// https://www.iana.org/domains/root/db/auspost.html auspost -// author : 2014-12-18 Amazon Registry Services, Inc. +// author : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/author.html author -// auto : 2014-11-13 XYZ.COM LLC +// auto : XYZ.COM LLC +// https://www.iana.org/domains/root/db/auto.html auto -// autos : 2014-01-09 XYZ.COM LLC +// autos : XYZ.COM LLC +// https://www.iana.org/domains/root/db/autos.html autos -// avianca : 2015-01-08 Avianca Inc. +// avianca : Avianca Inc. +// https://www.iana.org/domains/root/db/avianca.html avianca -// aws : 2015-06-25 AWS Registry LLC +// aws : AWS Registry LLC +// https://www.iana.org/domains/root/db/aws.html aws -// axa : 2013-12-19 AXA Group Operations SAS +// axa : AXA Group Operations SAS +// https://www.iana.org/domains/root/db/axa.html axa -// azure : 2014-12-18 Microsoft Corporation +// azure : Microsoft Corporation +// https://www.iana.org/domains/root/db/azure.html azure -// baby : 2015-04-09 XYZ.COM LLC +// baby : XYZ.COM LLC +// https://www.iana.org/domains/root/db/baby.html baby -// baidu : 2015-01-08 Baidu, Inc. +// baidu : Baidu, Inc. +// https://www.iana.org/domains/root/db/baidu.html baidu -// banamex : 2015-07-30 Citigroup Inc. +// banamex : Citigroup Inc. +// https://www.iana.org/domains/root/db/banamex.html banamex -// bananarepublic : 2015-07-31 The Gap, Inc. +// bananarepublic : The Gap, Inc. +// https://www.iana.org/domains/root/db/bananarepublic.html bananarepublic -// band : 2014-06-12 Dog Beach, LLC +// band : Dog Beach, LLC +// https://www.iana.org/domains/root/db/band.html band -// bank : 2014-09-25 fTLD Registry Services LLC +// bank : fTLD Registry Services LLC +// https://www.iana.org/domains/root/db/bank.html bank -// bar : 2013-12-12 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable +// bar : Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable +// https://www.iana.org/domains/root/db/bar.html bar -// barcelona : 2014-07-24 Municipi de Barcelona +// barcelona : Municipi de Barcelona +// https://www.iana.org/domains/root/db/barcelona.html barcelona -// barclaycard : 2014-11-20 Barclays Bank PLC +// barclaycard : Barclays Bank PLC +// https://www.iana.org/domains/root/db/barclaycard.html barclaycard -// barclays : 2014-11-20 Barclays Bank PLC +// barclays : Barclays Bank PLC +// https://www.iana.org/domains/root/db/barclays.html barclays -// barefoot : 2015-06-11 Gallo Vineyards, Inc. +// barefoot : Gallo Vineyards, Inc. +// https://www.iana.org/domains/root/db/barefoot.html barefoot -// bargains : 2013-11-14 Binky Moon, LLC +// bargains : Binky Moon, LLC +// https://www.iana.org/domains/root/db/bargains.html bargains -// baseball : 2015-10-29 MLB Advanced Media DH, LLC +// baseball : MLB Advanced Media DH, LLC +// https://www.iana.org/domains/root/db/baseball.html baseball -// basketball : 2015-08-20 Fédération Internationale de Basketball (FIBA) +// basketball : Fédération Internationale de Basketball (FIBA) +// https://www.iana.org/domains/root/db/basketball.html basketball -// bauhaus : 2014-04-17 Werkhaus GmbH +// bauhaus : Werkhaus GmbH +// https://www.iana.org/domains/root/db/bauhaus.html bauhaus -// bayern : 2014-01-23 Bayern Connect GmbH +// bayern : Bayern Connect GmbH +// https://www.iana.org/domains/root/db/bayern.html bayern -// bbc : 2014-12-18 British Broadcasting Corporation +// bbc : British Broadcasting Corporation +// https://www.iana.org/domains/root/db/bbc.html bbc -// bbt : 2015-07-23 BB&T Corporation +// bbt : BB&T Corporation +// https://www.iana.org/domains/root/db/bbt.html bbt -// bbva : 2014-10-02 BANCO BILBAO VIZCAYA ARGENTARIA, S.A. +// bbva : BANCO BILBAO VIZCAYA ARGENTARIA, S.A. +// https://www.iana.org/domains/root/db/bbva.html bbva -// bcg : 2015-04-02 The Boston Consulting Group, Inc. +// bcg : The Boston Consulting Group, Inc. +// https://www.iana.org/domains/root/db/bcg.html bcg -// bcn : 2014-07-24 Municipi de Barcelona +// bcn : Municipi de Barcelona +// https://www.iana.org/domains/root/db/bcn.html bcn -// beats : 2015-05-14 Beats Electronics, LLC +// beats : Beats Electronics, LLC +// https://www.iana.org/domains/root/db/beats.html beats -// beauty : 2015-12-03 XYZ.COM LLC +// beauty : XYZ.COM LLC +// https://www.iana.org/domains/root/db/beauty.html beauty -// beer : 2014-01-09 Registry Services, LLC +// beer : Registry Services, LLC +// https://www.iana.org/domains/root/db/beer.html beer -// bentley : 2014-12-18 Bentley Motors Limited +// bentley : Bentley Motors Limited +// https://www.iana.org/domains/root/db/bentley.html bentley -// berlin : 2013-10-31 dotBERLIN GmbH & Co. KG +// berlin : dotBERLIN GmbH & Co. KG +// https://www.iana.org/domains/root/db/berlin.html berlin -// best : 2013-12-19 BestTLD Pty Ltd +// best : BestTLD Pty Ltd +// https://www.iana.org/domains/root/db/best.html best -// bestbuy : 2015-07-31 BBY Solutions, Inc. +// bestbuy : BBY Solutions, Inc. +// https://www.iana.org/domains/root/db/bestbuy.html bestbuy -// bet : 2015-05-07 Identity Digital Limited +// bet : Identity Digital Limited +// https://www.iana.org/domains/root/db/bet.html bet -// bharti : 2014-01-09 Bharti Enterprises (Holding) Private Limited +// bharti : Bharti Enterprises (Holding) Private Limited +// https://www.iana.org/domains/root/db/bharti.html bharti -// bible : 2014-06-19 American Bible Society +// bible : American Bible Society +// https://www.iana.org/domains/root/db/bible.html bible -// bid : 2013-12-19 dot Bid Limited +// bid : dot Bid Limited +// https://www.iana.org/domains/root/db/bid.html bid -// bike : 2013-08-27 Binky Moon, LLC +// bike : Binky Moon, LLC +// https://www.iana.org/domains/root/db/bike.html bike -// bing : 2014-12-18 Microsoft Corporation +// bing : Microsoft Corporation +// https://www.iana.org/domains/root/db/bing.html bing -// bingo : 2014-12-04 Binky Moon, LLC +// bingo : Binky Moon, LLC +// https://www.iana.org/domains/root/db/bingo.html bingo -// bio : 2014-03-06 Identity Digital Limited +// bio : Identity Digital Limited +// https://www.iana.org/domains/root/db/bio.html bio -// black : 2014-01-16 Identity Digital Limited +// black : Identity Digital Limited +// https://www.iana.org/domains/root/db/black.html black -// blackfriday : 2014-01-16 Registry Services, LLC +// blackfriday : Registry Services, LLC +// https://www.iana.org/domains/root/db/blackfriday.html blackfriday -// blockbuster : 2015-07-30 Dish DBS Corporation +// blockbuster : Dish DBS Corporation +// https://www.iana.org/domains/root/db/blockbuster.html blockbuster -// blog : 2015-05-14 Knock Knock WHOIS There, LLC +// blog : Knock Knock WHOIS There, LLC +// https://www.iana.org/domains/root/db/blog.html blog -// bloomberg : 2014-07-17 Bloomberg IP Holdings LLC +// bloomberg : Bloomberg IP Holdings LLC +// https://www.iana.org/domains/root/db/bloomberg.html bloomberg -// blue : 2013-11-07 Identity Digital Limited +// blue : Identity Digital Limited +// https://www.iana.org/domains/root/db/blue.html blue -// bms : 2014-10-30 Bristol-Myers Squibb Company +// bms : Bristol-Myers Squibb Company +// https://www.iana.org/domains/root/db/bms.html bms -// bmw : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft +// bmw : Bayerische Motoren Werke Aktiengesellschaft +// https://www.iana.org/domains/root/db/bmw.html bmw -// bnpparibas : 2014-05-29 BNP Paribas +// bnpparibas : BNP Paribas +// https://www.iana.org/domains/root/db/bnpparibas.html bnpparibas -// boats : 2014-12-04 XYZ.COM LLC +// boats : XYZ.COM LLC +// https://www.iana.org/domains/root/db/boats.html boats -// boehringer : 2015-07-09 Boehringer Ingelheim International GmbH +// boehringer : Boehringer Ingelheim International GmbH +// https://www.iana.org/domains/root/db/boehringer.html boehringer -// bofa : 2015-07-31 Bank of America Corporation +// bofa : Bank of America Corporation +// https://www.iana.org/domains/root/db/bofa.html bofa -// bom : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br +// bom : Núcleo de Informação e Coordenação do Ponto BR - NIC.br +// https://www.iana.org/domains/root/db/bom.html bom -// bond : 2014-06-05 ShortDot SA +// bond : ShortDot SA +// https://www.iana.org/domains/root/db/bond.html bond -// boo : 2014-01-30 Charleston Road Registry Inc. +// boo : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/boo.html boo -// book : 2015-08-27 Amazon Registry Services, Inc. +// book : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/book.html book -// booking : 2015-07-16 Booking.com B.V. +// booking : Booking.com B.V. +// https://www.iana.org/domains/root/db/booking.html booking -// bosch : 2015-06-18 Robert Bosch GMBH +// bosch : Robert Bosch GMBH +// https://www.iana.org/domains/root/db/bosch.html bosch -// bostik : 2015-05-28 Bostik SA +// bostik : Bostik SA +// https://www.iana.org/domains/root/db/bostik.html bostik -// boston : 2015-12-10 Registry Services, LLC +// boston : Registry Services, LLC +// https://www.iana.org/domains/root/db/boston.html boston -// bot : 2014-12-18 Amazon Registry Services, Inc. +// bot : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/bot.html bot -// boutique : 2013-11-14 Binky Moon, LLC +// boutique : Binky Moon, LLC +// https://www.iana.org/domains/root/db/boutique.html boutique -// box : 2015-11-12 Intercap Registry Inc. +// box : Intercap Registry Inc. +// https://www.iana.org/domains/root/db/box.html box -// bradesco : 2014-12-18 Banco Bradesco S.A. +// bradesco : Banco Bradesco S.A. +// https://www.iana.org/domains/root/db/bradesco.html bradesco -// bridgestone : 2014-12-18 Bridgestone Corporation +// bridgestone : Bridgestone Corporation +// https://www.iana.org/domains/root/db/bridgestone.html bridgestone -// broadway : 2014-12-22 Celebrate Broadway, Inc. +// broadway : Celebrate Broadway, Inc. +// https://www.iana.org/domains/root/db/broadway.html broadway -// broker : 2014-12-11 Dog Beach, LLC +// broker : Dog Beach, LLC +// https://www.iana.org/domains/root/db/broker.html broker -// brother : 2015-01-29 Brother Industries, Ltd. +// brother : Brother Industries, Ltd. +// https://www.iana.org/domains/root/db/brother.html brother -// brussels : 2014-02-06 DNS.be vzw +// brussels : DNS.be vzw +// https://www.iana.org/domains/root/db/brussels.html brussels -// build : 2013-11-07 Plan Bee LLC +// build : Plan Bee LLC +// https://www.iana.org/domains/root/db/build.html build -// builders : 2013-11-07 Binky Moon, LLC +// builders : Binky Moon, LLC +// https://www.iana.org/domains/root/db/builders.html builders -// business : 2013-11-07 Binky Moon, LLC +// business : Binky Moon, LLC +// https://www.iana.org/domains/root/db/business.html business -// buy : 2014-12-18 Amazon Registry Services, Inc. +// buy : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/buy.html buy -// buzz : 2013-10-02 DOTSTRATEGY CO. +// buzz : DOTSTRATEGY CO. +// https://www.iana.org/domains/root/db/buzz.html buzz -// bzh : 2014-02-27 Association www.bzh +// bzh : Association www.bzh +// https://www.iana.org/domains/root/db/bzh.html bzh -// cab : 2013-10-24 Binky Moon, LLC +// cab : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cab.html cab -// cafe : 2015-02-11 Binky Moon, LLC +// cafe : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cafe.html cafe -// cal : 2014-07-24 Charleston Road Registry Inc. +// cal : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/cal.html cal -// call : 2014-12-18 Amazon Registry Services, Inc. +// call : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/call.html call -// calvinklein : 2015-07-30 PVH gTLD Holdings LLC +// calvinklein : PVH gTLD Holdings LLC +// https://www.iana.org/domains/root/db/calvinklein.html calvinklein -// cam : 2016-04-21 Cam Connecting SARL +// cam : Cam Connecting SARL +// https://www.iana.org/domains/root/db/cam.html cam -// camera : 2013-08-27 Binky Moon, LLC +// camera : Binky Moon, LLC +// https://www.iana.org/domains/root/db/camera.html camera -// camp : 2013-11-07 Binky Moon, LLC +// camp : Binky Moon, LLC +// https://www.iana.org/domains/root/db/camp.html camp -// canon : 2014-09-12 Canon Inc. +// canon : Canon Inc. +// https://www.iana.org/domains/root/db/canon.html canon -// capetown : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry +// capetown : ZA Central Registry NPC trading as ZA Central Registry +// https://www.iana.org/domains/root/db/capetown.html capetown -// capital : 2014-03-06 Binky Moon, LLC +// capital : Binky Moon, LLC +// https://www.iana.org/domains/root/db/capital.html capital -// capitalone : 2015-08-06 Capital One Financial Corporation +// capitalone : Capital One Financial Corporation +// https://www.iana.org/domains/root/db/capitalone.html capitalone -// car : 2015-01-22 XYZ.COM LLC +// car : XYZ.COM LLC +// https://www.iana.org/domains/root/db/car.html car -// caravan : 2013-12-12 Caravan International, Inc. +// caravan : Caravan International, Inc. +// https://www.iana.org/domains/root/db/caravan.html caravan -// cards : 2013-12-05 Binky Moon, LLC +// cards : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cards.html cards -// care : 2014-03-06 Binky Moon, LLC +// care : Binky Moon, LLC +// https://www.iana.org/domains/root/db/care.html care -// career : 2013-10-09 dotCareer LLC +// career : dotCareer LLC +// https://www.iana.org/domains/root/db/career.html career -// careers : 2013-10-02 Binky Moon, LLC +// careers : Binky Moon, LLC +// https://www.iana.org/domains/root/db/careers.html careers -// cars : 2014-11-13 XYZ.COM LLC +// cars : XYZ.COM LLC +// https://www.iana.org/domains/root/db/cars.html cars -// casa : 2013-11-21 Registry Services, LLC +// casa : Registry Services, LLC +// https://www.iana.org/domains/root/db/casa.html casa -// case : 2015-09-03 Digity, LLC +// case : Digity, LLC +// https://www.iana.org/domains/root/db/case.html case -// cash : 2014-03-06 Binky Moon, LLC +// cash : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cash.html cash -// casino : 2014-12-18 Binky Moon, LLC +// casino : Binky Moon, LLC +// https://www.iana.org/domains/root/db/casino.html casino -// catering : 2013-12-05 Binky Moon, LLC +// catering : Binky Moon, LLC +// https://www.iana.org/domains/root/db/catering.html catering -// catholic : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// catholic : Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// https://www.iana.org/domains/root/db/catholic.html catholic -// cba : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA +// cba : COMMONWEALTH BANK OF AUSTRALIA +// https://www.iana.org/domains/root/db/cba.html cba -// cbn : 2014-08-22 The Christian Broadcasting Network, Inc. +// cbn : The Christian Broadcasting Network, Inc. +// https://www.iana.org/domains/root/db/cbn.html cbn -// cbre : 2015-07-02 CBRE, Inc. +// cbre : CBRE, Inc. +// https://www.iana.org/domains/root/db/cbre.html cbre -// cbs : 2015-08-06 CBS Domains Inc. -cbs - -// center : 2013-11-07 Binky Moon, LLC +// center : Binky Moon, LLC +// https://www.iana.org/domains/root/db/center.html center -// ceo : 2013-11-07 CEOTLD Pty Ltd +// ceo : XYZ.COM LLC +// https://www.iana.org/domains/root/db/ceo.html ceo -// cern : 2014-06-05 European Organization for Nuclear Research ("CERN") +// cern : European Organization for Nuclear Research ("CERN") +// https://www.iana.org/domains/root/db/cern.html cern -// cfa : 2014-08-28 CFA Institute +// cfa : CFA Institute +// https://www.iana.org/domains/root/db/cfa.html cfa -// cfd : 2014-12-11 ShortDot SA +// cfd : ShortDot SA +// https://www.iana.org/domains/root/db/cfd.html cfd -// chanel : 2015-04-09 Chanel International B.V. +// chanel : Chanel International B.V. +// https://www.iana.org/domains/root/db/chanel.html chanel -// channel : 2014-05-08 Charleston Road Registry Inc. +// channel : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/channel.html channel -// charity : 2018-04-11 Public Interest Registry +// charity : Public Interest Registry +// https://www.iana.org/domains/root/db/charity.html charity -// chase : 2015-04-30 JPMorgan Chase Bank, National Association +// chase : JPMorgan Chase Bank, National Association +// https://www.iana.org/domains/root/db/chase.html chase -// chat : 2014-12-04 Binky Moon, LLC +// chat : Binky Moon, LLC +// https://www.iana.org/domains/root/db/chat.html chat -// cheap : 2013-11-14 Binky Moon, LLC +// cheap : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cheap.html cheap -// chintai : 2015-06-11 CHINTAI Corporation +// chintai : CHINTAI Corporation +// https://www.iana.org/domains/root/db/chintai.html chintai -// christmas : 2013-11-21 XYZ.COM LLC +// christmas : XYZ.COM LLC +// https://www.iana.org/domains/root/db/christmas.html christmas -// chrome : 2014-07-24 Charleston Road Registry Inc. +// chrome : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/chrome.html chrome -// church : 2014-02-06 Binky Moon, LLC +// church : Binky Moon, LLC +// https://www.iana.org/domains/root/db/church.html church -// cipriani : 2015-02-19 Hotel Cipriani Srl +// cipriani : Hotel Cipriani Srl +// https://www.iana.org/domains/root/db/cipriani.html cipriani -// circle : 2014-12-18 Amazon Registry Services, Inc. +// circle : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/circle.html circle -// cisco : 2014-12-22 Cisco Technology, Inc. +// cisco : Cisco Technology, Inc. +// https://www.iana.org/domains/root/db/cisco.html cisco -// citadel : 2015-07-23 Citadel Domain LLC +// citadel : Citadel Domain LLC +// https://www.iana.org/domains/root/db/citadel.html citadel -// citi : 2015-07-30 Citigroup Inc. +// citi : Citigroup Inc. +// https://www.iana.org/domains/root/db/citi.html citi -// citic : 2014-01-09 CITIC Group Corporation +// citic : CITIC Group Corporation +// https://www.iana.org/domains/root/db/citic.html citic -// city : 2014-05-29 Binky Moon, LLC +// city : Binky Moon, LLC +// https://www.iana.org/domains/root/db/city.html city -// cityeats : 2014-12-11 Lifestyle Domain Holdings, Inc. -cityeats - -// claims : 2014-03-20 Binky Moon, LLC +// claims : Binky Moon, LLC +// https://www.iana.org/domains/root/db/claims.html claims -// cleaning : 2013-12-05 Binky Moon, LLC +// cleaning : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cleaning.html cleaning -// click : 2014-06-05 Internet Naming Company LLC +// click : Internet Naming Company LLC +// https://www.iana.org/domains/root/db/click.html click -// clinic : 2014-03-20 Binky Moon, LLC +// clinic : Binky Moon, LLC +// https://www.iana.org/domains/root/db/clinic.html clinic -// clinique : 2015-10-01 The Estée Lauder Companies Inc. +// clinique : The Estée Lauder Companies Inc. +// https://www.iana.org/domains/root/db/clinique.html clinique -// clothing : 2013-08-27 Binky Moon, LLC +// clothing : Binky Moon, LLC +// https://www.iana.org/domains/root/db/clothing.html clothing -// cloud : 2015-04-16 Aruba PEC S.p.A. +// cloud : Aruba PEC S.p.A. +// https://www.iana.org/domains/root/db/cloud.html cloud -// club : 2013-11-08 Registry Services, LLC +// club : Registry Services, LLC +// https://www.iana.org/domains/root/db/club.html club -// clubmed : 2015-06-25 Club Méditerranée S.A. +// clubmed : Club Méditerranée S.A. +// https://www.iana.org/domains/root/db/clubmed.html clubmed -// coach : 2014-10-09 Binky Moon, LLC +// coach : Binky Moon, LLC +// https://www.iana.org/domains/root/db/coach.html coach -// codes : 2013-10-31 Binky Moon, LLC +// codes : Binky Moon, LLC +// https://www.iana.org/domains/root/db/codes.html codes -// coffee : 2013-10-17 Binky Moon, LLC +// coffee : Binky Moon, LLC +// https://www.iana.org/domains/root/db/coffee.html coffee -// college : 2014-01-16 XYZ.COM LLC +// college : XYZ.COM LLC +// https://www.iana.org/domains/root/db/college.html college -// cologne : 2014-02-05 dotKoeln GmbH +// cologne : dotKoeln GmbH +// https://www.iana.org/domains/root/db/cologne.html cologne -// comcast : 2015-07-23 Comcast IP Holdings I, LLC +// comcast : Comcast IP Holdings I, LLC +// https://www.iana.org/domains/root/db/comcast.html comcast -// commbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA +// commbank : COMMONWEALTH BANK OF AUSTRALIA +// https://www.iana.org/domains/root/db/commbank.html commbank -// community : 2013-12-05 Binky Moon, LLC +// community : Binky Moon, LLC +// https://www.iana.org/domains/root/db/community.html community -// company : 2013-11-07 Binky Moon, LLC +// company : Binky Moon, LLC +// https://www.iana.org/domains/root/db/company.html company -// compare : 2015-10-08 Registry Services, LLC +// compare : Registry Services, LLC +// https://www.iana.org/domains/root/db/compare.html compare -// computer : 2013-10-24 Binky Moon, LLC +// computer : Binky Moon, LLC +// https://www.iana.org/domains/root/db/computer.html computer -// comsec : 2015-01-08 VeriSign, Inc. +// comsec : VeriSign, Inc. +// https://www.iana.org/domains/root/db/comsec.html comsec -// condos : 2013-12-05 Binky Moon, LLC +// condos : Binky Moon, LLC +// https://www.iana.org/domains/root/db/condos.html condos -// construction : 2013-09-16 Binky Moon, LLC +// construction : Binky Moon, LLC +// https://www.iana.org/domains/root/db/construction.html construction -// consulting : 2013-12-05 Dog Beach, LLC +// consulting : Dog Beach, LLC +// https://www.iana.org/domains/root/db/consulting.html consulting -// contact : 2015-01-08 Dog Beach, LLC +// contact : Dog Beach, LLC +// https://www.iana.org/domains/root/db/contact.html contact -// contractors : 2013-09-10 Binky Moon, LLC +// contractors : Binky Moon, LLC +// https://www.iana.org/domains/root/db/contractors.html contractors -// cooking : 2013-11-21 Registry Services, LLC +// cooking : Registry Services, LLC +// https://www.iana.org/domains/root/db/cooking.html cooking -// cookingchannel : 2015-07-02 Lifestyle Domain Holdings, Inc. -cookingchannel - -// cool : 2013-11-14 Binky Moon, LLC +// cool : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cool.html cool -// corsica : 2014-09-25 Collectivité de Corse +// corsica : Collectivité de Corse +// https://www.iana.org/domains/root/db/corsica.html corsica -// country : 2013-12-19 Internet Naming Company LLC +// country : Internet Naming Company LLC +// https://www.iana.org/domains/root/db/country.html country -// coupon : 2015-02-26 Amazon Registry Services, Inc. +// coupon : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/coupon.html coupon -// coupons : 2015-03-26 Binky Moon, LLC +// coupons : Binky Moon, LLC +// https://www.iana.org/domains/root/db/coupons.html coupons -// courses : 2014-12-04 Registry Services, LLC +// courses : Registry Services, LLC +// https://www.iana.org/domains/root/db/courses.html courses -// cpa : 2019-06-10 American Institute of Certified Public Accountants +// cpa : American Institute of Certified Public Accountants +// https://www.iana.org/domains/root/db/cpa.html cpa -// credit : 2014-03-20 Binky Moon, LLC +// credit : Binky Moon, LLC +// https://www.iana.org/domains/root/db/credit.html credit -// creditcard : 2014-03-20 Binky Moon, LLC +// creditcard : Binky Moon, LLC +// https://www.iana.org/domains/root/db/creditcard.html creditcard -// creditunion : 2015-01-22 DotCooperation LLC +// creditunion : DotCooperation LLC +// https://www.iana.org/domains/root/db/creditunion.html creditunion -// cricket : 2014-10-09 dot Cricket Limited +// cricket : dot Cricket Limited +// https://www.iana.org/domains/root/db/cricket.html cricket -// crown : 2014-10-24 Crown Equipment Corporation +// crown : Crown Equipment Corporation +// https://www.iana.org/domains/root/db/crown.html crown -// crs : 2014-04-03 Federated Co-operatives Limited +// crs : Federated Co-operatives Limited +// https://www.iana.org/domains/root/db/crs.html crs -// cruise : 2015-12-10 Viking River Cruises (Bermuda) Ltd. +// cruise : Viking River Cruises (Bermuda) Ltd. +// https://www.iana.org/domains/root/db/cruise.html cruise -// cruises : 2013-12-05 Binky Moon, LLC +// cruises : Binky Moon, LLC +// https://www.iana.org/domains/root/db/cruises.html cruises -// cuisinella : 2014-04-03 SCHMIDT GROUPE S.A.S. +// cuisinella : SCHMIDT GROUPE S.A.S. +// https://www.iana.org/domains/root/db/cuisinella.html cuisinella -// cymru : 2014-05-08 Nominet UK +// cymru : Nominet UK +// https://www.iana.org/domains/root/db/cymru.html cymru -// cyou : 2015-01-22 ShortDot SA +// cyou : ShortDot SA +// https://www.iana.org/domains/root/db/cyou.html cyou -// dabur : 2014-02-06 Dabur India Limited +// dabur : Dabur India Limited +// https://www.iana.org/domains/root/db/dabur.html dabur -// dad : 2014-01-23 Charleston Road Registry Inc. +// dad : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/dad.html dad -// dance : 2013-10-24 Dog Beach, LLC +// dance : Dog Beach, LLC +// https://www.iana.org/domains/root/db/dance.html dance -// data : 2016-06-02 Dish DBS Corporation +// data : Dish DBS Corporation +// https://www.iana.org/domains/root/db/data.html data -// date : 2014-11-20 dot Date Limited +// date : dot Date Limited +// https://www.iana.org/domains/root/db/date.html date -// dating : 2013-12-05 Binky Moon, LLC +// dating : Binky Moon, LLC +// https://www.iana.org/domains/root/db/dating.html dating -// datsun : 2014-03-27 NISSAN MOTOR CO., LTD. +// datsun : NISSAN MOTOR CO., LTD. +// https://www.iana.org/domains/root/db/datsun.html datsun -// day : 2014-01-30 Charleston Road Registry Inc. +// day : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/day.html day -// dclk : 2014-11-20 Charleston Road Registry Inc. +// dclk : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/dclk.html dclk -// dds : 2015-05-07 Registry Services, LLC +// dds : Registry Services, LLC +// https://www.iana.org/domains/root/db/dds.html dds -// deal : 2015-06-25 Amazon Registry Services, Inc. +// deal : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/deal.html deal -// dealer : 2014-12-22 Intercap Registry Inc. +// dealer : Intercap Registry Inc. +// https://www.iana.org/domains/root/db/dealer.html dealer -// deals : 2014-05-22 Binky Moon, LLC +// deals : Binky Moon, LLC +// https://www.iana.org/domains/root/db/deals.html deals -// degree : 2014-03-06 Dog Beach, LLC +// degree : Dog Beach, LLC +// https://www.iana.org/domains/root/db/degree.html degree -// delivery : 2014-09-11 Binky Moon, LLC +// delivery : Binky Moon, LLC +// https://www.iana.org/domains/root/db/delivery.html delivery -// dell : 2014-10-24 Dell Inc. +// dell : Dell Inc. +// https://www.iana.org/domains/root/db/dell.html dell -// deloitte : 2015-07-31 Deloitte Touche Tohmatsu +// deloitte : Deloitte Touche Tohmatsu +// https://www.iana.org/domains/root/db/deloitte.html deloitte -// delta : 2015-02-19 Delta Air Lines, Inc. +// delta : Delta Air Lines, Inc. +// https://www.iana.org/domains/root/db/delta.html delta -// democrat : 2013-10-24 Dog Beach, LLC +// democrat : Dog Beach, LLC +// https://www.iana.org/domains/root/db/democrat.html democrat -// dental : 2014-03-20 Binky Moon, LLC +// dental : Binky Moon, LLC +// https://www.iana.org/domains/root/db/dental.html dental -// dentist : 2014-03-20 Dog Beach, LLC +// dentist : Dog Beach, LLC +// https://www.iana.org/domains/root/db/dentist.html dentist -// desi : 2013-11-14 Desi Networks LLC -desi - -// design : 2014-11-07 Registry Services, LLC +// design : Registry Services, LLC +// https://www.iana.org/domains/root/db/design.html design -// dev : 2014-10-16 Charleston Road Registry Inc. +// dev : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/dev.html dev -// dhl : 2015-07-23 Deutsche Post AG +// dhl : Deutsche Post AG +// https://www.iana.org/domains/root/db/dhl.html dhl -// diamonds : 2013-09-22 Binky Moon, LLC +// diamonds : Binky Moon, LLC +// https://www.iana.org/domains/root/db/diamonds.html diamonds -// diet : 2014-06-26 XYZ.COM LLC +// diet : XYZ.COM LLC +// https://www.iana.org/domains/root/db/diet.html diet -// digital : 2014-03-06 Binky Moon, LLC +// digital : Binky Moon, LLC +// https://www.iana.org/domains/root/db/digital.html digital -// direct : 2014-04-10 Binky Moon, LLC +// direct : Binky Moon, LLC +// https://www.iana.org/domains/root/db/direct.html direct -// directory : 2013-09-20 Binky Moon, LLC +// directory : Binky Moon, LLC +// https://www.iana.org/domains/root/db/directory.html directory -// discount : 2014-03-06 Binky Moon, LLC +// discount : Binky Moon, LLC +// https://www.iana.org/domains/root/db/discount.html discount -// discover : 2015-07-23 Discover Financial Services +// discover : Discover Financial Services +// https://www.iana.org/domains/root/db/discover.html discover -// dish : 2015-07-30 Dish DBS Corporation +// dish : Dish DBS Corporation +// https://www.iana.org/domains/root/db/dish.html dish -// diy : 2015-11-05 Lifestyle Domain Holdings, Inc. +// diy : Lifestyle Domain Holdings, Inc. +// https://www.iana.org/domains/root/db/diy.html diy -// dnp : 2013-12-13 Dai Nippon Printing Co., Ltd. +// dnp : Dai Nippon Printing Co., Ltd. +// https://www.iana.org/domains/root/db/dnp.html dnp -// docs : 2014-10-16 Charleston Road Registry Inc. +// docs : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/docs.html docs -// doctor : 2016-06-02 Binky Moon, LLC +// doctor : Binky Moon, LLC +// https://www.iana.org/domains/root/db/doctor.html doctor -// dog : 2014-12-04 Binky Moon, LLC +// dog : Binky Moon, LLC +// https://www.iana.org/domains/root/db/dog.html dog -// domains : 2013-10-17 Binky Moon, LLC +// domains : Binky Moon, LLC +// https://www.iana.org/domains/root/db/domains.html domains -// dot : 2015-05-21 Dish DBS Corporation +// dot : Dish DBS Corporation +// https://www.iana.org/domains/root/db/dot.html dot -// download : 2014-11-20 dot Support Limited +// download : dot Support Limited +// https://www.iana.org/domains/root/db/download.html download -// drive : 2015-03-05 Charleston Road Registry Inc. +// drive : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/drive.html drive -// dtv : 2015-06-04 Dish DBS Corporation +// dtv : Dish DBS Corporation +// https://www.iana.org/domains/root/db/dtv.html dtv -// dubai : 2015-01-01 Dubai Smart Government Department +// dubai : Dubai Smart Government Department +// https://www.iana.org/domains/root/db/dubai.html dubai -// dunlop : 2015-07-02 The Goodyear Tire & Rubber Company +// dunlop : The Goodyear Tire & Rubber Company +// https://www.iana.org/domains/root/db/dunlop.html dunlop -// dupont : 2015-06-25 DuPont Specialty Products USA, LLC +// dupont : DuPont Specialty Products USA, LLC +// https://www.iana.org/domains/root/db/dupont.html dupont -// durban : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry +// durban : ZA Central Registry NPC trading as ZA Central Registry +// https://www.iana.org/domains/root/db/durban.html durban -// dvag : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +// dvag : Deutsche Vermögensberatung Aktiengesellschaft DVAG +// https://www.iana.org/domains/root/db/dvag.html dvag -// dvr : 2016-05-26 DISH Technologies L.L.C. +// dvr : DISH Technologies L.L.C. +// https://www.iana.org/domains/root/db/dvr.html dvr -// earth : 2014-12-04 Interlink Systems Innovation Institute K.K. +// earth : Interlink Systems Innovation Institute K.K. +// https://www.iana.org/domains/root/db/earth.html earth -// eat : 2014-01-23 Charleston Road Registry Inc. +// eat : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/eat.html eat -// eco : 2016-07-08 Big Room Inc. +// eco : Big Room Inc. +// https://www.iana.org/domains/root/db/eco.html eco -// edeka : 2014-12-18 EDEKA Verband kaufmännischer Genossenschaften e.V. +// edeka : EDEKA Verband kaufmännischer Genossenschaften e.V. +// https://www.iana.org/domains/root/db/edeka.html edeka -// education : 2013-11-07 Binky Moon, LLC +// education : Binky Moon, LLC +// https://www.iana.org/domains/root/db/education.html education -// email : 2013-10-31 Binky Moon, LLC +// email : Binky Moon, LLC +// https://www.iana.org/domains/root/db/email.html email -// emerck : 2014-04-03 Merck KGaA +// emerck : Merck KGaA +// https://www.iana.org/domains/root/db/emerck.html emerck -// energy : 2014-09-11 Binky Moon, LLC +// energy : Binky Moon, LLC +// https://www.iana.org/domains/root/db/energy.html energy -// engineer : 2014-03-06 Dog Beach, LLC +// engineer : Dog Beach, LLC +// https://www.iana.org/domains/root/db/engineer.html engineer -// engineering : 2014-03-06 Binky Moon, LLC +// engineering : Binky Moon, LLC +// https://www.iana.org/domains/root/db/engineering.html engineering -// enterprises : 2013-09-20 Binky Moon, LLC +// enterprises : Binky Moon, LLC +// https://www.iana.org/domains/root/db/enterprises.html enterprises -// epson : 2014-12-04 Seiko Epson Corporation +// epson : Seiko Epson Corporation +// https://www.iana.org/domains/root/db/epson.html epson -// equipment : 2013-08-27 Binky Moon, LLC +// equipment : Binky Moon, LLC +// https://www.iana.org/domains/root/db/equipment.html equipment -// ericsson : 2015-07-09 Telefonaktiebolaget L M Ericsson +// ericsson : Telefonaktiebolaget L M Ericsson +// https://www.iana.org/domains/root/db/ericsson.html ericsson -// erni : 2014-04-03 ERNI Group Holding AG +// erni : ERNI Group Holding AG +// https://www.iana.org/domains/root/db/erni.html erni -// esq : 2014-05-08 Charleston Road Registry Inc. +// esq : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/esq.html esq -// estate : 2013-08-27 Binky Moon, LLC +// estate : Binky Moon, LLC +// https://www.iana.org/domains/root/db/estate.html estate -// etisalat : 2015-09-03 Emirates Telecommunications Corporation (trading as Etisalat) +// etisalat : Emirates Telecommunications Corporation (trading as Etisalat) +// https://www.iana.org/domains/root/db/etisalat.html etisalat -// eurovision : 2014-04-24 European Broadcasting Union (EBU) +// eurovision : European Broadcasting Union (EBU) +// https://www.iana.org/domains/root/db/eurovision.html eurovision -// eus : 2013-12-12 Puntueus Fundazioa +// eus : Puntueus Fundazioa +// https://www.iana.org/domains/root/db/eus.html eus -// events : 2013-12-05 Binky Moon, LLC +// events : Binky Moon, LLC +// https://www.iana.org/domains/root/db/events.html events -// exchange : 2014-03-06 Binky Moon, LLC +// exchange : Binky Moon, LLC +// https://www.iana.org/domains/root/db/exchange.html exchange -// expert : 2013-11-21 Binky Moon, LLC +// expert : Binky Moon, LLC +// https://www.iana.org/domains/root/db/expert.html expert -// exposed : 2013-12-05 Binky Moon, LLC +// exposed : Binky Moon, LLC +// https://www.iana.org/domains/root/db/exposed.html exposed -// express : 2015-02-11 Binky Moon, LLC +// express : Binky Moon, LLC +// https://www.iana.org/domains/root/db/express.html express -// extraspace : 2015-05-14 Extra Space Storage LLC +// extraspace : Extra Space Storage LLC +// https://www.iana.org/domains/root/db/extraspace.html extraspace -// fage : 2014-12-18 Fage International S.A. +// fage : Fage International S.A. +// https://www.iana.org/domains/root/db/fage.html fage -// fail : 2014-03-06 Binky Moon, LLC +// fail : Binky Moon, LLC +// https://www.iana.org/domains/root/db/fail.html fail -// fairwinds : 2014-11-13 FairWinds Partners, LLC +// fairwinds : FairWinds Partners, LLC +// https://www.iana.org/domains/root/db/fairwinds.html fairwinds -// faith : 2014-11-20 dot Faith Limited +// faith : dot Faith Limited +// https://www.iana.org/domains/root/db/faith.html faith -// family : 2015-04-02 Dog Beach, LLC +// family : Dog Beach, LLC +// https://www.iana.org/domains/root/db/family.html family -// fan : 2014-03-06 Dog Beach, LLC +// fan : Dog Beach, LLC +// https://www.iana.org/domains/root/db/fan.html fan -// fans : 2014-11-07 ZDNS International Limited +// fans : ZDNS International Limited +// https://www.iana.org/domains/root/db/fans.html fans -// farm : 2013-11-07 Binky Moon, LLC +// farm : Binky Moon, LLC +// https://www.iana.org/domains/root/db/farm.html farm -// farmers : 2015-07-09 Farmers Insurance Exchange +// farmers : Farmers Insurance Exchange +// https://www.iana.org/domains/root/db/farmers.html farmers -// fashion : 2014-07-03 Registry Services, LLC +// fashion : Registry Services, LLC +// https://www.iana.org/domains/root/db/fashion.html fashion -// fast : 2014-12-18 Amazon Registry Services, Inc. +// fast : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/fast.html fast -// fedex : 2015-08-06 Federal Express Corporation +// fedex : Federal Express Corporation +// https://www.iana.org/domains/root/db/fedex.html fedex -// feedback : 2013-12-19 Top Level Spectrum, Inc. +// feedback : Top Level Spectrum, Inc. +// https://www.iana.org/domains/root/db/feedback.html feedback -// ferrari : 2015-07-31 Fiat Chrysler Automobiles N.V. +// ferrari : Fiat Chrysler Automobiles N.V. +// https://www.iana.org/domains/root/db/ferrari.html ferrari -// ferrero : 2014-12-18 Ferrero Trading Lux S.A. +// ferrero : Ferrero Trading Lux S.A. +// https://www.iana.org/domains/root/db/ferrero.html ferrero -// fiat : 2015-07-31 Fiat Chrysler Automobiles N.V. -fiat - -// fidelity : 2015-07-30 Fidelity Brokerage Services LLC +// fidelity : Fidelity Brokerage Services LLC +// https://www.iana.org/domains/root/db/fidelity.html fidelity -// fido : 2015-08-06 Rogers Communications Canada Inc. +// fido : Rogers Communications Canada Inc. +// https://www.iana.org/domains/root/db/fido.html fido -// film : 2015-01-08 Motion Picture Domain Registry Pty Ltd +// film : Motion Picture Domain Registry Pty Ltd +// https://www.iana.org/domains/root/db/film.html film -// final : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br +// final : Núcleo de Informação e Coordenação do Ponto BR - NIC.br +// https://www.iana.org/domains/root/db/final.html final -// finance : 2014-03-20 Binky Moon, LLC +// finance : Binky Moon, LLC +// https://www.iana.org/domains/root/db/finance.html finance -// financial : 2014-03-06 Binky Moon, LLC +// financial : Binky Moon, LLC +// https://www.iana.org/domains/root/db/financial.html financial -// fire : 2015-06-25 Amazon Registry Services, Inc. +// fire : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/fire.html fire -// firestone : 2014-12-18 Bridgestone Licensing Services, Inc +// firestone : Bridgestone Licensing Services, Inc +// https://www.iana.org/domains/root/db/firestone.html firestone -// firmdale : 2014-03-27 Firmdale Holdings Limited +// firmdale : Firmdale Holdings Limited +// https://www.iana.org/domains/root/db/firmdale.html firmdale -// fish : 2013-12-12 Binky Moon, LLC +// fish : Binky Moon, LLC +// https://www.iana.org/domains/root/db/fish.html fish -// fishing : 2013-11-21 Registry Services, LLC +// fishing : Registry Services, LLC +// https://www.iana.org/domains/root/db/fishing.html fishing -// fit : 2014-11-07 Registry Services, LLC +// fit : Registry Services, LLC +// https://www.iana.org/domains/root/db/fit.html fit -// fitness : 2014-03-06 Binky Moon, LLC +// fitness : Binky Moon, LLC +// https://www.iana.org/domains/root/db/fitness.html fitness -// flickr : 2015-04-02 Flickr, Inc. +// flickr : Flickr, Inc. +// https://www.iana.org/domains/root/db/flickr.html flickr -// flights : 2013-12-05 Binky Moon, LLC +// flights : Binky Moon, LLC +// https://www.iana.org/domains/root/db/flights.html flights -// flir : 2015-07-23 FLIR Systems, Inc. +// flir : FLIR Systems, Inc. +// https://www.iana.org/domains/root/db/flir.html flir -// florist : 2013-11-07 Binky Moon, LLC +// florist : Binky Moon, LLC +// https://www.iana.org/domains/root/db/florist.html florist -// flowers : 2014-10-09 XYZ.COM LLC +// flowers : XYZ.COM LLC +// https://www.iana.org/domains/root/db/flowers.html flowers -// fly : 2014-05-08 Charleston Road Registry Inc. +// fly : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/fly.html fly -// foo : 2014-01-23 Charleston Road Registry Inc. +// foo : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/foo.html foo -// food : 2016-04-21 Lifestyle Domain Holdings, Inc. +// food : Lifestyle Domain Holdings, Inc. +// https://www.iana.org/domains/root/db/food.html food -// foodnetwork : 2015-07-02 Lifestyle Domain Holdings, Inc. -foodnetwork - -// football : 2014-12-18 Binky Moon, LLC +// football : Binky Moon, LLC +// https://www.iana.org/domains/root/db/football.html football -// ford : 2014-11-13 Ford Motor Company +// ford : Ford Motor Company +// https://www.iana.org/domains/root/db/ford.html ford -// forex : 2014-12-11 Dog Beach, LLC +// forex : Dog Beach, LLC +// https://www.iana.org/domains/root/db/forex.html forex -// forsale : 2014-05-22 Dog Beach, LLC +// forsale : Dog Beach, LLC +// https://www.iana.org/domains/root/db/forsale.html forsale -// forum : 2015-04-02 Fegistry, LLC +// forum : Fegistry, LLC +// https://www.iana.org/domains/root/db/forum.html forum -// foundation : 2013-12-05 Public Interest Registry +// foundation : Public Interest Registry +// https://www.iana.org/domains/root/db/foundation.html foundation -// fox : 2015-09-11 FOX Registry, LLC +// fox : FOX Registry, LLC +// https://www.iana.org/domains/root/db/fox.html fox -// free : 2015-12-10 Amazon Registry Services, Inc. +// free : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/free.html free -// fresenius : 2015-07-30 Fresenius Immobilien-Verwaltungs-GmbH +// fresenius : Fresenius Immobilien-Verwaltungs-GmbH +// https://www.iana.org/domains/root/db/fresenius.html fresenius -// frl : 2014-05-15 FRLregistry B.V. +// frl : FRLregistry B.V. +// https://www.iana.org/domains/root/db/frl.html frl -// frogans : 2013-12-19 OP3FT +// frogans : OP3FT +// https://www.iana.org/domains/root/db/frogans.html frogans -// frontdoor : 2015-07-02 Lifestyle Domain Holdings, Inc. -frontdoor - -// frontier : 2015-02-05 Frontier Communications Corporation +// frontier : Frontier Communications Corporation +// https://www.iana.org/domains/root/db/frontier.html frontier -// ftr : 2015-07-16 Frontier Communications Corporation +// ftr : Frontier Communications Corporation +// https://www.iana.org/domains/root/db/ftr.html ftr -// fujitsu : 2015-07-30 Fujitsu Limited +// fujitsu : Fujitsu Limited +// https://www.iana.org/domains/root/db/fujitsu.html fujitsu -// fun : 2016-01-14 Radix FZC +// fun : Radix FZC DMCC +// https://www.iana.org/domains/root/db/fun.html fun -// fund : 2014-03-20 Binky Moon, LLC +// fund : Binky Moon, LLC +// https://www.iana.org/domains/root/db/fund.html fund -// furniture : 2014-03-20 Binky Moon, LLC +// furniture : Binky Moon, LLC +// https://www.iana.org/domains/root/db/furniture.html furniture -// futbol : 2013-09-20 Dog Beach, LLC +// futbol : Dog Beach, LLC +// https://www.iana.org/domains/root/db/futbol.html futbol -// fyi : 2015-04-02 Binky Moon, LLC +// fyi : Binky Moon, LLC +// https://www.iana.org/domains/root/db/fyi.html fyi -// gal : 2013-11-07 Asociación puntoGAL +// gal : Asociación puntoGAL +// https://www.iana.org/domains/root/db/gal.html gal -// gallery : 2013-09-13 Binky Moon, LLC +// gallery : Binky Moon, LLC +// https://www.iana.org/domains/root/db/gallery.html gallery -// gallo : 2015-06-11 Gallo Vineyards, Inc. +// gallo : Gallo Vineyards, Inc. +// https://www.iana.org/domains/root/db/gallo.html gallo -// gallup : 2015-02-19 Gallup, Inc. +// gallup : Gallup, Inc. +// https://www.iana.org/domains/root/db/gallup.html gallup -// game : 2015-05-28 XYZ.COM LLC +// game : XYZ.COM LLC +// https://www.iana.org/domains/root/db/game.html game -// games : 2015-05-28 Dog Beach, LLC +// games : Dog Beach, LLC +// https://www.iana.org/domains/root/db/games.html games -// gap : 2015-07-31 The Gap, Inc. +// gap : The Gap, Inc. +// https://www.iana.org/domains/root/db/gap.html gap -// garden : 2014-06-26 Registry Services, LLC +// garden : Registry Services, LLC +// https://www.iana.org/domains/root/db/garden.html garden -// gay : 2019-05-23 Top Level Design, LLC +// gay : Registry Services, LLC +// https://www.iana.org/domains/root/db/gay.html gay -// gbiz : 2014-07-17 Charleston Road Registry Inc. +// gbiz : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/gbiz.html gbiz -// gdn : 2014-07-31 Joint Stock Company "Navigation-information systems" +// gdn : Joint Stock Company "Navigation-information systems" +// https://www.iana.org/domains/root/db/gdn.html gdn -// gea : 2014-12-04 GEA Group Aktiengesellschaft +// gea : GEA Group Aktiengesellschaft +// https://www.iana.org/domains/root/db/gea.html gea -// gent : 2014-01-23 Easyhost BV +// gent : Easyhost BV +// https://www.iana.org/domains/root/db/gent.html gent -// genting : 2015-03-12 Resorts World Inc Pte. Ltd. +// genting : Resorts World Inc Pte. Ltd. +// https://www.iana.org/domains/root/db/genting.html genting -// george : 2015-07-31 Wal-Mart Stores, Inc. +// george : Wal-Mart Stores, Inc. +// https://www.iana.org/domains/root/db/george.html george -// ggee : 2014-01-09 GMO Internet, Inc. +// ggee : GMO Internet, Inc. +// https://www.iana.org/domains/root/db/ggee.html ggee -// gift : 2013-10-17 DotGift, LLC +// gift : DotGift, LLC +// https://www.iana.org/domains/root/db/gift.html gift -// gifts : 2014-07-03 Binky Moon, LLC +// gifts : Binky Moon, LLC +// https://www.iana.org/domains/root/db/gifts.html gifts -// gives : 2014-03-06 Public Interest Registry +// gives : Public Interest Registry +// https://www.iana.org/domains/root/db/gives.html gives -// giving : 2014-11-13 Public Interest Registry +// giving : Public Interest Registry +// https://www.iana.org/domains/root/db/giving.html giving -// glass : 2013-11-07 Binky Moon, LLC +// glass : Binky Moon, LLC +// https://www.iana.org/domains/root/db/glass.html glass -// gle : 2014-07-24 Charleston Road Registry Inc. +// gle : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/gle.html gle -// global : 2014-04-17 Identity Digital Limited +// global : Identity Digital Limited +// https://www.iana.org/domains/root/db/global.html global -// globo : 2013-12-19 Globo Comunicação e Participações S.A +// globo : Globo Comunicação e Participações S.A +// https://www.iana.org/domains/root/db/globo.html globo -// gmail : 2014-05-01 Charleston Road Registry Inc. +// gmail : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/gmail.html gmail -// gmbh : 2016-01-29 Binky Moon, LLC +// gmbh : Binky Moon, LLC +// https://www.iana.org/domains/root/db/gmbh.html gmbh -// gmo : 2014-01-09 GMO Internet, Inc. +// gmo : GMO Internet, Inc. +// https://www.iana.org/domains/root/db/gmo.html gmo -// gmx : 2014-04-24 1&1 Mail & Media GmbH +// gmx : 1&1 Mail & Media GmbH +// https://www.iana.org/domains/root/db/gmx.html gmx -// godaddy : 2015-07-23 Go Daddy East, LLC +// godaddy : Go Daddy East, LLC +// https://www.iana.org/domains/root/db/godaddy.html godaddy -// gold : 2015-01-22 Binky Moon, LLC +// gold : Binky Moon, LLC +// https://www.iana.org/domains/root/db/gold.html gold -// goldpoint : 2014-11-20 YODOBASHI CAMERA CO.,LTD. +// goldpoint : YODOBASHI CAMERA CO.,LTD. +// https://www.iana.org/domains/root/db/goldpoint.html goldpoint -// golf : 2014-12-18 Binky Moon, LLC +// golf : Binky Moon, LLC +// https://www.iana.org/domains/root/db/golf.html golf -// goo : 2014-12-18 NTT Resonant Inc. +// goo : NTT Resonant Inc. +// https://www.iana.org/domains/root/db/goo.html goo -// goodyear : 2015-07-02 The Goodyear Tire & Rubber Company +// goodyear : The Goodyear Tire & Rubber Company +// https://www.iana.org/domains/root/db/goodyear.html goodyear -// goog : 2014-11-20 Charleston Road Registry Inc. +// goog : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/goog.html goog -// google : 2014-07-24 Charleston Road Registry Inc. +// google : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/google.html google -// gop : 2014-01-16 Republican State Leadership Committee, Inc. +// gop : Republican State Leadership Committee, Inc. +// https://www.iana.org/domains/root/db/gop.html gop -// got : 2014-12-18 Amazon Registry Services, Inc. +// got : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/got.html got -// grainger : 2015-05-07 Grainger Registry Services, LLC +// grainger : Grainger Registry Services, LLC +// https://www.iana.org/domains/root/db/grainger.html grainger -// graphics : 2013-09-13 Binky Moon, LLC +// graphics : Binky Moon, LLC +// https://www.iana.org/domains/root/db/graphics.html graphics -// gratis : 2014-03-20 Binky Moon, LLC +// gratis : Binky Moon, LLC +// https://www.iana.org/domains/root/db/gratis.html gratis -// green : 2014-05-08 Identity Digital Limited +// green : Identity Digital Limited +// https://www.iana.org/domains/root/db/green.html green -// gripe : 2014-03-06 Binky Moon, LLC +// gripe : Binky Moon, LLC +// https://www.iana.org/domains/root/db/gripe.html gripe -// grocery : 2016-06-16 Wal-Mart Stores, Inc. +// grocery : Wal-Mart Stores, Inc. +// https://www.iana.org/domains/root/db/grocery.html grocery -// group : 2014-08-15 Binky Moon, LLC +// group : Binky Moon, LLC +// https://www.iana.org/domains/root/db/group.html group -// guardian : 2015-07-30 The Guardian Life Insurance Company of America +// guardian : The Guardian Life Insurance Company of America +// https://www.iana.org/domains/root/db/guardian.html guardian -// gucci : 2014-11-13 Guccio Gucci S.p.a. +// gucci : Guccio Gucci S.p.a. +// https://www.iana.org/domains/root/db/gucci.html gucci -// guge : 2014-08-28 Charleston Road Registry Inc. +// guge : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/guge.html guge -// guide : 2013-09-13 Binky Moon, LLC +// guide : Binky Moon, LLC +// https://www.iana.org/domains/root/db/guide.html guide -// guitars : 2013-11-14 XYZ.COM LLC +// guitars : XYZ.COM LLC +// https://www.iana.org/domains/root/db/guitars.html guitars -// guru : 2013-08-27 Binky Moon, LLC +// guru : Binky Moon, LLC +// https://www.iana.org/domains/root/db/guru.html guru -// hair : 2015-12-03 XYZ.COM LLC +// hair : XYZ.COM LLC +// https://www.iana.org/domains/root/db/hair.html hair -// hamburg : 2014-02-20 Hamburg Top-Level-Domain GmbH +// hamburg : Hamburg Top-Level-Domain GmbH +// https://www.iana.org/domains/root/db/hamburg.html hamburg -// hangout : 2014-11-13 Charleston Road Registry Inc. +// hangout : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/hangout.html hangout -// haus : 2013-12-05 Dog Beach, LLC +// haus : Dog Beach, LLC +// https://www.iana.org/domains/root/db/haus.html haus -// hbo : 2015-07-30 HBO Registry Services, Inc. +// hbo : HBO Registry Services, Inc. +// https://www.iana.org/domains/root/db/hbo.html hbo -// hdfc : 2015-07-30 HOUSING DEVELOPMENT FINANCE CORPORATION LIMITED +// hdfc : HOUSING DEVELOPMENT FINANCE CORPORATION LIMITED +// https://www.iana.org/domains/root/db/hdfc.html hdfc -// hdfcbank : 2015-02-12 HDFC Bank Limited +// hdfcbank : HDFC Bank Limited +// https://www.iana.org/domains/root/db/hdfcbank.html hdfcbank -// health : 2015-02-11 DotHealth, LLC +// health : Registry Services, LLC +// https://www.iana.org/domains/root/db/health.html health -// healthcare : 2014-06-12 Binky Moon, LLC +// healthcare : Binky Moon, LLC +// https://www.iana.org/domains/root/db/healthcare.html healthcare -// help : 2014-06-26 Innovation service Limited +// help : Innovation service Limited +// https://www.iana.org/domains/root/db/help.html help -// helsinki : 2015-02-05 City of Helsinki +// helsinki : City of Helsinki +// https://www.iana.org/domains/root/db/helsinki.html helsinki -// here : 2014-02-06 Charleston Road Registry Inc. +// here : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/here.html here -// hermes : 2014-07-10 HERMES INTERNATIONAL +// hermes : HERMES INTERNATIONAL +// https://www.iana.org/domains/root/db/hermes.html hermes -// hgtv : 2015-07-02 Lifestyle Domain Holdings, Inc. -hgtv - -// hiphop : 2014-03-06 Dot Hip Hop, LLC +// hiphop : Dot Hip Hop, LLC +// https://www.iana.org/domains/root/db/hiphop.html hiphop -// hisamitsu : 2015-07-16 Hisamitsu Pharmaceutical Co.,Inc. +// hisamitsu : Hisamitsu Pharmaceutical Co.,Inc. +// https://www.iana.org/domains/root/db/hisamitsu.html hisamitsu -// hitachi : 2014-10-31 Hitachi, Ltd. +// hitachi : Hitachi, Ltd. +// https://www.iana.org/domains/root/db/hitachi.html hitachi -// hiv : 2014-03-13 Internet Naming Company LLC +// hiv : Internet Naming Company LLC +// https://www.iana.org/domains/root/db/hiv.html hiv -// hkt : 2015-05-14 PCCW-HKT DataCom Services Limited +// hkt : PCCW-HKT DataCom Services Limited +// https://www.iana.org/domains/root/db/hkt.html hkt -// hockey : 2015-03-19 Binky Moon, LLC +// hockey : Binky Moon, LLC +// https://www.iana.org/domains/root/db/hockey.html hockey -// holdings : 2013-08-27 Binky Moon, LLC +// holdings : Binky Moon, LLC +// https://www.iana.org/domains/root/db/holdings.html holdings -// holiday : 2013-11-07 Binky Moon, LLC +// holiday : Binky Moon, LLC +// https://www.iana.org/domains/root/db/holiday.html holiday -// homedepot : 2015-04-02 Home Depot Product Authority, LLC +// homedepot : Home Depot Product Authority, LLC +// https://www.iana.org/domains/root/db/homedepot.html homedepot -// homegoods : 2015-07-16 The TJX Companies, Inc. +// homegoods : The TJX Companies, Inc. +// https://www.iana.org/domains/root/db/homegoods.html homegoods -// homes : 2014-01-09 XYZ.COM LLC +// homes : XYZ.COM LLC +// https://www.iana.org/domains/root/db/homes.html homes -// homesense : 2015-07-16 The TJX Companies, Inc. +// homesense : The TJX Companies, Inc. +// https://www.iana.org/domains/root/db/homesense.html homesense -// honda : 2014-12-18 Honda Motor Co., Ltd. +// honda : Honda Motor Co., Ltd. +// https://www.iana.org/domains/root/db/honda.html honda -// horse : 2013-11-21 Registry Services, LLC +// horse : Registry Services, LLC +// https://www.iana.org/domains/root/db/horse.html horse -// hospital : 2016-10-20 Binky Moon, LLC +// hospital : Binky Moon, LLC +// https://www.iana.org/domains/root/db/hospital.html hospital -// host : 2014-04-17 Radix FZC +// host : Radix FZC DMCC +// https://www.iana.org/domains/root/db/host.html host -// hosting : 2014-05-29 XYZ.COM LLC +// hosting : XYZ.COM LLC +// https://www.iana.org/domains/root/db/hosting.html hosting -// hot : 2015-08-27 Amazon Registry Services, Inc. +// hot : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/hot.html hot -// hoteles : 2015-03-05 Travel Reservations SRL -hoteles - -// hotels : 2016-04-07 Booking.com B.V. +// hotels : Booking.com B.V. +// https://www.iana.org/domains/root/db/hotels.html hotels -// hotmail : 2014-12-18 Microsoft Corporation +// hotmail : Microsoft Corporation +// https://www.iana.org/domains/root/db/hotmail.html hotmail -// house : 2013-11-07 Binky Moon, LLC +// house : Binky Moon, LLC +// https://www.iana.org/domains/root/db/house.html house -// how : 2014-01-23 Charleston Road Registry Inc. +// how : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/how.html how -// hsbc : 2014-10-24 HSBC Global Services (UK) Limited +// hsbc : HSBC Global Services (UK) Limited +// https://www.iana.org/domains/root/db/hsbc.html hsbc -// hughes : 2015-07-30 Hughes Satellite Systems Corporation +// hughes : Hughes Satellite Systems Corporation +// https://www.iana.org/domains/root/db/hughes.html hughes -// hyatt : 2015-07-30 Hyatt GTLD, L.L.C. +// hyatt : Hyatt GTLD, L.L.C. +// https://www.iana.org/domains/root/db/hyatt.html hyatt -// hyundai : 2015-07-09 Hyundai Motor Company +// hyundai : Hyundai Motor Company +// https://www.iana.org/domains/root/db/hyundai.html hyundai -// ibm : 2014-07-31 International Business Machines Corporation +// ibm : International Business Machines Corporation +// https://www.iana.org/domains/root/db/ibm.html ibm -// icbc : 2015-02-19 Industrial and Commercial Bank of China Limited +// icbc : Industrial and Commercial Bank of China Limited +// https://www.iana.org/domains/root/db/icbc.html icbc -// ice : 2014-10-30 IntercontinentalExchange, Inc. +// ice : IntercontinentalExchange, Inc. +// https://www.iana.org/domains/root/db/ice.html ice -// icu : 2015-01-08 ShortDot SA +// icu : ShortDot SA +// https://www.iana.org/domains/root/db/icu.html icu -// ieee : 2015-07-23 IEEE Global LLC +// ieee : IEEE Global LLC +// https://www.iana.org/domains/root/db/ieee.html ieee -// ifm : 2014-01-30 ifm electronic gmbh +// ifm : ifm electronic gmbh +// https://www.iana.org/domains/root/db/ifm.html ifm -// ikano : 2015-07-09 Ikano S.A. +// ikano : Ikano S.A. +// https://www.iana.org/domains/root/db/ikano.html ikano -// imamat : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation) +// imamat : Fondation Aga Khan (Aga Khan Foundation) +// https://www.iana.org/domains/root/db/imamat.html imamat -// imdb : 2015-06-25 Amazon Registry Services, Inc. +// imdb : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/imdb.html imdb -// immo : 2014-07-10 Binky Moon, LLC +// immo : Binky Moon, LLC +// https://www.iana.org/domains/root/db/immo.html immo -// immobilien : 2013-11-07 Dog Beach, LLC +// immobilien : Dog Beach, LLC +// https://www.iana.org/domains/root/db/immobilien.html immobilien -// inc : 2018-03-10 Intercap Registry Inc. +// inc : Intercap Registry Inc. +// https://www.iana.org/domains/root/db/inc.html inc -// industries : 2013-12-05 Binky Moon, LLC +// industries : Binky Moon, LLC +// https://www.iana.org/domains/root/db/industries.html industries -// infiniti : 2014-03-27 NISSAN MOTOR CO., LTD. +// infiniti : NISSAN MOTOR CO., LTD. +// https://www.iana.org/domains/root/db/infiniti.html infiniti -// ing : 2014-01-23 Charleston Road Registry Inc. +// ing : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/ing.html ing -// ink : 2013-12-05 Top Level Design, LLC +// ink : Registry Services, LLC +// https://www.iana.org/domains/root/db/ink.html ink -// institute : 2013-11-07 Binky Moon, LLC +// institute : Binky Moon, LLC +// https://www.iana.org/domains/root/db/institute.html institute -// insurance : 2015-02-19 fTLD Registry Services LLC +// insurance : fTLD Registry Services LLC +// https://www.iana.org/domains/root/db/insurance.html insurance -// insure : 2014-03-20 Binky Moon, LLC +// insure : Binky Moon, LLC +// https://www.iana.org/domains/root/db/insure.html insure -// international : 2013-11-07 Binky Moon, LLC +// international : Binky Moon, LLC +// https://www.iana.org/domains/root/db/international.html international -// intuit : 2015-07-30 Intuit Administrative Services, Inc. +// intuit : Intuit Administrative Services, Inc. +// https://www.iana.org/domains/root/db/intuit.html intuit -// investments : 2014-03-20 Binky Moon, LLC +// investments : Binky Moon, LLC +// https://www.iana.org/domains/root/db/investments.html investments -// ipiranga : 2014-08-28 Ipiranga Produtos de Petroleo S.A. +// ipiranga : Ipiranga Produtos de Petroleo S.A. +// https://www.iana.org/domains/root/db/ipiranga.html ipiranga -// irish : 2014-08-07 Binky Moon, LLC +// irish : Binky Moon, LLC +// https://www.iana.org/domains/root/db/irish.html irish -// ismaili : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation) +// ismaili : Fondation Aga Khan (Aga Khan Foundation) +// https://www.iana.org/domains/root/db/ismaili.html ismaili -// ist : 2014-08-28 Istanbul Metropolitan Municipality +// ist : Istanbul Metropolitan Municipality +// https://www.iana.org/domains/root/db/ist.html ist -// istanbul : 2014-08-28 Istanbul Metropolitan Municipality +// istanbul : Istanbul Metropolitan Municipality +// https://www.iana.org/domains/root/db/istanbul.html istanbul -// itau : 2014-10-02 Itau Unibanco Holding S.A. +// itau : Itau Unibanco Holding S.A. +// https://www.iana.org/domains/root/db/itau.html itau -// itv : 2015-07-09 ITV Services Limited +// itv : ITV Services Limited +// https://www.iana.org/domains/root/db/itv.html itv -// jaguar : 2014-11-13 Jaguar Land Rover Ltd +// jaguar : Jaguar Land Rover Ltd +// https://www.iana.org/domains/root/db/jaguar.html jaguar -// java : 2014-06-19 Oracle Corporation +// java : Oracle Corporation +// https://www.iana.org/domains/root/db/java.html java -// jcb : 2014-11-20 JCB Co., Ltd. +// jcb : JCB Co., Ltd. +// https://www.iana.org/domains/root/db/jcb.html jcb -// jeep : 2015-07-30 FCA US LLC. +// jeep : FCA US LLC. +// https://www.iana.org/domains/root/db/jeep.html jeep -// jetzt : 2014-01-09 Binky Moon, LLC +// jetzt : Binky Moon, LLC +// https://www.iana.org/domains/root/db/jetzt.html jetzt -// jewelry : 2015-03-05 Binky Moon, LLC +// jewelry : Binky Moon, LLC +// https://www.iana.org/domains/root/db/jewelry.html jewelry -// jio : 2015-04-02 Reliance Industries Limited +// jio : Reliance Industries Limited +// https://www.iana.org/domains/root/db/jio.html jio -// jll : 2015-04-02 Jones Lang LaSalle Incorporated +// jll : Jones Lang LaSalle Incorporated +// https://www.iana.org/domains/root/db/jll.html jll -// jmp : 2015-03-26 Matrix IP LLC +// jmp : Matrix IP LLC +// https://www.iana.org/domains/root/db/jmp.html jmp -// jnj : 2015-06-18 Johnson & Johnson Services, Inc. +// jnj : Johnson & Johnson Services, Inc. +// https://www.iana.org/domains/root/db/jnj.html jnj -// joburg : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry +// joburg : ZA Central Registry NPC trading as ZA Central Registry +// https://www.iana.org/domains/root/db/joburg.html joburg -// jot : 2014-12-18 Amazon Registry Services, Inc. +// jot : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/jot.html jot -// joy : 2014-12-18 Amazon Registry Services, Inc. +// joy : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/joy.html joy -// jpmorgan : 2015-04-30 JPMorgan Chase Bank, National Association +// jpmorgan : JPMorgan Chase Bank, National Association +// https://www.iana.org/domains/root/db/jpmorgan.html jpmorgan -// jprs : 2014-09-18 Japan Registry Services Co., Ltd. +// jprs : Japan Registry Services Co., Ltd. +// https://www.iana.org/domains/root/db/jprs.html jprs -// juegos : 2014-03-20 Internet Naming Company LLC +// juegos : Internet Naming Company LLC +// https://www.iana.org/domains/root/db/juegos.html juegos -// juniper : 2015-07-30 JUNIPER NETWORKS, INC. +// juniper : JUNIPER NETWORKS, INC. +// https://www.iana.org/domains/root/db/juniper.html juniper -// kaufen : 2013-11-07 Dog Beach, LLC +// kaufen : Dog Beach, LLC +// https://www.iana.org/domains/root/db/kaufen.html kaufen -// kddi : 2014-09-12 KDDI CORPORATION +// kddi : KDDI CORPORATION +// https://www.iana.org/domains/root/db/kddi.html kddi -// kerryhotels : 2015-04-30 Kerry Trading Co. Limited +// kerryhotels : Kerry Trading Co. Limited +// https://www.iana.org/domains/root/db/kerryhotels.html kerryhotels -// kerrylogistics : 2015-04-09 Kerry Trading Co. Limited +// kerrylogistics : Kerry Trading Co. Limited +// https://www.iana.org/domains/root/db/kerrylogistics.html kerrylogistics -// kerryproperties : 2015-04-09 Kerry Trading Co. Limited +// kerryproperties : Kerry Trading Co. Limited +// https://www.iana.org/domains/root/db/kerryproperties.html kerryproperties -// kfh : 2014-12-04 Kuwait Finance House +// kfh : Kuwait Finance House +// https://www.iana.org/domains/root/db/kfh.html kfh -// kia : 2015-07-09 KIA MOTORS CORPORATION +// kia : KIA MOTORS CORPORATION +// https://www.iana.org/domains/root/db/kia.html kia -// kids : 2021-08-13 DotKids Foundation Limited +// kids : DotKids Foundation Limited +// https://www.iana.org/domains/root/db/kids.html kids -// kim : 2013-09-23 Identity Digital Limited +// kim : Identity Digital Limited +// https://www.iana.org/domains/root/db/kim.html kim -// kinder : 2014-11-07 Ferrero Trading Lux S.A. -kinder - -// kindle : 2015-06-25 Amazon Registry Services, Inc. +// kindle : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/kindle.html kindle -// kitchen : 2013-09-20 Binky Moon, LLC +// kitchen : Binky Moon, LLC +// https://www.iana.org/domains/root/db/kitchen.html kitchen -// kiwi : 2013-09-20 DOT KIWI LIMITED +// kiwi : DOT KIWI LIMITED +// https://www.iana.org/domains/root/db/kiwi.html kiwi -// koeln : 2014-01-09 dotKoeln GmbH +// koeln : dotKoeln GmbH +// https://www.iana.org/domains/root/db/koeln.html koeln -// komatsu : 2015-01-08 Komatsu Ltd. +// komatsu : Komatsu Ltd. +// https://www.iana.org/domains/root/db/komatsu.html komatsu -// kosher : 2015-08-20 Kosher Marketing Assets LLC +// kosher : Kosher Marketing Assets LLC +// https://www.iana.org/domains/root/db/kosher.html kosher -// kpmg : 2015-04-23 KPMG International Cooperative (KPMG International Genossenschaft) +// kpmg : KPMG International Cooperative (KPMG International Genossenschaft) +// https://www.iana.org/domains/root/db/kpmg.html kpmg -// kpn : 2015-01-08 Koninklijke KPN N.V. +// kpn : Koninklijke KPN N.V. +// https://www.iana.org/domains/root/db/kpn.html kpn -// krd : 2013-12-05 KRG Department of Information Technology +// krd : KRG Department of Information Technology +// https://www.iana.org/domains/root/db/krd.html krd -// kred : 2013-12-19 KredTLD Pty Ltd +// kred : KredTLD Pty Ltd +// https://www.iana.org/domains/root/db/kred.html kred -// kuokgroup : 2015-04-09 Kerry Trading Co. Limited +// kuokgroup : Kerry Trading Co. Limited +// https://www.iana.org/domains/root/db/kuokgroup.html kuokgroup -// kyoto : 2014-11-07 Academic Institution: Kyoto Jyoho Gakuen +// kyoto : Academic Institution: Kyoto Jyoho Gakuen +// https://www.iana.org/domains/root/db/kyoto.html kyoto -// lacaixa : 2014-01-09 Fundación Bancaria Caixa d’Estalvis i Pensions de Barcelona, “la Caixa” +// lacaixa : Fundación Bancaria Caixa d’Estalvis i Pensions de Barcelona, “la Caixa” +// https://www.iana.org/domains/root/db/lacaixa.html lacaixa -// lamborghini : 2015-06-04 Automobili Lamborghini S.p.A. +// lamborghini : Automobili Lamborghini S.p.A. +// https://www.iana.org/domains/root/db/lamborghini.html lamborghini -// lamer : 2015-10-01 The Estée Lauder Companies Inc. +// lamer : The Estée Lauder Companies Inc. +// https://www.iana.org/domains/root/db/lamer.html lamer -// lancaster : 2015-02-12 LANCASTER +// lancaster : LANCASTER +// https://www.iana.org/domains/root/db/lancaster.html lancaster -// lancia : 2015-07-31 Fiat Chrysler Automobiles N.V. -lancia - -// land : 2013-09-10 Binky Moon, LLC +// land : Binky Moon, LLC +// https://www.iana.org/domains/root/db/land.html land -// landrover : 2014-11-13 Jaguar Land Rover Ltd +// landrover : Jaguar Land Rover Ltd +// https://www.iana.org/domains/root/db/landrover.html landrover -// lanxess : 2015-07-30 LANXESS Corporation +// lanxess : LANXESS Corporation +// https://www.iana.org/domains/root/db/lanxess.html lanxess -// lasalle : 2015-04-02 Jones Lang LaSalle Incorporated +// lasalle : Jones Lang LaSalle Incorporated +// https://www.iana.org/domains/root/db/lasalle.html lasalle -// lat : 2014-10-16 XYZ.COM LLC +// lat : XYZ.COM LLC +// https://www.iana.org/domains/root/db/lat.html lat -// latino : 2015-07-30 Dish DBS Corporation +// latino : Dish DBS Corporation +// https://www.iana.org/domains/root/db/latino.html latino -// latrobe : 2014-06-16 La Trobe University +// latrobe : La Trobe University +// https://www.iana.org/domains/root/db/latrobe.html latrobe -// law : 2015-01-22 Registry Services, LLC +// law : Registry Services, LLC +// https://www.iana.org/domains/root/db/law.html law -// lawyer : 2014-03-20 Dog Beach, LLC +// lawyer : Dog Beach, LLC +// https://www.iana.org/domains/root/db/lawyer.html lawyer -// lds : 2014-03-20 IRI Domain Management, LLC +// lds : IRI Domain Management, LLC +// https://www.iana.org/domains/root/db/lds.html lds -// lease : 2014-03-06 Binky Moon, LLC +// lease : Binky Moon, LLC +// https://www.iana.org/domains/root/db/lease.html lease -// leclerc : 2014-08-07 A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc +// leclerc : A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc +// https://www.iana.org/domains/root/db/leclerc.html leclerc -// lefrak : 2015-07-16 LeFrak Organization, Inc. +// lefrak : LeFrak Organization, Inc. +// https://www.iana.org/domains/root/db/lefrak.html lefrak -// legal : 2014-10-16 Binky Moon, LLC +// legal : Binky Moon, LLC +// https://www.iana.org/domains/root/db/legal.html legal -// lego : 2015-07-16 LEGO Juris A/S +// lego : LEGO Juris A/S +// https://www.iana.org/domains/root/db/lego.html lego -// lexus : 2015-04-23 TOYOTA MOTOR CORPORATION +// lexus : TOYOTA MOTOR CORPORATION +// https://www.iana.org/domains/root/db/lexus.html lexus -// lgbt : 2014-05-08 Identity Digital Limited +// lgbt : Identity Digital Limited +// https://www.iana.org/domains/root/db/lgbt.html lgbt -// lidl : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG +// lidl : Schwarz Domains und Services GmbH & Co. KG +// https://www.iana.org/domains/root/db/lidl.html lidl -// life : 2014-02-06 Binky Moon, LLC +// life : Binky Moon, LLC +// https://www.iana.org/domains/root/db/life.html life -// lifeinsurance : 2015-01-15 American Council of Life Insurers +// lifeinsurance : American Council of Life Insurers +// https://www.iana.org/domains/root/db/lifeinsurance.html lifeinsurance -// lifestyle : 2014-12-11 Lifestyle Domain Holdings, Inc. +// lifestyle : Lifestyle Domain Holdings, Inc. +// https://www.iana.org/domains/root/db/lifestyle.html lifestyle -// lighting : 2013-08-27 Binky Moon, LLC +// lighting : Binky Moon, LLC +// https://www.iana.org/domains/root/db/lighting.html lighting -// like : 2014-12-18 Amazon Registry Services, Inc. +// like : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/like.html like -// lilly : 2015-07-31 Eli Lilly and Company +// lilly : Eli Lilly and Company +// https://www.iana.org/domains/root/db/lilly.html lilly -// limited : 2014-03-06 Binky Moon, LLC +// limited : Binky Moon, LLC +// https://www.iana.org/domains/root/db/limited.html limited -// limo : 2013-10-17 Binky Moon, LLC +// limo : Binky Moon, LLC +// https://www.iana.org/domains/root/db/limo.html limo -// lincoln : 2014-11-13 Ford Motor Company +// lincoln : Ford Motor Company +// https://www.iana.org/domains/root/db/lincoln.html lincoln -// link : 2013-11-14 Nova Registry Ltd +// link : Nova Registry Ltd +// https://www.iana.org/domains/root/db/link.html link -// lipsy : 2015-06-25 Lipsy Ltd +// lipsy : Lipsy Ltd +// https://www.iana.org/domains/root/db/lipsy.html lipsy -// live : 2014-12-04 Dog Beach, LLC +// live : Dog Beach, LLC +// https://www.iana.org/domains/root/db/live.html live -// living : 2015-07-30 Lifestyle Domain Holdings, Inc. +// living : Lifestyle Domain Holdings, Inc. +// https://www.iana.org/domains/root/db/living.html living -// llc : 2017-12-14 Identity Digital Limited +// llc : Identity Digital Limited +// https://www.iana.org/domains/root/db/llc.html llc -// llp : 2019-08-26 Intercap Registry Inc. +// llp : Intercap Registry Inc. +// https://www.iana.org/domains/root/db/llp.html llp -// loan : 2014-11-20 dot Loan Limited +// loan : dot Loan Limited +// https://www.iana.org/domains/root/db/loan.html loan -// loans : 2014-03-20 Binky Moon, LLC +// loans : Binky Moon, LLC +// https://www.iana.org/domains/root/db/loans.html loans -// locker : 2015-06-04 Dish DBS Corporation +// locker : Orange Domains LLC +// https://www.iana.org/domains/root/db/locker.html locker -// locus : 2015-06-25 Locus Analytics LLC +// locus : Locus Analytics LLC +// https://www.iana.org/domains/root/db/locus.html locus -// lol : 2015-01-30 XYZ.COM LLC +// lol : XYZ.COM LLC +// https://www.iana.org/domains/root/db/lol.html lol -// london : 2013-11-14 Dot London Domains Limited +// london : Dot London Domains Limited +// https://www.iana.org/domains/root/db/london.html london -// lotte : 2014-11-07 Lotte Holdings Co., Ltd. +// lotte : Lotte Holdings Co., Ltd. +// https://www.iana.org/domains/root/db/lotte.html lotte -// lotto : 2014-04-10 Identity Digital Limited +// lotto : Identity Digital Limited +// https://www.iana.org/domains/root/db/lotto.html lotto -// love : 2014-12-22 Merchant Law Group LLP +// love : Merchant Law Group LLP +// https://www.iana.org/domains/root/db/love.html love -// lpl : 2015-07-30 LPL Holdings, Inc. +// lpl : LPL Holdings, Inc. +// https://www.iana.org/domains/root/db/lpl.html lpl -// lplfinancial : 2015-07-30 LPL Holdings, Inc. +// lplfinancial : LPL Holdings, Inc. +// https://www.iana.org/domains/root/db/lplfinancial.html lplfinancial -// ltd : 2014-09-25 Binky Moon, LLC +// ltd : Binky Moon, LLC +// https://www.iana.org/domains/root/db/ltd.html ltd -// ltda : 2014-04-17 InterNetX, Corp +// ltda : InterNetX, Corp +// https://www.iana.org/domains/root/db/ltda.html ltda -// lundbeck : 2015-08-06 H. Lundbeck A/S +// lundbeck : H. Lundbeck A/S +// https://www.iana.org/domains/root/db/lundbeck.html lundbeck -// luxe : 2014-01-09 Registry Services, LLC +// luxe : Registry Services, LLC +// https://www.iana.org/domains/root/db/luxe.html luxe -// luxury : 2013-10-17 Luxury Partners, LLC +// luxury : Luxury Partners, LLC +// https://www.iana.org/domains/root/db/luxury.html luxury -// madrid : 2014-05-01 Comunidad de Madrid +// madrid : Comunidad de Madrid +// https://www.iana.org/domains/root/db/madrid.html madrid -// maif : 2014-10-02 Mutuelle Assurance Instituteur France (MAIF) +// maif : Mutuelle Assurance Instituteur France (MAIF) +// https://www.iana.org/domains/root/db/maif.html maif -// maison : 2013-12-05 Binky Moon, LLC +// maison : Binky Moon, LLC +// https://www.iana.org/domains/root/db/maison.html maison -// makeup : 2015-01-15 XYZ.COM LLC +// makeup : XYZ.COM LLC +// https://www.iana.org/domains/root/db/makeup.html makeup -// man : 2014-12-04 MAN SE +// man : MAN SE +// https://www.iana.org/domains/root/db/man.html man -// management : 2013-11-07 Binky Moon, LLC +// management : Binky Moon, LLC +// https://www.iana.org/domains/root/db/management.html management -// mango : 2013-10-24 PUNTO FA S.L. +// mango : PUNTO FA S.L. +// https://www.iana.org/domains/root/db/mango.html mango -// map : 2016-06-09 Charleston Road Registry Inc. +// map : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/map.html map -// market : 2014-03-06 Dog Beach, LLC +// market : Dog Beach, LLC +// https://www.iana.org/domains/root/db/market.html market -// marketing : 2013-11-07 Binky Moon, LLC +// marketing : Binky Moon, LLC +// https://www.iana.org/domains/root/db/marketing.html marketing -// markets : 2014-12-11 Dog Beach, LLC +// markets : Dog Beach, LLC +// https://www.iana.org/domains/root/db/markets.html markets -// marriott : 2014-10-09 Marriott Worldwide Corporation +// marriott : Marriott Worldwide Corporation +// https://www.iana.org/domains/root/db/marriott.html marriott -// marshalls : 2015-07-16 The TJX Companies, Inc. +// marshalls : The TJX Companies, Inc. +// https://www.iana.org/domains/root/db/marshalls.html marshalls -// maserati : 2015-07-31 Fiat Chrysler Automobiles N.V. -maserati - -// mattel : 2015-08-06 Mattel Sites, Inc. +// mattel : Mattel Sites, Inc. +// https://www.iana.org/domains/root/db/mattel.html mattel -// mba : 2015-04-02 Binky Moon, LLC +// mba : Binky Moon, LLC +// https://www.iana.org/domains/root/db/mba.html mba -// mckinsey : 2015-07-31 McKinsey Holdings, Inc. +// mckinsey : McKinsey Holdings, Inc. +// https://www.iana.org/domains/root/db/mckinsey.html mckinsey -// med : 2015-08-06 Medistry LLC +// med : Medistry LLC +// https://www.iana.org/domains/root/db/med.html med -// media : 2014-03-06 Binky Moon, LLC +// media : Binky Moon, LLC +// https://www.iana.org/domains/root/db/media.html media -// meet : 2014-01-16 Charleston Road Registry Inc. +// meet : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/meet.html meet -// melbourne : 2014-05-29 The Crown in right of the State of Victoria, represented by its Department of State Development, Business and Innovation +// melbourne : The Crown in right of the State of Victoria, represented by its Department of State Development, Business and Innovation +// https://www.iana.org/domains/root/db/melbourne.html melbourne -// meme : 2014-01-30 Charleston Road Registry Inc. +// meme : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/meme.html meme -// memorial : 2014-10-16 Dog Beach, LLC +// memorial : Dog Beach, LLC +// https://www.iana.org/domains/root/db/memorial.html memorial -// men : 2015-02-26 Exclusive Registry Limited +// men : Exclusive Registry Limited +// https://www.iana.org/domains/root/db/men.html men -// menu : 2013-09-11 Dot Menu Registry, LLC +// menu : Dot Menu Registry, LLC +// https://www.iana.org/domains/root/db/menu.html menu -// merckmsd : 2016-07-14 MSD Registry Holdings, Inc. +// merckmsd : MSD Registry Holdings, Inc. +// https://www.iana.org/domains/root/db/merckmsd.html merckmsd -// miami : 2013-12-19 Registry Services, LLC +// miami : Registry Services, LLC +// https://www.iana.org/domains/root/db/miami.html miami -// microsoft : 2014-12-18 Microsoft Corporation +// microsoft : Microsoft Corporation +// https://www.iana.org/domains/root/db/microsoft.html microsoft -// mini : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft +// mini : Bayerische Motoren Werke Aktiengesellschaft +// https://www.iana.org/domains/root/db/mini.html mini -// mint : 2015-07-30 Intuit Administrative Services, Inc. +// mint : Intuit Administrative Services, Inc. +// https://www.iana.org/domains/root/db/mint.html mint -// mit : 2015-07-02 Massachusetts Institute of Technology +// mit : Massachusetts Institute of Technology +// https://www.iana.org/domains/root/db/mit.html mit -// mitsubishi : 2015-07-23 Mitsubishi Corporation +// mitsubishi : Mitsubishi Corporation +// https://www.iana.org/domains/root/db/mitsubishi.html mitsubishi -// mlb : 2015-05-21 MLB Advanced Media DH, LLC +// mlb : MLB Advanced Media DH, LLC +// https://www.iana.org/domains/root/db/mlb.html mlb -// mls : 2015-04-23 The Canadian Real Estate Association +// mls : The Canadian Real Estate Association +// https://www.iana.org/domains/root/db/mls.html mls -// mma : 2014-11-07 MMA IARD +// mma : MMA IARD +// https://www.iana.org/domains/root/db/mma.html mma -// mobile : 2016-06-02 Dish DBS Corporation +// mobile : Dish DBS Corporation +// https://www.iana.org/domains/root/db/mobile.html mobile -// moda : 2013-11-07 Dog Beach, LLC +// moda : Dog Beach, LLC +// https://www.iana.org/domains/root/db/moda.html moda -// moe : 2013-11-13 Interlink Systems Innovation Institute K.K. +// moe : Interlink Systems Innovation Institute K.K. +// https://www.iana.org/domains/root/db/moe.html moe -// moi : 2014-12-18 Amazon Registry Services, Inc. +// moi : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/moi.html moi -// mom : 2015-04-16 XYZ.COM LLC +// mom : XYZ.COM LLC +// https://www.iana.org/domains/root/db/mom.html mom -// monash : 2013-09-30 Monash University +// monash : Monash University +// https://www.iana.org/domains/root/db/monash.html monash -// money : 2014-10-16 Binky Moon, LLC +// money : Binky Moon, LLC +// https://www.iana.org/domains/root/db/money.html money -// monster : 2015-09-11 XYZ.COM LLC +// monster : XYZ.COM LLC +// https://www.iana.org/domains/root/db/monster.html monster -// mormon : 2013-12-05 IRI Domain Management, LLC +// mormon : IRI Domain Management, LLC +// https://www.iana.org/domains/root/db/mormon.html mormon -// mortgage : 2014-03-20 Dog Beach, LLC +// mortgage : Dog Beach, LLC +// https://www.iana.org/domains/root/db/mortgage.html mortgage -// moscow : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) +// moscow : Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) +// https://www.iana.org/domains/root/db/moscow.html moscow -// moto : 2015-06-04 Motorola Trademark Holdings, LLC +// moto : Motorola Trademark Holdings, LLC +// https://www.iana.org/domains/root/db/moto.html moto -// motorcycles : 2014-01-09 XYZ.COM LLC +// motorcycles : XYZ.COM LLC +// https://www.iana.org/domains/root/db/motorcycles.html motorcycles -// mov : 2014-01-30 Charleston Road Registry Inc. +// mov : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/mov.html mov -// movie : 2015-02-05 Binky Moon, LLC +// movie : Binky Moon, LLC +// https://www.iana.org/domains/root/db/movie.html movie -// msd : 2015-07-23 MSD Registry Holdings, Inc. +// msd : MSD Registry Holdings, Inc. +// https://www.iana.org/domains/root/db/msd.html msd -// mtn : 2014-12-04 MTN Dubai Limited +// mtn : MTN Dubai Limited +// https://www.iana.org/domains/root/db/mtn.html mtn -// mtr : 2015-03-12 MTR Corporation Limited +// mtr : MTR Corporation Limited +// https://www.iana.org/domains/root/db/mtr.html mtr -// music : 2021-05-04 DotMusic Limited +// music : DotMusic Limited +// https://www.iana.org/domains/root/db/music.html music -// mutual : 2015-04-02 Northwestern Mutual MU TLD Registry, LLC -mutual - -// nab : 2015-08-20 National Australia Bank Limited +// nab : National Australia Bank Limited +// https://www.iana.org/domains/root/db/nab.html nab -// nagoya : 2013-10-24 GMO Registry, Inc. +// nagoya : GMO Registry, Inc. +// https://www.iana.org/domains/root/db/nagoya.html nagoya -// natura : 2015-03-12 NATURA COSMÉTICOS S.A. +// natura : NATURA COSMÉTICOS S.A. +// https://www.iana.org/domains/root/db/natura.html natura -// navy : 2014-03-06 Dog Beach, LLC +// navy : Dog Beach, LLC +// https://www.iana.org/domains/root/db/navy.html navy -// nba : 2015-07-31 NBA REGISTRY, LLC +// nba : NBA REGISTRY, LLC +// https://www.iana.org/domains/root/db/nba.html nba -// nec : 2015-01-08 NEC Corporation +// nec : NEC Corporation +// https://www.iana.org/domains/root/db/nec.html nec -// netbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA +// netbank : COMMONWEALTH BANK OF AUSTRALIA +// https://www.iana.org/domains/root/db/netbank.html netbank -// netflix : 2015-06-18 Netflix, Inc. +// netflix : Netflix, Inc. +// https://www.iana.org/domains/root/db/netflix.html netflix -// network : 2013-11-14 Binky Moon, LLC +// network : Binky Moon, LLC +// https://www.iana.org/domains/root/db/network.html network -// neustar : 2013-12-05 NeuStar, Inc. +// neustar : NeuStar, Inc. +// https://www.iana.org/domains/root/db/neustar.html neustar -// new : 2014-01-30 Charleston Road Registry Inc. +// new : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/new.html new -// news : 2014-12-18 Dog Beach, LLC +// news : Dog Beach, LLC +// https://www.iana.org/domains/root/db/news.html news -// next : 2015-06-18 Next plc +// next : Next plc +// https://www.iana.org/domains/root/db/next.html next -// nextdirect : 2015-06-18 Next plc +// nextdirect : Next plc +// https://www.iana.org/domains/root/db/nextdirect.html nextdirect -// nexus : 2014-07-24 Charleston Road Registry Inc. +// nexus : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/nexus.html nexus -// nfl : 2015-07-23 NFL Reg Ops LLC +// nfl : NFL Reg Ops LLC +// https://www.iana.org/domains/root/db/nfl.html nfl -// ngo : 2014-03-06 Public Interest Registry +// ngo : Public Interest Registry +// https://www.iana.org/domains/root/db/ngo.html ngo -// nhk : 2014-02-13 Japan Broadcasting Corporation (NHK) +// nhk : Japan Broadcasting Corporation (NHK) +// https://www.iana.org/domains/root/db/nhk.html nhk -// nico : 2014-12-04 DWANGO Co., Ltd. +// nico : DWANGO Co., Ltd. +// https://www.iana.org/domains/root/db/nico.html nico -// nike : 2015-07-23 NIKE, Inc. +// nike : NIKE, Inc. +// https://www.iana.org/domains/root/db/nike.html nike -// nikon : 2015-05-21 NIKON CORPORATION +// nikon : NIKON CORPORATION +// https://www.iana.org/domains/root/db/nikon.html nikon -// ninja : 2013-11-07 Dog Beach, LLC +// ninja : Dog Beach, LLC +// https://www.iana.org/domains/root/db/ninja.html ninja -// nissan : 2014-03-27 NISSAN MOTOR CO., LTD. +// nissan : NISSAN MOTOR CO., LTD. +// https://www.iana.org/domains/root/db/nissan.html nissan -// nissay : 2015-10-29 Nippon Life Insurance Company +// nissay : Nippon Life Insurance Company +// https://www.iana.org/domains/root/db/nissay.html nissay -// nokia : 2015-01-08 Nokia Corporation +// nokia : Nokia Corporation +// https://www.iana.org/domains/root/db/nokia.html nokia -// northwesternmutual : 2015-06-18 Northwestern Mutual Registry, LLC -northwesternmutual - -// norton : 2014-12-04 NortonLifeLock Inc. +// norton : NortonLifeLock Inc. +// https://www.iana.org/domains/root/db/norton.html norton -// now : 2015-06-25 Amazon Registry Services, Inc. +// now : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/now.html now -// nowruz : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// nowruz : Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// https://www.iana.org/domains/root/db/nowruz.html nowruz -// nowtv : 2015-05-14 Starbucks (HK) Limited +// nowtv : Starbucks (HK) Limited +// https://www.iana.org/domains/root/db/nowtv.html nowtv -// nra : 2014-05-22 NRA Holdings Company, INC. +// nra : NRA Holdings Company, INC. +// https://www.iana.org/domains/root/db/nra.html nra -// nrw : 2013-11-21 Minds + Machines GmbH +// nrw : Minds + Machines GmbH +// https://www.iana.org/domains/root/db/nrw.html nrw -// ntt : 2014-10-31 NIPPON TELEGRAPH AND TELEPHONE CORPORATION +// ntt : NIPPON TELEGRAPH AND TELEPHONE CORPORATION +// https://www.iana.org/domains/root/db/ntt.html ntt -// nyc : 2014-01-23 The City of New York by and through the New York City Department of Information Technology & Telecommunications +// nyc : The City of New York by and through the New York City Department of Information Technology & Telecommunications +// https://www.iana.org/domains/root/db/nyc.html nyc -// obi : 2014-09-25 OBI Group Holding SE & Co. KGaA +// obi : OBI Group Holding SE & Co. KGaA +// https://www.iana.org/domains/root/db/obi.html obi -// observer : 2015-04-30 Dog Beach, LLC +// observer : Fegistry, LLC +// https://www.iana.org/domains/root/db/observer.html observer -// office : 2015-03-12 Microsoft Corporation +// office : Microsoft Corporation +// https://www.iana.org/domains/root/db/office.html office -// okinawa : 2013-12-05 BRregistry, Inc. +// okinawa : BRregistry, Inc. +// https://www.iana.org/domains/root/db/okinawa.html okinawa -// olayan : 2015-05-14 Crescent Holding GmbH +// olayan : Competrol (Luxembourg) Sarl +// https://www.iana.org/domains/root/db/olayan.html olayan -// olayangroup : 2015-05-14 Crescent Holding GmbH +// olayangroup : Competrol (Luxembourg) Sarl +// https://www.iana.org/domains/root/db/olayangroup.html olayangroup -// oldnavy : 2015-07-31 The Gap, Inc. +// oldnavy : The Gap, Inc. +// https://www.iana.org/domains/root/db/oldnavy.html oldnavy -// ollo : 2015-06-04 Dish DBS Corporation +// ollo : Dish DBS Corporation +// https://www.iana.org/domains/root/db/ollo.html ollo -// omega : 2015-01-08 The Swatch Group Ltd +// omega : The Swatch Group Ltd +// https://www.iana.org/domains/root/db/omega.html omega -// one : 2014-11-07 One.com A/S +// one : One.com A/S +// https://www.iana.org/domains/root/db/one.html one -// ong : 2014-03-06 Public Interest Registry +// ong : Public Interest Registry +// https://www.iana.org/domains/root/db/ong.html ong -// onl : 2013-09-16 iRegistry GmbH +// onl : iRegistry GmbH +// https://www.iana.org/domains/root/db/onl.html onl -// online : 2015-01-15 Radix FZC +// online : Radix FZC DMCC +// https://www.iana.org/domains/root/db/online.html online -// ooo : 2014-01-09 INFIBEAM AVENUES LIMITED +// ooo : INFIBEAM AVENUES LIMITED +// https://www.iana.org/domains/root/db/ooo.html ooo -// open : 2015-07-31 American Express Travel Related Services Company, Inc. +// open : American Express Travel Related Services Company, Inc. +// https://www.iana.org/domains/root/db/open.html open -// oracle : 2014-06-19 Oracle Corporation +// oracle : Oracle Corporation +// https://www.iana.org/domains/root/db/oracle.html oracle -// orange : 2015-03-12 Orange Brand Services Limited +// orange : Orange Brand Services Limited +// https://www.iana.org/domains/root/db/orange.html orange -// organic : 2014-03-27 Identity Digital Limited +// organic : Identity Digital Limited +// https://www.iana.org/domains/root/db/organic.html organic -// origins : 2015-10-01 The Estée Lauder Companies Inc. +// origins : The Estée Lauder Companies Inc. +// https://www.iana.org/domains/root/db/origins.html origins -// osaka : 2014-09-04 Osaka Registry Co., Ltd. +// osaka : Osaka Registry Co., Ltd. +// https://www.iana.org/domains/root/db/osaka.html osaka -// otsuka : 2013-10-11 Otsuka Holdings Co., Ltd. +// otsuka : Otsuka Holdings Co., Ltd. +// https://www.iana.org/domains/root/db/otsuka.html otsuka -// ott : 2015-06-04 Dish DBS Corporation +// ott : Dish DBS Corporation +// https://www.iana.org/domains/root/db/ott.html ott -// ovh : 2014-01-16 MédiaBC +// ovh : MédiaBC +// https://www.iana.org/domains/root/db/ovh.html ovh -// page : 2014-12-04 Charleston Road Registry Inc. +// page : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/page.html page -// panasonic : 2015-07-30 Panasonic Holdings Corporation +// panasonic : Panasonic Holdings Corporation +// https://www.iana.org/domains/root/db/panasonic.html panasonic -// paris : 2014-01-30 City of Paris +// paris : City of Paris +// https://www.iana.org/domains/root/db/paris.html paris -// pars : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// pars : Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// https://www.iana.org/domains/root/db/pars.html pars -// partners : 2013-12-05 Binky Moon, LLC +// partners : Binky Moon, LLC +// https://www.iana.org/domains/root/db/partners.html partners -// parts : 2013-12-05 Binky Moon, LLC +// parts : Binky Moon, LLC +// https://www.iana.org/domains/root/db/parts.html parts -// party : 2014-09-11 Blue Sky Registry Limited +// party : Blue Sky Registry Limited +// https://www.iana.org/domains/root/db/party.html party -// passagens : 2015-03-05 Travel Reservations SRL -passagens - -// pay : 2015-08-27 Amazon Registry Services, Inc. +// pay : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/pay.html pay -// pccw : 2015-05-14 PCCW Enterprises Limited +// pccw : PCCW Enterprises Limited +// https://www.iana.org/domains/root/db/pccw.html pccw -// pet : 2015-05-07 Identity Digital Limited +// pet : Identity Digital Limited +// https://www.iana.org/domains/root/db/pet.html pet -// pfizer : 2015-09-11 Pfizer Inc. +// pfizer : Pfizer Inc. +// https://www.iana.org/domains/root/db/pfizer.html pfizer -// pharmacy : 2014-06-19 National Association of Boards of Pharmacy +// pharmacy : National Association of Boards of Pharmacy +// https://www.iana.org/domains/root/db/pharmacy.html pharmacy -// phd : 2016-07-28 Charleston Road Registry Inc. +// phd : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/phd.html phd -// philips : 2014-11-07 Koninklijke Philips N.V. +// philips : Koninklijke Philips N.V. +// https://www.iana.org/domains/root/db/philips.html philips -// phone : 2016-06-02 Dish DBS Corporation +// phone : Dish DBS Corporation +// https://www.iana.org/domains/root/db/phone.html phone -// photo : 2013-11-14 Registry Services, LLC +// photo : Registry Services, LLC +// https://www.iana.org/domains/root/db/photo.html photo -// photography : 2013-09-20 Binky Moon, LLC +// photography : Binky Moon, LLC +// https://www.iana.org/domains/root/db/photography.html photography -// photos : 2013-10-17 Binky Moon, LLC +// photos : Binky Moon, LLC +// https://www.iana.org/domains/root/db/photos.html photos -// physio : 2014-05-01 PhysBiz Pty Ltd +// physio : PhysBiz Pty Ltd +// https://www.iana.org/domains/root/db/physio.html physio -// pics : 2013-11-14 XYZ.COM LLC +// pics : XYZ.COM LLC +// https://www.iana.org/domains/root/db/pics.html pics -// pictet : 2014-06-26 Pictet Europe S.A. +// pictet : Pictet Europe S.A. +// https://www.iana.org/domains/root/db/pictet.html pictet -// pictures : 2014-03-06 Binky Moon, LLC +// pictures : Binky Moon, LLC +// https://www.iana.org/domains/root/db/pictures.html pictures -// pid : 2015-01-08 Top Level Spectrum, Inc. +// pid : Top Level Spectrum, Inc. +// https://www.iana.org/domains/root/db/pid.html pid -// pin : 2014-12-18 Amazon Registry Services, Inc. +// pin : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/pin.html pin -// ping : 2015-06-11 Ping Registry Provider, Inc. +// ping : Ping Registry Provider, Inc. +// https://www.iana.org/domains/root/db/ping.html ping -// pink : 2013-10-01 Identity Digital Limited +// pink : Identity Digital Limited +// https://www.iana.org/domains/root/db/pink.html pink -// pioneer : 2015-07-16 Pioneer Corporation +// pioneer : Pioneer Corporation +// https://www.iana.org/domains/root/db/pioneer.html pioneer -// pizza : 2014-06-26 Binky Moon, LLC +// pizza : Binky Moon, LLC +// https://www.iana.org/domains/root/db/pizza.html pizza -// place : 2014-04-24 Binky Moon, LLC +// place : Binky Moon, LLC +// https://www.iana.org/domains/root/db/place.html place -// play : 2015-03-05 Charleston Road Registry Inc. +// play : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/play.html play -// playstation : 2015-07-02 Sony Interactive Entertainment Inc. +// playstation : Sony Interactive Entertainment Inc. +// https://www.iana.org/domains/root/db/playstation.html playstation -// plumbing : 2013-09-10 Binky Moon, LLC +// plumbing : Binky Moon, LLC +// https://www.iana.org/domains/root/db/plumbing.html plumbing -// plus : 2015-02-05 Binky Moon, LLC +// plus : Binky Moon, LLC +// https://www.iana.org/domains/root/db/plus.html plus -// pnc : 2015-07-02 PNC Domain Co., LLC +// pnc : PNC Domain Co., LLC +// https://www.iana.org/domains/root/db/pnc.html pnc -// pohl : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +// pohl : Deutsche Vermögensberatung Aktiengesellschaft DVAG +// https://www.iana.org/domains/root/db/pohl.html pohl -// poker : 2014-07-03 Identity Digital Limited +// poker : Identity Digital Limited +// https://www.iana.org/domains/root/db/poker.html poker -// politie : 2015-08-20 Politie Nederland +// politie : Politie Nederland +// https://www.iana.org/domains/root/db/politie.html politie -// porn : 2014-10-16 ICM Registry PN LLC +// porn : ICM Registry PN LLC +// https://www.iana.org/domains/root/db/porn.html porn -// pramerica : 2015-07-30 Prudential Financial, Inc. +// pramerica : Prudential Financial, Inc. +// https://www.iana.org/domains/root/db/pramerica.html pramerica -// praxi : 2013-12-05 Praxi S.p.A. +// praxi : Praxi S.p.A. +// https://www.iana.org/domains/root/db/praxi.html praxi -// press : 2014-04-03 Radix FZC +// press : Radix FZC DMCC +// https://www.iana.org/domains/root/db/press.html press -// prime : 2015-06-25 Amazon Registry Services, Inc. +// prime : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/prime.html prime -// prod : 2014-01-23 Charleston Road Registry Inc. +// prod : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/prod.html prod -// productions : 2013-12-05 Binky Moon, LLC +// productions : Binky Moon, LLC +// https://www.iana.org/domains/root/db/productions.html productions -// prof : 2014-07-24 Charleston Road Registry Inc. +// prof : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/prof.html prof -// progressive : 2015-07-23 Progressive Casualty Insurance Company +// progressive : Progressive Casualty Insurance Company +// https://www.iana.org/domains/root/db/progressive.html progressive -// promo : 2014-12-18 Identity Digital Limited +// promo : Identity Digital Limited +// https://www.iana.org/domains/root/db/promo.html promo -// properties : 2013-12-05 Binky Moon, LLC +// properties : Binky Moon, LLC +// https://www.iana.org/domains/root/db/properties.html properties -// property : 2014-05-22 Internet Naming Company LLC +// property : Digital Property Infrastructure Limited +// https://www.iana.org/domains/root/db/property.html property -// protection : 2015-04-23 XYZ.COM LLC +// protection : XYZ.COM LLC +// https://www.iana.org/domains/root/db/protection.html protection -// pru : 2015-07-30 Prudential Financial, Inc. +// pru : Prudential Financial, Inc. +// https://www.iana.org/domains/root/db/pru.html pru -// prudential : 2015-07-30 Prudential Financial, Inc. +// prudential : Prudential Financial, Inc. +// https://www.iana.org/domains/root/db/prudential.html prudential -// pub : 2013-12-12 Dog Beach, LLC +// pub : Dog Beach, LLC +// https://www.iana.org/domains/root/db/pub.html pub -// pwc : 2015-10-29 PricewaterhouseCoopers LLP +// pwc : PricewaterhouseCoopers LLP +// https://www.iana.org/domains/root/db/pwc.html pwc -// qpon : 2013-11-14 dotQPON LLC +// qpon : dotQPON LLC +// https://www.iana.org/domains/root/db/qpon.html qpon -// quebec : 2013-12-19 PointQuébec Inc +// quebec : PointQuébec Inc +// https://www.iana.org/domains/root/db/quebec.html quebec -// quest : 2015-03-26 XYZ.COM LLC +// quest : XYZ.COM LLC +// https://www.iana.org/domains/root/db/quest.html quest -// racing : 2014-12-04 Premier Registry Limited +// racing : Premier Registry Limited +// https://www.iana.org/domains/root/db/racing.html racing -// radio : 2016-07-21 European Broadcasting Union (EBU) +// radio : European Broadcasting Union (EBU) +// https://www.iana.org/domains/root/db/radio.html radio -// read : 2014-12-18 Amazon Registry Services, Inc. +// read : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/read.html read -// realestate : 2015-09-11 dotRealEstate LLC +// realestate : dotRealEstate LLC +// https://www.iana.org/domains/root/db/realestate.html realestate -// realtor : 2014-05-29 Real Estate Domains LLC +// realtor : Real Estate Domains LLC +// https://www.iana.org/domains/root/db/realtor.html realtor -// realty : 2015-03-19 Dog Beach, LLC +// realty : Internet Naming Company LLC +// https://www.iana.org/domains/root/db/realty.html realty -// recipes : 2013-10-17 Binky Moon, LLC +// recipes : Binky Moon, LLC +// https://www.iana.org/domains/root/db/recipes.html recipes -// red : 2013-11-07 Identity Digital Limited +// red : Identity Digital Limited +// https://www.iana.org/domains/root/db/red.html red -// redstone : 2014-10-31 Redstone Haute Couture Co., Ltd. +// redstone : Redstone Haute Couture Co., Ltd. +// https://www.iana.org/domains/root/db/redstone.html redstone -// redumbrella : 2015-03-26 Travelers TLD, LLC +// redumbrella : Travelers TLD, LLC +// https://www.iana.org/domains/root/db/redumbrella.html redumbrella -// rehab : 2014-03-06 Dog Beach, LLC +// rehab : Dog Beach, LLC +// https://www.iana.org/domains/root/db/rehab.html rehab -// reise : 2014-03-13 Binky Moon, LLC +// reise : Binky Moon, LLC +// https://www.iana.org/domains/root/db/reise.html reise -// reisen : 2014-03-06 Binky Moon, LLC +// reisen : Binky Moon, LLC +// https://www.iana.org/domains/root/db/reisen.html reisen -// reit : 2014-09-04 National Association of Real Estate Investment Trusts, Inc. +// reit : National Association of Real Estate Investment Trusts, Inc. +// https://www.iana.org/domains/root/db/reit.html reit -// reliance : 2015-04-02 Reliance Industries Limited +// reliance : Reliance Industries Limited +// https://www.iana.org/domains/root/db/reliance.html reliance -// ren : 2013-12-12 ZDNS International Limited +// ren : ZDNS International Limited +// https://www.iana.org/domains/root/db/ren.html ren -// rent : 2014-12-04 XYZ.COM LLC +// rent : XYZ.COM LLC +// https://www.iana.org/domains/root/db/rent.html rent -// rentals : 2013-12-05 Binky Moon, LLC +// rentals : Binky Moon, LLC +// https://www.iana.org/domains/root/db/rentals.html rentals -// repair : 2013-11-07 Binky Moon, LLC +// repair : Binky Moon, LLC +// https://www.iana.org/domains/root/db/repair.html repair -// report : 2013-12-05 Binky Moon, LLC +// report : Binky Moon, LLC +// https://www.iana.org/domains/root/db/report.html report -// republican : 2014-03-20 Dog Beach, LLC +// republican : Dog Beach, LLC +// https://www.iana.org/domains/root/db/republican.html republican -// rest : 2013-12-19 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable +// rest : Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable +// https://www.iana.org/domains/root/db/rest.html rest -// restaurant : 2014-07-03 Binky Moon, LLC +// restaurant : Binky Moon, LLC +// https://www.iana.org/domains/root/db/restaurant.html restaurant -// review : 2014-11-20 dot Review Limited +// review : dot Review Limited +// https://www.iana.org/domains/root/db/review.html review -// reviews : 2013-09-13 Dog Beach, LLC +// reviews : Dog Beach, LLC +// https://www.iana.org/domains/root/db/reviews.html reviews -// rexroth : 2015-06-18 Robert Bosch GMBH +// rexroth : Robert Bosch GMBH +// https://www.iana.org/domains/root/db/rexroth.html rexroth -// rich : 2013-11-21 iRegistry GmbH +// rich : iRegistry GmbH +// https://www.iana.org/domains/root/db/rich.html rich -// richardli : 2015-05-14 Pacific Century Asset Management (HK) Limited +// richardli : Pacific Century Asset Management (HK) Limited +// https://www.iana.org/domains/root/db/richardli.html richardli -// ricoh : 2014-11-20 Ricoh Company, Ltd. +// ricoh : Ricoh Company, Ltd. +// https://www.iana.org/domains/root/db/ricoh.html ricoh -// ril : 2015-04-02 Reliance Industries Limited +// ril : Reliance Industries Limited +// https://www.iana.org/domains/root/db/ril.html ril -// rio : 2014-02-27 Empresa Municipal de Informática SA - IPLANRIO +// rio : Empresa Municipal de Informática SA - IPLANRIO +// https://www.iana.org/domains/root/db/rio.html rio -// rip : 2014-07-10 Dog Beach, LLC +// rip : Dog Beach, LLC +// https://www.iana.org/domains/root/db/rip.html rip -// rocher : 2014-12-18 Ferrero Trading Lux S.A. -rocher - -// rocks : 2013-11-14 Dog Beach, LLC +// rocks : Dog Beach, LLC +// https://www.iana.org/domains/root/db/rocks.html rocks -// rodeo : 2013-12-19 Registry Services, LLC +// rodeo : Registry Services, LLC +// https://www.iana.org/domains/root/db/rodeo.html rodeo -// rogers : 2015-08-06 Rogers Communications Canada Inc. +// rogers : Rogers Communications Canada Inc. +// https://www.iana.org/domains/root/db/rogers.html rogers -// room : 2014-12-18 Amazon Registry Services, Inc. +// room : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/room.html room -// rsvp : 2014-05-08 Charleston Road Registry Inc. +// rsvp : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/rsvp.html rsvp -// rugby : 2016-12-15 World Rugby Strategic Developments Limited +// rugby : World Rugby Strategic Developments Limited +// https://www.iana.org/domains/root/db/rugby.html rugby -// ruhr : 2013-10-02 dotSaarland GmbH +// ruhr : dotSaarland GmbH +// https://www.iana.org/domains/root/db/ruhr.html ruhr -// run : 2015-03-19 Binky Moon, LLC +// run : Binky Moon, LLC +// https://www.iana.org/domains/root/db/run.html run -// rwe : 2015-04-02 RWE AG +// rwe : RWE AG +// https://www.iana.org/domains/root/db/rwe.html rwe -// ryukyu : 2014-01-09 BRregistry, Inc. +// ryukyu : BRregistry, Inc. +// https://www.iana.org/domains/root/db/ryukyu.html ryukyu -// saarland : 2013-12-12 dotSaarland GmbH +// saarland : dotSaarland GmbH +// https://www.iana.org/domains/root/db/saarland.html saarland -// safe : 2014-12-18 Amazon Registry Services, Inc. +// safe : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/safe.html safe -// safety : 2015-01-08 Safety Registry Services, LLC. +// safety : Safety Registry Services, LLC. +// https://www.iana.org/domains/root/db/safety.html safety -// sakura : 2014-12-18 SAKURA Internet Inc. +// sakura : SAKURA Internet Inc. +// https://www.iana.org/domains/root/db/sakura.html sakura -// sale : 2014-10-16 Dog Beach, LLC +// sale : Dog Beach, LLC +// https://www.iana.org/domains/root/db/sale.html sale -// salon : 2014-12-11 Binky Moon, LLC +// salon : Binky Moon, LLC +// https://www.iana.org/domains/root/db/salon.html salon -// samsclub : 2015-07-31 Wal-Mart Stores, Inc. +// samsclub : Wal-Mart Stores, Inc. +// https://www.iana.org/domains/root/db/samsclub.html samsclub -// samsung : 2014-04-03 SAMSUNG SDS CO., LTD +// samsung : SAMSUNG SDS CO., LTD +// https://www.iana.org/domains/root/db/samsung.html samsung -// sandvik : 2014-11-13 Sandvik AB +// sandvik : Sandvik AB +// https://www.iana.org/domains/root/db/sandvik.html sandvik -// sandvikcoromant : 2014-11-07 Sandvik AB +// sandvikcoromant : Sandvik AB +// https://www.iana.org/domains/root/db/sandvikcoromant.html sandvikcoromant -// sanofi : 2014-10-09 Sanofi +// sanofi : Sanofi +// https://www.iana.org/domains/root/db/sanofi.html sanofi -// sap : 2014-03-27 SAP AG +// sap : SAP AG +// https://www.iana.org/domains/root/db/sap.html sap -// sarl : 2014-07-03 Binky Moon, LLC +// sarl : Binky Moon, LLC +// https://www.iana.org/domains/root/db/sarl.html sarl -// sas : 2015-04-02 Research IP LLC +// sas : Research IP LLC +// https://www.iana.org/domains/root/db/sas.html sas -// save : 2015-06-25 Amazon Registry Services, Inc. +// save : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/save.html save -// saxo : 2014-10-31 Saxo Bank A/S +// saxo : Saxo Bank A/S +// https://www.iana.org/domains/root/db/saxo.html saxo -// sbi : 2015-03-12 STATE BANK OF INDIA +// sbi : STATE BANK OF INDIA +// https://www.iana.org/domains/root/db/sbi.html sbi -// sbs : 2014-11-07 ShortDot SA +// sbs : ShortDot SA +// https://www.iana.org/domains/root/db/sbs.html sbs -// sca : 2014-03-13 SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ) +// sca : SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ) +// https://www.iana.org/domains/root/db/sca.html sca -// scb : 2014-02-20 The Siam Commercial Bank Public Company Limited ("SCB") +// scb : The Siam Commercial Bank Public Company Limited ("SCB") +// https://www.iana.org/domains/root/db/scb.html scb -// schaeffler : 2015-08-06 Schaeffler Technologies AG & Co. KG +// schaeffler : Schaeffler Technologies AG & Co. KG +// https://www.iana.org/domains/root/db/schaeffler.html schaeffler -// schmidt : 2014-04-03 SCHMIDT GROUPE S.A.S. +// schmidt : SCHMIDT GROUPE S.A.S. +// https://www.iana.org/domains/root/db/schmidt.html schmidt -// scholarships : 2014-04-24 Scholarships.com, LLC +// scholarships : Scholarships.com, LLC +// https://www.iana.org/domains/root/db/scholarships.html scholarships -// school : 2014-12-18 Binky Moon, LLC +// school : Binky Moon, LLC +// https://www.iana.org/domains/root/db/school.html school -// schule : 2014-03-06 Binky Moon, LLC +// schule : Binky Moon, LLC +// https://www.iana.org/domains/root/db/schule.html schule -// schwarz : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG +// schwarz : Schwarz Domains und Services GmbH & Co. KG +// https://www.iana.org/domains/root/db/schwarz.html schwarz -// science : 2014-09-11 dot Science Limited +// science : dot Science Limited +// https://www.iana.org/domains/root/db/science.html science -// scot : 2014-01-23 Dot Scot Registry Limited +// scot : Dot Scot Registry Limited +// https://www.iana.org/domains/root/db/scot.html scot -// search : 2016-06-09 Charleston Road Registry Inc. +// search : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/search.html search -// seat : 2014-05-22 SEAT, S.A. (Sociedad Unipersonal) +// seat : SEAT, S.A. (Sociedad Unipersonal) +// https://www.iana.org/domains/root/db/seat.html seat -// secure : 2015-08-27 Amazon Registry Services, Inc. +// secure : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/secure.html secure -// security : 2015-05-14 XYZ.COM LLC +// security : XYZ.COM LLC +// https://www.iana.org/domains/root/db/security.html security -// seek : 2014-12-04 Seek Limited +// seek : Seek Limited +// https://www.iana.org/domains/root/db/seek.html seek -// select : 2015-10-08 Registry Services, LLC +// select : Registry Services, LLC +// https://www.iana.org/domains/root/db/select.html select -// sener : 2014-10-24 Sener Ingeniería y Sistemas, S.A. +// sener : Sener Ingeniería y Sistemas, S.A. +// https://www.iana.org/domains/root/db/sener.html sener -// services : 2014-02-27 Binky Moon, LLC +// services : Binky Moon, LLC +// https://www.iana.org/domains/root/db/services.html services -// seven : 2015-08-06 Seven West Media Ltd +// seven : Seven West Media Ltd +// https://www.iana.org/domains/root/db/seven.html seven -// sew : 2014-07-17 SEW-EURODRIVE GmbH & Co KG +// sew : SEW-EURODRIVE GmbH & Co KG +// https://www.iana.org/domains/root/db/sew.html sew -// sex : 2014-11-13 ICM Registry SX LLC +// sex : ICM Registry SX LLC +// https://www.iana.org/domains/root/db/sex.html sex -// sexy : 2013-09-11 Internet Naming Company LLC +// sexy : Internet Naming Company LLC +// https://www.iana.org/domains/root/db/sexy.html sexy -// sfr : 2015-08-13 Societe Francaise du Radiotelephone - SFR +// sfr : Societe Francaise du Radiotelephone - SFR +// https://www.iana.org/domains/root/db/sfr.html sfr -// shangrila : 2015-09-03 Shangri‐La International Hotel Management Limited +// shangrila : Shangri‐La International Hotel Management Limited +// https://www.iana.org/domains/root/db/shangrila.html shangrila -// sharp : 2014-05-01 Sharp Corporation +// sharp : Sharp Corporation +// https://www.iana.org/domains/root/db/sharp.html sharp -// shaw : 2015-04-23 Shaw Cablesystems G.P. +// shaw : Shaw Cablesystems G.P. +// https://www.iana.org/domains/root/db/shaw.html shaw -// shell : 2015-07-30 Shell Information Technology International Inc +// shell : Shell Information Technology International Inc +// https://www.iana.org/domains/root/db/shell.html shell -// shia : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// shia : Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// https://www.iana.org/domains/root/db/shia.html shia -// shiksha : 2013-11-14 Identity Digital Limited +// shiksha : Identity Digital Limited +// https://www.iana.org/domains/root/db/shiksha.html shiksha -// shoes : 2013-10-02 Binky Moon, LLC +// shoes : Binky Moon, LLC +// https://www.iana.org/domains/root/db/shoes.html shoes -// shop : 2016-04-08 GMO Registry, Inc. +// shop : GMO Registry, Inc. +// https://www.iana.org/domains/root/db/shop.html shop -// shopping : 2016-03-31 Binky Moon, LLC +// shopping : Binky Moon, LLC +// https://www.iana.org/domains/root/db/shopping.html shopping -// shouji : 2015-01-08 Beijing Qihu Keji Co., Ltd. +// shouji : Beijing Qihu Keji Co., Ltd. +// https://www.iana.org/domains/root/db/shouji.html shouji -// show : 2015-03-05 Binky Moon, LLC +// show : Binky Moon, LLC +// https://www.iana.org/domains/root/db/show.html show -// showtime : 2015-08-06 CBS Domains Inc. -showtime - -// silk : 2015-06-25 Amazon Registry Services, Inc. +// silk : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/silk.html silk -// sina : 2015-03-12 Sina Corporation +// sina : Sina Corporation +// https://www.iana.org/domains/root/db/sina.html sina -// singles : 2013-08-27 Binky Moon, LLC +// singles : Binky Moon, LLC +// https://www.iana.org/domains/root/db/singles.html singles -// site : 2015-01-15 Radix FZC +// site : Radix FZC DMCC +// https://www.iana.org/domains/root/db/site.html site -// ski : 2015-04-09 Identity Digital Limited +// ski : Identity Digital Limited +// https://www.iana.org/domains/root/db/ski.html ski -// skin : 2015-01-15 XYZ.COM LLC +// skin : XYZ.COM LLC +// https://www.iana.org/domains/root/db/skin.html skin -// sky : 2014-06-19 Sky International AG +// sky : Sky International AG +// https://www.iana.org/domains/root/db/sky.html sky -// skype : 2014-12-18 Microsoft Corporation +// skype : Microsoft Corporation +// https://www.iana.org/domains/root/db/skype.html skype -// sling : 2015-07-30 DISH Technologies L.L.C. +// sling : DISH Technologies L.L.C. +// https://www.iana.org/domains/root/db/sling.html sling -// smart : 2015-07-09 Smart Communications, Inc. (SMART) +// smart : Smart Communications, Inc. (SMART) +// https://www.iana.org/domains/root/db/smart.html smart -// smile : 2014-12-18 Amazon Registry Services, Inc. +// smile : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/smile.html smile -// sncf : 2015-02-19 Société Nationale SNCF +// sncf : Société Nationale SNCF +// https://www.iana.org/domains/root/db/sncf.html sncf -// soccer : 2015-03-26 Binky Moon, LLC +// soccer : Binky Moon, LLC +// https://www.iana.org/domains/root/db/soccer.html soccer -// social : 2013-11-07 Dog Beach, LLC +// social : Dog Beach, LLC +// https://www.iana.org/domains/root/db/social.html social -// softbank : 2015-07-02 SoftBank Group Corp. +// softbank : SoftBank Group Corp. +// https://www.iana.org/domains/root/db/softbank.html softbank -// software : 2014-03-20 Dog Beach, LLC +// software : Dog Beach, LLC +// https://www.iana.org/domains/root/db/software.html software -// sohu : 2013-12-19 Sohu.com Limited +// sohu : Sohu.com Limited +// https://www.iana.org/domains/root/db/sohu.html sohu -// solar : 2013-11-07 Binky Moon, LLC +// solar : Binky Moon, LLC +// https://www.iana.org/domains/root/db/solar.html solar -// solutions : 2013-11-07 Binky Moon, LLC +// solutions : Binky Moon, LLC +// https://www.iana.org/domains/root/db/solutions.html solutions -// song : 2015-02-26 Amazon Registry Services, Inc. +// song : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/song.html song -// sony : 2015-01-08 Sony Corporation +// sony : Sony Corporation +// https://www.iana.org/domains/root/db/sony.html sony -// soy : 2014-01-23 Charleston Road Registry Inc. +// soy : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/soy.html soy -// spa : 2019-09-19 Asia Spa and Wellness Promotion Council Limited +// spa : Asia Spa and Wellness Promotion Council Limited +// https://www.iana.org/domains/root/db/spa.html spa -// space : 2014-04-03 Radix FZC +// space : Radix FZC DMCC +// https://www.iana.org/domains/root/db/space.html space -// sport : 2017-11-16 Global Association of International Sports Federations (GAISF) +// sport : SportAccord +// https://www.iana.org/domains/root/db/sport.html sport -// spot : 2015-02-26 Amazon Registry Services, Inc. +// spot : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/spot.html spot -// srl : 2015-05-07 InterNetX, Corp +// srl : InterNetX, Corp +// https://www.iana.org/domains/root/db/srl.html srl -// stada : 2014-11-13 STADA Arzneimittel AG +// stada : STADA Arzneimittel AG +// https://www.iana.org/domains/root/db/stada.html stada -// staples : 2015-07-30 Staples, Inc. +// staples : Staples, Inc. +// https://www.iana.org/domains/root/db/staples.html staples -// star : 2015-01-08 Star India Private Limited +// star : Star India Private Limited +// https://www.iana.org/domains/root/db/star.html star -// statebank : 2015-03-12 STATE BANK OF INDIA +// statebank : STATE BANK OF INDIA +// https://www.iana.org/domains/root/db/statebank.html statebank -// statefarm : 2015-07-30 State Farm Mutual Automobile Insurance Company +// statefarm : State Farm Mutual Automobile Insurance Company +// https://www.iana.org/domains/root/db/statefarm.html statefarm -// stc : 2014-10-09 Saudi Telecom Company +// stc : Saudi Telecom Company +// https://www.iana.org/domains/root/db/stc.html stc -// stcgroup : 2014-10-09 Saudi Telecom Company +// stcgroup : Saudi Telecom Company +// https://www.iana.org/domains/root/db/stcgroup.html stcgroup -// stockholm : 2014-12-18 Stockholms kommun +// stockholm : Stockholms kommun +// https://www.iana.org/domains/root/db/stockholm.html stockholm -// storage : 2014-12-22 XYZ.COM LLC +// storage : XYZ.COM LLC +// https://www.iana.org/domains/root/db/storage.html storage -// store : 2015-04-09 Radix FZC +// store : Radix FZC DMCC +// https://www.iana.org/domains/root/db/store.html store -// stream : 2016-01-08 dot Stream Limited +// stream : dot Stream Limited +// https://www.iana.org/domains/root/db/stream.html stream -// studio : 2015-02-11 Dog Beach, LLC +// studio : Dog Beach, LLC +// https://www.iana.org/domains/root/db/studio.html studio -// study : 2014-12-11 Registry Services, LLC +// study : Registry Services, LLC +// https://www.iana.org/domains/root/db/study.html study -// style : 2014-12-04 Binky Moon, LLC +// style : Binky Moon, LLC +// https://www.iana.org/domains/root/db/style.html style -// sucks : 2014-12-22 Vox Populi Registry Ltd. +// sucks : Vox Populi Registry Ltd. +// https://www.iana.org/domains/root/db/sucks.html sucks -// supplies : 2013-12-19 Binky Moon, LLC +// supplies : Binky Moon, LLC +// https://www.iana.org/domains/root/db/supplies.html supplies -// supply : 2013-12-19 Binky Moon, LLC +// supply : Binky Moon, LLC +// https://www.iana.org/domains/root/db/supply.html supply -// support : 2013-10-24 Binky Moon, LLC +// support : Binky Moon, LLC +// https://www.iana.org/domains/root/db/support.html support -// surf : 2014-01-09 Registry Services, LLC +// surf : Registry Services, LLC +// https://www.iana.org/domains/root/db/surf.html surf -// surgery : 2014-03-20 Binky Moon, LLC +// surgery : Binky Moon, LLC +// https://www.iana.org/domains/root/db/surgery.html surgery -// suzuki : 2014-02-20 SUZUKI MOTOR CORPORATION +// suzuki : SUZUKI MOTOR CORPORATION +// https://www.iana.org/domains/root/db/suzuki.html suzuki -// swatch : 2015-01-08 The Swatch Group Ltd +// swatch : The Swatch Group Ltd +// https://www.iana.org/domains/root/db/swatch.html swatch -// swiss : 2014-10-16 Swiss Confederation +// swiss : Swiss Confederation +// https://www.iana.org/domains/root/db/swiss.html swiss -// sydney : 2014-09-18 State of New South Wales, Department of Premier and Cabinet +// sydney : State of New South Wales, Department of Premier and Cabinet +// https://www.iana.org/domains/root/db/sydney.html sydney -// systems : 2013-11-07 Binky Moon, LLC +// systems : Binky Moon, LLC +// https://www.iana.org/domains/root/db/systems.html systems -// tab : 2014-12-04 Tabcorp Holdings Limited +// tab : Tabcorp Holdings Limited +// https://www.iana.org/domains/root/db/tab.html tab -// taipei : 2014-07-10 Taipei City Government +// taipei : Taipei City Government +// https://www.iana.org/domains/root/db/taipei.html taipei -// talk : 2015-04-09 Amazon Registry Services, Inc. +// talk : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/talk.html talk -// taobao : 2015-01-15 Alibaba Group Holding Limited +// taobao : Alibaba Group Holding Limited +// https://www.iana.org/domains/root/db/taobao.html taobao -// target : 2015-07-31 Target Domain Holdings, LLC +// target : Target Domain Holdings, LLC +// https://www.iana.org/domains/root/db/target.html target -// tatamotors : 2015-03-12 Tata Motors Ltd +// tatamotors : Tata Motors Ltd +// https://www.iana.org/domains/root/db/tatamotors.html tatamotors -// tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic" +// tatar : Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic" +// https://www.iana.org/domains/root/db/tatar.html tatar -// tattoo : 2013-08-30 Top Level Design, LLC +// tattoo : Registry Services, LLC +// https://www.iana.org/domains/root/db/tattoo.html tattoo -// tax : 2014-03-20 Binky Moon, LLC +// tax : Binky Moon, LLC +// https://www.iana.org/domains/root/db/tax.html tax -// taxi : 2015-03-19 Binky Moon, LLC +// taxi : Binky Moon, LLC +// https://www.iana.org/domains/root/db/taxi.html taxi -// tci : 2014-09-12 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// tci : Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// https://www.iana.org/domains/root/db/tci.html tci -// tdk : 2015-06-11 TDK Corporation +// tdk : TDK Corporation +// https://www.iana.org/domains/root/db/tdk.html tdk -// team : 2015-03-05 Binky Moon, LLC +// team : Binky Moon, LLC +// https://www.iana.org/domains/root/db/team.html team -// tech : 2015-01-30 Radix FZC +// tech : Radix FZC DMCC +// https://www.iana.org/domains/root/db/tech.html tech -// technology : 2013-09-13 Binky Moon, LLC +// technology : Binky Moon, LLC +// https://www.iana.org/domains/root/db/technology.html technology -// temasek : 2014-08-07 Temasek Holdings (Private) Limited +// temasek : Temasek Holdings (Private) Limited +// https://www.iana.org/domains/root/db/temasek.html temasek -// tennis : 2014-12-04 Binky Moon, LLC +// tennis : Binky Moon, LLC +// https://www.iana.org/domains/root/db/tennis.html tennis -// teva : 2015-07-02 Teva Pharmaceutical Industries Limited +// teva : Teva Pharmaceutical Industries Limited +// https://www.iana.org/domains/root/db/teva.html teva -// thd : 2015-04-02 Home Depot Product Authority, LLC +// thd : Home Depot Product Authority, LLC +// https://www.iana.org/domains/root/db/thd.html thd -// theater : 2015-03-19 Binky Moon, LLC +// theater : Binky Moon, LLC +// https://www.iana.org/domains/root/db/theater.html theater -// theatre : 2015-05-07 XYZ.COM LLC +// theatre : XYZ.COM LLC +// https://www.iana.org/domains/root/db/theatre.html theatre -// tiaa : 2015-07-23 Teachers Insurance and Annuity Association of America +// tiaa : Teachers Insurance and Annuity Association of America +// https://www.iana.org/domains/root/db/tiaa.html tiaa -// tickets : 2015-02-05 XYZ.COM LLC +// tickets : XYZ.COM LLC +// https://www.iana.org/domains/root/db/tickets.html tickets -// tienda : 2013-11-14 Binky Moon, LLC +// tienda : Binky Moon, LLC +// https://www.iana.org/domains/root/db/tienda.html tienda -// tiffany : 2015-01-30 Tiffany and Company -tiffany - -// tips : 2013-09-20 Binky Moon, LLC +// tips : Binky Moon, LLC +// https://www.iana.org/domains/root/db/tips.html tips -// tires : 2014-11-07 Binky Moon, LLC +// tires : Binky Moon, LLC +// https://www.iana.org/domains/root/db/tires.html tires -// tirol : 2014-04-24 punkt Tirol GmbH +// tirol : punkt Tirol GmbH +// https://www.iana.org/domains/root/db/tirol.html tirol -// tjmaxx : 2015-07-16 The TJX Companies, Inc. +// tjmaxx : The TJX Companies, Inc. +// https://www.iana.org/domains/root/db/tjmaxx.html tjmaxx -// tjx : 2015-07-16 The TJX Companies, Inc. +// tjx : The TJX Companies, Inc. +// https://www.iana.org/domains/root/db/tjx.html tjx -// tkmaxx : 2015-07-16 The TJX Companies, Inc. +// tkmaxx : The TJX Companies, Inc. +// https://www.iana.org/domains/root/db/tkmaxx.html tkmaxx -// tmall : 2015-01-15 Alibaba Group Holding Limited +// tmall : Alibaba Group Holding Limited +// https://www.iana.org/domains/root/db/tmall.html tmall -// today : 2013-09-20 Binky Moon, LLC +// today : Binky Moon, LLC +// https://www.iana.org/domains/root/db/today.html today -// tokyo : 2013-11-13 GMO Registry, Inc. +// tokyo : GMO Registry, Inc. +// https://www.iana.org/domains/root/db/tokyo.html tokyo -// tools : 2013-11-21 Binky Moon, LLC +// tools : Binky Moon, LLC +// https://www.iana.org/domains/root/db/tools.html tools -// top : 2014-03-20 .TOP Registry +// top : .TOP Registry +// https://www.iana.org/domains/root/db/top.html top -// toray : 2014-12-18 Toray Industries, Inc. +// toray : Toray Industries, Inc. +// https://www.iana.org/domains/root/db/toray.html toray -// toshiba : 2014-04-10 TOSHIBA Corporation +// toshiba : TOSHIBA Corporation +// https://www.iana.org/domains/root/db/toshiba.html toshiba -// total : 2015-08-06 TotalEnergies SE +// total : TotalEnergies SE +// https://www.iana.org/domains/root/db/total.html total -// tours : 2015-01-22 Binky Moon, LLC +// tours : Binky Moon, LLC +// https://www.iana.org/domains/root/db/tours.html tours -// town : 2014-03-06 Binky Moon, LLC +// town : Binky Moon, LLC +// https://www.iana.org/domains/root/db/town.html town -// toyota : 2015-04-23 TOYOTA MOTOR CORPORATION +// toyota : TOYOTA MOTOR CORPORATION +// https://www.iana.org/domains/root/db/toyota.html toyota -// toys : 2014-03-06 Binky Moon, LLC +// toys : Binky Moon, LLC +// https://www.iana.org/domains/root/db/toys.html toys -// trade : 2014-01-23 Elite Registry Limited +// trade : Elite Registry Limited +// https://www.iana.org/domains/root/db/trade.html trade -// trading : 2014-12-11 Dog Beach, LLC +// trading : Dog Beach, LLC +// https://www.iana.org/domains/root/db/trading.html trading -// training : 2013-11-07 Binky Moon, LLC +// training : Binky Moon, LLC +// https://www.iana.org/domains/root/db/training.html training -// travel : 2015-10-09 Dog Beach, LLC +// travel : Dog Beach, LLC +// https://www.iana.org/domains/root/db/travel.html travel -// travelchannel : 2015-07-02 Lifestyle Domain Holdings, Inc. -travelchannel - -// travelers : 2015-03-26 Travelers TLD, LLC +// travelers : Travelers TLD, LLC +// https://www.iana.org/domains/root/db/travelers.html travelers -// travelersinsurance : 2015-03-26 Travelers TLD, LLC +// travelersinsurance : Travelers TLD, LLC +// https://www.iana.org/domains/root/db/travelersinsurance.html travelersinsurance -// trust : 2014-10-16 Internet Naming Company LLC +// trust : Internet Naming Company LLC +// https://www.iana.org/domains/root/db/trust.html trust -// trv : 2015-03-26 Travelers TLD, LLC +// trv : Travelers TLD, LLC +// https://www.iana.org/domains/root/db/trv.html trv -// tube : 2015-06-11 Latin American Telecom LLC +// tube : Latin American Telecom LLC +// https://www.iana.org/domains/root/db/tube.html tube -// tui : 2014-07-03 TUI AG +// tui : TUI AG +// https://www.iana.org/domains/root/db/tui.html tui -// tunes : 2015-02-26 Amazon Registry Services, Inc. +// tunes : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/tunes.html tunes -// tushu : 2014-12-18 Amazon Registry Services, Inc. +// tushu : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/tushu.html tushu -// tvs : 2015-02-19 T V SUNDRAM IYENGAR & SONS LIMITED +// tvs : T V SUNDRAM IYENGAR & SONS LIMITED +// https://www.iana.org/domains/root/db/tvs.html tvs -// ubank : 2015-08-20 National Australia Bank Limited +// ubank : National Australia Bank Limited +// https://www.iana.org/domains/root/db/ubank.html ubank -// ubs : 2014-12-11 UBS AG +// ubs : UBS AG +// https://www.iana.org/domains/root/db/ubs.html ubs -// unicom : 2015-10-15 China United Network Communications Corporation Limited +// unicom : China United Network Communications Corporation Limited +// https://www.iana.org/domains/root/db/unicom.html unicom -// university : 2014-03-06 Binky Moon, LLC +// university : Binky Moon, LLC +// https://www.iana.org/domains/root/db/university.html university -// uno : 2013-09-11 Radix FZC +// uno : Radix FZC DMCC +// https://www.iana.org/domains/root/db/uno.html uno -// uol : 2014-05-01 UBN INTERNET LTDA. +// uol : UBN INTERNET LTDA. +// https://www.iana.org/domains/root/db/uol.html uol -// ups : 2015-06-25 UPS Market Driver, Inc. +// ups : UPS Market Driver, Inc. +// https://www.iana.org/domains/root/db/ups.html ups -// vacations : 2013-12-05 Binky Moon, LLC +// vacations : Binky Moon, LLC +// https://www.iana.org/domains/root/db/vacations.html vacations -// vana : 2014-12-11 Lifestyle Domain Holdings, Inc. +// vana : Lifestyle Domain Holdings, Inc. +// https://www.iana.org/domains/root/db/vana.html vana -// vanguard : 2015-09-03 The Vanguard Group, Inc. +// vanguard : The Vanguard Group, Inc. +// https://www.iana.org/domains/root/db/vanguard.html vanguard -// vegas : 2014-01-16 Dot Vegas, Inc. +// vegas : Dot Vegas, Inc. +// https://www.iana.org/domains/root/db/vegas.html vegas -// ventures : 2013-08-27 Binky Moon, LLC +// ventures : Binky Moon, LLC +// https://www.iana.org/domains/root/db/ventures.html ventures -// verisign : 2015-08-13 VeriSign, Inc. +// verisign : VeriSign, Inc. +// https://www.iana.org/domains/root/db/verisign.html verisign -// versicherung : 2014-03-20 tldbox GmbH +// versicherung : tldbox GmbH +// https://www.iana.org/domains/root/db/versicherung.html versicherung -// vet : 2014-03-06 Dog Beach, LLC +// vet : Dog Beach, LLC +// https://www.iana.org/domains/root/db/vet.html vet -// viajes : 2013-10-17 Binky Moon, LLC +// viajes : Binky Moon, LLC +// https://www.iana.org/domains/root/db/viajes.html viajes -// video : 2014-10-16 Dog Beach, LLC +// video : Dog Beach, LLC +// https://www.iana.org/domains/root/db/video.html video -// vig : 2015-05-14 VIENNA INSURANCE GROUP AG Wiener Versicherung Gruppe +// vig : VIENNA INSURANCE GROUP AG Wiener Versicherung Gruppe +// https://www.iana.org/domains/root/db/vig.html vig -// viking : 2015-04-02 Viking River Cruises (Bermuda) Ltd. +// viking : Viking River Cruises (Bermuda) Ltd. +// https://www.iana.org/domains/root/db/viking.html viking -// villas : 2013-12-05 Binky Moon, LLC +// villas : Binky Moon, LLC +// https://www.iana.org/domains/root/db/villas.html villas -// vin : 2015-06-18 Binky Moon, LLC +// vin : Binky Moon, LLC +// https://www.iana.org/domains/root/db/vin.html vin -// vip : 2015-01-22 Registry Services, LLC +// vip : Registry Services, LLC +// https://www.iana.org/domains/root/db/vip.html vip -// virgin : 2014-09-25 Virgin Enterprises Limited +// virgin : Virgin Enterprises Limited +// https://www.iana.org/domains/root/db/virgin.html virgin -// visa : 2015-07-30 Visa Worldwide Pte. Limited +// visa : Visa Worldwide Pte. Limited +// https://www.iana.org/domains/root/db/visa.html visa -// vision : 2013-12-05 Binky Moon, LLC +// vision : Binky Moon, LLC +// https://www.iana.org/domains/root/db/vision.html vision -// viva : 2014-11-07 Saudi Telecom Company +// viva : Saudi Telecom Company +// https://www.iana.org/domains/root/db/viva.html viva -// vivo : 2015-07-31 Telefonica Brasil S.A. +// vivo : Telefonica Brasil S.A. +// https://www.iana.org/domains/root/db/vivo.html vivo -// vlaanderen : 2014-02-06 DNS.be vzw +// vlaanderen : DNS.be vzw +// https://www.iana.org/domains/root/db/vlaanderen.html vlaanderen -// vodka : 2013-12-19 Registry Services, LLC +// vodka : Registry Services, LLC +// https://www.iana.org/domains/root/db/vodka.html vodka -// volkswagen : 2015-05-14 Volkswagen Group of America Inc. +// volkswagen : Volkswagen Group of America Inc. +// https://www.iana.org/domains/root/db/volkswagen.html volkswagen -// volvo : 2015-11-12 Volvo Holding Sverige Aktiebolag +// volvo : Volvo Holding Sverige Aktiebolag +// https://www.iana.org/domains/root/db/volvo.html volvo -// vote : 2013-11-21 Monolith Registry LLC +// vote : Monolith Registry LLC +// https://www.iana.org/domains/root/db/vote.html vote -// voting : 2013-11-13 Valuetainment Corp. +// voting : Valuetainment Corp. +// https://www.iana.org/domains/root/db/voting.html voting -// voto : 2013-11-21 Monolith Registry LLC +// voto : Monolith Registry LLC +// https://www.iana.org/domains/root/db/voto.html voto -// voyage : 2013-08-27 Binky Moon, LLC +// voyage : Binky Moon, LLC +// https://www.iana.org/domains/root/db/voyage.html voyage -// vuelos : 2015-03-05 Travel Reservations SRL -vuelos - -// wales : 2014-05-08 Nominet UK +// wales : Nominet UK +// https://www.iana.org/domains/root/db/wales.html wales -// walmart : 2015-07-31 Wal-Mart Stores, Inc. +// walmart : Wal-Mart Stores, Inc. +// https://www.iana.org/domains/root/db/walmart.html walmart -// walter : 2014-11-13 Sandvik AB +// walter : Sandvik AB +// https://www.iana.org/domains/root/db/walter.html walter -// wang : 2013-10-24 Zodiac Wang Limited +// wang : Zodiac Wang Limited +// https://www.iana.org/domains/root/db/wang.html wang -// wanggou : 2014-12-18 Amazon Registry Services, Inc. +// wanggou : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/wanggou.html wanggou -// watch : 2013-11-14 Binky Moon, LLC +// watch : Binky Moon, LLC +// https://www.iana.org/domains/root/db/watch.html watch -// watches : 2014-12-22 Identity Digital Limited +// watches : Identity Digital Limited +// https://www.iana.org/domains/root/db/watches.html watches -// weather : 2015-01-08 International Business Machines Corporation +// weather : International Business Machines Corporation +// https://www.iana.org/domains/root/db/weather.html weather -// weatherchannel : 2015-03-12 International Business Machines Corporation +// weatherchannel : International Business Machines Corporation +// https://www.iana.org/domains/root/db/weatherchannel.html weatherchannel -// webcam : 2014-01-23 dot Webcam Limited +// webcam : dot Webcam Limited +// https://www.iana.org/domains/root/db/webcam.html webcam -// weber : 2015-06-04 Saint-Gobain Weber SA +// weber : Saint-Gobain Weber SA +// https://www.iana.org/domains/root/db/weber.html weber -// website : 2014-04-03 Radix FZC +// website : Radix FZC DMCC +// https://www.iana.org/domains/root/db/website.html website -// wedding : 2014-04-24 Registry Services, LLC +// wedding : Registry Services, LLC +// https://www.iana.org/domains/root/db/wedding.html wedding -// weibo : 2015-03-05 Sina Corporation +// weibo : Sina Corporation +// https://www.iana.org/domains/root/db/weibo.html weibo -// weir : 2015-01-29 Weir Group IP Limited +// weir : Weir Group IP Limited +// https://www.iana.org/domains/root/db/weir.html weir -// whoswho : 2014-02-20 Who's Who Registry +// whoswho : Who's Who Registry +// https://www.iana.org/domains/root/db/whoswho.html whoswho -// wien : 2013-10-28 punkt.wien GmbH +// wien : punkt.wien GmbH +// https://www.iana.org/domains/root/db/wien.html wien -// wiki : 2013-11-07 Top Level Design, LLC +// wiki : Registry Services, LLC +// https://www.iana.org/domains/root/db/wiki.html wiki -// williamhill : 2014-03-13 William Hill Organization Limited +// williamhill : William Hill Organization Limited +// https://www.iana.org/domains/root/db/williamhill.html williamhill -// win : 2014-11-20 First Registry Limited +// win : First Registry Limited +// https://www.iana.org/domains/root/db/win.html win -// windows : 2014-12-18 Microsoft Corporation +// windows : Microsoft Corporation +// https://www.iana.org/domains/root/db/windows.html windows -// wine : 2015-06-18 Binky Moon, LLC +// wine : Binky Moon, LLC +// https://www.iana.org/domains/root/db/wine.html wine -// winners : 2015-07-16 The TJX Companies, Inc. +// winners : The TJX Companies, Inc. +// https://www.iana.org/domains/root/db/winners.html winners -// wme : 2014-02-13 William Morris Endeavor Entertainment, LLC +// wme : William Morris Endeavor Entertainment, LLC +// https://www.iana.org/domains/root/db/wme.html wme -// wolterskluwer : 2015-08-06 Wolters Kluwer N.V. +// wolterskluwer : Wolters Kluwer N.V. +// https://www.iana.org/domains/root/db/wolterskluwer.html wolterskluwer -// woodside : 2015-07-09 Woodside Petroleum Limited +// woodside : Woodside Petroleum Limited +// https://www.iana.org/domains/root/db/woodside.html woodside -// work : 2013-12-19 Registry Services, LLC +// work : Registry Services, LLC +// https://www.iana.org/domains/root/db/work.html work -// works : 2013-11-14 Binky Moon, LLC +// works : Binky Moon, LLC +// https://www.iana.org/domains/root/db/works.html works -// world : 2014-06-12 Binky Moon, LLC +// world : Binky Moon, LLC +// https://www.iana.org/domains/root/db/world.html world -// wow : 2015-10-08 Amazon Registry Services, Inc. +// wow : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/wow.html wow -// wtc : 2013-12-19 World Trade Centers Association, Inc. +// wtc : World Trade Centers Association, Inc. +// https://www.iana.org/domains/root/db/wtc.html wtc -// wtf : 2014-03-06 Binky Moon, LLC +// wtf : Binky Moon, LLC +// https://www.iana.org/domains/root/db/wtf.html wtf -// xbox : 2014-12-18 Microsoft Corporation +// xbox : Microsoft Corporation +// https://www.iana.org/domains/root/db/xbox.html xbox -// xerox : 2014-10-24 Xerox DNHC LLC +// xerox : Xerox DNHC LLC +// https://www.iana.org/domains/root/db/xerox.html xerox -// xfinity : 2015-07-09 Comcast IP Holdings I, LLC +// xfinity : Comcast IP Holdings I, LLC +// https://www.iana.org/domains/root/db/xfinity.html xfinity -// xihuan : 2015-01-08 Beijing Qihu Keji Co., Ltd. +// xihuan : Beijing Qihu Keji Co., Ltd. +// https://www.iana.org/domains/root/db/xihuan.html xihuan -// xin : 2014-12-11 Elegant Leader Limited +// xin : Elegant Leader Limited +// https://www.iana.org/domains/root/db/xin.html xin -// xn--11b4c3d : 2015-01-15 VeriSign Sarl +// xn--11b4c3d : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--11b4c3d.html कॉम -// xn--1ck2e1b : 2015-02-26 Amazon Registry Services, Inc. +// xn--1ck2e1b : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--1ck2e1b.html セール -// xn--1qqw23a : 2014-01-09 Guangzhou YU Wei Information Technology Co., Ltd. +// xn--1qqw23a : Guangzhou YU Wei Information Technology Co., Ltd. +// https://www.iana.org/domains/root/db/xn--1qqw23a.html 佛山 -// xn--30rr7y : 2014-06-12 Excellent First Limited +// xn--30rr7y : Excellent First Limited +// https://www.iana.org/domains/root/db/xn--30rr7y.html 慈善 -// xn--3bst00m : 2013-09-13 Eagle Horizon Limited +// xn--3bst00m : Eagle Horizon Limited +// https://www.iana.org/domains/root/db/xn--3bst00m.html 集团 -// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED OY +// xn--3ds443g : TLD REGISTRY LIMITED OY +// https://www.iana.org/domains/root/db/xn--3ds443g.html 在线 -// xn--3pxu8k : 2015-01-15 VeriSign Sarl +// xn--3pxu8k : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--3pxu8k.html 点看 -// xn--42c2d9a : 2015-01-15 VeriSign Sarl +// xn--42c2d9a : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--42c2d9a.html คอม -// xn--45q11c : 2013-11-21 Zodiac Gemini Ltd +// xn--45q11c : Zodiac Gemini Ltd +// https://www.iana.org/domains/root/db/xn--45q11c.html 八卦 -// xn--4gbrim : 2013-10-04 Helium TLDs Ltd +// xn--4gbrim : Helium TLDs Ltd +// https://www.iana.org/domains/root/db/xn--4gbrim.html موقع -// xn--55qw42g : 2013-11-08 China Organizational Name Administration Center +// xn--55qw42g : China Organizational Name Administration Center +// https://www.iana.org/domains/root/db/xn--55qw42g.html 公益 -// xn--55qx5d : 2013-11-14 China Internet Network Information Center (CNNIC) +// xn--55qx5d : China Internet Network Information Center (CNNIC) +// https://www.iana.org/domains/root/db/xn--55qx5d.html 公司 -// xn--5su34j936bgsg : 2015-09-03 Shangri‐La International Hotel Management Limited +// xn--5su34j936bgsg : Shangri‐La International Hotel Management Limited +// https://www.iana.org/domains/root/db/xn--5su34j936bgsg.html 香格里拉 -// xn--5tzm5g : 2014-12-22 Global Website TLD Asia Limited +// xn--5tzm5g : Global Website TLD Asia Limited +// https://www.iana.org/domains/root/db/xn--5tzm5g.html 网站 -// xn--6frz82g : 2013-09-23 Identity Digital Limited +// xn--6frz82g : Identity Digital Limited +// https://www.iana.org/domains/root/db/xn--6frz82g.html 移动 -// xn--6qq986b3xl : 2013-09-13 Tycoon Treasure Limited +// xn--6qq986b3xl : Tycoon Treasure Limited +// https://www.iana.org/domains/root/db/xn--6qq986b3xl.html 我爱你 -// xn--80adxhks : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) +// xn--80adxhks : Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) +// https://www.iana.org/domains/root/db/xn--80adxhks.html москва -// xn--80aqecdr1a : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// xn--80aqecdr1a : Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// https://www.iana.org/domains/root/db/xn--80aqecdr1a.html католик -// xn--80asehdb : 2013-07-14 CORE Association +// xn--80asehdb : CORE Association +// https://www.iana.org/domains/root/db/xn--80asehdb.html онлайн -// xn--80aswg : 2013-07-14 CORE Association +// xn--80aswg : CORE Association +// https://www.iana.org/domains/root/db/xn--80aswg.html сайт -// xn--8y0a063a : 2015-03-26 China United Network Communications Corporation Limited +// xn--8y0a063a : China United Network Communications Corporation Limited +// https://www.iana.org/domains/root/db/xn--8y0a063a.html 联通 -// xn--9dbq2a : 2015-01-15 VeriSign Sarl +// xn--9dbq2a : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--9dbq2a.html קום -// xn--9et52u : 2014-06-12 RISE VICTORY LIMITED +// xn--9et52u : RISE VICTORY LIMITED +// https://www.iana.org/domains/root/db/xn--9et52u.html 时尚 -// xn--9krt00a : 2015-03-12 Sina Corporation +// xn--9krt00a : Sina Corporation +// https://www.iana.org/domains/root/db/xn--9krt00a.html 微博 -// xn--b4w605ferd : 2014-08-07 Temasek Holdings (Private) Limited +// xn--b4w605ferd : Temasek Holdings (Private) Limited +// https://www.iana.org/domains/root/db/xn--b4w605ferd.html 淡马锡 -// xn--bck1b9a5dre4c : 2015-02-26 Amazon Registry Services, Inc. +// xn--bck1b9a5dre4c : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--bck1b9a5dre4c.html ファッション -// xn--c1avg : 2013-11-14 Public Interest Registry +// xn--c1avg : Public Interest Registry +// https://www.iana.org/domains/root/db/xn--c1avg.html орг -// xn--c2br7g : 2015-01-15 VeriSign Sarl +// xn--c2br7g : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--c2br7g.html नेट -// xn--cck2b3b : 2015-02-26 Amazon Registry Services, Inc. +// xn--cck2b3b : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--cck2b3b.html ストア -// xn--cckwcxetd : 2019-12-19 Amazon Registry Services, Inc. +// xn--cckwcxetd : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--cckwcxetd.html アマゾン -// xn--cg4bki : 2013-09-27 SAMSUNG SDS CO., LTD +// xn--cg4bki : SAMSUNG SDS CO., LTD +// https://www.iana.org/domains/root/db/xn--cg4bki.html 삼성 -// xn--czr694b : 2014-01-16 Internet DotTrademark Organisation Limited +// xn--czr694b : Internet DotTrademark Organisation Limited +// https://www.iana.org/domains/root/db/xn--czr694b.html 商标 -// xn--czrs0t : 2013-12-19 Binky Moon, LLC +// xn--czrs0t : Binky Moon, LLC +// https://www.iana.org/domains/root/db/xn--czrs0t.html 商店 -// xn--czru2d : 2013-11-21 Zodiac Aquarius Limited +// xn--czru2d : Zodiac Aquarius Limited +// https://www.iana.org/domains/root/db/xn--czru2d.html 商城 -// xn--d1acj3b : 2013-11-20 The Foundation for Network Initiatives “The Smart Internet” +// xn--d1acj3b : The Foundation for Network Initiatives “The Smart Internet” +// https://www.iana.org/domains/root/db/xn--d1acj3b.html дети -// xn--eckvdtc9d : 2014-12-18 Amazon Registry Services, Inc. +// xn--eckvdtc9d : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--eckvdtc9d.html ポイント -// xn--efvy88h : 2014-08-22 Guangzhou YU Wei Information Technology Co., Ltd. +// xn--efvy88h : Guangzhou YU Wei Information Technology Co., Ltd. +// https://www.iana.org/domains/root/db/xn--efvy88h.html 新闻 -// xn--fct429k : 2015-04-09 Amazon Registry Services, Inc. +// xn--fct429k : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--fct429k.html 家電 -// xn--fhbei : 2015-01-15 VeriSign Sarl +// xn--fhbei : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--fhbei.html كوم -// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED OY +// xn--fiq228c5hs : TLD REGISTRY LIMITED OY +// https://www.iana.org/domains/root/db/xn--fiq228c5hs.html 中文网 -// xn--fiq64b : 2013-10-14 CITIC Group Corporation +// xn--fiq64b : CITIC Group Corporation +// https://www.iana.org/domains/root/db/xn--fiq64b.html 中信 -// xn--fjq720a : 2014-05-22 Binky Moon, LLC +// xn--fjq720a : Binky Moon, LLC +// https://www.iana.org/domains/root/db/xn--fjq720a.html 娱乐 -// xn--flw351e : 2014-07-31 Charleston Road Registry Inc. +// xn--flw351e : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/xn--flw351e.html 谷歌 -// xn--fzys8d69uvgm : 2015-05-14 PCCW Enterprises Limited +// xn--fzys8d69uvgm : PCCW Enterprises Limited +// https://www.iana.org/domains/root/db/xn--fzys8d69uvgm.html 電訊盈科 -// xn--g2xx48c : 2015-01-30 Nawang Heli(Xiamen) Network Service Co., LTD. +// xn--g2xx48c : Nawang Heli(Xiamen) Network Service Co., LTD. +// https://www.iana.org/domains/root/db/xn--g2xx48c.html 购物 -// xn--gckr3f0f : 2015-02-26 Amazon Registry Services, Inc. +// xn--gckr3f0f : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--gckr3f0f.html クラウド -// xn--gk3at1e : 2015-10-08 Amazon Registry Services, Inc. +// xn--gk3at1e : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--gk3at1e.html 通販 -// xn--hxt814e : 2014-05-15 Zodiac Taurus Limited +// xn--hxt814e : Zodiac Taurus Limited +// https://www.iana.org/domains/root/db/xn--hxt814e.html 网店 -// xn--i1b6b1a6a2e : 2013-11-14 Public Interest Registry +// xn--i1b6b1a6a2e : Public Interest Registry +// https://www.iana.org/domains/root/db/xn--i1b6b1a6a2e.html संगठन -// xn--imr513n : 2014-12-11 Internet DotTrademark Organisation Limited +// xn--imr513n : Internet DotTrademark Organisation Limited +// https://www.iana.org/domains/root/db/xn--imr513n.html 餐厅 -// xn--io0a7i : 2013-11-14 China Internet Network Information Center (CNNIC) +// xn--io0a7i : China Internet Network Information Center (CNNIC) +// https://www.iana.org/domains/root/db/xn--io0a7i.html 网络 -// xn--j1aef : 2015-01-15 VeriSign Sarl +// xn--j1aef : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--j1aef.html ком -// xn--jlq480n2rg : 2019-12-19 Amazon Registry Services, Inc. +// xn--jlq480n2rg : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--jlq480n2rg.html 亚马逊 -// xn--jvr189m : 2015-02-26 Amazon Registry Services, Inc. +// xn--jvr189m : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--jvr189m.html 食品 -// xn--kcrx77d1x4a : 2014-11-07 Koninklijke Philips N.V. +// xn--kcrx77d1x4a : Koninklijke Philips N.V. +// https://www.iana.org/domains/root/db/xn--kcrx77d1x4a.html 飞利浦 -// xn--kput3i : 2014-02-13 Beijing RITT-Net Technology Development Co., Ltd +// xn--kput3i : Beijing RITT-Net Technology Development Co., Ltd +// https://www.iana.org/domains/root/db/xn--kput3i.html 手机 -// xn--mgba3a3ejt : 2014-11-20 Aramco Services Company +// xn--mgba3a3ejt : Aramco Services Company +// https://www.iana.org/domains/root/db/xn--mgba3a3ejt.html ارامكو -// xn--mgba7c0bbn0a : 2015-05-14 Crescent Holding GmbH +// xn--mgba7c0bbn0a : Competrol (Luxembourg) Sarl +// https://www.iana.org/domains/root/db/xn--mgba7c0bbn0a.html العليان -// xn--mgbaakc7dvf : 2015-09-03 Emirates Telecommunications Corporation (trading as Etisalat) +// xn--mgbaakc7dvf : Emirates Telecommunications Corporation (trading as Etisalat) +// https://www.iana.org/domains/root/db/xn--mgbaakc7dvf.html اتصالات -// xn--mgbab2bd : 2013-10-31 CORE Association +// xn--mgbab2bd : CORE Association +// https://www.iana.org/domains/root/db/xn--mgbab2bd.html بازار -// xn--mgbca7dzdo : 2015-07-30 Abu Dhabi Systems and Information Centre +// xn--mgbca7dzdo : Abu Dhabi Systems and Information Centre +// https://www.iana.org/domains/root/db/xn--mgbca7dzdo.html ابوظبي -// xn--mgbi4ecexp : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// xn--mgbi4ecexp : Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// https://www.iana.org/domains/root/db/xn--mgbi4ecexp.html كاثوليك -// xn--mgbt3dhd : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// xn--mgbt3dhd : Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +// https://www.iana.org/domains/root/db/xn--mgbt3dhd.html همراه -// xn--mk1bu44c : 2015-01-15 VeriSign Sarl +// xn--mk1bu44c : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--mk1bu44c.html 닷컴 -// xn--mxtq1m : 2014-03-06 Net-Chinese Co., Ltd. +// xn--mxtq1m : Net-Chinese Co., Ltd. +// https://www.iana.org/domains/root/db/xn--mxtq1m.html 政府 -// xn--ngbc5azd : 2013-07-13 International Domain Registry Pty. Ltd. +// xn--ngbc5azd : International Domain Registry Pty. Ltd. +// https://www.iana.org/domains/root/db/xn--ngbc5azd.html شبكة -// xn--ngbe9e0a : 2014-12-04 Kuwait Finance House +// xn--ngbe9e0a : Kuwait Finance House +// https://www.iana.org/domains/root/db/xn--ngbe9e0a.html بيتك -// xn--ngbrx : 2015-11-12 League of Arab States +// xn--ngbrx : League of Arab States +// https://www.iana.org/domains/root/db/xn--ngbrx.html عرب -// xn--nqv7f : 2013-11-14 Public Interest Registry +// xn--nqv7f : Public Interest Registry +// https://www.iana.org/domains/root/db/xn--nqv7f.html 机构 -// xn--nqv7fs00ema : 2013-11-14 Public Interest Registry +// xn--nqv7fs00ema : Public Interest Registry +// https://www.iana.org/domains/root/db/xn--nqv7fs00ema.html 组织机构 -// xn--nyqy26a : 2014-11-07 Stable Tone Limited +// xn--nyqy26a : Stable Tone Limited +// https://www.iana.org/domains/root/db/xn--nyqy26a.html 健康 -// xn--otu796d : 2017-08-06 Jiang Yu Liang Cai Technology Company Limited +// xn--otu796d : Jiang Yu Liang Cai Technology Company Limited +// https://www.iana.org/domains/root/db/xn--otu796d.html 招聘 -// xn--p1acf : 2013-12-12 Rusnames Limited +// xn--p1acf : Rusnames Limited +// https://www.iana.org/domains/root/db/xn--p1acf.html рус -// xn--pssy2u : 2015-01-15 VeriSign Sarl +// xn--pssy2u : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--pssy2u.html 大拿 -// xn--q9jyb4c : 2013-09-17 Charleston Road Registry Inc. +// xn--q9jyb4c : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/xn--q9jyb4c.html みんな -// xn--qcka1pmc : 2014-07-31 Charleston Road Registry Inc. +// xn--qcka1pmc : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/xn--qcka1pmc.html グーグル -// xn--rhqv96g : 2013-09-11 Stable Tone Limited +// xn--rhqv96g : Stable Tone Limited +// https://www.iana.org/domains/root/db/xn--rhqv96g.html 世界 -// xn--rovu88b : 2015-02-26 Amazon Registry Services, Inc. +// xn--rovu88b : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/xn--rovu88b.html 書籍 -// xn--ses554g : 2014-01-16 KNET Co., Ltd. +// xn--ses554g : KNET Co., Ltd. +// https://www.iana.org/domains/root/db/xn--ses554g.html 网址 -// xn--t60b56a : 2015-01-15 VeriSign Sarl +// xn--t60b56a : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--t60b56a.html 닷넷 -// xn--tckwe : 2015-01-15 VeriSign Sarl +// xn--tckwe : VeriSign Sarl +// https://www.iana.org/domains/root/db/xn--tckwe.html コム -// xn--tiq49xqyj : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// xn--tiq49xqyj : Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +// https://www.iana.org/domains/root/db/xn--tiq49xqyj.html 天主教 -// xn--unup4y : 2013-07-14 Binky Moon, LLC +// xn--unup4y : Binky Moon, LLC +// https://www.iana.org/domains/root/db/xn--unup4y.html 游戏 -// xn--vermgensberater-ctb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +// xn--vermgensberater-ctb : Deutsche Vermögensberatung Aktiengesellschaft DVAG +// https://www.iana.org/domains/root/db/xn--vermgensberater-ctb.html vermögensberater -// xn--vermgensberatung-pwb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +// xn--vermgensberatung-pwb : Deutsche Vermögensberatung Aktiengesellschaft DVAG +// https://www.iana.org/domains/root/db/xn--vermgensberatung-pwb.html vermögensberatung -// xn--vhquv : 2013-08-27 Binky Moon, LLC +// xn--vhquv : Binky Moon, LLC +// https://www.iana.org/domains/root/db/xn--vhquv.html 企业 -// xn--vuq861b : 2014-10-16 Beijing Tele-info Network Technology Co., Ltd. +// xn--vuq861b : Beijing Tele-info Technology Co., Ltd. +// https://www.iana.org/domains/root/db/xn--vuq861b.html 信息 -// xn--w4r85el8fhu5dnra : 2015-04-30 Kerry Trading Co. Limited +// xn--w4r85el8fhu5dnra : Kerry Trading Co. Limited +// https://www.iana.org/domains/root/db/xn--w4r85el8fhu5dnra.html 嘉里大酒店 -// xn--w4rs40l : 2015-07-30 Kerry Trading Co. Limited +// xn--w4rs40l : Kerry Trading Co. Limited +// https://www.iana.org/domains/root/db/xn--w4rs40l.html 嘉里 -// xn--xhq521b : 2013-11-14 Guangzhou YU Wei Information Technology Co., Ltd. +// xn--xhq521b : Guangzhou YU Wei Information Technology Co., Ltd. +// https://www.iana.org/domains/root/db/xn--xhq521b.html 广东 -// xn--zfr164b : 2013-11-08 China Organizational Name Administration Center +// xn--zfr164b : China Organizational Name Administration Center +// https://www.iana.org/domains/root/db/xn--zfr164b.html 政务 -// xyz : 2013-12-05 XYZ.COM LLC +// xyz : XYZ.COM LLC +// https://www.iana.org/domains/root/db/xyz.html xyz -// yachts : 2014-01-09 XYZ.COM LLC +// yachts : XYZ.COM LLC +// https://www.iana.org/domains/root/db/yachts.html yachts -// yahoo : 2015-04-02 Oath Inc. +// yahoo : Oath Inc. +// https://www.iana.org/domains/root/db/yahoo.html yahoo -// yamaxun : 2014-12-18 Amazon Registry Services, Inc. +// yamaxun : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/yamaxun.html yamaxun -// yandex : 2014-04-10 Yandex Europe B.V. +// yandex : Yandex Europe B.V. +// https://www.iana.org/domains/root/db/yandex.html yandex -// yodobashi : 2014-11-20 YODOBASHI CAMERA CO.,LTD. +// yodobashi : YODOBASHI CAMERA CO.,LTD. +// https://www.iana.org/domains/root/db/yodobashi.html yodobashi -// yoga : 2014-05-29 Registry Services, LLC +// yoga : Registry Services, LLC +// https://www.iana.org/domains/root/db/yoga.html yoga -// yokohama : 2013-12-12 GMO Registry, Inc. +// yokohama : GMO Registry, Inc. +// https://www.iana.org/domains/root/db/yokohama.html yokohama -// you : 2015-04-09 Amazon Registry Services, Inc. +// you : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/you.html you -// youtube : 2014-05-01 Charleston Road Registry Inc. +// youtube : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/youtube.html youtube -// yun : 2015-01-08 Beijing Qihu Keji Co., Ltd. +// yun : Beijing Qihu Keji Co., Ltd. +// https://www.iana.org/domains/root/db/yun.html yun -// zappos : 2015-06-25 Amazon Registry Services, Inc. +// zappos : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/zappos.html zappos -// zara : 2014-11-07 Industria de Diseño Textil, S.A. (INDITEX, S.A.) +// zara : Industria de Diseño Textil, S.A. (INDITEX, S.A.) +// https://www.iana.org/domains/root/db/zara.html zara -// zero : 2014-12-18 Amazon Registry Services, Inc. +// zero : Amazon Registry Services, Inc. +// https://www.iana.org/domains/root/db/zero.html zero -// zip : 2014-05-08 Charleston Road Registry Inc. +// zip : Charleston Road Registry Inc. +// https://www.iana.org/domains/root/db/zip.html zip -// zone : 2013-11-14 Binky Moon, LLC +// zone : Binky Moon, LLC +// https://www.iana.org/domains/root/db/zone.html zone -// zuerich : 2014-11-07 Kanton Zürich (Canton of Zurich) +// zuerich : Kanton Zürich (Canton of Zurich) +// https://www.iana.org/domains/root/db/zuerich.html zuerich @@ -10189,11 +11317,78 @@ myamaze.net // Submitted by AWS Security // Subsections of Amazon/subsidiaries will appear until "concludes" tag +// Amazon API Gateway +// Submitted by AWS Security +// Reference: 4d863337-ff98-4501-a6f2-361eba8445d6 +execute-api.cn-north-1.amazonaws.com.cn +execute-api.cn-northwest-1.amazonaws.com.cn +execute-api.af-south-1.amazonaws.com +execute-api.ap-east-1.amazonaws.com +execute-api.ap-northeast-1.amazonaws.com +execute-api.ap-northeast-2.amazonaws.com +execute-api.ap-northeast-3.amazonaws.com +execute-api.ap-south-1.amazonaws.com +execute-api.ap-south-2.amazonaws.com +execute-api.ap-southeast-1.amazonaws.com +execute-api.ap-southeast-2.amazonaws.com +execute-api.ap-southeast-3.amazonaws.com +execute-api.ap-southeast-4.amazonaws.com +execute-api.ca-central-1.amazonaws.com +execute-api.eu-central-1.amazonaws.com +execute-api.eu-central-2.amazonaws.com +execute-api.eu-north-1.amazonaws.com +execute-api.eu-south-1.amazonaws.com +execute-api.eu-south-2.amazonaws.com +execute-api.eu-west-1.amazonaws.com +execute-api.eu-west-2.amazonaws.com +execute-api.eu-west-3.amazonaws.com +execute-api.il-central-1.amazonaws.com +execute-api.me-central-1.amazonaws.com +execute-api.me-south-1.amazonaws.com +execute-api.sa-east-1.amazonaws.com +execute-api.us-east-1.amazonaws.com +execute-api.us-east-2.amazonaws.com +execute-api.us-gov-east-1.amazonaws.com +execute-api.us-gov-west-1.amazonaws.com +execute-api.us-west-1.amazonaws.com +execute-api.us-west-2.amazonaws.com + // Amazon CloudFront // Submitted by Donavan Miller // Reference: 54144616-fd49-4435-8535-19c6a601bdb3 cloudfront.net +// Amazon Cognito +// Submitted by AWS Security +// Reference: 7bee1013-f456-47df-bfe8-03c78d946d61 +auth.af-south-1.amazoncognito.com +auth.ap-northeast-1.amazoncognito.com +auth.ap-northeast-2.amazoncognito.com +auth.ap-northeast-3.amazoncognito.com +auth.ap-south-1.amazoncognito.com +auth.ap-southeast-1.amazoncognito.com +auth.ap-southeast-2.amazoncognito.com +auth.ap-southeast-3.amazoncognito.com +auth.ca-central-1.amazoncognito.com +auth.eu-central-1.amazoncognito.com +auth.eu-north-1.amazoncognito.com +auth.eu-south-1.amazoncognito.com +auth.eu-west-1.amazoncognito.com +auth.eu-west-2.amazoncognito.com +auth.eu-west-3.amazoncognito.com +auth.il-central-1.amazoncognito.com +auth.me-south-1.amazoncognito.com +auth.sa-east-1.amazoncognito.com +auth.us-east-1.amazoncognito.com +auth-fips.us-east-1.amazoncognito.com +auth.us-east-2.amazoncognito.com +auth-fips.us-east-2.amazoncognito.com +auth-fips.us-gov-west-1.amazoncognito.com +auth.us-west-1.amazoncognito.com +auth-fips.us-west-1.amazoncognito.com +auth.us-west-2.amazoncognito.com +auth-fips.us-west-2.amazoncognito.com + // Amazon EC2 // Submitted by Luke Wells // Reference: 4c38fa71-58ac-4768-99e5-689c1767e537 @@ -10202,47 +11397,307 @@ cloudfront.net *.compute.amazonaws.com.cn us-east-1.amazonaws.com +// Amazon EMR +// Submitted by AWS Security +// Reference: 597f3f8e-9283-4e48-8e32-7ee25a1ff6ab +emrappui-prod.cn-north-1.amazonaws.com.cn +emrnotebooks-prod.cn-north-1.amazonaws.com.cn +emrstudio-prod.cn-north-1.amazonaws.com.cn +emrappui-prod.cn-northwest-1.amazonaws.com.cn +emrnotebooks-prod.cn-northwest-1.amazonaws.com.cn +emrstudio-prod.cn-northwest-1.amazonaws.com.cn +emrappui-prod.af-south-1.amazonaws.com +emrnotebooks-prod.af-south-1.amazonaws.com +emrstudio-prod.af-south-1.amazonaws.com +emrappui-prod.ap-east-1.amazonaws.com +emrnotebooks-prod.ap-east-1.amazonaws.com +emrstudio-prod.ap-east-1.amazonaws.com +emrappui-prod.ap-northeast-1.amazonaws.com +emrnotebooks-prod.ap-northeast-1.amazonaws.com +emrstudio-prod.ap-northeast-1.amazonaws.com +emrappui-prod.ap-northeast-2.amazonaws.com +emrnotebooks-prod.ap-northeast-2.amazonaws.com +emrstudio-prod.ap-northeast-2.amazonaws.com +emrappui-prod.ap-northeast-3.amazonaws.com +emrnotebooks-prod.ap-northeast-3.amazonaws.com +emrstudio-prod.ap-northeast-3.amazonaws.com +emrappui-prod.ap-south-1.amazonaws.com +emrnotebooks-prod.ap-south-1.amazonaws.com +emrstudio-prod.ap-south-1.amazonaws.com +emrappui-prod.ap-southeast-1.amazonaws.com +emrnotebooks-prod.ap-southeast-1.amazonaws.com +emrstudio-prod.ap-southeast-1.amazonaws.com +emrappui-prod.ap-southeast-2.amazonaws.com +emrnotebooks-prod.ap-southeast-2.amazonaws.com +emrstudio-prod.ap-southeast-2.amazonaws.com +emrappui-prod.ap-southeast-3.amazonaws.com +emrnotebooks-prod.ap-southeast-3.amazonaws.com +emrstudio-prod.ap-southeast-3.amazonaws.com +emrappui-prod.ca-central-1.amazonaws.com +emrnotebooks-prod.ca-central-1.amazonaws.com +emrstudio-prod.ca-central-1.amazonaws.com +emrappui-prod.eu-central-1.amazonaws.com +emrnotebooks-prod.eu-central-1.amazonaws.com +emrstudio-prod.eu-central-1.amazonaws.com +emrappui-prod.eu-north-1.amazonaws.com +emrnotebooks-prod.eu-north-1.amazonaws.com +emrstudio-prod.eu-north-1.amazonaws.com +emrappui-prod.eu-south-1.amazonaws.com +emrnotebooks-prod.eu-south-1.amazonaws.com +emrstudio-prod.eu-south-1.amazonaws.com +emrappui-prod.eu-west-1.amazonaws.com +emrnotebooks-prod.eu-west-1.amazonaws.com +emrstudio-prod.eu-west-1.amazonaws.com +emrappui-prod.eu-west-2.amazonaws.com +emrnotebooks-prod.eu-west-2.amazonaws.com +emrstudio-prod.eu-west-2.amazonaws.com +emrappui-prod.eu-west-3.amazonaws.com +emrnotebooks-prod.eu-west-3.amazonaws.com +emrstudio-prod.eu-west-3.amazonaws.com +emrappui-prod.me-central-1.amazonaws.com +emrnotebooks-prod.me-central-1.amazonaws.com +emrstudio-prod.me-central-1.amazonaws.com +emrappui-prod.me-south-1.amazonaws.com +emrnotebooks-prod.me-south-1.amazonaws.com +emrstudio-prod.me-south-1.amazonaws.com +emrappui-prod.sa-east-1.amazonaws.com +emrnotebooks-prod.sa-east-1.amazonaws.com +emrstudio-prod.sa-east-1.amazonaws.com +emrappui-prod.us-east-1.amazonaws.com +emrnotebooks-prod.us-east-1.amazonaws.com +emrstudio-prod.us-east-1.amazonaws.com +emrappui-prod.us-east-2.amazonaws.com +emrnotebooks-prod.us-east-2.amazonaws.com +emrstudio-prod.us-east-2.amazonaws.com +emrappui-prod.us-gov-east-1.amazonaws.com +emrnotebooks-prod.us-gov-east-1.amazonaws.com +emrstudio-prod.us-gov-east-1.amazonaws.com +emrappui-prod.us-gov-west-1.amazonaws.com +emrnotebooks-prod.us-gov-west-1.amazonaws.com +emrstudio-prod.us-gov-west-1.amazonaws.com +emrappui-prod.us-west-1.amazonaws.com +emrnotebooks-prod.us-west-1.amazonaws.com +emrstudio-prod.us-west-1.amazonaws.com +emrappui-prod.us-west-2.amazonaws.com +emrnotebooks-prod.us-west-2.amazonaws.com +emrstudio-prod.us-west-2.amazonaws.com + +// Amazon Managed Workflows for Apache Airflow +// Submitted by AWS Security +// Reference: 4ab55e6f-90c0-4a8d-b6a0-52ca5dbb1c2e +*.cn-north-1.airflow.amazonaws.com.cn +*.cn-northwest-1.airflow.amazonaws.com.cn +*.ap-northeast-1.airflow.amazonaws.com +*.ap-northeast-2.airflow.amazonaws.com +*.ap-south-1.airflow.amazonaws.com +*.ap-southeast-1.airflow.amazonaws.com +*.ap-southeast-2.airflow.amazonaws.com +*.ca-central-1.airflow.amazonaws.com +*.eu-central-1.airflow.amazonaws.com +*.eu-north-1.airflow.amazonaws.com +*.eu-west-1.airflow.amazonaws.com +*.eu-west-2.airflow.amazonaws.com +*.eu-west-3.airflow.amazonaws.com +*.sa-east-1.airflow.amazonaws.com +*.us-east-1.airflow.amazonaws.com +*.us-east-2.airflow.amazonaws.com +*.us-west-2.airflow.amazonaws.com + // Amazon S3 -// Submitted by Luke Wells -// Reference: d068bd97-f0a9-4838-a6d8-954b622ef4ae +// Submitted by AWS Security +// Reference: 0e801048-08f2-4064-9cb8-e7373e0b57f4 +s3.dualstack.cn-north-1.amazonaws.com.cn +s3-accesspoint.dualstack.cn-north-1.amazonaws.com.cn +s3-website.dualstack.cn-north-1.amazonaws.com.cn s3.cn-north-1.amazonaws.com.cn +s3-accesspoint.cn-north-1.amazonaws.com.cn +s3-deprecated.cn-north-1.amazonaws.com.cn +s3-object-lambda.cn-north-1.amazonaws.com.cn +s3-website.cn-north-1.amazonaws.com.cn +s3.dualstack.cn-northwest-1.amazonaws.com.cn +s3-accesspoint.dualstack.cn-northwest-1.amazonaws.com.cn +s3.cn-northwest-1.amazonaws.com.cn +s3-accesspoint.cn-northwest-1.amazonaws.com.cn +s3-object-lambda.cn-northwest-1.amazonaws.com.cn +s3-website.cn-northwest-1.amazonaws.com.cn +s3.dualstack.af-south-1.amazonaws.com +s3-accesspoint.dualstack.af-south-1.amazonaws.com +s3-website.dualstack.af-south-1.amazonaws.com +s3.af-south-1.amazonaws.com +s3-accesspoint.af-south-1.amazonaws.com +s3-object-lambda.af-south-1.amazonaws.com +s3-website.af-south-1.amazonaws.com +s3.dualstack.ap-east-1.amazonaws.com +s3-accesspoint.dualstack.ap-east-1.amazonaws.com +s3.ap-east-1.amazonaws.com +s3-accesspoint.ap-east-1.amazonaws.com +s3-object-lambda.ap-east-1.amazonaws.com +s3-website.ap-east-1.amazonaws.com s3.dualstack.ap-northeast-1.amazonaws.com +s3-accesspoint.dualstack.ap-northeast-1.amazonaws.com +s3-website.dualstack.ap-northeast-1.amazonaws.com +s3.ap-northeast-1.amazonaws.com +s3-accesspoint.ap-northeast-1.amazonaws.com +s3-object-lambda.ap-northeast-1.amazonaws.com +s3-website.ap-northeast-1.amazonaws.com s3.dualstack.ap-northeast-2.amazonaws.com +s3-accesspoint.dualstack.ap-northeast-2.amazonaws.com +s3-website.dualstack.ap-northeast-2.amazonaws.com s3.ap-northeast-2.amazonaws.com +s3-accesspoint.ap-northeast-2.amazonaws.com +s3-object-lambda.ap-northeast-2.amazonaws.com s3-website.ap-northeast-2.amazonaws.com +s3.dualstack.ap-northeast-3.amazonaws.com +s3-accesspoint.dualstack.ap-northeast-3.amazonaws.com +s3-website.dualstack.ap-northeast-3.amazonaws.com +s3.ap-northeast-3.amazonaws.com +s3-accesspoint.ap-northeast-3.amazonaws.com +s3-object-lambda.ap-northeast-3.amazonaws.com +s3-website.ap-northeast-3.amazonaws.com s3.dualstack.ap-south-1.amazonaws.com +s3-accesspoint.dualstack.ap-south-1.amazonaws.com +s3-website.dualstack.ap-south-1.amazonaws.com s3.ap-south-1.amazonaws.com +s3-accesspoint.ap-south-1.amazonaws.com +s3-object-lambda.ap-south-1.amazonaws.com s3-website.ap-south-1.amazonaws.com +s3.dualstack.ap-south-2.amazonaws.com +s3-accesspoint.dualstack.ap-south-2.amazonaws.com +s3.ap-south-2.amazonaws.com +s3-accesspoint.ap-south-2.amazonaws.com +s3-object-lambda.ap-south-2.amazonaws.com +s3-website.ap-south-2.amazonaws.com s3.dualstack.ap-southeast-1.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-1.amazonaws.com +s3-website.dualstack.ap-southeast-1.amazonaws.com +s3.ap-southeast-1.amazonaws.com +s3-accesspoint.ap-southeast-1.amazonaws.com +s3-object-lambda.ap-southeast-1.amazonaws.com +s3-website.ap-southeast-1.amazonaws.com s3.dualstack.ap-southeast-2.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-2.amazonaws.com +s3-website.dualstack.ap-southeast-2.amazonaws.com +s3.ap-southeast-2.amazonaws.com +s3-accesspoint.ap-southeast-2.amazonaws.com +s3-object-lambda.ap-southeast-2.amazonaws.com +s3-website.ap-southeast-2.amazonaws.com +s3.dualstack.ap-southeast-3.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-3.amazonaws.com +s3.ap-southeast-3.amazonaws.com +s3-accesspoint.ap-southeast-3.amazonaws.com +s3-object-lambda.ap-southeast-3.amazonaws.com +s3-website.ap-southeast-3.amazonaws.com +s3.dualstack.ap-southeast-4.amazonaws.com +s3-accesspoint.dualstack.ap-southeast-4.amazonaws.com +s3.ap-southeast-4.amazonaws.com +s3-accesspoint.ap-southeast-4.amazonaws.com +s3-object-lambda.ap-southeast-4.amazonaws.com +s3-website.ap-southeast-4.amazonaws.com s3.dualstack.ca-central-1.amazonaws.com +s3-accesspoint.dualstack.ca-central-1.amazonaws.com +s3-accesspoint-fips.dualstack.ca-central-1.amazonaws.com +s3-fips.dualstack.ca-central-1.amazonaws.com +s3-website.dualstack.ca-central-1.amazonaws.com s3.ca-central-1.amazonaws.com +s3-accesspoint.ca-central-1.amazonaws.com +s3-accesspoint-fips.ca-central-1.amazonaws.com +s3-fips.ca-central-1.amazonaws.com +s3-object-lambda.ca-central-1.amazonaws.com s3-website.ca-central-1.amazonaws.com s3.dualstack.eu-central-1.amazonaws.com +s3-accesspoint.dualstack.eu-central-1.amazonaws.com +s3-website.dualstack.eu-central-1.amazonaws.com s3.eu-central-1.amazonaws.com +s3-accesspoint.eu-central-1.amazonaws.com +s3-object-lambda.eu-central-1.amazonaws.com s3-website.eu-central-1.amazonaws.com +s3.dualstack.eu-central-2.amazonaws.com +s3-accesspoint.dualstack.eu-central-2.amazonaws.com +s3.eu-central-2.amazonaws.com +s3-accesspoint.eu-central-2.amazonaws.com +s3-object-lambda.eu-central-2.amazonaws.com +s3-website.eu-central-2.amazonaws.com +s3.dualstack.eu-north-1.amazonaws.com +s3-accesspoint.dualstack.eu-north-1.amazonaws.com +s3.eu-north-1.amazonaws.com +s3-accesspoint.eu-north-1.amazonaws.com +s3-object-lambda.eu-north-1.amazonaws.com +s3-website.eu-north-1.amazonaws.com +s3.dualstack.eu-south-1.amazonaws.com +s3-accesspoint.dualstack.eu-south-1.amazonaws.com +s3-website.dualstack.eu-south-1.amazonaws.com +s3.eu-south-1.amazonaws.com +s3-accesspoint.eu-south-1.amazonaws.com +s3-object-lambda.eu-south-1.amazonaws.com +s3-website.eu-south-1.amazonaws.com +s3.dualstack.eu-south-2.amazonaws.com +s3-accesspoint.dualstack.eu-south-2.amazonaws.com +s3.eu-south-2.amazonaws.com +s3-accesspoint.eu-south-2.amazonaws.com +s3-object-lambda.eu-south-2.amazonaws.com +s3-website.eu-south-2.amazonaws.com s3.dualstack.eu-west-1.amazonaws.com +s3-accesspoint.dualstack.eu-west-1.amazonaws.com +s3-website.dualstack.eu-west-1.amazonaws.com +s3.eu-west-1.amazonaws.com +s3-accesspoint.eu-west-1.amazonaws.com +s3-deprecated.eu-west-1.amazonaws.com +s3-object-lambda.eu-west-1.amazonaws.com +s3-website.eu-west-1.amazonaws.com s3.dualstack.eu-west-2.amazonaws.com +s3-accesspoint.dualstack.eu-west-2.amazonaws.com s3.eu-west-2.amazonaws.com +s3-accesspoint.eu-west-2.amazonaws.com +s3-object-lambda.eu-west-2.amazonaws.com s3-website.eu-west-2.amazonaws.com s3.dualstack.eu-west-3.amazonaws.com +s3-accesspoint.dualstack.eu-west-3.amazonaws.com +s3-website.dualstack.eu-west-3.amazonaws.com s3.eu-west-3.amazonaws.com +s3-accesspoint.eu-west-3.amazonaws.com +s3-object-lambda.eu-west-3.amazonaws.com s3-website.eu-west-3.amazonaws.com +s3.dualstack.il-central-1.amazonaws.com +s3-accesspoint.dualstack.il-central-1.amazonaws.com +s3.il-central-1.amazonaws.com +s3-accesspoint.il-central-1.amazonaws.com +s3-object-lambda.il-central-1.amazonaws.com +s3-website.il-central-1.amazonaws.com +s3.dualstack.me-central-1.amazonaws.com +s3-accesspoint.dualstack.me-central-1.amazonaws.com +s3.me-central-1.amazonaws.com +s3-accesspoint.me-central-1.amazonaws.com +s3-object-lambda.me-central-1.amazonaws.com +s3-website.me-central-1.amazonaws.com +s3.dualstack.me-south-1.amazonaws.com +s3-accesspoint.dualstack.me-south-1.amazonaws.com +s3.me-south-1.amazonaws.com +s3-accesspoint.me-south-1.amazonaws.com +s3-object-lambda.me-south-1.amazonaws.com +s3-website.me-south-1.amazonaws.com s3.amazonaws.com +s3-1.amazonaws.com +s3-ap-east-1.amazonaws.com s3-ap-northeast-1.amazonaws.com s3-ap-northeast-2.amazonaws.com +s3-ap-northeast-3.amazonaws.com s3-ap-south-1.amazonaws.com s3-ap-southeast-1.amazonaws.com s3-ap-southeast-2.amazonaws.com s3-ca-central-1.amazonaws.com s3-eu-central-1.amazonaws.com +s3-eu-north-1.amazonaws.com s3-eu-west-1.amazonaws.com s3-eu-west-2.amazonaws.com s3-eu-west-3.amazonaws.com s3-external-1.amazonaws.com +s3-fips-us-gov-east-1.amazonaws.com s3-fips-us-gov-west-1.amazonaws.com +mrap.accesspoint.s3-global.amazonaws.com +s3-me-south-1.amazonaws.com s3-sa-east-1.amazonaws.com s3-us-east-2.amazonaws.com +s3-us-gov-east-1.amazonaws.com s3-us-gov-west-1.amazonaws.com s3-us-west-1.amazonaws.com s3-us-west-2.amazonaws.com @@ -10252,80 +11707,277 @@ s3-website-ap-southeast-2.amazonaws.com s3-website-eu-west-1.amazonaws.com s3-website-sa-east-1.amazonaws.com s3-website-us-east-1.amazonaws.com +s3-website-us-gov-west-1.amazonaws.com s3-website-us-west-1.amazonaws.com s3-website-us-west-2.amazonaws.com s3.dualstack.sa-east-1.amazonaws.com +s3-accesspoint.dualstack.sa-east-1.amazonaws.com +s3-website.dualstack.sa-east-1.amazonaws.com +s3.sa-east-1.amazonaws.com +s3-accesspoint.sa-east-1.amazonaws.com +s3-object-lambda.sa-east-1.amazonaws.com +s3-website.sa-east-1.amazonaws.com s3.dualstack.us-east-1.amazonaws.com +s3-accesspoint.dualstack.us-east-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-east-1.amazonaws.com +s3-fips.dualstack.us-east-1.amazonaws.com +s3-website.dualstack.us-east-1.amazonaws.com +s3.us-east-1.amazonaws.com +s3-accesspoint.us-east-1.amazonaws.com +s3-accesspoint-fips.us-east-1.amazonaws.com +s3-deprecated.us-east-1.amazonaws.com +s3-fips.us-east-1.amazonaws.com +s3-object-lambda.us-east-1.amazonaws.com +s3-website.us-east-1.amazonaws.com s3.dualstack.us-east-2.amazonaws.com +s3-accesspoint.dualstack.us-east-2.amazonaws.com +s3-accesspoint-fips.dualstack.us-east-2.amazonaws.com +s3-fips.dualstack.us-east-2.amazonaws.com s3.us-east-2.amazonaws.com +s3-accesspoint.us-east-2.amazonaws.com +s3-accesspoint-fips.us-east-2.amazonaws.com +s3-deprecated.us-east-2.amazonaws.com +s3-fips.us-east-2.amazonaws.com +s3-object-lambda.us-east-2.amazonaws.com s3-website.us-east-2.amazonaws.com +s3.dualstack.us-gov-east-1.amazonaws.com +s3-accesspoint.dualstack.us-gov-east-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-gov-east-1.amazonaws.com +s3-fips.dualstack.us-gov-east-1.amazonaws.com +s3.us-gov-east-1.amazonaws.com +s3-accesspoint.us-gov-east-1.amazonaws.com +s3-accesspoint-fips.us-gov-east-1.amazonaws.com +s3-fips.us-gov-east-1.amazonaws.com +s3-object-lambda.us-gov-east-1.amazonaws.com +s3-website.us-gov-east-1.amazonaws.com +s3.dualstack.us-gov-west-1.amazonaws.com +s3-accesspoint.dualstack.us-gov-west-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-gov-west-1.amazonaws.com +s3-fips.dualstack.us-gov-west-1.amazonaws.com +s3.us-gov-west-1.amazonaws.com +s3-accesspoint.us-gov-west-1.amazonaws.com +s3-accesspoint-fips.us-gov-west-1.amazonaws.com +s3-fips.us-gov-west-1.amazonaws.com +s3-object-lambda.us-gov-west-1.amazonaws.com +s3-website.us-gov-west-1.amazonaws.com +s3.dualstack.us-west-1.amazonaws.com +s3-accesspoint.dualstack.us-west-1.amazonaws.com +s3-accesspoint-fips.dualstack.us-west-1.amazonaws.com +s3-fips.dualstack.us-west-1.amazonaws.com +s3-website.dualstack.us-west-1.amazonaws.com +s3.us-west-1.amazonaws.com +s3-accesspoint.us-west-1.amazonaws.com +s3-accesspoint-fips.us-west-1.amazonaws.com +s3-fips.us-west-1.amazonaws.com +s3-object-lambda.us-west-1.amazonaws.com +s3-website.us-west-1.amazonaws.com +s3.dualstack.us-west-2.amazonaws.com +s3-accesspoint.dualstack.us-west-2.amazonaws.com +s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com +s3-fips.dualstack.us-west-2.amazonaws.com +s3-website.dualstack.us-west-2.amazonaws.com +s3.us-west-2.amazonaws.com +s3-accesspoint.us-west-2.amazonaws.com +s3-accesspoint-fips.us-west-2.amazonaws.com +s3-deprecated.us-west-2.amazonaws.com +s3-fips.us-west-2.amazonaws.com +s3-object-lambda.us-west-2.amazonaws.com +s3-website.us-west-2.amazonaws.com + +// Amazon SageMaker Notebook Instances +// Submitted by AWS Security +// Reference: fe8c9e94-5a22-486d-8750-991a3a9b13c6 +notebook.af-south-1.sagemaker.aws +notebook.ap-east-1.sagemaker.aws +notebook.ap-northeast-1.sagemaker.aws +notebook.ap-northeast-2.sagemaker.aws +notebook.ap-northeast-3.sagemaker.aws +notebook.ap-south-1.sagemaker.aws +notebook.ap-south-2.sagemaker.aws +notebook.ap-southeast-1.sagemaker.aws +notebook.ap-southeast-2.sagemaker.aws +notebook.ap-southeast-3.sagemaker.aws +notebook.ap-southeast-4.sagemaker.aws +notebook.ca-central-1.sagemaker.aws +notebook.eu-central-1.sagemaker.aws +notebook.eu-central-2.sagemaker.aws +notebook.eu-north-1.sagemaker.aws +notebook.eu-south-1.sagemaker.aws +notebook.eu-south-2.sagemaker.aws +notebook.eu-west-1.sagemaker.aws +notebook.eu-west-2.sagemaker.aws +notebook.eu-west-3.sagemaker.aws +notebook.il-central-1.sagemaker.aws +notebook.me-central-1.sagemaker.aws +notebook.me-south-1.sagemaker.aws +notebook.sa-east-1.sagemaker.aws +notebook.us-east-1.sagemaker.aws +notebook-fips.us-east-1.sagemaker.aws +notebook.us-east-2.sagemaker.aws +notebook-fips.us-east-2.sagemaker.aws +notebook.us-gov-east-1.sagemaker.aws +notebook-fips.us-gov-east-1.sagemaker.aws +notebook.us-gov-west-1.sagemaker.aws +notebook-fips.us-gov-west-1.sagemaker.aws +notebook.us-west-1.sagemaker.aws +notebook.us-west-2.sagemaker.aws +notebook-fips.us-west-2.sagemaker.aws +notebook.cn-north-1.sagemaker.com.cn +notebook.cn-northwest-1.sagemaker.com.cn + +// Amazon SageMaker Studio +// Submitted by AWS Security +// Reference: 057ee397-6bf8-4f20-b807-d7bc145ac980 +studio.af-south-1.sagemaker.aws +studio.ap-east-1.sagemaker.aws +studio.ap-northeast-1.sagemaker.aws +studio.ap-northeast-2.sagemaker.aws +studio.ap-northeast-3.sagemaker.aws +studio.ap-south-1.sagemaker.aws +studio.ap-southeast-1.sagemaker.aws +studio.ap-southeast-2.sagemaker.aws +studio.ap-southeast-3.sagemaker.aws +studio.ca-central-1.sagemaker.aws +studio.eu-central-1.sagemaker.aws +studio.eu-north-1.sagemaker.aws +studio.eu-south-1.sagemaker.aws +studio.eu-west-1.sagemaker.aws +studio.eu-west-2.sagemaker.aws +studio.eu-west-3.sagemaker.aws +studio.il-central-1.sagemaker.aws +studio.me-central-1.sagemaker.aws +studio.me-south-1.sagemaker.aws +studio.sa-east-1.sagemaker.aws +studio.us-east-1.sagemaker.aws +studio.us-east-2.sagemaker.aws +studio.us-gov-east-1.sagemaker.aws +studio-fips.us-gov-east-1.sagemaker.aws +studio.us-gov-west-1.sagemaker.aws +studio-fips.us-gov-west-1.sagemaker.aws +studio.us-west-1.sagemaker.aws +studio.us-west-2.sagemaker.aws +studio.cn-north-1.sagemaker.com.cn +studio.cn-northwest-1.sagemaker.com.cn + +// Analytics on AWS +// Submitted by AWS Security +// Reference: 955f9f40-a495-4e73-ae85-67b77ac9cadd +analytics-gateway.ap-northeast-1.amazonaws.com +analytics-gateway.ap-northeast-2.amazonaws.com +analytics-gateway.ap-south-1.amazonaws.com +analytics-gateway.ap-southeast-1.amazonaws.com +analytics-gateway.ap-southeast-2.amazonaws.com +analytics-gateway.eu-central-1.amazonaws.com +analytics-gateway.eu-west-1.amazonaws.com +analytics-gateway.us-east-1.amazonaws.com +analytics-gateway.us-east-2.amazonaws.com +analytics-gateway.us-west-2.amazonaws.com + +// AWS Amplify +// Submitted by AWS Security +// Reference: 5ecce854-c033-4fc4-a755-1a9916d9a9bb +*.amplifyapp.com + +// AWS App Runner +// Submitted by AWS Security +// Reference: 6828c008-ba5d-442f-ade5-48da4e7c2316 +*.awsapprunner.com // AWS Cloud9 // Submitted by: AWS Security -// Reference: 2b6dfa9a-3a7f-4367-b2e7-0321e77c0d59 +// Reference: 05c44955-977c-4b57-938a-f2af92733f9f +webview-assets.aws-cloud9.af-south-1.amazonaws.com vfs.cloud9.af-south-1.amazonaws.com webview-assets.cloud9.af-south-1.amazonaws.com +webview-assets.aws-cloud9.ap-east-1.amazonaws.com vfs.cloud9.ap-east-1.amazonaws.com webview-assets.cloud9.ap-east-1.amazonaws.com +webview-assets.aws-cloud9.ap-northeast-1.amazonaws.com vfs.cloud9.ap-northeast-1.amazonaws.com webview-assets.cloud9.ap-northeast-1.amazonaws.com +webview-assets.aws-cloud9.ap-northeast-2.amazonaws.com vfs.cloud9.ap-northeast-2.amazonaws.com webview-assets.cloud9.ap-northeast-2.amazonaws.com +webview-assets.aws-cloud9.ap-northeast-3.amazonaws.com vfs.cloud9.ap-northeast-3.amazonaws.com webview-assets.cloud9.ap-northeast-3.amazonaws.com +webview-assets.aws-cloud9.ap-south-1.amazonaws.com vfs.cloud9.ap-south-1.amazonaws.com webview-assets.cloud9.ap-south-1.amazonaws.com +webview-assets.aws-cloud9.ap-southeast-1.amazonaws.com vfs.cloud9.ap-southeast-1.amazonaws.com webview-assets.cloud9.ap-southeast-1.amazonaws.com +webview-assets.aws-cloud9.ap-southeast-2.amazonaws.com vfs.cloud9.ap-southeast-2.amazonaws.com webview-assets.cloud9.ap-southeast-2.amazonaws.com +webview-assets.aws-cloud9.ca-central-1.amazonaws.com vfs.cloud9.ca-central-1.amazonaws.com webview-assets.cloud9.ca-central-1.amazonaws.com +webview-assets.aws-cloud9.eu-central-1.amazonaws.com vfs.cloud9.eu-central-1.amazonaws.com webview-assets.cloud9.eu-central-1.amazonaws.com +webview-assets.aws-cloud9.eu-north-1.amazonaws.com vfs.cloud9.eu-north-1.amazonaws.com webview-assets.cloud9.eu-north-1.amazonaws.com +webview-assets.aws-cloud9.eu-south-1.amazonaws.com vfs.cloud9.eu-south-1.amazonaws.com webview-assets.cloud9.eu-south-1.amazonaws.com +webview-assets.aws-cloud9.eu-west-1.amazonaws.com vfs.cloud9.eu-west-1.amazonaws.com webview-assets.cloud9.eu-west-1.amazonaws.com +webview-assets.aws-cloud9.eu-west-2.amazonaws.com vfs.cloud9.eu-west-2.amazonaws.com webview-assets.cloud9.eu-west-2.amazonaws.com +webview-assets.aws-cloud9.eu-west-3.amazonaws.com vfs.cloud9.eu-west-3.amazonaws.com webview-assets.cloud9.eu-west-3.amazonaws.com +webview-assets.aws-cloud9.me-south-1.amazonaws.com vfs.cloud9.me-south-1.amazonaws.com webview-assets.cloud9.me-south-1.amazonaws.com +webview-assets.aws-cloud9.sa-east-1.amazonaws.com vfs.cloud9.sa-east-1.amazonaws.com webview-assets.cloud9.sa-east-1.amazonaws.com +webview-assets.aws-cloud9.us-east-1.amazonaws.com vfs.cloud9.us-east-1.amazonaws.com webview-assets.cloud9.us-east-1.amazonaws.com +webview-assets.aws-cloud9.us-east-2.amazonaws.com vfs.cloud9.us-east-2.amazonaws.com webview-assets.cloud9.us-east-2.amazonaws.com +webview-assets.aws-cloud9.us-west-1.amazonaws.com vfs.cloud9.us-west-1.amazonaws.com webview-assets.cloud9.us-west-1.amazonaws.com +webview-assets.aws-cloud9.us-west-2.amazonaws.com vfs.cloud9.us-west-2.amazonaws.com webview-assets.cloud9.us-west-2.amazonaws.com // AWS Elastic Beanstalk -// Submitted by Luke Wells -// Reference: aa202394-43a0-4857-b245-8db04549137e +// Submitted by AWS Security +// Reference: bb5a965c-dec3-4967-aa22-e306ad064797 cn-north-1.eb.amazonaws.com.cn cn-northwest-1.eb.amazonaws.com.cn elasticbeanstalk.com +af-south-1.elasticbeanstalk.com +ap-east-1.elasticbeanstalk.com ap-northeast-1.elasticbeanstalk.com ap-northeast-2.elasticbeanstalk.com ap-northeast-3.elasticbeanstalk.com ap-south-1.elasticbeanstalk.com ap-southeast-1.elasticbeanstalk.com ap-southeast-2.elasticbeanstalk.com +ap-southeast-3.elasticbeanstalk.com ca-central-1.elasticbeanstalk.com eu-central-1.elasticbeanstalk.com +eu-north-1.elasticbeanstalk.com +eu-south-1.elasticbeanstalk.com eu-west-1.elasticbeanstalk.com eu-west-2.elasticbeanstalk.com eu-west-3.elasticbeanstalk.com +il-central-1.elasticbeanstalk.com +me-south-1.elasticbeanstalk.com sa-east-1.elasticbeanstalk.com us-east-1.elasticbeanstalk.com us-east-2.elasticbeanstalk.com +us-gov-east-1.elasticbeanstalk.com us-gov-west-1.elasticbeanstalk.com us-west-1.elasticbeanstalk.com us-west-2.elasticbeanstalk.com @@ -11588,7 +13240,7 @@ freemyip.com // Submitted by Daniel A. Maierhofer wien.funkfeuer.at -// Futureweb OG : http://www.futureweb.at +// Futureweb GmbH : https://www.futureweb.at // Submitted by Andreas Schnederle-Wagner *.futurecms.at *.ex.futurecms.at @@ -12095,7 +13747,6 @@ iobb.net // Submitted by Ihor Kolodyuk mel.cloudlets.com.au cloud.interhostsolutions.be -users.scale.virtualcloud.com.br mycloud.by alp1.ae.flow.ch appengine.flow.ch @@ -12119,9 +13770,7 @@ ch.trendhosting.cloud de.trendhosting.cloud jele.club amscompute.com -clicketcloud.com dopaas.com -hidora.com paas.hosted-by-previder.com rag-cloud.hosteur.com rag-cloud-ch.hosteur.com @@ -12436,6 +14085,10 @@ azurestaticapps.net 1.azurestaticapps.net 2.azurestaticapps.net 3.azurestaticapps.net +4.azurestaticapps.net +5.azurestaticapps.net +6.azurestaticapps.net +7.azurestaticapps.net centralus.azurestaticapps.net eastasia.azurestaticapps.net eastus2.azurestaticapps.net @@ -12516,6 +14169,9 @@ sa.ngrok.io us.ngrok.io ngrok.pizza +// Nicolaus Copernicus University in Torun - MSK TORMAN (https://www.man.torun.pl) +torun.pl + // Nimbus Hosting Ltd. : https://www.nimbushosting.co.uk/ // Submitted by Nicholas Ford nh-serv.co.uk @@ -13230,6 +14886,20 @@ bounty-full.com alpha.bounty-full.com beta.bounty-full.com +// Smallregistry by Promopixel SARL: https://www.smallregistry.net +// Former AFNIC's SLDs +// Submitted by Jérôme Lipowicz +aeroport.fr +avocat.fr +chambagri.fr +chirurgiens-dentistes.fr +experts-comptables.fr +medecin.fr +notaires.fr +pharmacien.fr +port.fr +veterinaire.fr + // Small Technology Foundation : https://small-tech.org // Submitted by Aral Balkan small-web.org @@ -13323,6 +14993,10 @@ myspreadshop.co.uk // Submitted by Jacob Lee api.stdlib.com +// Storipress : https://storipress.com +// Submitted by Benno Liu +storipress.app + // Storj Labs Inc. : https://storj.io/ // Submitted by Philip Hutchins storj.farm @@ -13690,6 +15364,8 @@ js.wpenginepowered.com // Submitted by Shahar Talmi wixsite.com editorx.io +wixstudio.io +wix.run // XenonCloud GbR: https://xenoncloud.net // Submitted by Julian Uphoff diff --git a/src/java.base/share/legal/public_suffix.md b/src/java.base/share/legal/public_suffix.md index 24924b6968a..493f3b1680d 100644 --- a/src/java.base/share/legal/public_suffix.md +++ b/src/java.base/share/legal/public_suffix.md @@ -11,7 +11,7 @@ If you do not wish to use the Public Suffix List, you may remove the The Source Code of this file is available under the Mozilla Public License, v. 2.0 and is located at -https://raw.githubusercontent.com/publicsuffix/list/88467c960d6cdad2ca1623e892e5e17506bc269f/public_suffix_list.dat. +https://raw.githubusercontent.com/publicsuffix/list/b5bf572c52988dbe9d865b8f090ea819024a9936/public_suffix_list.dat. If a copy of the MPL was not distributed with this file, you can obtain one at https://mozilla.org/MPL/2.0/. diff --git a/test/jdk/sun/security/util/RegisteredDomain/tests.dat b/test/jdk/sun/security/util/RegisteredDomain/tests.dat index 8d8ba34c832..280e66ff93b 100644 --- a/test/jdk/sun/security/util/RegisteredDomain/tests.dat +++ b/test/jdk/sun/security/util/RegisteredDomain/tests.dat @@ -152,6 +152,10 @@ s.k12.oh.us k12.oh.us s.k12.oh.us s.pvt.k12.ma.us pvt.k12.ma.us s.pvt.k12.ma.us w.s.pvt.k12.ma.us pvt.k12.ma.us s.pvt.k12.ma.us +# vn +site.com.vn com.vn site.com.vn +site.ai.vn ai.vn site.ai.vn + # السعودية السعودية السعودية null foo.السعودية السعودية foo.السعودية From c3b0c03df30db30fad885b66f13d0d3007e8b1d4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 19 Dec 2023 09:24:53 +0000 Subject: [PATCH 022/261] 8319668: Fixup of jar filename typo in BadFactoryTest.sh Backport-of: 63ad868e182279eeef8b5d27a25453873039d22f --- test/jdk/javax/script/JDK_8196959/BadFactoryTest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/script/JDK_8196959/BadFactoryTest.sh b/test/jdk/javax/script/JDK_8196959/BadFactoryTest.sh index 21becec9f71..e5d1a063840 100644 --- a/test/jdk/javax/script/JDK_8196959/BadFactoryTest.sh +++ b/test/jdk/javax/script/JDK_8196959/BadFactoryTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023, 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,5 +56,5 @@ fi echo "Running test without security manager ..." $JAVA ${TESTVMOPTS} -classpath \ - "${TESTCLASSES}${PS}${TESTCLASSES}/badfactoty.jar" \ + "${TESTCLASSES}${PS}${TESTCLASSES}/badfactory.jar" \ BadFactoryTest From d50fd26002735f4b79d2b4d0244e2538b9eff9a4 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:12:07 +0000 Subject: [PATCH 023/261] 8314990: Generational ZGC: Strong OopStorage stats reported as weak roots Reviewed-by: stefank Backport-of: dcd6e756718b656d43f4575558f41ce0c28d0eca --- src/hotspot/share/gc/z/zRootsIterator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/z/zRootsIterator.cpp b/src/hotspot/share/gc/z/zRootsIterator.cpp index 130ab5e4627..086d90781dd 100644 --- a/src/hotspot/share/gc/z/zRootsIterator.cpp +++ b/src/hotspot/share/gc/z/zRootsIterator.cpp @@ -101,7 +101,7 @@ void ZParallelApply::apply(ClosureType* cl) { } void ZOopStorageSetIteratorStrong::apply(OopClosure* cl) { - ZRootStatTimer timer(ZSubPhaseConcurrentWeakRootsOopStorageSet, _generation); + ZRootStatTimer timer(ZSubPhaseConcurrentRootsOopStorageSet, _generation); _iter.oops_do(cl); } From ee7748a3d3f74c4de4fe533dc37058cce88daf9e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:17:28 +0000 Subject: [PATCH 024/261] 8317300: javac erroneously allows "final" in front of a record pattern Backport-of: 5ca1beb30e35cc91bf170960fb832de6438de1de --- .../sun/tools/javac/parser/JavacParser.java | 1 + .../tools/javac/patterns/T8317300.java | 24 +++++++++++++++++++ .../tools/javac/patterns/T8317300.out | 5 ++++ 3 files changed, 30 insertions(+) create mode 100644 test/langtools/tools/javac/patterns/T8317300.java create mode 100644 test/langtools/tools/javac/patterns/T8317300.out diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java index 9350cb5c54d..e26d157937d 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -910,6 +910,7 @@ public JCPattern parsePattern(int pos, JCModifiers mods, JCExpression parsedType if (mods.annotations.nonEmpty()) { log.error(mods.annotations.head.pos(), Errors.RecordPatternsAnnotationsNotAllowed); } + checkNoMods(pos, mods.flags & Flags.FINAL); new TreeScanner() { @Override public void visitAnnotatedType(JCAnnotatedType tree) { diff --git a/test/langtools/tools/javac/patterns/T8317300.java b/test/langtools/tools/javac/patterns/T8317300.java new file mode 100644 index 00000000000..20b5da3a1f4 --- /dev/null +++ b/test/langtools/tools/javac/patterns/T8317300.java @@ -0,0 +1,24 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8317300 + * @summary javac erroneously allows "final" in front of a record pattern + * @compile/fail/ref=T8317300.out -XDrawDiagnostics T8317300.java + */ +public class T8317300 { + record Foo (int x) {} + record Bar (Foo x) {} + + void test1(Object obj) { + switch (obj) { + case final Foo(int x) -> {} + default -> {} + } + } + + void test2(Object obj) { + switch (obj) { + case Bar(final Foo(int x)) -> {} + default -> {} + } + } +} diff --git a/test/langtools/tools/javac/patterns/T8317300.out b/test/langtools/tools/javac/patterns/T8317300.out new file mode 100644 index 00000000000..f28fd7467d8 --- /dev/null +++ b/test/langtools/tools/javac/patterns/T8317300.out @@ -0,0 +1,5 @@ +T8317300.java:13:18: compiler.err.mod.not.allowed.here: final +T8317300.java:20:22: compiler.err.illegal.start.of.expr +T8317300.java:20:31: compiler.err.expected: token.identifier +T8317300.java:20:37: compiler.err.expected: ';' +4 errors From 80b5f72ccd2dc302b8e5390f5f22a83b4773b61c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:19:17 +0000 Subject: [PATCH 025/261] 8263256: Test java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java fails due to dynamic reconfigurations of network interface during test Backport-of: 0048f1da4ce83b3de5d5ac074f969437f7b3024e --- .../Inet6AddressSerializationTest.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java b/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java index 4b1ffafc9df..c52884f1040 100644 --- a/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java +++ b/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -38,10 +38,16 @@ import java.util.Enumeration; import java.util.List; +import jdk.test.lib.Platform; +import jdk.test.lib.NetworkConfiguration; + /** * @test * @bug 8007373 * @summary jdk7 backward compatibility serialization problem + * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * @run main/othervm Inet6AddressSerializationTest */ public class Inet6AddressSerializationTest { @@ -177,12 +183,19 @@ static void testAllNetworkInterfaces() throws Exception { .getNetworkInterfaces(); e.hasMoreElements();) { NetworkInterface netIF = e.nextElement(); // Skip (Windows)Teredo Tunneling Pseudo-Interface + String dName = netIF.getDisplayName(); if (isWindows) { - String dName = netIF.getDisplayName(); if (dName != null && dName.contains("Teredo")) { continue; } } + // skip awdl and llw interfaces on macosx + if (Platform.isOSX()) { + if((dName != null) && + ((dName.contains("awdl")) || (dName.contains("llw")))) { + continue; + } + } for (Enumeration iadrs = netIF.getInetAddresses(); iadrs .hasMoreElements();) { InetAddress iadr = iadrs.nextElement(); @@ -622,8 +635,8 @@ static void assertNetworkInterfaceEqual( + deserializedNetworkInterface); failed = true; } - } else if (!expectedNetworkInterface - .equals(deserializedNetworkInterface)) { + } else if (!NetworkConfiguration.isSameInterface(expectedNetworkInterface, + deserializedNetworkInterface)) { System.err.println("Error checking " + // versionStr + " NetworkInterface, expected:" + expectedNetworkInterface From 6644066557bf3e1f4b9cbac9f15130b641b334df Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:19:34 +0000 Subject: [PATCH 026/261] 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory Backport-of: 864a876ebfdf745b0e1f875c3e3668380f2498a7 --- .../FloatingDecimal/TestFloatingDecimal.java | 149 +++++------------- 1 file changed, 41 insertions(+), 108 deletions(-) diff --git a/test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java b/test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java index 5fcb5b52b04..de245ff2f5d 100644 --- a/test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java +++ b/test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -24,6 +24,12 @@ import java.util.Random; import jdk.internal.math.FloatingDecimal; +import jdk.test.lib.RandomFactory; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + /* OldFloatingDecimalForTest @@ -57,48 +63,35 @@ public class jdk.internal.math.FloatingDecimal { /** * @test * @bug 7032154 - * @summary unit tests of FloatingDecimal + * @summary unit tests of FloatingDecimal (use -Dseed=X to set PRANDOM seed) * @modules java.base/jdk.internal.math + * @library .. + * @library /test/lib * @library /java/lang/Math + * @build jdk.test.lib.RandomFactory * @build DoubleConsts FloatConsts - * @run main TestFloatingDecimal + * @run junit TestFloatingDecimal * @author Brian Burkhalter * @key randomness */ public class TestFloatingDecimal { - private static enum ResultType { - RESULT_EXCEPTION, - RESULT_PRINT - } + private static final int NUM_RANDOM_TESTS = 100_000; - private static final ResultType RESULT_TYPE = ResultType.RESULT_PRINT; - private static final int NUM_RANDOM_TESTS = 100000; - - private static final Random RANDOM = new Random(); - - private static void result(String message) { - switch (RESULT_TYPE) { - case RESULT_EXCEPTION: - throw new RuntimeException(message); - case RESULT_PRINT: - System.err.println(message); - break; - default: - assert false; - } - } + private static final Random RANDOM = RandomFactory.getRandom(); private static int check(String test, Object expected, Object actual) { int failures = 0; if(!actual.equals(expected)) { failures++; - result("Test "+test+" expected "+expected+" but obtained "+actual); + System.err.println("Test " + test + + " expected " + expected + + " but obtained " + actual); } return failures; } - private static int testAppendToDouble() { - System.out.println(" testAppendToDouble"); + @Test + public void testAppendToDouble() { int failures = 0; for(int i = 0; i < NUM_RANDOM_TESTS; i++) { @@ -119,11 +112,11 @@ private static int testAppendToDouble() { } } - return failures; + assertEquals(0, failures); } - private static int testAppendToFloat() { - System.out.println(" testAppendToFloat"); + @Test + public void testAppendToFloat() { int failures = 0; for(int i = 0; i < NUM_RANDOM_TESTS; i++) { @@ -144,21 +137,11 @@ private static int testAppendToFloat() { } } - return failures; + assertEquals(0, failures); } - private static int testAppendTo() { - System.out.println("testAppendTo"); - int failures = 0; - - failures += testAppendToDouble(); - failures += testAppendToFloat(); - - return failures; - } - - private static int testParseDouble() { - System.out.println(" testParseDouble"); + @Test + public void testParseDouble() { int failures = 0; for(int i = 0; i < NUM_RANDOM_TESTS; i++) { @@ -177,11 +160,11 @@ private static int testParseDouble() { } } - return failures; + assertEquals(0, failures); } - private static int testParseFloat() { - System.out.println(" testParseFloat"); + @Test + public void testParseFloat() { int failures = 0; for(int i = 0; i < NUM_RANDOM_TESTS; i++) { @@ -200,21 +183,11 @@ private static int testParseFloat() { } } - return failures; - } - - private static int testParse() { - System.out.println("testParse"); - int failures = 0; - - failures += testParseDouble(); - failures += testParseFloat(); - - return failures; + assertEquals(0, failures); } - private static int testToJavaFormatStringDoubleFixed() { - System.out.println(" testToJavaFormatStringDoubleFixed"); + @Test + public void testToJavaFormatStringDoubleFixed() { int failures = 0; double[] d = new double [] { @@ -228,11 +201,11 @@ private static int testToJavaFormatStringDoubleFixed() { failures += check("testToJavaFormatStringDoubleFixed", ofd.toJavaFormatString(), FloatingDecimal.toJavaFormatString(d[i])); } - return failures; + assertEquals(0, failures); } - private static int testToJavaFormatStringDoubleRandom() { - System.out.println(" testToJavaFormatStringDoubleRandom"); + @Test + public void testToJavaFormatStringDoubleRandom() { int failures = 0; for(int i = 0; i < NUM_RANDOM_TESTS; i++) { @@ -247,19 +220,11 @@ private static int testToJavaFormatStringDoubleRandom() { } } - return failures; + assertEquals(0, failures); } - private static int testToJavaFormatStringDouble() { - System.out.println(" testToJavaFormatStringDouble"); - int failures = 0; - failures += testToJavaFormatStringDoubleFixed(); - failures += testToJavaFormatStringDoubleRandom(); - return failures; - } - - private static int testToJavaFormatStringFloatFixed() { - System.out.println(" testToJavaFormatStringFloatFixed"); + @Test + public void testToJavaFormatStringFloatFixed() { int failures = 0; float[] f = new float[] { @@ -273,11 +238,11 @@ private static int testToJavaFormatStringFloatFixed() { failures += check("testToJavaFormatStringFloatFixed", ofd.toJavaFormatString(), FloatingDecimal.toJavaFormatString(f[i])); } - return failures; + assertEquals(0, failures); } - private static int testToJavaFormatStringFloatRandom() { - System.out.println(" testToJavaFormatStringFloatRandom"); + @Test + public void testToJavaFormatStringFloatRandom() { int failures = 0; for(int i = 0; i < NUM_RANDOM_TESTS; i++) { @@ -292,38 +257,6 @@ private static int testToJavaFormatStringFloatRandom() { } } - return failures; - } - - private static int testToJavaFormatStringFloat() { - System.out.println(" testToJavaFormatStringFloat"); - int failures = 0; - - failures += testToJavaFormatStringFloatFixed(); - failures += testToJavaFormatStringFloatRandom(); - - return failures; - } - - private static int testToJavaFormatString() { - System.out.println("testToJavaFormatString"); - int failures = 0; - - failures += testToJavaFormatStringDouble(); - failures += testToJavaFormatStringFloat(); - - return failures; - } - - public static void main(String[] args) { - int failures = 0; - - failures += testAppendTo(); - failures += testParse(); - failures += testToJavaFormatString(); - - if (failures != 0) { - throw new RuntimeException("" + failures + " failures while testing FloatingDecimal"); - } + assertEquals(0, failures); } } From 0c924607aef2f39dfd119afa88c5fda148bb8398 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:21:13 +0000 Subject: [PATCH 027/261] 8309302: java/net/Socket/Timeouts.java fails with AssertionError on test temporal post condition Backport-of: 87c79c080186abc53d033449dd9f76c8832d44f5 --- test/jdk/java/net/Socket/Timeouts.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/jdk/java/net/Socket/Timeouts.java b/test/jdk/java/net/Socket/Timeouts.java index e70037a39d1..83bf01ebf50 100644 --- a/test/jdk/java/net/Socket/Timeouts.java +++ b/test/jdk/java/net/Socket/Timeouts.java @@ -137,7 +137,7 @@ public void testTimedRead3() throws IOException { long startMillis = millisTime(); expectThrows(SocketTimeoutException.class, () -> s2.getInputStream().read()); int timeout = s2.getSoTimeout(); - checkDuration(startMillis, timeout-100, timeout+2000); + checkDuration(startMillis, timeout-100, timeout+20_000); }); } @@ -307,7 +307,7 @@ public void testTimedAccept3() throws IOException { fail(); } catch (SocketTimeoutException expected) { int timeout = ss.getSoTimeout(); - checkDuration(startMillis, timeout-100, timeout+2000); + checkDuration(startMillis, timeout-100, timeout+20_000); } } } @@ -385,7 +385,7 @@ public void testTimedAccept7() throws IOException { ss.accept().close(); fail(); } catch (SocketException expected) { - checkDuration(startMillis, delay-100, delay+2000); + checkDuration(startMillis, delay-100, delay+20_000); } } } @@ -407,7 +407,7 @@ public void testTimedAccept8() throws IOException { } catch (SocketTimeoutException expected) { // accept should have blocked for 2 seconds int timeout = ss.getSoTimeout(); - checkDuration(startMillis, timeout-100, timeout+2000); + checkDuration(startMillis, timeout-100, timeout+20_000); assertTrue(Thread.currentThread().isInterrupted()); } finally { Thread.interrupted(); // clear interrupt status @@ -433,7 +433,7 @@ public void testTimedAccept9() throws IOException { } catch (SocketTimeoutException expected) { // accept should have blocked for 4 seconds int timeout = ss.getSoTimeout(); - checkDuration(startMillis, timeout-100, timeout+2000); + checkDuration(startMillis, timeout-100, timeout+20_000); assertTrue(Thread.currentThread().isInterrupted()); } finally { interrupter.cancel(true); @@ -463,7 +463,7 @@ public void testTimedAccept10() throws Exception { // should get here in 4 seconds, not 8 seconds int timeout = ss.getSoTimeout(); - checkDuration(startMillis, timeout-100, timeout+2000); + checkDuration(startMillis, timeout-100, timeout+20_000); } finally { pool.shutdown(); } @@ -505,7 +505,7 @@ public void testTimedAccept11() throws Exception { // should get here in 4 seconds, not 8 seconds int timeout = ss.getSoTimeout(); - checkDuration(startMillis, timeout-100, timeout+2000); + checkDuration(startMillis, timeout-100, timeout+20_000); } finally { pool.shutdown(); } From 5d328605f0db5155a8c8aa517d74935f114c2988 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:21:28 +0000 Subject: [PATCH 028/261] 8310807: java/nio/channels/DatagramChannel/Connect.java timed out Backport-of: 570dffb104fc37f053fcdf38a24aa2cabdc921c0 --- .../nio/channels/DatagramChannel/Connect.java | 115 ++++++++++++------ 1 file changed, 79 insertions(+), 36 deletions(-) diff --git a/test/jdk/java/nio/channels/DatagramChannel/Connect.java b/test/jdk/java/nio/channels/DatagramChannel/Connect.java index 5b2bbea4e5b..082a3234cc5 100644 --- a/test/jdk/java/nio/channels/DatagramChannel/Connect.java +++ b/test/jdk/java/nio/channels/DatagramChannel/Connect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2023, 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 @@ -23,6 +23,7 @@ /* @test * @bug 4313882 7183800 + * @run main/othervm Connect * @summary Test DatagramChannel's send and receive methods */ @@ -30,18 +31,28 @@ import java.net.*; import java.nio.*; import java.nio.channels.*; -import java.nio.charset.*; +import java.time.Instant; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.stream.Stream; +import static java.nio.charset.StandardCharsets.US_ASCII; + public class Connect { - static PrintStream log = System.err; + static final PrintStream err = System.err; + static final String TIME_STAMP = Instant.now().toString(); + static final String MESSAGE = "Hello " + TIME_STAMP; + static final String OTHER = "Hey " + TIME_STAMP; + static final String RESPONSE = "Hi " + TIME_STAMP; + static final int MAX = Math.max(256, MESSAGE.getBytes(US_ASCII).length + 16); public static void main(String[] args) throws Exception { + assert MAX > MESSAGE.getBytes(US_ASCII).length; + assert MAX > OTHER.getBytes(US_ASCII).length; + assert MAX > RESPONSE.getBytes(US_ASCII).length; test(); } @@ -99,41 +110,62 @@ public static class Initiator implements AutoCloseable, Runnable { public void run() { try { - ByteBuffer bb = ByteBuffer.allocateDirect(256); - bb.put("hello".getBytes()); + byte[] bytes = MESSAGE.getBytes(US_ASCII); + ByteBuffer bb = ByteBuffer.allocateDirect(MAX); + bb.put(bytes); bb.flip(); - log.println("Initiator connecting to " + connectSocketAddress); + err.println("Initiator connecting to: " + connectSocketAddress); dc.connect(connectSocketAddress); + err.println("Initiator bound to: " + dc.getLocalAddress()); // Send a message - log.println("Initiator attempting to write to Responder at " + connectSocketAddress.toString()); + err.println("Initiator attempting to write to Responder at " + connectSocketAddress); dc.write(bb); // Try to send to some other address try { int port = dc.socket().getLocalPort(); InetAddress loopback = InetAddress.getLoopbackAddress(); - InetSocketAddress otherAddress = new InetSocketAddress(loopback, (port == 3333 ? 3332 : 3333)); - log.println("Testing if Initiator throws AlreadyConnectedException" + otherAddress.toString()); - dc.send(bb, otherAddress); + try (DatagramChannel other = DatagramChannel.open()) { + InetSocketAddress otherAddress = new InetSocketAddress(loopback, 0); + other.bind(otherAddress); + err.println("Testing if Initiator throws AlreadyConnectedException"); + otherAddress = (InetSocketAddress) other.getLocalAddress(); + assert port != otherAddress.getPort(); + assert !connectSocketAddress.equals(otherAddress); + err.printf("Initiator sending \"%s\" to other address %s%n", OTHER, otherAddress); + dc.send(ByteBuffer.wrap(OTHER.getBytes(US_ASCII)), otherAddress); + } throw new RuntimeException("Initiator allowed send to other address while already connected"); } catch (AlreadyConnectedException ace) { // Correct behavior + err.println("Initiator got expected " + ace); } - // Read a reply - bb.flip(); - log.println("Initiator waiting to read"); - dc.read(bb); - bb.flip(); - CharBuffer cb = StandardCharsets.US_ASCII. - newDecoder().decode(bb); - log.println("Initiator received from Responder at " + connectSocketAddress + ": " + cb); + // wait for response + while (true) { + // zero out buffer + bb.clear(); + bb.put(new byte[bb.remaining()]); + bb.flip(); + + // Read a reply + err.println("Initiator waiting to read"); + dc.read(bb); + bb.flip(); + CharBuffer cb = US_ASCII.newDecoder().decode(bb); + err.println("Initiator received from Responder at " + connectSocketAddress + ": " + cb); + if (!RESPONSE.equals(cb.toString())) { + err.println("Initiator received unexpected message: continue waiting"); + continue; + } + break; + } } catch (Exception ex) { - log.println("Initiator threw exception: " + ex); + err.println("Initiator threw exception: " + ex); throw new RuntimeException(ex); } finally { - log.println("Initiator finished"); + err.println("Initiator finished"); } } @@ -156,26 +188,37 @@ SocketAddress getSocketAddress() throws IOException { } public void run() { + ByteBuffer bb = ByteBuffer.allocateDirect(MAX); try { - // Listen for a message - ByteBuffer bb = ByteBuffer.allocateDirect(100); - log.println("Responder waiting to receive"); - SocketAddress sa = dc.receive(bb); - bb.flip(); - CharBuffer cb = StandardCharsets.US_ASCII. - newDecoder().decode(bb); - log.println("Responder received from Initiator at" + sa + ": " + cb); - - // Reply to sender - dc.connect(sa); - bb.flip(); - log.println("Responder attempting to write: " + dc.getRemoteAddress().toString()); - dc.write(bb); + while (true) { + // Listen for a message + err.println("Responder waiting to receive"); + SocketAddress sa = dc.receive(bb); + bb.flip(); + CharBuffer cb = US_ASCII. + newDecoder().decode(bb); + err.println("Responder received from Initiator at " + sa + ": " + cb); + if (!MESSAGE.equals(cb.toString())) { + err.println("Responder received unexpected message: continue waiting"); + bb.clear(); + continue; + } + + // Reply to sender + dc.connect(sa); + bb.clear(); + bb.put(RESPONSE.getBytes(US_ASCII)); + bb.flip(); + err.println("Responder attempting to write: " + dc.getRemoteAddress()); + dc.write(bb); + bb.flip(); + break; + } } catch (Exception ex) { - log.println("Responder threw exception: " + ex); + err.println("Responder threw exception: " + ex); throw new RuntimeException(ex); } finally { - log.println("Responder finished"); + err.println("Responder finished"); } } From b8a0d9faaf131a5eceed7cb15383bcec90c3be64 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:23:22 +0000 Subject: [PATCH 029/261] 8316229: Enhance class initialization logging Backport-of: 84124794c2ff70ba22cbfbf1ff01cf4d935896bd --- src/hotspot/share/oops/instanceKlass.cpp | 58 ++++++++++++++++++++++-- src/hotspot/share/oops/instanceKlass.hpp | 10 +++- src/hotspot/share/runtime/javaThread.cpp | 7 +++ src/hotspot/share/runtime/javaThread.hpp | 1 + 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 565c1364354..94fa9c3e52b 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -768,20 +768,43 @@ void InstanceKlass::link_class(TRAPS) { void InstanceKlass::check_link_state_and_wait(JavaThread* current) { MonitorLocker ml(current, _init_monitor); + bool debug_logging_enabled = log_is_enabled(Debug, class, init); + // Another thread is linking this class, wait. while (is_being_linked() && !is_init_thread(current)) { + if (debug_logging_enabled) { + ResourceMark rm(current); + log_debug(class, init)("Thread \"%s\" waiting for linking of %s by thread \"%s\"", + current->name(), external_name(), init_thread_name()); + } ml.wait(); } // This thread is recursively linking this class, continue if (is_being_linked() && is_init_thread(current)) { + if (debug_logging_enabled) { + ResourceMark rm(current); + log_debug(class, init)("Thread \"%s\" recursively linking %s", + current->name(), external_name()); + } return; } // If this class wasn't linked already, set state to being_linked if (!is_linked()) { + if (debug_logging_enabled) { + ResourceMark rm(current); + log_debug(class, init)("Thread \"%s\" linking %s", + current->name(), external_name()); + } set_init_state(being_linked); set_init_thread(current); + } else { + if (debug_logging_enabled) { + ResourceMark rm(current); + log_debug(class, init)("Thread \"%s\" found %s already linked", + current->name(), external_name()); + } } } @@ -1047,13 +1070,21 @@ void InstanceKlass::initialize_impl(TRAPS) { JavaThread* jt = THREAD; + bool debug_logging_enabled = log_is_enabled(Debug, class, init); + // refer to the JVM book page 47 for description of steps // Step 1 { - MonitorLocker ml(THREAD, _init_monitor); + MonitorLocker ml(jt, _init_monitor); // Step 2 while (is_being_initialized() && !is_init_thread(jt)) { + if (debug_logging_enabled) { + ResourceMark rm(jt); + log_debug(class, init)("Thread \"%s\" waiting for initialization of %s by thread \"%s\"", + jt->name(), external_name(), init_thread_name()); + } + wait = true; jt->set_class_to_be_initialized(this); ml.wait(); @@ -1062,24 +1093,44 @@ void InstanceKlass::initialize_impl(TRAPS) { // Step 3 if (is_being_initialized() && is_init_thread(jt)) { + if (debug_logging_enabled) { + ResourceMark rm(jt); + log_debug(class, init)("Thread \"%s\" recursively initializing %s", + jt->name(), external_name()); + } DTRACE_CLASSINIT_PROBE_WAIT(recursive, -1, wait); return; } // Step 4 if (is_initialized()) { + if (debug_logging_enabled) { + ResourceMark rm(jt); + log_debug(class, init)("Thread \"%s\" found %s already initialized", + jt->name(), external_name()); + } DTRACE_CLASSINIT_PROBE_WAIT(concurrent, -1, wait); return; } // Step 5 if (is_in_error_state()) { + if (debug_logging_enabled) { + ResourceMark rm(jt); + log_debug(class, init)("Thread \"%s\" found %s is in error state", + jt->name(), external_name()); + } throw_error = true; } else { // Step 6 set_init_state(being_initialized); set_init_thread(jt); + if (debug_logging_enabled) { + ResourceMark rm(jt); + log_debug(class, init)("Thread \"%s\" is initializing %s", + jt->name(), external_name()); + } } } @@ -1553,7 +1604,9 @@ void InstanceKlass::call_class_initializer(TRAPS) { LogStream ls(lt); ls.print("%d Initializing ", call_class_initializer_counter++); name()->print_value_on(&ls); - ls.print_cr("%s (" PTR_FORMAT ")", h_method() == nullptr ? "(no method)" : "", p2i(this)); + ls.print_cr("%s (" PTR_FORMAT ") by thread \"%s\"", + h_method() == nullptr ? "(no method)" : "", p2i(this), + THREAD->name()); } if (h_method() != nullptr) { JavaCallArguments args; // No arguments @@ -4321,4 +4374,3 @@ void ClassHierarchyIterator::next() { _current = _current->next_sibling(); return; // visit next sibling subclass } - diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index ae08a56686f..faa432a1dc7 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -491,6 +491,14 @@ class InstanceKlass: public Klass { static void check_prohibited_package(Symbol* class_name, ClassLoaderData* loader_data, TRAPS); + + JavaThread* init_thread() { return Atomic::load(&_init_thread); } + // We can safely access the name as long as we hold the _init_monitor. + const char* init_thread_name() { + assert(_init_monitor->owned_by_self(), "Must hold _init_monitor here"); + return init_thread()->name_raw(); + } + public: // initialization state bool is_loaded() const { return init_state() >= loaded; } @@ -500,7 +508,7 @@ class InstanceKlass: public Klass { bool is_not_initialized() const { return init_state() < being_initialized; } bool is_being_initialized() const { return init_state() == being_initialized; } bool is_in_error_state() const { return init_state() == initialization_error; } - bool is_init_thread(JavaThread *thread) { return thread == Atomic::load(&_init_thread); } + bool is_init_thread(JavaThread *thread) { return thread == init_thread(); } ClassState init_state() const { return Atomic::load(&_init_state); } const char* init_state_name() const; bool is_rewritten() const { return _misc_flags.rewritten(); } diff --git a/src/hotspot/share/runtime/javaThread.cpp b/src/hotspot/share/runtime/javaThread.cpp index b469c1a6790..ff8c842daaa 100644 --- a/src/hotspot/share/runtime/javaThread.cpp +++ b/src/hotspot/share/runtime/javaThread.cpp @@ -1587,6 +1587,13 @@ const char* JavaThread::name() const { return Thread::name(); } +// Like name() but doesn't include the protection check. This must only be +// called when it is known to be safe, even though the protection check can't tell +// that e.g. when this thread is the init_thread() - see instanceKlass.cpp. +const char* JavaThread::name_raw() const { + return get_thread_name_string(); +} + // Returns a non-null representation of this thread's name, or a suitable // descriptive string if there is no set name. const char* JavaThread::get_thread_name_string(char* buf, int buflen) const { diff --git a/src/hotspot/share/runtime/javaThread.hpp b/src/hotspot/share/runtime/javaThread.hpp index f2cb56646d4..e8e6ccbfe6a 100644 --- a/src/hotspot/share/runtime/javaThread.hpp +++ b/src/hotspot/share/runtime/javaThread.hpp @@ -904,6 +904,7 @@ class JavaThread: public Thread { // Misc. operations const char* name() const; + const char* name_raw() const; const char* type_name() const { return "JavaThread"; } static const char* name_for(oop thread_obj); From f55a91a5d12702a703d4b2d919a053b382876218 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:23:39 +0000 Subject: [PATCH 030/261] 8319897: Move StackWatermark handling out of LockStack::contains Backport-of: bbf52e0e4cb76b4c6425e7d1266dcdbb4df556ea --- src/hotspot/share/runtime/lockStack.inline.hpp | 14 ++++---------- src/hotspot/share/runtime/threads.cpp | 7 +++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/runtime/lockStack.inline.hpp b/src/hotspot/share/runtime/lockStack.inline.hpp index 9dd04d8f7fe..b36be2f72de 100644 --- a/src/hotspot/share/runtime/lockStack.inline.hpp +++ b/src/hotspot/share/runtime/lockStack.inline.hpp @@ -104,16 +104,10 @@ inline void LockStack::remove(oop o) { inline bool LockStack::contains(oop o) const { verify("pre-contains"); - if (!SafepointSynchronize::is_at_safepoint() && !is_owning_thread()) { - // When a foreign thread inspects this thread's lock-stack, it may see - // bad references here when a concurrent collector has not gotten - // to processing the lock-stack, yet. Call StackWaterMark::start_processing() - // to ensure that all references are valid. - StackWatermark* watermark = StackWatermarkSet::get(get_thread(), StackWatermarkKind::gc); - if (watermark != nullptr) { - watermark->start_processing(); - } - } + + // Can't poke around in thread oops without having started stack watermark processing. + assert(StackWatermarkSet::processing_started(get_thread()), "Processing must have started!"); + int end = to_index(_top); for (int i = end - 1; i >= 0; i--) { if (_base[i] == o) { diff --git a/src/hotspot/share/runtime/threads.cpp b/src/hotspot/share/runtime/threads.cpp index fd8667d13c0..3e121e3bf74 100644 --- a/src/hotspot/share/runtime/threads.cpp +++ b/src/hotspot/share/runtime/threads.cpp @@ -80,6 +80,7 @@ #include "runtime/safepointVerifiers.hpp" #include "runtime/serviceThread.hpp" #include "runtime/sharedRuntime.hpp" +#include "runtime/stackWatermarkSet.inline.hpp" #include "runtime/statSampler.hpp" #include "runtime/stubCodeGenerator.hpp" #include "runtime/thread.inline.hpp" @@ -1229,6 +1230,12 @@ JavaThread *Threads::owning_thread_from_monitor_owner(ThreadsList * t_list, JavaThread* Threads::owning_thread_from_object(ThreadsList * t_list, oop obj) { assert(LockingMode == LM_LIGHTWEIGHT, "Only with new lightweight locking"); for (JavaThread* q : *t_list) { + // Need to start processing before accessing oops in the thread. + StackWatermark* watermark = StackWatermarkSet::get(q, StackWatermarkKind::gc); + if (watermark != nullptr) { + watermark->start_processing(); + } + if (q->lock_stack().contains(obj)) { return q; } From af6df7743b2b3e1e87bdac2e3f09514223b96858 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:29:40 +0000 Subject: [PATCH 031/261] 8305971: NPE in JavacProcessingEnvironment for missing enum constructor body Backport-of: 01ea1eff66e43f106640ecfd19fadf2c8245a1ad --- .../JavacProcessingEnvironment.java | 2 +- .../CrashEmptyEnumConstructorTest.java | 131 ++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 test/langtools/tools/javac/annotations/crash_empty_enum_const/CrashEmptyEnumConstructorTest.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java index d0dbbb56cfb..028b8ba8f9f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java @@ -1650,7 +1650,7 @@ public void visitClassDef(JCClassDecl node) { public void visitMethodDef(JCMethodDecl node) { // remove super constructor call that may have been added during attribution: if (TreeInfo.isConstructor(node) && node.sym != null && node.sym.owner.isEnum() && - node.body.stats.nonEmpty() && TreeInfo.isSuperCall(node.body.stats.head) && + node.body != null && node.body.stats.nonEmpty() && TreeInfo.isSuperCall(node.body.stats.head) && node.body.stats.head.pos == node.body.pos) { node.body.stats = node.body.stats.tail; } diff --git a/test/langtools/tools/javac/annotations/crash_empty_enum_const/CrashEmptyEnumConstructorTest.java b/test/langtools/tools/javac/annotations/crash_empty_enum_const/CrashEmptyEnumConstructorTest.java new file mode 100644 index 00000000000..29340dd720e --- /dev/null +++ b/test/langtools/tools/javac/annotations/crash_empty_enum_const/CrashEmptyEnumConstructorTest.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8305971 + * @summary NPE in JavacProcessingEnvironment for missing enum constructor body + * @library /tools/lib /tools/javac/lib + * @modules + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * @build toolbox.ToolBox toolbox.JavacTask + * @run main CrashEmptyEnumConstructorTest + */ + +import java.io.IOException; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import java.util.List; +import java.util.Set; +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.TypeElement; + +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.Task.Mode; +import toolbox.Task.OutputKind; +import toolbox.TestRunner; +import toolbox.ToolBox; + +public class CrashEmptyEnumConstructorTest extends TestRunner { + protected ToolBox tb; + + CrashEmptyEnumConstructorTest() { + super(System.err); + tb = new ToolBox(); + } + + public static void main(String... args) throws Exception { + new CrashEmptyEnumConstructorTest().runTests(); + } + + protected void runTests() throws Exception { + runTests(m -> new Object[]{Paths.get(m.getName())}); + } + + Path[] findJavaFiles(Path... paths) throws IOException { + return tb.findJavaFiles(paths); + } + + @Test + public void testEmptyEnumConstructor(Path base) throws Exception { + Path src = base.resolve("src"); + Path r = src.resolve("E"); + + Path classes = base.resolve("classes"); + + Files.createDirectories(classes); + + tb.writeJavaFiles(r, + """ + enum E { + ONE(""); + E(String one); + } + """); + + List expected = List.of( + "E.java:3: error: missing method body, or declare abstract", + " E(String one);", + " ^", + "1 error"); + + List log = new JavacTask(tb) + .options("-processor", SimpleProcessor.class.getName()) + .files(findJavaFiles(src)) + .outdir(classes) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + if (log.size() != expected.size()) { + throw new AssertionError("Unexpected output: " + log); + } else { + for (int i = 0; i < expected.size(); i++) { + if (!log.get(i).contains(expected.get(i))) { + throw new AssertionError("Unexpected output: " + log); + } + } + } + } + + @SupportedAnnotationTypes("*") + public static final class SimpleProcessor extends AbstractProcessor { + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latestSupported(); + } + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + return false; + } + } +} From 03acee85e66b82f486df15688509770b4641f180 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 10:30:03 +0000 Subject: [PATCH 032/261] 8314578: Non-verifiable code is emitted when two guards declare pattern variables in colon-switch Backport-of: 15588e08ed455eac356aa923c35503beaecd5b6d --- .../com/sun/tools/javac/comp/Check.java | 6 +-- .../tools/javac/patterns/T8314578.java | 43 +++++++++++++++++++ .../tools/javac/patterns/T8314578.out | 6 +++ 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 test/langtools/tools/javac/patterns/T8314578.java create mode 100644 test/langtools/tools/javac/patterns/T8314578.out diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index faa816e7f7b..f35c847b98e 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -4635,11 +4635,11 @@ void checkSwitchCaseStructure(List cases) { if (previousCompletessNormally && c.stats.nonEmpty() && c.labels.head instanceof JCPatternCaseLabel patternLabel && - hasBindings(patternLabel.pat)) { + (hasBindings(patternLabel.pat) || hasBindings(c.guard))) { log.error(c.labels.head.pos(), Errors.FlowsThroughToPattern); } else if (c.stats.isEmpty() && c.labels.head instanceof JCPatternCaseLabel patternLabel && - hasBindings(patternLabel.pat) && + (hasBindings(patternLabel.pat) || hasBindings(c.guard)) && hasStatements(l.tail)) { log.error(c.labels.head.pos(), Errors.FlowsThroughFromPattern); } @@ -4648,7 +4648,7 @@ void checkSwitchCaseStructure(List cases) { } } - boolean hasBindings(JCPattern p) { + boolean hasBindings(JCTree p) { boolean[] bindings = new boolean[1]; new TreeScanner() { diff --git a/test/langtools/tools/javac/patterns/T8314578.java b/test/langtools/tools/javac/patterns/T8314578.java new file mode 100644 index 00000000000..28acaec3482 --- /dev/null +++ b/test/langtools/tools/javac/patterns/T8314578.java @@ -0,0 +1,43 @@ +/** + * @test /nodynamiccopyright/ + * @bug 8314578 + * @enablePreview + * @summary Parsing of erroneous patterns succeeds + * @compile/fail/ref=T8314578.out -XDrawDiagnostics T8314578.java + */ +public class T8314578 { + record R1() {} + record R2() {} + + static void test(Object o) { + switch (o) { + case R1() when o instanceof String s: + case R2() when o instanceof Integer i: + System.out.println("hello: " + i); + break; + default: + break; + } + } + + static void test2(Object o) { + switch (o) { + case R1() when o instanceof String s: + System.out.println("hello: " + s); + case R2() when o instanceof Integer i: + System.out.println("hello: " + i); + break; + default: + break; + } + } + + static int unnamedInGuardsOK(String s) { + return switch (s) { + case String _ when s instanceof String _ -> // should be OK + 1; + default -> + -1; + }; + } +} \ No newline at end of file diff --git a/test/langtools/tools/javac/patterns/T8314578.out b/test/langtools/tools/javac/patterns/T8314578.out new file mode 100644 index 00000000000..6d6acf6d48b --- /dev/null +++ b/test/langtools/tools/javac/patterns/T8314578.out @@ -0,0 +1,6 @@ +T8314578.java:14:18: compiler.err.flows.through.from.pattern +T8314578.java:15:18: compiler.err.flows.through.to.pattern +T8314578.java:27:18: compiler.err.flows.through.to.pattern +- compiler.note.preview.filename: T8314578.java, DEFAULT +- compiler.note.preview.recompile +3 errors \ No newline at end of file From 2433635872d41c9da66bfd9c692d770fd358da1b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 19 Dec 2023 13:21:33 +0000 Subject: [PATCH 033/261] 8314220: Configurable InlineCacheBuffer size Backport-of: a40d8d97e84d88d1a65aba81bfc09339be95e427 --- src/hotspot/share/code/icBuffer.cpp | 2 +- src/hotspot/share/code/stubs.cpp | 2 -- src/hotspot/share/compiler/compilerDefinitions.cpp | 5 +++++ src/hotspot/share/runtime/globals.hpp | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/code/icBuffer.cpp b/src/hotspot/share/code/icBuffer.cpp index a43d3678ad3..520a8c75259 100644 --- a/src/hotspot/share/code/icBuffer.cpp +++ b/src/hotspot/share/code/icBuffer.cpp @@ -140,7 +140,7 @@ void ICStub::print() { void InlineCacheBuffer::initialize() { if (_buffer != nullptr) return; // already initialized - _buffer = new StubQueue(new ICStubInterface, 10*K, InlineCacheBuffer_lock, "InlineCacheBuffer"); + _buffer = new StubQueue(new ICStubInterface, checked_cast(InlineCacheBufferSize), InlineCacheBuffer_lock, "InlineCacheBuffer"); assert (_buffer != nullptr, "cannot allocate InlineCacheBuffer"); } diff --git a/src/hotspot/share/code/stubs.cpp b/src/hotspot/share/code/stubs.cpp index 55e0207c87d..6037b683b12 100644 --- a/src/hotspot/share/code/stubs.cpp +++ b/src/hotspot/share/code/stubs.cpp @@ -217,8 +217,6 @@ void StubQueue::verify() { guarantee(0 <= _queue_begin && _queue_begin < _buffer_limit, "_queue_begin out of bounds"); guarantee(0 <= _queue_end && _queue_end <= _buffer_limit, "_queue_end out of bounds"); // verify alignment - guarantee(_buffer_size % stub_alignment() == 0, "_buffer_size not aligned"); - guarantee(_buffer_limit % stub_alignment() == 0, "_buffer_limit not aligned"); guarantee(_queue_begin % stub_alignment() == 0, "_queue_begin not aligned"); guarantee(_queue_end % stub_alignment() == 0, "_queue_end not aligned"); // verify buffer limit/size relationship diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp index 23af57f3910..221fc00d1a4 100644 --- a/src/hotspot/share/compiler/compilerDefinitions.cpp +++ b/src/hotspot/share/compiler/compilerDefinitions.cpp @@ -497,6 +497,11 @@ bool CompilerConfig::check_args_consistency(bool status) { "Invalid NonNMethodCodeHeapSize=%dK. Must be at least %uK.\n", NonNMethodCodeHeapSize/K, min_code_cache_size/K); status = false; + } else if (InlineCacheBufferSize > NonNMethodCodeHeapSize / 2) { + jio_fprintf(defaultStream::error_stream(), + "Invalid InlineCacheBufferSize=" SIZE_FORMAT "K. Must be less than or equal to " SIZE_FORMAT "K.\n", + InlineCacheBufferSize/K, NonNMethodCodeHeapSize/2/K); + status = false; } #ifdef _LP64 diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 033a2954cf0..23c0a3bdcb2 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -295,6 +295,9 @@ const int ObjectAlignmentInBytes = 8; product(bool, UseInlineCaches, true, \ "Use Inline Caches for virtual calls ") \ \ + product(size_t, InlineCacheBufferSize, 10*K, EXPERIMENTAL, \ + "InlineCacheBuffer size") \ + \ product(bool, InlineArrayCopy, true, DIAGNOSTIC, \ "Inline arraycopy native that is known to be part of " \ "base library DLL") \ From c725f4bdcb35ec831b1908f21557e5f1e9917397 Mon Sep 17 00:00:00 2001 From: Frederic Thevenet Date: Tue, 19 Dec 2023 13:55:57 +0000 Subject: [PATCH 034/261] 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll Backport-of: 05f950934ee720c82e9b62dd8d31e13bab7775da --- make/autoconf/jdk-version.m4 | 9 +++++++++ make/autoconf/spec.gmk.in | 1 + make/common/JdkNativeCompilation.gmk | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/make/autoconf/jdk-version.m4 b/make/autoconf/jdk-version.m4 index 6a7662556fd..7c9ecad7779 100644 --- a/make/autoconf/jdk-version.m4 +++ b/make/autoconf/jdk-version.m4 @@ -110,6 +110,15 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE]) AC_SUBST(COMPANY_NAME) + # Set the JDK RC Company name + # Otherwise uses the value set for "vendor-name". + UTIL_ARG_WITH(NAME: jdk-rc-company-name, TYPE: string, + DEFAULT: $COMPANY_NAME, + DESC: [Set JDK RC company name. This is used for CompanyName properties of MS Windows binaries.], + DEFAULT_DESC: [from branding.conf], + CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE]) + AC_SUBST(JDK_RC_COMPANY_NAME) + # The vendor URL, if any # Only set VENDOR_URL if '--with-vendor-url' was used and is not empty. # Otherwise we will use the value from "branding.conf" included above. diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index 7c5e6f6d07b..f6def153c82 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -191,6 +191,7 @@ PRODUCT_NAME:=@PRODUCT_NAME@ PRODUCT_SUFFIX:=@PRODUCT_SUFFIX@ JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@ JDK_RC_NAME:=@JDK_RC_NAME@ +JDK_RC_COMPANY_NAME:=@JDK_RC_COMPANY_NAME@ COMPANY_NAME:=@COMPANY_NAME@ HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@ MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@ diff --git a/make/common/JdkNativeCompilation.gmk b/make/common/JdkNativeCompilation.gmk index 6a963ac2c49..1a1333cf517 100644 --- a/make/common/JdkNativeCompilation.gmk +++ b/make/common/JdkNativeCompilation.gmk @@ -98,7 +98,7 @@ GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/ve JDK_RCFLAGS=$(RCFLAGS) \ -D"JDK_VERSION_STRING=$(VERSION_STRING)" \ - -D"JDK_COMPANY=$(COMPANY_NAME)" \ + -D"JDK_COMPANY=$(JDK_RC_COMPANY_NAME)" \ -D"JDK_VER=$(VERSION_NUMBER_FOUR_POSITIONS)" \ -D"JDK_COPYRIGHT=Copyright \xA9 $(COPYRIGHT_YEAR)" \ -D"JDK_NAME=$(JDK_RC_NAME) $(VERSION_SHORT)" \ From 3e4adb6fd4c057d87cc0ddf448913ed49d8fc342 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 19 Dec 2023 15:14:09 +0000 Subject: [PATCH 035/261] 8320168: handle setsocktopt return values Backport-of: db1d82347bb18e21c4c6a18076ffdaf17724c733 --- .../unix/native/libnet/Inet4AddressImpl.c | 18 ++++++++++++++--- .../unix/native/libnet/Inet6AddressImpl.c | 20 +++++++++++++++---- .../unix/native/libnet/net_util_md.c | 4 +++- .../windows/native/libnet/Inet4AddressImpl.c | 6 +++++- .../windows/native/libnet/Inet6AddressImpl.c | 6 +++++- src/java.base/windows/native/libnio/ch/Net.c | 2 +- ...ndowsAsynchronousServerSocketChannelImpl.c | 6 ++++-- .../ch/WindowsAsynchronousSocketChannelImpl.c | 6 ++++-- 8 files changed, 53 insertions(+), 15 deletions(-) diff --git a/src/java.base/unix/native/libnet/Inet4AddressImpl.c b/src/java.base/unix/native/libnet/Inet4AddressImpl.c index 4db86234b23..fff524e03ae 100644 --- a/src/java.base/unix/native/libnet/Inet4AddressImpl.c +++ b/src/java.base/unix/native/libnet/Inet4AddressImpl.c @@ -263,7 +263,11 @@ tcp_ping4(JNIEnv *env, SOCKETADDRESS *sa, SOCKETADDRESS *netif, jint timeout, // set TTL if (ttl > 0) { - setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); + if (setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) < 0) { + NET_ThrowNew(env, errno, "setsockopt IP_TTL failed"); + close(fd); + return JNI_FALSE; + } } // A network interface was specified, so let's bind to it. @@ -349,11 +353,19 @@ ping4(JNIEnv *env, jint fd, SOCKETADDRESS *sa, SOCKETADDRESS *netif, struct timeval tv = { 0, 0 }; const size_t plen = ICMP_MINLEN + sizeof(tv); - setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) < 0) { + NET_ThrowNew(env, errno, "setsockopt SO_RCVBUF failed"); + close(fd); + return JNI_FALSE; + } // sets the ttl (max number of hops) if (ttl > 0) { - setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); + if (setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) < 0) { + NET_ThrowNew(env, errno, "setsockopt IP_TTL failed"); + close(fd); + return JNI_FALSE; + } } // a specific interface was specified, so let's bind the socket diff --git a/src/java.base/unix/native/libnet/Inet6AddressImpl.c b/src/java.base/unix/native/libnet/Inet6AddressImpl.c index a28b2f99be0..bad7872c179 100644 --- a/src/java.base/unix/native/libnet/Inet6AddressImpl.c +++ b/src/java.base/unix/native/libnet/Inet6AddressImpl.c @@ -463,12 +463,16 @@ tcp_ping6(JNIEnv *env, SOCKETADDRESS *sa, SOCKETADDRESS *netif, jint timeout, // set TTL if (ttl > 0) { - setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl)); + if (setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl)) < 0) { + NET_ThrowNew(env, errno, "setsockopt IPV6_UNICAST_HOPS failed"); + close(fd); + return JNI_FALSE; + } } // A network interface was specified, so let's bind to it. if (netif != NULL) { - if (bind(fd, &netif->sa, sizeof(struct sockaddr_in6)) <0) { + if (bind(fd, &netif->sa, sizeof(struct sockaddr_in6)) < 0) { NET_ThrowNew(env, errno, "Can't bind socket"); close(fd); return JNI_FALSE; @@ -557,11 +561,19 @@ ping6(JNIEnv *env, jint fd, SOCKETADDRESS *sa, SOCKETADDRESS *netif, setsockopt(fd, SOL_RAW, IPV6_CHECKSUM, &csum_offset, sizeof(int)); #endif - setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) < 0) { + NET_ThrowNew(env, errno, "setsockopt SO_RCVBUF failed"); + close(fd); + return JNI_FALSE; + } // sets the ttl (max number of hops) if (ttl > 0) { - setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl)); + if (setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl)) < 0) { + NET_ThrowNew(env, errno, "setsockopt IPV6_UNICAST_HOPS failed"); + close(fd); + return JNI_FALSE; + } } // a specific interface was specified, so let's bind the socket diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c index 9d812de5c88..7be6d9a69fe 100644 --- a/src/java.base/unix/native/libnet/net_util_md.c +++ b/src/java.base/unix/native/libnet/net_util_md.c @@ -615,7 +615,9 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, } if (sotype == SOCK_DGRAM) { - setsockopt(fd, level, SO_REUSEPORT, arg, len); + if (setsockopt(fd, level, SO_REUSEPORT, arg, len) < 0) { + return -1; + } } } #endif diff --git a/src/java.base/windows/native/libnet/Inet4AddressImpl.c b/src/java.base/windows/native/libnet/Inet4AddressImpl.c index 97f3ef4e8e1..0e2d6a3455f 100644 --- a/src/java.base/windows/native/libnet/Inet4AddressImpl.c +++ b/src/java.base/windows/native/libnet/Inet4AddressImpl.c @@ -232,7 +232,11 @@ tcp_ping4(JNIEnv *env, SOCKETADDRESS *sa, SOCKETADDRESS *netif, jint timeout, // set TTL if (ttl > 0) { - setsockopt(fd, IPPROTO_IP, IP_TTL, (const char *)&ttl, sizeof(ttl)); + if (setsockopt(fd, IPPROTO_IP, IP_TTL, (const char *)&ttl, sizeof(ttl)) == SOCKET_ERROR) { + NET_ThrowNew(env, WSAGetLastError(), "setsockopt IP_TTL failed"); + closesocket(fd); + return JNI_FALSE; + } } // A network interface was specified, so let's bind to it. diff --git a/src/java.base/windows/native/libnet/Inet6AddressImpl.c b/src/java.base/windows/native/libnet/Inet6AddressImpl.c index 324024c842e..244e2fefa9b 100644 --- a/src/java.base/windows/native/libnet/Inet6AddressImpl.c +++ b/src/java.base/windows/native/libnet/Inet6AddressImpl.c @@ -310,7 +310,11 @@ tcp_ping6(JNIEnv *env, SOCKETADDRESS *sa, SOCKETADDRESS *netif, jint timeout, // set TTL if (ttl > 0) { - setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, (const char *)&ttl, sizeof(ttl)); + if (setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, (const char *)&ttl, sizeof(ttl)) == SOCKET_ERROR) { + NET_ThrowNew(env, WSAGetLastError(), "setsockopt IPV6_UNICAST_HOPS failed"); + closesocket(fd); + return JNI_FALSE; + } } // A network interface was specified, so let's bind to it. diff --git a/src/java.base/windows/native/libnio/ch/Net.c b/src/java.base/windows/native/libnio/ch/Net.c index 5cc5a2cd53f..3ccdbcc4752 100644 --- a/src/java.base/windows/native/libnio/ch/Net.c +++ b/src/java.base/windows/native/libnio/ch/Net.c @@ -156,7 +156,7 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, if (s != INVALID_SOCKET) { SetHandleInformation((HANDLE)s, HANDLE_FLAG_INHERIT, 0); - /* IPV6_V6ONLY is true by default */ + /* Attempt to disable IPV6_V6ONLY to ensure dual-socket support; ignore errors */ if (domain == AF_INET6) { int opt = 0; setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, diff --git a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c index 340bbb9c8de..2c6de95ac65 100644 --- a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c +++ b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousServerSocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, 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 @@ -131,7 +131,9 @@ Java_sun_nio_ch_WindowsAsynchronousServerSocketChannelImpl_updateAcceptContext(J SOCKET s1 = (SOCKET)jlong_to_ptr(listenSocket); SOCKET s2 = (SOCKET)jlong_to_ptr(acceptSocket); - setsockopt(s2, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char *)&s1, sizeof(s1)); + if (setsockopt(s2, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char *)&s1, sizeof(s1)) == SOCKET_ERROR) { + JNU_ThrowIOExceptionWithLastError(env, "setsockopt failed"); + } } diff --git a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c index 6b1fa64e708..b325c34c9d8 100644 --- a/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c +++ b/src/java.base/windows/native/libnio/ch/WindowsAsynchronousSocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, 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 @@ -123,7 +123,9 @@ Java_sun_nio_ch_WindowsAsynchronousSocketChannelImpl_updateConnectContext(JNIEnv jlong socket) { SOCKET s = (SOCKET)jlong_to_ptr(socket); - setsockopt(s, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0); + if (setsockopt(s, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0) == SOCKET_ERROR) { + JNU_ThrowIOExceptionWithLastError(env, "setsockopt failed"); + } } From 34fc725b82914ddb8aee2458b499d78ac337e06e Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 20 Dec 2023 11:32:33 +0000 Subject: [PATCH 036/261] 8317307: test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java fails with ConnectException: Connection timed out: no further information Backport-of: b9b82631bf75dc93d9e11536b6872df4c89e9592 --- test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java b/test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java index 4646d9fa461..66865f85942 100644 --- a/test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java +++ b/test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,7 +124,7 @@ private static void attemptConnect(Hashtable env) throws Excepti // assertCompletion may wrap a CommunicationException in an RTE assertNotNull(msg); assertTrue(msg.contains("Network is unreachable") - || msg.contains("No route to host")); + || msg.contains("No route to host") || msg.contains("Connection timed out")); } catch (NamingException ex) { String msg = ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage(); System.err.println("MSG: " + msg); From bd552ef842d206fce3be2f435011f05d2cef0f1d Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Wed, 20 Dec 2023 15:23:27 +0000 Subject: [PATCH 037/261] 8313229: DHEKeySizing.java should be modified to use TLS versions TLSv1, TLSv1.1, TLSv1.2 Backport-of: c698b45a7bcb0eedeed979d482f8ab15cf16baaa --- .../ssl/DHKeyExchange/DHEKeySizing.java | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java b/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java index c6c8841f6c7..e52fb76c4ab 100644 --- a/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java +++ b/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java @@ -32,58 +32,55 @@ * @summary make ephemeral DH key match the length of the certificate key * @library /javax/net/ssl/templates * @run main/othervm -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1643 267 + * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA 1643 267 TLSv1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 + * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 1259 75 TLSv1.1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=matched * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 + * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 1259 75 TLSv1.2 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=legacy * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 + * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 1259 75 TLSv1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=1024 * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 - * + * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 1259 75 TLSv1.1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA true 233 75 - * + * DHEKeySizing SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA 233 75 TLSv1.2 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1643 267 + * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA 1643 267 TLSv1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=legacy * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1323 107 + * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA 1323 107 TLSv1.1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=matched * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1643 267 + * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA 1645 267 TLSv1.2 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=1024 * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1387 139 - * + * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA 1387 139 TLSv1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.client.enableSessionTicketExtension=false - * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 617 267 + * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 617 267 TLSv1.1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.client.enableSessionTicketExtension=false * -Djdk.tls.ephemeralDHKeySize=legacy - * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 297 107 + * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 297 107 TLSv1.2 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.client.enableSessionTicketExtension=false * -Djdk.tls.ephemeralDHKeySize=matched - * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 617 267 + * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 617 267 TLSv1 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.client.enableSessionTicketExtension=false * -Djdk.tls.ephemeralDHKeySize=1024 - * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 361 139 + * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 361 139 TLSv1.1 */ /* @@ -133,11 +130,13 @@ public class DHEKeySizing extends SSLEngineTemplate { // key length bias because of the stripping of leading zero bytes of // negotiated DH keys. // - // This is an effort to mimum intermittent failure when we cannot + // This is an effort to minimize intermittent failures when we cannot // estimate what's the exact number of leading zero bytes of // negotiated DH keys. private final static int KEY_LEN_BIAS = 6; + private static String protocol; + private void checkResult(ByteBuffer bbIn, ByteBuffer bbOut, SSLEngineResult result, Status status, HandshakeStatus hsStatus, @@ -175,8 +174,8 @@ private void checkResult(ByteBuffer bbIn, ByteBuffer bbOut, } } - private void test(String cipherSuite, boolean exportable, - int lenServerKeyEx, int lenClientKeyEx) throws Exception { + private void test(String cipherSuite, int lenServerKeyEx, + int lenClientKeyEx) throws Exception { SSLEngineResult result1; // clientEngine's results from last operation SSLEngineResult result2; // serverEngine's results from last operation @@ -316,15 +315,16 @@ public static void main(String args[]) throws Exception { if (args.length != 4) { System.out.println( "Usage: java DHEKeySizing cipher-suite " + - "exportable(true|false)\n" + - " size-of-server-hello-record size-of-client-key-exchange"); + "size-of-server-hello-record\n" + + " size-of-client-key-exchange protocol"); throw new Exception("Incorrect usage!"); } + protocol = args[3]; + (new DHEKeySizing()).test(args[0], - Boolean.parseBoolean(args[1]), - Integer.parseInt(args[2]), - Integer.parseInt(args[3])); + Integer.parseInt(args[1]), + Integer.parseInt(args[2])); System.out.println("Test Passed."); } @@ -359,12 +359,12 @@ protected SSLContext createClientSSLContext() throws Exception { @Override protected ContextParameters getClientContextParameters() { - return new ContextParameters("TLSv1", "PKIX", "NewSunX509"); + return new ContextParameters(protocol, "PKIX", "NewSunX509"); } @Override protected ContextParameters getServerContextParameters() { - return new ContextParameters("TLSv1", "PKIX", "NewSunX509"); + return new ContextParameters(protocol, "PKIX", "NewSunX509"); } private static void log(String str) { From 9aad573ac8224109d0bac125cc61c6a525fb126a Mon Sep 17 00:00:00 2001 From: KIRIYAMA Takuya Date: Wed, 20 Dec 2023 23:00:00 +0000 Subject: [PATCH 038/261] 8311081: KeytoolReaderP12Test.java fail on localized Windows platform Backport-of: b4b2fecb42d9f14d73e8d79a9e59dee4d697f9cf --- test/jdk/java/security/KeyStore/PKCS12/Utils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/jdk/java/security/KeyStore/PKCS12/Utils.java b/test/jdk/java/security/KeyStore/PKCS12/Utils.java index 67286bd8bea..22131390d06 100644 --- a/test/jdk/java/security/KeyStore/PKCS12/Utils.java +++ b/test/jdk/java/security/KeyStore/PKCS12/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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 @@ -59,11 +59,14 @@ public static OutputAnalyzer executeKeytoolCommand(String[] command) { public static OutputAnalyzer executeKeytoolCommand(String[] command, int exitCode) { - String[] keytoolCmd = new String[command.length + 1]; + String[] keytoolCmd = new String[command.length + 3]; OutputAnalyzer output = null; try { keytoolCmd[0] = JDKToolFinder.getJDKTool(KEYTOOL); - System.arraycopy(command, 0, keytoolCmd, 1, command.length); + // Ensure the keytool process is always ran under English locale + keytoolCmd[1] = "-J-Duser.language=en"; + keytoolCmd[2] = "-J-Duser.country=US"; + System.arraycopy(command, 0, keytoolCmd, 3, command.length); output = ProcessTools.executeCommand(keytoolCmd); output.shouldHaveExitValue(exitCode); out.println("Executed keytool command sucessfully:" From 80f129da204483dfe0b01e5be31b2a884b178ebd Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 10:08:50 +0000 Subject: [PATCH 039/261] 8311581: Remove obsolete code and comments in TestLVT.java Backport-of: 27de536b409aa80c8b8bb452160329be52814e0b --- test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java b/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java index 2750038dfb5..b1ed991b931 100644 --- a/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java +++ b/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java @@ -41,21 +41,16 @@ public class TestLVT { public static void main(String[] args) throws Exception { test(); // Test good LVT in this test - String jarFile = System.getProperty("test.src") + "/testcase.jar"; - - // java -cp $testSrc/testcase.jar DuplicateLVT ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("DuplicateLVT"); new OutputAnalyzer(pb.start()) .shouldContain("Duplicated LocalVariableTable attribute entry for 'by' in class file DuplicateLVT") .shouldHaveExitValue(1); - // java -cp $testclasses/testcase.jar DuplicateLVTT pb = ProcessTools.createJavaProcessBuilder("DuplicateLVTT"); new OutputAnalyzer(pb.start()) .shouldContain("Duplicated LocalVariableTypeTable attribute entry for 'list' in class file DuplicateLVTT") .shouldHaveExitValue(1); - // java -cp $testclasses/testcase.jar NotFoundLVTT pb = ProcessTools.createJavaProcessBuilder("NotFoundLVTT"); new OutputAnalyzer(pb.start()) .shouldContain("LVTT entry for 'list' in class file NotFoundLVTT does not match any LVT entry") From b806f56f544f1a05e644ec4872bccf3ecff467f9 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 10:10:32 +0000 Subject: [PATCH 040/261] 8312916: Remove remaining usages of -Xdebug from test/hotspot/jtreg Backport-of: e9daf4a0185b90762d2bdd38d86fe93b4822ea08 --- test/hotspot/jtreg/serviceability/attach/ShMemLongName.java | 3 +-- .../jdi/AttachingConnector/attach/attach004/TestDriver.java | 3 +-- .../hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java b/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java index bd491a1628b..bf90dd9a08c 100644 --- a/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java +++ b/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -95,7 +95,6 @@ private static void log(String s) { private static ProcessBuilder getTarget(String shmemName) throws IOException { log("starting target with shmem name: '" + shmemName + "'..."); return ProcessTools.createJavaProcessBuilder( - "-Xdebug", "-Xrunjdwp:transport=" + transport + ",server=y,suspend=n,address=" + shmemName, "ShMemLongName$Target"); } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach004/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach004/TestDriver.java index 07d78e47096..1860b612829 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach004/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach004/TestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,7 +92,6 @@ private static Process startDebuggee(String[] jdiArgs, String transport, String Collections.addAll(cmd, Utils.prependTestJavaOpts( "-cp", Utils.TEST_CLASS_PATH, - "-Xdebug", "-agentlib:jdwp=transport=" + transport + ",server=y,suspend=" + suspend, "-Dmy.little.cookie=" + ProcessHandle.current().pid(), debuggeeClass.getName())); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java b/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java index 0be4658d824..79192149409 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeBinder.java @@ -328,8 +328,6 @@ public String[] makeCommandLineArgs(String classToExecute, String transportAddre args.add(classPath); */ - args.add("-Xdebug"); - String server; if (argumentHandler.isAttachingConnector()) { server = "y"; From 19d74b451a305dfef5a5a5820a082142373c47e6 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 10:29:52 +0000 Subject: [PATCH 041/261] 8307408: Some jdk/sun/tools/jhsdb tests don't pass test JVM args to the debuggee JVM Backport-of: 87b08b6e0192d88025c2275c7dd2c4bdecda58e8 --- test/jdk/ProblemList-zgc.txt | 3 +++ test/jdk/ProblemList.txt | 1 + test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java | 11 +++++++++-- test/jdk/sun/tools/jhsdb/JStackStressTest.java | 6 ++++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/test/jdk/ProblemList-zgc.txt b/test/jdk/ProblemList-zgc.txt index 59a0a967721..df7edd2cf7d 100644 --- a/test/jdk/ProblemList-zgc.txt +++ b/test/jdk/ProblemList-zgc.txt @@ -28,3 +28,6 @@ ############################################################################# java/util/concurrent/locks/Lock/OOMEInAQS.java 8309218 generic-all + +sun/tools/jhsdb/JShellHeapDumpTest.java 8276539 generic-all +sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8276539 generic-all diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index ec34e1f461b..1cf258eb4d9 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -742,6 +742,7 @@ sun/tools/jstat/jstatLineCounts3.sh 8248691,8268211 sun/tools/jstat/jstatLineCounts4.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 sun/tools/jhsdb/JStackStressTest.java 8276210 linux-aarch64 +sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8313798 generic-aarch64 ############################################################################ diff --git a/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java b/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java index d529466aacc..a6641319096 100644 --- a/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java +++ b/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -150,7 +150,14 @@ public static void launchJshell() throws IOException { System.out.println("Starting Jshell"); long startTime = System.currentTimeMillis(); try { - ProcessBuilder pb = new ProcessBuilder(JDKToolFinder.getTestJDKTool("jshell")); + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jshell"); + if (doSleep) { + launcher.addVMArgs(Utils.getTestJavaOpts()); + } else { + // Don't allow use of SerialGC. See JDK-8313655. + launcher.addVMArgs(Utils.getFilteredTestJavaOpts("-XX:\\+UseSerialGC")); + } + ProcessBuilder pb = new ProcessBuilder(launcher.getCommand()); jShellProcess = ProcessTools.startProcess("JShell", pb, s -> { // warm-up predicate return s.contains("Welcome to JShell"); diff --git a/test/jdk/sun/tools/jhsdb/JStackStressTest.java b/test/jdk/sun/tools/jhsdb/JStackStressTest.java index 9870908a3b2..97945b6092b 100644 --- a/test/jdk/sun/tools/jhsdb/JStackStressTest.java +++ b/test/jdk/sun/tools/jhsdb/JStackStressTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -93,7 +93,9 @@ public static void launchJshell() throws IOException { System.out.println("Starting Jshell"); long startTime = System.currentTimeMillis(); try { - ProcessBuilder pb = new ProcessBuilder(JDKToolFinder.getTestJDKTool("jshell")); + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jshell"); + launcher.addVMArgs(Utils.getTestJavaOpts()); + ProcessBuilder pb = new ProcessBuilder(launcher.getCommand()); jShellProcess = ProcessTools.startProcess("JShell", pb); } catch (Exception ex) { throw new RuntimeException("Test ERROR " + ex, ex); From 20dd66b2077f400e9c73afc3da35ee956c2f6945 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 10:35:21 +0000 Subject: [PATCH 042/261] 8314333: Update com/sun/jdi/ProcessAttachTest.java to use ProcessTools.createTestJvm(..) Backport-of: 7342f5a0337df88b6787c4c2b53c8007667b6636 --- test/jdk/com/sun/jdi/ProcessAttachTest.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/jdk/com/sun/jdi/ProcessAttachTest.java b/test/jdk/com/sun/jdi/ProcessAttachTest.java index 8cccb1e2be3..04cc8320570 100644 --- a/test/jdk/com/sun/jdi/ProcessAttachTest.java +++ b/test/jdk/com/sun/jdi/ProcessAttachTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -58,8 +58,6 @@ public static void main(String args[]) throws Exception { public class ProcessAttachTest { - public static final String TESTCLASSES = System.getProperty("test.classes"); - public static void main(String[] args) throws Exception { System.out.println("Test 1: Debuggee start with suspend=n"); @@ -71,9 +69,8 @@ public static void main(String[] args) throws Exception { } private static void runTest(String jdwpArg) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( jdwpArg, - "-classpath", TESTCLASSES, "ProcessAttachTestTarg"); Process p = null; try { From 320cf855a71455886b1220685805d728775aac6b Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 10:48:28 +0000 Subject: [PATCH 043/261] 8315406: [REDO] serviceability/jdwp/AllModulesCommandTest.java ignores VM flags Backport-of: 5cbff2460812fee707f9d96ab00a628d1ce3fbef --- .../jdwp/AllModulesCommandTest.java | 8 +-- .../serviceability/jdwp/DebuggeeLauncher.java | 60 ++++--------------- .../serviceability/jdwp/StreamHandler.java | 5 +- 3 files changed, 13 insertions(+), 60 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java b/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java index 3c799f6e54d..28fdeec3219 100644 --- a/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java +++ b/test/hotspot/jtreg/serviceability/jdwp/AllModulesCommandTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -72,12 +72,6 @@ public void onDebuggeeSendingCompleted() { jdwpLatch.countDown(); } - @Override - public void onDebuggeeError(String message) { - System.err.println("Debuggee error: '" + message + "'"); - System.exit(1); - } - private void doJdwp() throws Exception { try { // Establish JDWP socket connection diff --git a/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java b/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java index 5c3d01ec2dc..2d03d2f418f 100644 --- a/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java +++ b/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -22,9 +22,9 @@ */ import java.util.StringTokenizer; -import jdk.test.lib.JDKToolFinder; import jdk.test.lib.JDWP; import static jdk.test.lib.Asserts.assertFalse; +import jdk.test.lib.process.ProcessTools; /** * Launches the debuggee with the necessary JDWP options and handles the output @@ -45,21 +45,14 @@ public interface Listener { */ void onDebuggeeSendingCompleted(); - /** - * Callback to handle any debuggee error - * - * @param line line from the debuggee's stderr - */ - void onDebuggeeError(String line); } private int jdwpPort = -1; - private static final String CLS_DIR = System.getProperty("test.classes", "").trim(); private static final String DEBUGGEE = "AllModulesCommandTestDebuggee"; + private static final String JDWP_OPT = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0"; + private Process p; private final Listener listener; - private StreamHandler inputHandler; - private StreamHandler errorHandler; /** * @param listener the listener we report the debuggee events to @@ -70,36 +63,20 @@ public DebuggeeLauncher(Listener listener) { /** * Starts the debuggee with the necessary JDWP options and handles the - * debuggee's stdout and stderr outputs + * debuggee's stdout output. stderr might contain jvm output, which is just printed to the log. * * @throws Throwable */ public void launchDebuggee() throws Throwable { - ProcessBuilder pb = new ProcessBuilder(getCommand()); + ProcessBuilder pb = ProcessTools.createTestJvm(JDWP_OPT, DEBUGGEE); p = pb.start(); - inputHandler = new StreamHandler(p.getInputStream(), this); - errorHandler = new StreamHandler(p.getErrorStream(), this); + StreamHandler inputHandler = new StreamHandler(p.getInputStream(), this); + StreamHandler errorHandler = new StreamHandler(p.getErrorStream(), l -> System.out.println("[stderr]: " + l)); inputHandler.start(); errorHandler.start(); } - /** - * Command to start the debuggee with the JDWP options and using the JDK - * under test - * - * @return the command - */ - private String[] getCommand() { - return new String[]{ - JDKToolFinder.getTestJDKTool("java"), - getJdwpOptions(), - "-cp", - CLS_DIR, - DEBUGGEE - }; - } - /** * Terminates the debuggee */ @@ -109,15 +86,6 @@ public void terminateDebuggee() { } } - /** - * Debuggee JDWP options - * - * @return the JDWP options to start the debuggee with - */ - private static String getJdwpOptions() { - return "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0"; - } - /** * Gets JDWP port debuggee is listening on. * @@ -129,16 +97,8 @@ public int getJdwpPort() { } @Override - public void onStringRead(StreamHandler handler, String line) { - if (handler.equals(errorHandler)) { - terminateDebuggee(); - listener.onDebuggeeError(line); - } else { - processDebuggeeOutput(line); - } - } - - private void processDebuggeeOutput(String line) { + public void onStringRead(String line) { + System.out.println("[stdout]: " + line); if (jdwpPort == -1) { JDWP.ListenAddress addr = JDWP.parseListenAddress(line); if (addr != null) { diff --git a/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java b/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java index 257f66a66a9..2822a91a8ce 100644 --- a/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java +++ b/test/hotspot/jtreg/serviceability/jdwp/StreamHandler.java @@ -37,10 +37,9 @@ public class StreamHandler implements Runnable { public interface Listener { /** * Called when a line has been read from the process output stream - * @param handler this StreamHandler * @param s the line */ - void onStringRead(StreamHandler handler, String s); + void onStringRead(String s); } private final ExecutorService executor; @@ -71,7 +70,7 @@ public void run() { BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; while ((line = br.readLine()) != null) { - listener.onStringRead(this, line); + listener.onStringRead(line); } } catch (Exception x) { throw new RuntimeException(x); From ebd5179aa29358c91264b6b22d767a3c2bd4c893 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 10:58:09 +0000 Subject: [PATCH 044/261] 8314831: NMT tests ignore vm flags Backport-of: 9bf3dee2424bd8ccbc7ef0175c6e7165ff5cf1c6 --- test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java | 4 ++-- .../jtreg/runtime/NMT/CommandLineEmptyArgument.java | 3 ++- .../jtreg/runtime/NMT/CommandLineInvalidArgument.java | 3 ++- test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java | 4 ++-- test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java | 3 ++- test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java | 3 ++- test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java | 8 +++++++- test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java | 4 ++-- test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java | 6 +++--- test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java | 6 +++--- .../runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java | 3 ++- 11 files changed, 29 insertions(+), 18 deletions(-) diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java b/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java index 94bd1de830a..074a9b194eb 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public class CommandLineDetail { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( "-XX:NativeMemoryTracking=detail", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java b/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java index e2d627ffded..3d2ac8baf29 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @summary Empty argument to NMT should result in an informative error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java b/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java index 78eeb29222c..d82df08b8cc 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @summary Invalid argument to NMT should result in an informative error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java b/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java index 1efe805b457..c44be999d5f 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public class CommandLineSummary { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( "-XX:NativeMemoryTracking=summary", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java b/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java index c2b784e383e..710902a53cb 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @summary Turning off NMT should not result in an error + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java b/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java index da1dd497975..079d8d99052 100644 --- a/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java +++ b/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @summary Verify that jcmd correctly reports that NMT is not enabled + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java b/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java index c321f91b719..ba53d4d06a1 100644 --- a/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java +++ b/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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,6 +26,7 @@ /* * @test id=global-limit-fatal * @summary Verify -XX:MallocLimit with a global limit + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver MallocLimitTest global-limit-fatal @@ -34,6 +35,7 @@ /* * @test id=global-limit-oom * @summary Verify -XX:MallocLimit with a global limit + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver MallocLimitTest global-limit-oom @@ -42,6 +44,7 @@ /* * @test id=compiler-limit-fatal * @summary Verify -XX:MallocLimit with a compiler-specific limit (for "mtCompiler" category) + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver MallocLimitTest compiler-limit-fatal @@ -50,6 +53,7 @@ /* * @test id=compiler-limit-oom * @summary Verify -XX:MallocLimit with a compiler-specific limit (for "mtCompiler" category) + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver MallocLimitTest compiler-limit-oom @@ -58,6 +62,7 @@ /* * @test id=multi-limit * @summary Verify -XX:MallocLimit with multiple limits + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver MallocLimitTest multi-limit @@ -66,6 +71,7 @@ /* * @test id=limit-without-nmt * @summary Verify that the VM warns if -XX:MallocLimit is given but NMT is disabled + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver MallocLimitTest limit-without-nmt diff --git a/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java b/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java index b0e543dfe43..ef1e5cd8346 100644 --- a/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java +++ b/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 SAP SE. All rights reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -156,7 +156,7 @@ public static void main(String args[]) throws Exception { } vmArgs.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmArgs); + ProcessBuilder pb = ProcessTools.createTestJvm(vmArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (debug) { output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java b/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java index 777b08ce9ff..994705e1e77 100644 --- a/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java +++ b/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -38,14 +38,14 @@ public class NMTWithCDS { public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createTestJvm( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:dump", "-Xlog:cds"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createTestJvm( "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); diff --git a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java index c59ce0315e8..3263cc40233 100644 --- a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java +++ b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public class PrintNMTStatistics { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=detail", @@ -55,7 +55,7 @@ public static void main(String args[]) throws Exception { // Make sure memory reserved for Module processing is recorded. output_detail.shouldContain(" Module (reserved="); - ProcessBuilder pb1 = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb1 = ProcessTools.createTestJvm( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=summary", diff --git a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java index 31ab2537fe1..70222701b06 100644 --- a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java +++ b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @summary Trying to enable PrintNMTStatistics should result in a warning + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management From 15459679363e01212a59c40a105fb0afc8d2e697 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:00:03 +0000 Subject: [PATCH 045/261] 8313638: Add test for dump of resolved references Reviewed-by: matsaave Backport-of: 83dca6296e3fc7b9912ef7b82e443ce1415a7bcc --- src/hotspot/share/prims/whitebox.cpp | 7 ++ .../ResolvedReferencesNotNullTest.java | 75 +++++++++++++++++ .../ResolvedReferencesTestApp.java | 31 +++++++ .../sharedStrings/ResolvedReferencesWb.java | 83 +++++++++++++++++++ test/lib/jdk/test/whitebox/WhiteBox.java | 6 ++ 5 files changed, 202 insertions(+) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index 41ed8192a5a..c3cadc4b4a2 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -1865,6 +1865,12 @@ WB_ENTRY(jint, WB_GetConstantPoolCacheLength(JNIEnv* env, jobject wb, jclass kla return cp->cache()->length(); WB_END +WB_ENTRY(jobjectArray, WB_GetResolvedReferences(JNIEnv* env, jobject wb, jclass klass)) + InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass))); + objArrayOop resolved_refs= ik->constants()->resolved_references(); + return (jobjectArray)JNIHandles::make_local(THREAD, resolved_refs); +WB_END + WB_ENTRY(jint, WB_ConstantPoolRemapInstructionOperandFromCache(JNIEnv* env, jobject wb, jclass klass, jint index)) InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass))); ConstantPool* cp = ik->constants(); @@ -2745,6 +2751,7 @@ static JNINativeMethod methods[] = { {CC"getConstantPool0", CC"(Ljava/lang/Class;)J", (void*)&WB_GetConstantPool }, {CC"getConstantPoolCacheIndexTag0", CC"()I", (void*)&WB_GetConstantPoolCacheIndexTag}, {CC"getConstantPoolCacheLength0", CC"(Ljava/lang/Class;)I", (void*)&WB_GetConstantPoolCacheLength}, + {CC"getResolvedReferences0", CC"(Ljava/lang/Class;)[Ljava/lang/Object;", (void*)&WB_GetResolvedReferences}, {CC"remapInstructionOperandFromCPCache0", CC"(Ljava/lang/Class;I)I", (void*)&WB_ConstantPoolRemapInstructionOperandFromCache}, {CC"encodeConstantPoolIndyIndex0", diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java new file mode 100644 index 00000000000..005a1f78e0b --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test ResolvedReferencesNotNullTest + * @bug 8313638 + * @summary Testing resolved references array to ensure elements are non-null + * @requires vm.cds.write.archived.java.heap + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds + * @build jdk.test.whitebox.WhiteBox ResolvedReferencesWb ResolvedReferencesTestApp + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run driver ResolvedReferencesNotNullTest + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.whitebox.WhiteBox; + +public class ResolvedReferencesNotNullTest { + public static void main(String[] args) throws Exception { + SharedStringsUtils.buildJarAndWhiteBox("ResolvedReferencesWb", "ResolvedReferencesTestApp"); + String appJar = TestCommon.getTestJar(SharedStringsUtils.TEST_JAR_NAME_FULL); + String whiteboxParam = SharedStringsUtils.getWbParam(); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-cp", + appJar, + whiteboxParam, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "ResolvedReferencesWb", + "false" // ResolvedReferencesTestApp is not archived + ); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + + TestCommon.dump(appJar, + TestCommon.list("ResolvedReferencesWb", "ResolvedReferencesTestApp"), + TestCommon.concat("-XX:SharedArchiveFile=ResolvedRef.jsa", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + whiteboxParam)); + + // Since ResolvedReferencesTestApp is now archived, all of the strings should be in the resolved + // references array + TestCommon.run("-cp", + appJar, + whiteboxParam, + "-XX:SharedArchiveFile=ResolvedRef.jsa", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "ResolvedReferencesWb", + "true" // ResolvedReferencesTestApp is archived + ).assertNormalExit(); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java new file mode 100644 index 00000000000..4b059485bc9 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesTestApp.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023, 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. + */ + +public class ResolvedReferencesTestApp { + // These strings must be in the resolved references array + static String foo = "fooString"; + static String bar = "barString"; + + // This method is never called so the string should not be added to the resolved references array + String qux() { return "quxString"; } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java new file mode 100644 index 00000000000..d1e25936c3b --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesWb.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.whitebox.WhiteBox; + +public class ResolvedReferencesWb { + public static void main(String[] args) throws Exception { + WhiteBox wb = WhiteBox.getWhiteBox(); + + if (args.length < 1) { + throw new RuntimeException("Test requires arg: [true|false]"); + } + + if (!args[0].equals("true") && !args[0].equals("false")) { + throw new RuntimeException("Invalid argument: Test requires arg: [true|false]"); + } + + ResolvedReferencesTestApp t = new ResolvedReferencesTestApp(); + Object[] resolvedReferences = wb.getResolvedReferences(ResolvedReferencesTestApp.class); + boolean isArchived = (args[0].equals("true")); + + if (resolvedReferences.length <= 0) { + throw new RuntimeException("Resolved reference should not be null"); + } + + boolean foundFoo = false; + boolean foundBar = false; + boolean foundQux = false; + + for (Object o : resolvedReferences) { + if (o != null) { + foundFoo |= (o.equals("fooString")); + foundBar |= (o.equals("barString")); + foundQux |= (o.equals("quxString")); + } + } + + if (isArchived) { + // CDS eagerly resolves all the string literals in the ConstantPool. At this point, all + // three strings should be in the resolvedReferences array. + if (!foundFoo || !foundBar || !foundQux) { + throwException(resolvedReferences, "Incorrect resolved references array, all strings should be present"); + } + } else { + // If the class is not archived, the string literals in the ConstantPool are resolved + // on-demand. At this point, ResolvedReferencesTestApp:: has been executed + // so the two strings used there should be in the resolvedReferences array. + // ResolvedReferencesTestApp::qux() is not executed so "quxString" + // should not yet be resolved. + if (!foundFoo || !foundBar || foundQux) { + throwException(resolvedReferences, "Incorrect resolved references array, quxString should not be archived"); + } + } + } + + static void throwException(Object[] resolvedRefs, String errMsg) throws RuntimeException { + System.out.printf("Resolved References Array Length: %d\n", resolvedRefs.length); + for (Object o : resolvedRefs) { + System.out.println(o); + } + throw new RuntimeException(errMsg); + } +} diff --git a/test/lib/jdk/test/whitebox/WhiteBox.java b/test/lib/jdk/test/whitebox/WhiteBox.java index a19dbc10688..0cf7d48969b 100644 --- a/test/lib/jdk/test/whitebox/WhiteBox.java +++ b/test/lib/jdk/test/whitebox/WhiteBox.java @@ -140,6 +140,12 @@ public int getConstantPoolCacheLength(Class aClass) { return getConstantPoolCacheLength0(aClass); } + private native Object[] getResolvedReferences0(Class aClass); + public Object[] getResolvedReferences(Class aClass) { + Objects.requireNonNull(aClass); + return getResolvedReferences0(aClass); + } + private native int remapInstructionOperandFromCPCache0(Class aClass, int index); public int remapInstructionOperandFromCPCache(Class aClass, int index) { Objects.requireNonNull(aClass); From e51457885e884891a57c456cbf2c48916e607efd Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:02:21 +0000 Subject: [PATCH 046/261] 8314829: serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java ignores vm flags Backport-of: e0f8d16833c8212a79ea3dda3f4fe31134c41025 --- test/hotspot/jtreg/ProblemList-zgc.txt | 1 + .../serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList-zgc.txt b/test/hotspot/jtreg/ProblemList-zgc.txt index d9863b4690b..9598cc36ae4 100644 --- a/test/hotspot/jtreg/ProblemList-zgc.txt +++ b/test/hotspot/jtreg/ProblemList-zgc.txt @@ -30,6 +30,7 @@ resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8276539 generic-all serviceability/sa/CDSJMapClstats.java 8276539 generic-all serviceability/sa/ClhsdbJhisto.java 8276539 generic-all +serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 8276539 generic-all serviceability/sa/ClhsdbFindPC.java#xcomp-core 8284045 generic-all serviceability/sa/TestJmapCore.java 8268283,8270202 linux-aarch64,linux-x64,macosx-aarch64 diff --git a/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java index 692fc0153e3..2ecb1d9bf41 100644 --- a/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java +++ b/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -77,7 +77,7 @@ public static void main(String[] args) throws Exception { private static void testHProfFileFormat(String vmArgs, long heapSize, String expectedFormat) throws Exception, IOException, InterruptedException, FileNotFoundException { - ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder procBuilder = ProcessTools.createTestJvm( "--add-exports=java.management/sun.management=ALL-UNNAMED", vmArgs, "JMapHProfLargeHeapProc", String.valueOf(heapSize)); procBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); Process largeHeapProc = procBuilder.start(); From f4e7c0c8e01ac998b84c4eedd445f3acd32ac2ad Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:04:17 +0000 Subject: [PATCH 047/261] 8316562: serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java times out after JDK-8314829 Backport-of: 54028e779bb076a5ab1c03baa8ab89587252af4a --- .../sa/jmap-hprof/JMapHProfLargeHeapTest.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java index 2ecb1d9bf41..ef31f325481 100644 --- a/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java +++ b/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java @@ -25,11 +25,11 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; +import java.io.InputStreamReader; import java.io.IOException; import java.io.Reader; import java.nio.CharBuffer; import java.util.Arrays; -import java.util.Scanner; import jdk.test.lib.Asserts; import jdk.test.lib.JDKToolLauncher; @@ -82,15 +82,22 @@ private static void testHProfFileFormat(String vmArgs, long heapSize, procBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); Process largeHeapProc = procBuilder.start(); - try (Scanner largeHeapScanner = new Scanner( - largeHeapProc.getInputStream());) { + try (BufferedReader r = new BufferedReader( + new InputStreamReader(largeHeapProc.getInputStream()))) { String pidstring = null; - if (!largeHeapScanner.hasNext()) { - throw new RuntimeException ("Test failed: could not open largeHeapScanner."); + while ((pidstring = r.readLine()) != null) { + // The output might contain different VM output, skip it while searching PID line. + if (pidstring.matches("PID\\[[0-9].*\\]")) { + System.out.println("Found: " + pidstring); + break; + } else { + System.out.println("Ignoring: " + pidstring); + } } - while ((pidstring = largeHeapScanner.findInLine("PID\\[[0-9].*\\]")) == null) { - Thread.sleep(500); + if (pidstring == null) { + throw new RuntimeException("Not able to find string matching PID."); } + int pid = Integer.parseInt(pidstring.substring(4, pidstring.length() - 1)); System.out.println("Extracted pid: " + pid); From afa729ceeffd9befe7fff985a1b1ff15eff5318a Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:06:04 +0000 Subject: [PATCH 048/261] 8316446: 4 sun/management/jdp tests ignore VM flags Backport-of: 5b311f20dfaed0f34d38e8c5c6b90d97ffc75172 --- test/jdk/sun/management/jdp/DynamicLauncher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/sun/management/jdp/DynamicLauncher.java b/test/jdk/sun/management/jdp/DynamicLauncher.java index 73223f2a178..a36dfdbc7ae 100644 --- a/test/jdk/sun/management/jdp/DynamicLauncher.java +++ b/test/jdk/sun/management/jdp/DynamicLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +67,7 @@ protected void run() throws Exception { protected OutputAnalyzer runVM() throws Exception { String[] options = this.options(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(options); + ProcessBuilder pb = ProcessTools.createTestJvm(options); OutputAnalyzer out = ProcessTools.executeProcess(pb); System.out.println(out.getStdout()); System.err.println(out.getStderr()); From 4846aa25f97a9868d4ae9bc80340f21d066a40e2 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:08:11 +0000 Subject: [PATCH 049/261] 8317228: GC: Make TestXXXHeapSizeFlags use createTestJvm Backport-of: 7ca0ae94159ac0fd2df23ee1a1e8cf626ce31048 --- test/hotspot/jtreg/TEST.ROOT | 3 +- .../gc/arguments/TestG1HeapSizeFlags.java | 5 ++- .../gc/arguments/TestMaxHeapSizeTools.java | 12 +++--- .../arguments/TestParallelHeapSizeFlags.java | 5 ++- .../gc/arguments/TestSerialHeapSizeFlags.java | 4 +- test/jtreg-ext/requires/VMProps.java | 37 +++++++++++++++++-- 6 files changed, 50 insertions(+), 16 deletions(-) diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index a8ccd8f7298..529f0a8bc7a 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -32,7 +32,8 @@ # intermittent: flaky test, known to fail intermittently # randomness: test uses randomness, test cases differ from run to run # cgroups: test uses cgroups -keys=stress headful intermittent randomness cgroups +# flag-sensitive: test is sensitive to certain flags and might fail when flags are passed using -vmoptions and -javaoptions +keys=stress headful intermittent randomness cgroups flag-sensitive groups=TEST.groups TEST.quick-groups diff --git a/test/hotspot/jtreg/gc/arguments/TestG1HeapSizeFlags.java b/test/hotspot/jtreg/gc/arguments/TestG1HeapSizeFlags.java index e5efd2fc483..de6137f7503 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1HeapSizeFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1HeapSizeFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,8 +26,9 @@ /* * @test TestG1HeapSizeFlags * @bug 8006088 - * @requires vm.gc.G1 * @summary Tests argument processing for initial and maximum heap size for the G1 collector + * @key flag-sensitive + * @requires vm.gc.G1 & vm.opt.x.Xmx == null & vm.opt.x.Xms == null & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null * @library /test/lib * @library / * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java b/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java index 70fe6924f83..2480f882f00 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java +++ b/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -23,10 +23,10 @@ package gc.arguments; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.ArrayList; import java.util.Arrays; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.whitebox.WhiteBox; @@ -115,7 +115,7 @@ private static long align_up(long value, long alignment) { } private static void getNewOldSize(String gcflag, long[] values) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(gcflag, + ProcessBuilder pb = GCArguments.createTestJvm(gcflag, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -208,7 +208,7 @@ public static OutputAnalyzer runWhiteBoxTest(String[] vmargs, String classname, finalargs.add(classname); finalargs.addAll(Arrays.asList(arguments)); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(finalargs.toArray(String[]::new)); + ProcessBuilder pb = GCArguments.createTestJvm(finalargs.toArray(String[]::new)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -308,7 +308,7 @@ private static void shouldContainOrNot(OutputAnalyzer output, boolean contains, } private static void expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flags); + ProcessBuilder pb = GCArguments.createTestJvm(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); shouldContainOrNot(output, hasWarning, "Warning"); shouldContainOrNot(output, hasError, "Error"); diff --git a/test/hotspot/jtreg/gc/arguments/TestParallelHeapSizeFlags.java b/test/hotspot/jtreg/gc/arguments/TestParallelHeapSizeFlags.java index 9a95a01cb4e..8e73abb9134 100644 --- a/test/hotspot/jtreg/gc/arguments/TestParallelHeapSizeFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestParallelHeapSizeFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +28,8 @@ * @bug 8006088 * @summary Tests argument processing for initial and maximum heap size for the * parallel collectors. - * @requires vm.gc.Parallel + * @key flag-sensitive + * @requires vm.gc.Parallel & vm.opt.x.Xmx == null & vm.opt.x.Xms == null & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null * @library /test/lib * @library / * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/gc/arguments/TestSerialHeapSizeFlags.java b/test/hotspot/jtreg/gc/arguments/TestSerialHeapSizeFlags.java index 956ab665e72..b46b1ccb268 100644 --- a/test/hotspot/jtreg/gc/arguments/TestSerialHeapSizeFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestSerialHeapSizeFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,8 @@ * @test TestSerialHeapSizeFlags * @bug 8006088 * @summary Tests argument processing for initial and maximum heap size for the Serial collector + * @key flag-sensitive + * @requires vm.gc.Serial & vm.opt.x.Xmx == null & vm.opt.x.Xms == null & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null * @library /test/lib * @library / * @modules java.base/jdk.internal.misc diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index e5b4d561e2b..3be9344ace0 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -47,9 +47,10 @@ import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; import jdk.internal.foreign.CABI; - import jdk.test.whitebox.code.Compiler; import jdk.test.whitebox.cpuinfo.CPUInfo; import jdk.test.whitebox.gc.GC; @@ -83,6 +84,10 @@ public void put(String key, Supplier s) { } map.put(key, value); } + + public void putAll(Map map) { + map.entrySet().forEach(e -> put(e.getKey(), () -> e.getValue())); + } } /** @@ -130,6 +135,7 @@ public Map call() { map.put("jdk.containerized", this::jdkContainerized); map.put("vm.flagless", this::isFlagless); map.put("jdk.foreign.linker", this::jdkForeignLinker); + map.putAll(xOptFlags()); // -Xmx4g -> @requires vm.opt.x.Xmx == "4g" ) vmGC(map); // vm.gc.X = true/false vmGCforCDS(map); // may set vm.gc vmOptFinalFlags(map); @@ -624,9 +630,7 @@ private String isFlagless() { return "" + result; } - List allFlags = new ArrayList(); - Collections.addAll(allFlags, System.getProperty("test.vm.opts", "").trim().split("\\s+")); - Collections.addAll(allFlags, System.getProperty("test.java.opts", "").trim().split("\\s+")); + List allFlags = allFlags().toList(); // check -XX flags var ignoredXXFlags = Set.of( @@ -669,6 +673,31 @@ private String isFlagless() { return "" + result; } + private Stream allFlags() { + return Stream.of((System.getProperty("test.vm.opts", "") + " " + System.getProperty("test.java.opts", "")).trim().split("\\s+")); + } + + /** + * Parses extra options, options that start with -X excluding the + * bare -X option (as it is not considered an extra option). + * Ignores extra options not starting with -X + * + * This could be improved to handle extra options not starting + * with -X as well as "standard" options. + */ + private Map xOptFlags() { + return allFlags() + .filter(s -> s.startsWith("-X") && !s.startsWith("-XX:") && !s.equals("-X")) + .map(s -> s.replaceFirst("-", "")) + .map(flag -> flag.splitWithDelimiters("[:0123456789]", 2)) + .collect(Collectors.toMap(a -> "vm.opt.x." + a[0], + a -> (a.length == 1) + ? "true" // -Xnoclassgc + : (a[1].equals(":") + ? a[2] // ["-XshowSettings", ":", "system"] + : a[1] + a[2]))); // ["-Xmx", "4", "g"] + } + /* * A string indicating the foreign linker that is currently being used. See jdk.internal.foreign.CABI * for valid values. From 5f7b7c5cd17ef822b4c8e07600b008d09ec97bd9 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:10:21 +0000 Subject: [PATCH 050/261] 8317347: Parallel: Make TestInitialTenuringThreshold use createTestJvm Backport-of: 6ee6171e8124ae8ce4f60c2582c2fe2cae6fc3db --- .../jtreg/gc/arguments/TestInitialTenuringThreshold.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java b/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java index 784a69cd9ae..5006dec7128 100644 --- a/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java +++ b/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +26,7 @@ /* * @test TestInitialTenuringThreshold * @bug 8014765 - * @requires vm.gc.Parallel + * @requires vm.gc.Parallel & vm.opt.InitialTenuringThreshold == null & vm.opt.MaxTenuringThreshold == null * @summary Tests argument processing for initial tenuring threshold * @library /test/lib * @library / @@ -41,7 +41,7 @@ public class TestInitialTenuringThreshold { public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJvm( "-XX:+UseParallelGC", "-XX:InitialTenuringThreshold=" + String.valueOf(initial), "-XX:MaxTenuringThreshold=" + String.valueOf(max), @@ -58,8 +58,9 @@ public static void runWithThresholds(int initial, int max, boolean shouldfail) t public static void main(String args[]) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJvm( // some value below the default value of InitialTenuringThreshold of 7 + "-XX:+UseParallelGC", "-XX:MaxTenuringThreshold=1", "-version" ); From 4f6a2e6de62540216c4c2619f95221f2baca17b8 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:12:18 +0000 Subject: [PATCH 051/261] 8317343: GC: Make TestHeapFreeRatio use createTestJvm Backport-of: c64bd3d6715304accd9a1e3266edd9d3d2353273 --- test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java b/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java index 3842c55b6d3..24528c923ed 100644 --- a/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java +++ b/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ * @test TestHeapFreeRatio * @bug 8025661 * @summary Test parsing of -Xminf and -Xmaxf + * @requires vm.opt.x.Xminf == null & vm.opt.x.Xmaxf == null & vm.opt.MinHeapFreeRatio == null & vm.opt.MaxHeapFreeRatio == null * @library /test/lib * @library / * @modules java.base/jdk.internal.misc @@ -47,7 +48,7 @@ enum Validation { } private static void testMinMaxFreeRatio(String min, String max, Validation type) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJvm( "-Xminf" + min, "-Xmaxf" + max, "-version"); From eb6fedc2faf4f65290fbd1e4cc40efef27b70bb4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:14:10 +0000 Subject: [PATCH 052/261] 8317317: G1: Make TestG1RemSetFlags use createTestJvm Backport-of: 5bd10521eb5e51e76b20e955addd45f76abba6f7 --- test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java b/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java index 3f339d60162..be18156df41 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ /* * @test TestG1RemSetFlags - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.UnlockExperimentalVMOptions == null & vm.opt.G1RemSetHowlNumBuckets == null & vm.opt.G1RemSetHowlMaxNumBuckets == null * @summary Verify that the remembered set flags are updated as expected * @modules java.base/jdk.internal.misc * @modules java.management/sun.management @@ -48,7 +48,7 @@ private static void checkG1RemSetFlags(String[] flags, int exitValue) throws Exc flagList.add("-XX:+PrintFlagsFinal"); flagList.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flagList); + ProcessBuilder pb = GCArguments.createTestJvm(flagList); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(exitValue); } From a565d4978fb86361a3493a8eac23e1c0accfc61f Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:16:24 +0000 Subject: [PATCH 053/261] 8317316: G1: Make TestG1PercentageOptions use createTestJvm Backport-of: d8cd60588aef6abcbfedbe3262d9a094c9bbcb8c --- .../jtreg/gc/arguments/TestG1PercentageOptions.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java b/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java index 873f22b874d..abf7926f966 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +26,7 @@ /* * @test TestG1PercentageOptions * @bug 8068942 - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.G1ConfidencePercent == null * @summary Test argument processing of various percentage options * @library /test/lib * @library / @@ -63,8 +63,7 @@ private static final class OptionDescription { }; private static void check(String flag, boolean is_valid) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( - "-XX:+UseG1GC", flag, "-version"); + ProcessBuilder pb = GCArguments.createTestJvm("-XX:+UseG1GC", flag, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (is_valid) { output.shouldHaveExitValue(0); @@ -73,8 +72,7 @@ private static void check(String flag, boolean is_valid) throws Exception { } } - private static - void check(String name, String value, boolean is_valid) throws Exception { + private static void check(String name, String value, boolean is_valid) throws Exception { check("-XX:" + name + "=" + value, is_valid); } From a6c2398ff9ef2f046b21b4026838c5624f2c13d6 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:18:24 +0000 Subject: [PATCH 054/261] 8317218: G1: Make TestG1HeapRegionSize use createTestJvm Backport-of: 75b37e6d7ec285f1a954f9d5b16bf9e6b642f2fc --- test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java b/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java index e9132da1930..ededd10f0c3 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +26,7 @@ /* * @test TestG1HeapRegionSize * @bug 8021879 - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.G1HeapRegionSize == null * @summary Verify that the flag G1HeapRegionSize is updated properly * @modules java.base/jdk.internal.misc * @modules java.management/sun.management @@ -53,7 +53,7 @@ private static void checkG1HeapRegionSize(String[] flags, int expectedValue, int flagList.add("-XX:+PrintFlagsFinal"); flagList.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flagList); + ProcessBuilder pb = GCArguments.createTestJvm(flagList); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(exitValue); From 840724babc6cc594456b5d1b3ae51d4a5187b27d Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:20:27 +0000 Subject: [PATCH 055/261] 8317188: G1: Make TestG1ConcRefinementThreads use createTestJvm Backport-of: a949824e98a8872645f292c9cc9ed2fe1cccadce --- .../jtreg/gc/arguments/TestG1ConcRefinementThreads.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java b/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java index 750dfefd6c6..8a2ec1ab5f6 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +26,7 @@ /* * @test TestG1ConcRefinementThreads * @bug 8047976 - * @requires vm.gc.G1 + * @requires vm.gc.G1 & vm.opt.G1ConcRefinementThreads == null * @summary Tests argument processing for G1ConcRefinementThreads * @library /test/lib * @library / @@ -69,7 +69,7 @@ private static void runG1ConcRefinementThreadsTest(String[] passedOpts, } Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createTestJvm(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); From 2f65dda068970c765ade3ffc2f694bc283d14269 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:22:52 +0000 Subject: [PATCH 056/261] 8316462: sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java ignores VM flags Backport-of: d6679031e0316f9ce0613b7db6bdf8ad46d31501 --- .../monitor/MonitoredVm/MonitorVmStartTerminate.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java b/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java index 3a1c425dfee..d98ab41f4ad 100644 --- a/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java +++ b/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -308,10 +308,9 @@ public void terminate() { private void executeJava() throws Throwable { String className = JavaProcess.class.getName(); - String classPath = System.getProperty("test.classes"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJvm( "-Dtest.timeout.factor=" + System.getProperty("test.timeout.factor", "1.0"), - "-cp", classPath, className, mainArgsIdentifier); + className, mainArgsIdentifier); OutputAnalyzer ob = ProcessTools.executeProcess(pb); System.out.println("Java Process " + getMainArgsIdentifier() + " stderr:" + ob.getStderr()); From e0de68e3208ba65d30083c7e583c727dba0b2522 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:23:08 +0000 Subject: [PATCH 057/261] 8209595: MonitorVmStartTerminate.java timed out Backport-of: a045258ae2eb02daa17a9a9799a666f42daa7e20 --- .../MonitoredVm/MonitorVmStartTerminate.java | 59 +++++++++++++------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java b/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java index d98ab41f4ad..7e129c15e23 100644 --- a/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java +++ b/test/jdk/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java @@ -98,6 +98,7 @@ public static void main(String... args) throws Exception { System.out.println("Waiting for all processes to get started notification"); listener.started.acquire(PROCESS_COUNT); + System.out.println("Terminating all processes"); for (JavaProcess javaProcess : javaProcesses) { javaProcess.terminate(); } @@ -138,7 +139,7 @@ public void disconnected(HostEvent arg0) { } private void releaseStarted(Set ids) { - System.out.println("realeaseStarted(" + ids + ")"); + System.out.println("releaseStarted(" + ids + ")"); for (Integer id : ids) { releaseStarted(id); } @@ -149,11 +150,12 @@ private void releaseStarted(Integer id) { if (hasMainArgs(id, jp.getMainArgsIdentifier())) { // store id for terminated identification jp.setId(id); - System.out.println("RELEASED (id=" + jp.getId() + ", args=" + jp.getMainArgsIdentifier() + ")"); + System.out.println("RELEASED started (id=" + jp.getId() + ", args=" + jp.getMainArgsIdentifier() + ")"); started.release(); return; } } + System.out.println("releaseStarted: not a test pid: " + id); } private void releaseTerminated(Set ids) { @@ -166,23 +168,44 @@ private void releaseTerminated(Set ids) { private void releaseTerminated(Integer id) { for (JavaProcess jp : processes) { if (id.equals(jp.getId())) { - System.out.println("RELEASED (id=" + jp.getId() + ", args=" + jp.getMainArgsIdentifier() + ")"); + System.out.println("RELEASED terminated (id=" + jp.getId() + ", args=" + jp.getMainArgsIdentifier() + ")"); terminated.release(); return; } } } + private static final int ARGS_ATTEMPTS = 3; + private boolean hasMainArgs(Integer id, String args) { + VmIdentifier vmid = null; try { - VmIdentifier vmid = new VmIdentifier("//" + id.intValue()); - MonitoredVm target = host.getMonitoredVm(vmid); - String monitoredArgs = MonitoredVmUtil.mainArgs(target); - if (monitoredArgs != null && monitoredArgs.contains(args)) { - return true; + vmid = new VmIdentifier("//" + id.intValue()); + } catch (URISyntaxException e) { + System.out.println("hasMainArgs(" + id + "): " + e); + return false; + } + // Retry a failing attempt to check arguments for a match, + // as not recognizing a test process will cause timeout and failure. + for (int i = 0; i < ARGS_ATTEMPTS; i++) { + try { + MonitoredVm target = host.getMonitoredVm(vmid); + String monitoredArgs = MonitoredVmUtil.mainArgs(target); + System.out.println("hasMainArgs(" + id + "): has main args: '" + monitoredArgs + "'"); + if (monitoredArgs == null || monitoredArgs.equals("Unknown")) { + System.out.println("hasMainArgs(" + id + "): retry" ); + takeNap(); + continue; + } else if (monitoredArgs.contains(args)) { + return true; + } else { + return false; + } + } catch (MonitorException e) { + // Process probably not running or not ours, e.g. + // sun.jvmstat.monitor.MonitorException: Could not attach to PID + System.out.println("hasMainArgs(" + id + "): " + e); } - } catch (URISyntaxException | MonitorException e) { - // ok. process probably not running } return false; } @@ -247,14 +270,6 @@ private static void waitForRemoval(Path path) { } } - private static void takeNap() { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // ignore - } - } - private final String mainArgsIdentifier; private final ShutdownHook shutdownHook; private volatile Integer id; @@ -322,4 +337,12 @@ public String getMainArgsIdentifier() { return mainArgsIdentifier; } } + + public static void takeNap() { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + // ignore + } + } } From 12915c3a2037337b24011a7abcf27586f17d3771 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:24:48 +0000 Subject: [PATCH 058/261] 8261837: SIGSEGV in ciVirtualCallTypeData::translate_from Backport-of: 1bb250c9e6b65d1a7a2b90eeb7d6e3a936fb8e8e --- .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 16 ++++- .../cpu/aarch64/interp_masm_aarch64.cpp | 12 ++-- .../cpu/riscv/c1_LIRAssembler_riscv.cpp | 13 +++- src/hotspot/cpu/riscv/interp_masm_riscv.cpp | 24 ++++--- src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp | 68 +++++++++++++------ src/hotspot/cpu/x86/interp_masm_x86.cpp | 20 ++++++ src/hotspot/cpu/x86/macroAssembler_x86.hpp | 1 + 7 files changed, 115 insertions(+), 39 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 6c0c67a6e2d..94df2fbffe6 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -2723,7 +2723,10 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { __ verify_oop(obj); if (tmp != obj) { + assert_different_registers(obj, tmp, rscratch1, rscratch2, mdo_addr.base(), mdo_addr.index()); __ mov(tmp, obj); + } else { + assert_different_registers(obj, rscratch1, rscratch2, mdo_addr.base(), mdo_addr.index()); } if (do_null) { __ cbnz(tmp, update); @@ -2780,10 +2783,11 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { __ cbz(rscratch2, none); __ cmp(rscratch2, (u1)TypeEntries::null_seen); __ br(Assembler::EQ, none); - // There is a chance that the checks above (re-reading profiling - // data from memory) fail if another thread has just set the + // There is a chance that the checks above + // fail if another thread has just set the // profiling to this obj's klass __ dmb(Assembler::ISHLD); + __ eor(tmp, tmp, rscratch2); // get back original value before XOR __ ldr(rscratch2, mdo_addr); __ eor(tmp, tmp, rscratch2); __ andr(rscratch1, tmp, TypeEntries::type_klass_mask); @@ -2808,6 +2812,10 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { __ bind(none); // first time here. Set profile type. __ str(tmp, mdo_addr); +#ifdef ASSERT + __ andr(tmp, tmp, TypeEntries::type_mask); + __ verify_klass_ptr(tmp); +#endif } } else { // There's a single possible klass at this profile point @@ -2839,6 +2847,10 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { #endif // first time here. Set profile type. __ str(tmp, mdo_addr); +#ifdef ASSERT + __ andr(tmp, tmp, TypeEntries::type_mask); + __ verify_klass_ptr(tmp); +#endif } else { assert(ciTypeEntries::valid_ciklass(current_klass) != nullptr && ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent"); diff --git a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp index 86a272cd97a..9e69c913a7b 100644 --- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp @@ -1669,7 +1669,7 @@ void InterpreterMacroAssembler::call_VM_base(Register oop_result, } void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) { - assert_different_registers(obj, rscratch1); + assert_different_registers(obj, rscratch1, mdo_addr.base(), mdo_addr.index()); Label update, next, none; verify_oop(obj); @@ -1691,13 +1691,13 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md tbnz(obj, exact_log2(TypeEntries::type_unknown), next); // already unknown. Nothing to do anymore. - ldr(rscratch1, mdo_addr); cbz(rscratch1, none); cmp(rscratch1, (u1)TypeEntries::null_seen); br(Assembler::EQ, none); - // There is a chance that the checks above (re-reading profiling - // data from memory) fail if another thread has just set the + // There is a chance that the checks above + // fail if another thread has just set the // profiling to this obj's klass + eor(obj, obj, rscratch1); // get back original value before XOR ldr(rscratch1, mdo_addr); eor(obj, obj, rscratch1); tst(obj, TypeEntries::type_klass_mask); @@ -1710,6 +1710,10 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md bind(none); // first time here. Set profile type. str(obj, mdo_addr); +#ifdef ASSERT + andr(obj, obj, TypeEntries::type_mask); + verify_klass_ptr(obj); +#endif bind(next); } diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp index c99102f03d6..8e52a677525 100644 --- a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp @@ -1648,10 +1648,11 @@ void LIR_Assembler::check_conflict(ciKlass* exact_klass, intptr_t current_klass, __ beqz(t1, none); __ mv(t0, (u1)TypeEntries::null_seen); __ beq(t0, t1, none); - // There is a chance that the checks above (re-reading profiling - // data from memory) fail if another thread has just set the + // There is a chance that the checks above + // fail if another thread has just set the // profiling to this obj's klass __ membar(MacroAssembler::LoadLoad); + __ xorr(tmp, tmp, t1); // get back original value before XOR __ ld(t1, mdo_addr); __ xorr(tmp, tmp, t1); __ andi(t0, tmp, TypeEntries::type_klass_mask); @@ -1678,6 +1679,10 @@ void LIR_Assembler::check_conflict(ciKlass* exact_klass, intptr_t current_klass, __ bind(none); // first time here. Set profile type. __ sd(tmp, mdo_addr); +#ifdef ASSERT + __ andi(tmp, tmp, TypeEntries::type_mask); + __ verify_klass_ptr(tmp); +#endif } } @@ -1712,6 +1717,10 @@ void LIR_Assembler::check_no_conflict(ciKlass* exact_klass, intptr_t current_kla #endif // first time here. Set profile type. __ sd(tmp, mdo_addr); +#ifdef ASSERT + __ andi(tmp, tmp, TypeEntries::type_mask); + __ verify_klass_ptr(tmp); +#endif } else { assert(ciTypeEntries::valid_ciklass(current_klass) != nullptr && ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent"); diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp index af7a5dc7b0c..b5c834dc1d0 100644 --- a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp +++ b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp @@ -1732,8 +1732,8 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md bind(update); load_klass(obj, obj); - ld(t0, mdo_addr); - xorr(obj, obj, t0); + ld(tmp, mdo_addr); + xorr(obj, obj, tmp); andi(t0, obj, TypeEntries::type_klass_mask); beqz(t0, next); // klass seen before, nothing to // do. The unknown bit may have been @@ -1743,15 +1743,15 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md bnez(t0, next); // already unknown. Nothing to do anymore. - ld(t0, mdo_addr); - beqz(t0, none); - mv(tmp, (u1)TypeEntries::null_seen); - beq(t0, tmp, none); - // There is a chance that the checks above (re-reading profiling - // data from memory) fail if another thread has just set the + beqz(tmp, none); + mv(t0, (u1)TypeEntries::null_seen); + beq(tmp, t0, none); + // There is a chance that the checks above + // fail if another thread has just set the // profiling to this obj's klass - ld(t0, mdo_addr); - xorr(obj, obj, t0); + xorr(obj, obj, tmp); // get back original value before XOR + ld(tmp, mdo_addr); + xorr(obj, obj, tmp); andi(t0, obj, TypeEntries::type_klass_mask); beqz(t0, next); @@ -1762,6 +1762,10 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md bind(none); // first time here. Set profile type. sd(obj, mdo_addr); +#ifdef ASSERT + andi(obj, obj, TypeEntries::type_mask); + verify_klass_ptr(obj); +#endif bind(next); } diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index 430ea51fa36..57da3860324 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -3640,13 +3640,33 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { __ verify_oop(obj); - if (tmp != obj) { - __ mov(tmp, obj); +#ifdef ASSERT + if (obj == tmp) { +#ifdef _LP64 + assert_different_registers(obj, rscratch1, mdo_addr.base(), mdo_addr.index()); +#else + assert_different_registers(obj, mdo_addr.base(), mdo_addr.index()); +#endif + } else { +#ifdef _LP64 + assert_different_registers(obj, tmp, rscratch1, mdo_addr.base(), mdo_addr.index()); +#else + assert_different_registers(obj, tmp, mdo_addr.base(), mdo_addr.index()); +#endif } +#endif if (do_null) { - __ testptr(tmp, tmp); + __ testptr(obj, obj); __ jccb(Assembler::notZero, update); if (!TypeEntries::was_null_seen(current_klass)) { + __ testptr(mdo_addr, TypeEntries::null_seen); +#ifndef ASSERT + __ jccb(Assembler::notZero, next); // already set +#else + __ jcc(Assembler::notZero, next); // already set +#endif + // atomic update to prevent overwriting Klass* with 0 + __ lock(); __ orptr(mdo_addr, TypeEntries::null_seen); } if (do_update) { @@ -3657,7 +3677,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { __ jmp(next); } } else { - __ testptr(tmp, tmp); + __ testptr(obj, obj); __ jcc(Assembler::notZero, update); __ stop("unexpected null obj"); #endif @@ -3669,7 +3689,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { #ifdef ASSERT if (exact_klass != nullptr) { Label ok; - __ load_klass(tmp, tmp, tmp_load_klass); + __ load_klass(tmp, obj, tmp_load_klass); __ push(tmp); __ mov_metadata(tmp, exact_klass->constant_encoding()); __ cmpptr(tmp, Address(rsp, 0)); @@ -3684,9 +3704,11 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { if (exact_klass != nullptr) { __ mov_metadata(tmp, exact_klass->constant_encoding()); } else { - __ load_klass(tmp, tmp, tmp_load_klass); + __ load_klass(tmp, obj, tmp_load_klass); } - +#ifdef _LP64 + __ mov(rscratch1, tmp); // save original value before XOR +#endif __ xorptr(tmp, mdo_addr); __ testptr(tmp, TypeEntries::type_klass_mask); // klass seen before, nothing to do. The unknown bit may have been @@ -3697,23 +3719,23 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { __ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore. if (TypeEntries::is_type_none(current_klass)) { - __ cmpptr(mdo_addr, 0); - __ jccb(Assembler::equal, none); - __ cmpptr(mdo_addr, TypeEntries::null_seen); - __ jccb(Assembler::equal, none); + __ testptr(mdo_addr, TypeEntries::type_mask); + __ jccb(Assembler::zero, none); +#ifdef _LP64 // There is a chance that the checks above (re-reading profiling // data from memory) fail if another thread has just set the // profiling to this obj's klass + __ mov(tmp, rscratch1); // get back original value before XOR __ xorptr(tmp, mdo_addr); __ testptr(tmp, TypeEntries::type_klass_mask); __ jccb(Assembler::zero, next); +#endif } } else { assert(ciTypeEntries::valid_ciklass(current_klass) != nullptr && ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "conflict only"); - __ movptr(tmp, mdo_addr); - __ testptr(tmp, TypeEntries::type_unknown); + __ testptr(mdo_addr, TypeEntries::type_unknown); __ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore. } @@ -3726,6 +3748,10 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { __ bind(none); // first time here. Set profile type. __ movptr(mdo_addr, tmp); +#ifdef ASSERT + __ andptr(tmp, TypeEntries::type_klass_mask); + __ verify_klass_ptr(tmp); +#endif } } else { // There's a single possible klass at this profile point @@ -3740,10 +3766,8 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { { Label ok; __ push(tmp); - __ cmpptr(mdo_addr, 0); - __ jcc(Assembler::equal, ok); - __ cmpptr(mdo_addr, TypeEntries::null_seen); - __ jcc(Assembler::equal, ok); + __ testptr(mdo_addr, TypeEntries::type_mask); + __ jcc(Assembler::zero, ok); // may have been set by another thread __ mov_metadata(tmp, exact_klass->constant_encoding()); __ xorptr(tmp, mdo_addr); @@ -3759,20 +3783,22 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { #endif // first time here. Set profile type. __ movptr(mdo_addr, tmp); +#ifdef ASSERT + __ andptr(tmp, TypeEntries::type_klass_mask); + __ verify_klass_ptr(tmp); +#endif } else { assert(ciTypeEntries::valid_ciklass(current_klass) != nullptr && ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent"); - __ movptr(tmp, mdo_addr); - __ testptr(tmp, TypeEntries::type_unknown); + __ testptr(mdo_addr, TypeEntries::type_unknown); __ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore. __ orptr(mdo_addr, TypeEntries::type_unknown); } } - - __ bind(next); } + __ bind(next); } void LIR_Assembler::emit_delay(LIR_OpDelay*) { diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp index 5acffd6a89f..0f1c808b27b 100644 --- a/src/hotspot/cpu/x86/interp_masm_x86.cpp +++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp @@ -51,15 +51,28 @@ void InterpreterMacroAssembler::jump_to_entry(address entry) { void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) { Label update, next, none; +#ifdef _LP64 + assert_different_registers(obj, rscratch1, mdo_addr.base(), mdo_addr.index()); +#else + assert_different_registers(obj, mdo_addr.base(), mdo_addr.index()); +#endif + interp_verify_oop(obj, atos); testptr(obj, obj); jccb(Assembler::notZero, update); + testptr(mdo_addr, TypeEntries::null_seen); + jccb(Assembler::notZero, next); // null already seen. Nothing to do anymore. + // atomic update to prevent overwriting Klass* with 0 + lock(); orptr(mdo_addr, TypeEntries::null_seen); jmpb(next); bind(update); load_klass(obj, obj, rscratch1); +#ifdef _LP64 + mov(rscratch1, obj); +#endif xorptr(obj, mdo_addr); testptr(obj, TypeEntries::type_klass_mask); @@ -74,12 +87,15 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md jccb(Assembler::equal, none); cmpptr(mdo_addr, TypeEntries::null_seen); jccb(Assembler::equal, none); +#ifdef _LP64 // There is a chance that the checks above (re-reading profiling // data from memory) fail if another thread has just set the // profiling to this obj's klass + mov(obj, rscratch1); xorptr(obj, mdo_addr); testptr(obj, TypeEntries::type_klass_mask); jccb(Assembler::zero, next); +#endif // different than before. Cannot keep accurate profile. orptr(mdo_addr, TypeEntries::type_unknown); @@ -88,6 +104,10 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md bind(none); // first time here. Set profile type. movptr(mdo_addr, obj); +#ifdef ASSERT + andptr(obj, TypeEntries::type_klass_mask); + verify_klass_ptr(obj); +#endif bind(next); } diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index bd5a4c05793..7c9637dfeec 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -893,6 +893,7 @@ class MacroAssembler: public Assembler { void testptr(Register src, int32_t imm32) { LP64_ONLY(testq(src, imm32)) NOT_LP64(testl(src, imm32)); } void testptr(Register src1, Address src2) { LP64_ONLY(testq(src1, src2)) NOT_LP64(testl(src1, src2)); } + void testptr(Address src, int32_t imm32) { LP64_ONLY(testq(src, imm32)) NOT_LP64(testl(src, imm32)); } void testptr(Register src1, Register src2); void xorptr(Register dst, Register src) { LP64_ONLY(xorq(dst, src)) NOT_LP64(xorl(dst, src)); } From e4056b9cee3092f531b451448c3c69f1a15e5ef0 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Dec 2023 11:36:29 +0000 Subject: [PATCH 059/261] 8321409: Console read line with zero out should zero out underlying buffer in JLine (redux) Backport-of: 4ed38f5ad5f822ab948257ed39717ea919fd32ed --- .../jdk/internal/org/jline/JdkConsoleProviderImpl.java | 2 +- .../classes/jdk/internal/org/jline/reader/LineReader.java | 5 +++++ .../jdk/internal/org/jline/reader/impl/LineReaderImpl.java | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java index 5b1b965d55b..f8946763110 100644 --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java @@ -112,7 +112,7 @@ public char[] readPassword(String fmt, Object ... args) { } catch (EndOfFileException eofe) { return null; } finally { - jline.getBuffer().zeroOut(); + jline.zeroOut(); } } diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/LineReader.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/LineReader.java index 03729853ca5..bc719e9b46a 100644 --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/LineReader.java +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/LineReader.java @@ -750,4 +750,9 @@ enum SuggestionType { void setAutosuggestion(SuggestionType type); SuggestionType getAutosuggestion(); + + // JDK specific modification + default void zeroOut() { + throw new UnsupportedOperationException(); + } } diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/LineReaderImpl.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/LineReaderImpl.java index ee8a434e1a2..a41f7d19bf8 100644 --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/LineReaderImpl.java +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/LineReaderImpl.java @@ -6250,4 +6250,10 @@ private void rebind(KeyMap keyMap, String operation, String prevBinding } } + // JDK specific modification + @Override + public void zeroOut() { + buf.zeroOut(); + parsedLine = null; + } } From 636607b6bbd4d705f385d112302028821927806f Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Thu, 21 Dec 2023 13:28:58 +0000 Subject: [PATCH 060/261] 8313816: Accessing jmethodID might lead to spurious crashes Backport-of: cdd1a6e851bcaf4a25d4a405b8ee0b0d5b83a4a9 --- src/hotspot/share/oops/instanceKlass.cpp | 18 ++++ src/hotspot/share/oops/instanceKlass.hpp | 2 + src/hotspot/share/oops/method.cpp | 14 ++++ src/hotspot/share/oops/method.hpp | 1 + src/hotspot/share/prims/whitebox.cpp | 5 ++ .../GetStackTraceAndRetransformTest.java | 82 +++++++++++++++++++ .../libGetStackTraceAndRetransformTest.cpp | 82 +++++++++++++++++++ test/lib/jdk/test/whitebox/WhiteBox.java | 2 + 8 files changed, 206 insertions(+) create mode 100644 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/GetStackTraceAndRetransformTest.java create mode 100644 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/libGetStackTraceAndRetransformTest.cpp diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 94fa9c3e52b..6f0d521b9d4 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -4112,6 +4112,23 @@ bool InstanceKlass::should_clean_previous_versions_and_reset() { return ret; } +// This nulls out jmethodIDs for all methods in 'klass' +// It needs to be called explicitly for all previous versions of a class because these may not be cleaned up +// during class unloading. +// We can not use the jmethodID cache associated with klass directly because the 'previous' versions +// do not have the jmethodID cache filled in. Instead, we need to lookup jmethodID for each method and this +// is expensive - O(n) for one jmethodID lookup. For all contained methods it is O(n^2). +// The reason for expensive jmethodID lookup for each method is that there is no direct link between method and jmethodID. +void InstanceKlass::clear_jmethod_ids(InstanceKlass* klass) { + Array* method_refs = klass->methods(); + for (int k = 0; k < method_refs->length(); k++) { + Method* method = method_refs->at(k); + if (method != nullptr && method->is_obsolete()) { + method->clear_jmethod_id(); + } + } +} + // Purge previous versions before adding new previous versions of the class and // during class unloading. void InstanceKlass::purge_previous_version_list() { @@ -4155,6 +4172,7 @@ void InstanceKlass::purge_previous_version_list() { // Unlink from previous version list. assert(pv_node->class_loader_data() == loader_data, "wrong loader_data"); InstanceKlass* next = pv_node->previous_versions(); + clear_jmethod_ids(pv_node); // jmethodID maintenance for the unloaded class pv_node->link_previous_versions(nullptr); // point next to null last->link_previous_versions(next); // Delete this node directly. Nothing is referring to it and we don't diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index faa432a1dc7..30269602211 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -1085,6 +1085,8 @@ class InstanceKlass: public Klass { bool idnum_can_increment() const { return has_been_redefined(); } inline jmethodID* methods_jmethod_ids_acquire() const; inline void release_set_methods_jmethod_ids(jmethodID* jmeths); + // This nulls out jmethodIDs for all methods in 'klass' + static void clear_jmethod_ids(InstanceKlass* klass); // Lock during initialization public: diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp index 8625d2537cc..c5693b02b05 100644 --- a/src/hotspot/share/oops/method.cpp +++ b/src/hotspot/share/oops/method.cpp @@ -2262,6 +2262,20 @@ void Method::clear_jmethod_ids(ClassLoaderData* loader_data) { loader_data->jmethod_ids()->clear_all_methods(); } +void Method::clear_jmethod_id() { + // Being at a safepoint prevents racing against other class redefinitions + assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); + // The jmethodID is not stored in the Method instance, we need to look it up first + jmethodID methodid = find_jmethod_id_or_null(); + // We need to make sure that jmethodID actually resolves to this method + // - multiple redefined versions may share jmethodID slots and if a method + // has already been rewired to a newer version we could be removing reference + // to a still existing method instance + if (methodid != nullptr && *((Method**)methodid) == this) { + *((Method**)methodid) = nullptr; + } +} + bool Method::has_method_vptr(const void* ptr) { Method m; // This assumes that the vtbl pointer is the first word of a C++ object. diff --git a/src/hotspot/share/oops/method.hpp b/src/hotspot/share/oops/method.hpp index 06f0b8cf7d7..a4f8f3075ef 100644 --- a/src/hotspot/share/oops/method.hpp +++ b/src/hotspot/share/oops/method.hpp @@ -773,6 +773,7 @@ class Method : public Metadata { // Clear methods static void clear_jmethod_ids(ClassLoaderData* loader_data); + void clear_jmethod_id(); static void print_jmethod_ids_count(const ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN; // Get this method's jmethodID -- allocate if it doesn't exist diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index c3cadc4b4a2..f68147fea4f 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -2564,6 +2564,10 @@ WB_ENTRY(void, WB_PreTouchMemory(JNIEnv* env, jobject wb, jlong addr, jlong size } WB_END +WB_ENTRY(void, WB_CleanMetaspaces(JNIEnv* env, jobject target)) + ClassLoaderDataGraph::safepoint_and_clean_metaspaces(); +WB_END + #define CC (char*) static JNINativeMethod methods[] = { @@ -2845,6 +2849,7 @@ static JNINativeMethod methods[] = { {CC"unlockCritical", CC"()V", (void*)&WB_UnlockCritical}, {CC"setVirtualThreadsNotifyJvmtiMode", CC"(Z)Z", (void*)&WB_SetVirtualThreadsNotifyJvmtiMode}, {CC"preTouchMemory", CC"(JJ)V", (void*)&WB_PreTouchMemory}, + {CC"cleanMetaspaces", CC"()V", (void*)&WB_CleanMetaspaces}, }; diff --git a/test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/GetStackTraceAndRetransformTest.java b/test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/GetStackTraceAndRetransformTest.java new file mode 100644 index 00000000000..eb7d30124cb --- /dev/null +++ b/test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/GetStackTraceAndRetransformTest.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2023, Datadog, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8313816 + * @summary Test that a sequence of method retransformation and stacktrace capture while the old method + * version is still on stack does not lead to a crash when that method's jmethodID is used as + * an argument for JVMTI functions. + * @requires vm.jvmti + * @requires vm.flagless + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @modules java.instrument + * java.compiler + * @compile GetStackTraceAndRetransformTest.java + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main RedefineClassHelper + * @run main/othervm/native -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -javaagent:redefineagent.jar -agentlib:GetStackTraceAndRetransformTest GetStackTraceAndRetransformTest + */ + +import jdk.test.whitebox.WhiteBox; + +class Transformable { + static final String newClass = """ + class Transformable { + static final String newClass = ""; + static void redefineAndStacktrace() throws Exception {} + static void stacktrace() throws Exception { + capture(Thread.currentThread()); + } + public static native void capture(Thread thread); + } + """; + static void redefineAndStacktrace() throws Exception { + // This call will cause the class to be retransformed. + // However, this method is still on stack so the subsequent attempt to capture the stacktrace + // will result into this frame being identified by the jmethodID of the previous method version. + RedefineClassHelper.redefineClass(Transformable.class, newClass); + capture(Thread.currentThread()); + } + + static void stacktrace() throws Exception { + } + + public static native void capture(Thread thread); +} + +public class GetStackTraceAndRetransformTest { + public static void main(String args[]) throws Throwable { + initialize(Transformable.class); + + Transformable.redefineAndStacktrace(); + Transformable.stacktrace(); + + WhiteBox.getWhiteBox().cleanMetaspaces(); + check(2); + } + + public static native void initialize(Class target); + public static native void check(int expected); +} diff --git a/test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/libGetStackTraceAndRetransformTest.cpp b/test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/libGetStackTraceAndRetransformTest.cpp new file mode 100644 index 00000000000..3be6dcf824f --- /dev/null +++ b/test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/GetStackTraceAndRetransformTest/libGetStackTraceAndRetransformTest.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2023, Datadog, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include +#include "jvmti.h" +#include "jvmti_common.h" +#include "../get_stack_trace.h" + + +extern "C" { + +static jvmtiEnv *jvmti = NULL; +static jmethodID* ids = NULL; +static int ids_size = 0; + +JNIEXPORT jint JNICALL +Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) { + jint res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1); + if (res != JNI_OK || jvmti == NULL) { + printf("Wrong result of a valid call to GetEnv!\n"); + return JNI_ERR; + } + ids = (jmethodID*)malloc(sizeof(jmethodID) * 10); + return JNI_OK; +} + +JNIEXPORT void JNICALL +Java_GetStackTraceAndRetransformTest_initialize(JNIEnv *env, jclass cls, jclass tgt) { + // we need to force jmethodids to be created for the methods we are going to retransform + env->GetStaticMethodID(tgt, "redefineAndStacktrace", "()V"); + env->GetStaticMethodID(tgt, "stacktrace", "()V"); +} + +JNIEXPORT void JNICALL +Java_Transformable_capture(JNIEnv *env, jclass cls, jthread thread) { + jint count; + const int MAX_NUMBER_OF_FRAMES = 32; + jvmtiFrameInfo frames[MAX_NUMBER_OF_FRAMES]; + + jvmtiError err = jvmti->GetStackTrace(thread, 0, MAX_NUMBER_OF_FRAMES, frames, &count); + check_jvmti_status(env, err, "GetStackTrace failed."); + + ids[ids_size++] = frames[1].method; +} + +JNIEXPORT void JNICALL +Java_GetStackTraceAndRetransformTest_check(JNIEnv *jni, jclass cls, jint expected) { + if (ids_size != expected) { + fprintf(stderr, "Unexpected number methods captured: %d (expected %d)\n", ids_size, expected); + exit(2); + } + for (int i = 0; i < ids_size; i++) { + jclass rslt = NULL; + char* class_name = NULL; + jvmti->GetMethodDeclaringClass(ids[i], &rslt); + if (rslt != NULL) { + jvmti->GetClassSignature(rslt, &class_name, NULL); + } + } +} +} diff --git a/test/lib/jdk/test/whitebox/WhiteBox.java b/test/lib/jdk/test/whitebox/WhiteBox.java index 0cf7d48969b..2810f099763 100644 --- a/test/lib/jdk/test/whitebox/WhiteBox.java +++ b/test/lib/jdk/test/whitebox/WhiteBox.java @@ -493,6 +493,8 @@ public void clearInlineCaches(boolean preserve_static_stubs) { public native long metaspaceCapacityUntilGC(); public native long metaspaceSharedRegionAlignment(); + public native void cleanMetaspaces(); + // Metaspace Arena Tests public native long createMetaspaceTestContext(long commit_limit, long reserve_limit); public native void destroyMetaspaceTestContext(long context); From aaee2d7507742c948c0a45bf2371da8a181c96e9 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Thu, 21 Dec 2023 16:26:46 +0000 Subject: [PATCH 061/261] 8322040: Missing array bounds check in ClassReader.parameter Reviewed-by: sgehwolf Backport-of: 20de541b1304b4dc3a385f8a78f1215da237e4aa --- .../com/sun/tools/javac/jvm/ClassReader.java | 2 +- .../javac/classreader/BadMethodParameter.java | 152 ++++++++++++++++++ 2 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 test/langtools/tools/javac/classreader/BadMethodParameter.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java index 8bb985ddf27..c14743c81af 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java @@ -2791,7 +2791,7 @@ private VarSymbol parameter(int mpIndex, int lvtIndex, Type t, MethodSymbol owne && parameterAccessFlags[mpIndex] != 0) { flags |= parameterAccessFlags[mpIndex]; } - if (parameterNameIndicesMp != null + if (parameterNameIndicesMp != null && mpIndex < parameterNameIndicesMp.length // if name_index is 0, then we might still get a name from the LocalVariableTable && parameterNameIndicesMp[mpIndex] != 0) { argName = optPoolEntry(parameterNameIndicesMp[mpIndex], poolReader::getName, names.empty); diff --git a/test/langtools/tools/javac/classreader/BadMethodParameter.java b/test/langtools/tools/javac/classreader/BadMethodParameter.java new file mode 100644 index 00000000000..0fc9db0d2cd --- /dev/null +++ b/test/langtools/tools/javac/classreader/BadMethodParameter.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2023, Alphabet LLC. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8322040 + * @summary Missing array bounds check in ClassReader.parameter + * @library /tools/lib /tools/javac/lib + * @modules + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * java.base/jdk.internal.classfile + * java.base/jdk.internal.classfile.attribute + * @build toolbox.ToolBox toolbox.JavacTask + * @run main BadMethodParameter + */ + +import jdk.internal.classfile.ClassModel; +import jdk.internal.classfile.ClassTransform; +import jdk.internal.classfile.Classfile; +import jdk.internal.classfile.MethodTransform; +import jdk.internal.classfile.attribute.MethodParametersAttribute; + +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.TestRunner; +import toolbox.ToolBox; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Set; + +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.TypeElement; + +public class BadMethodParameter extends TestRunner { + + protected ToolBox tb; + + BadMethodParameter() { + super(System.err); + tb = new ToolBox(); + } + + public static void main(String... args) throws Exception { + new BadMethodParameter().runTests(); + } + + protected void runTests() throws Exception { + runTests(m -> new Object[] {Paths.get(m.getName())}); + } + + @Test + public void testAnnoOnConstructors(Path base) throws Exception { + Path src = base.resolve("src"); + Path t = src.resolve("T.java"); + Path classes = base.resolve("classes"); + + Files.createDirectories(classes); + + tb.writeJavaFiles( + src, + """ + class T { + public static void f(int x, int y) { + } + } + """); + + new JavacTask(tb).options("-parameters").files(t).outdir(classes).run(); + + transform(classes.resolve("T.class")); + + Path classDir = getClassDir(); + new JavacTask(tb) + .classpath(classes, classDir) + .options("-verbose", "-parameters", "-processor", P.class.getName()) + .classes(P.class.getName()) + .outdir(classes) + .run(Task.Expect.SUCCESS); + } + + public Path getClassDir() { + String classes = ToolBox.testClasses; + if (classes == null) { + return Paths.get("build"); + } else { + return Paths.get(classes); + } + } + + @SupportedAnnotationTypes("*") + public static final class P extends AbstractProcessor { + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latestSupported(); + } + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (processingEnv.getElementUtils().getTypeElement("T") == null) { + throw new AssertionError("could not load T"); + } + return false; + } + } + + private static void transform(Path path) throws IOException { + byte[] bytes = Files.readAllBytes(path); + ClassModel classModel = Classfile.parse(bytes); + MethodTransform methodTransform = + (mb, me) -> { + if (me instanceof MethodParametersAttribute mp) { + // create a MethodParameters attribute with the wrong number of entries + mb.with( + MethodParametersAttribute.of( + mp.parameters().subList(0, mp.parameters().size() - 1))); + } else { + mb.with(me); + } + }; + + ClassTransform classTransform = ClassTransform.transformingMethods(methodTransform); + bytes = classModel.transform(classTransform); + Files.write(path, bytes); + } +} From 7927315fb10a3cc7238834b268a60cec0496e719 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Fri, 22 Dec 2023 01:51:36 +0000 Subject: [PATCH 062/261] 8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform Backport-of: e8768ae08dbee9c3e1ed01934142c03ffad5f349 --- src/hotspot/cpu/riscv/assembler_riscv.hpp | 11 +++++++++++ src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp index 4dfe0cef29e..0988056f15a 100644 --- a/src/hotspot/cpu/riscv/assembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp @@ -2914,6 +2914,17 @@ enum Nf { return uabs(target - branch) < branch_range; } + // Decode the given instruction, checking if it's a 16-bit compressed + // instruction and return the address of the next instruction. + static address locate_next_instruction(address inst) { + // Instruction wider than 16 bits has the two least-significant bits set. + if ((0x3 & *inst) == 0x3) { + return inst + instruction_size; + } else { + return inst + compressed_instruction_size; + } + } + Assembler(CodeBuffer* code) : AbstractAssembler(code), _in_compressible_region(true) {} }; diff --git a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp index 6eeb76acbbf..eb3bf02d66c 100644 --- a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp +++ b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp @@ -232,7 +232,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, CompiledMethod* nm = (cb != nullptr) ? cb->as_compiled_method_or_null() : nullptr; bool is_unsafe_arraycopy = (thread->doing_unsafe_access() && UnsafeCopyMemory::contains_pc(pc)); if ((nm != nullptr && nm->has_unsafe_access()) || is_unsafe_arraycopy) { - address next_pc = pc + NativeCall::instruction_size; + address next_pc = Assembler::locate_next_instruction(pc); if (is_unsafe_arraycopy) { next_pc = UnsafeCopyMemory::page_error_continue_pc(pc); } @@ -273,7 +273,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, thread->thread_state() == _thread_in_native) && sig == SIGBUS && /* info->si_code == BUS_OBJERR && */ thread->doing_unsafe_access()) { - address next_pc = pc + NativeCall::instruction_size; + address next_pc = Assembler::locate_next_instruction(pc); if (UnsafeCopyMemory::contains_pc(pc)) { next_pc = UnsafeCopyMemory::page_error_continue_pc(pc); } From 506c4de9a2b06e3f0e64ba8a0ccf544c2c350bb9 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:05:08 +0000 Subject: [PATCH 063/261] 8313854: Some tests in serviceability area fail on localized Windows platform Backport-of: 49b29845f7c516c379dde7aae8b3073808f2118a --- .../sun/management/jmxremote/startstop/JMXStartStopTest.java | 4 +++- test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java index 283cccd8397..2a611803a18 100644 --- a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java +++ b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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 @@ -393,6 +393,8 @@ private static TestAppRun doTest(String name, String ... args) List pbArgs = new ArrayList<>(Arrays.asList( "-cp", System.getProperty("test.class.path"), + "-Duser.language=en", + "-Duser.country=US", "-XX:+UsePerfData" )); pbArgs.addAll(Arrays.asList(args)); diff --git a/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java b/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java index a6641319096..7ca36d40a6f 100644 --- a/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java +++ b/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java @@ -158,6 +158,9 @@ public static void launchJshell() throws IOException { launcher.addVMArgs(Utils.getFilteredTestJavaOpts("-XX:\\+UseSerialGC")); } ProcessBuilder pb = new ProcessBuilder(launcher.getCommand()); + // Needed so we can properly parse the "Welcome to JShell" output. + pb.command().add("-J-Duser.language=en"); + pb.command().add("-J-Duser.country=US"); jShellProcess = ProcessTools.startProcess("JShell", pb, s -> { // warm-up predicate return s.contains("Welcome to JShell"); From 6b938b8e7711651a4808ecb461d3ec27b685a719 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:08:10 +0000 Subject: [PATCH 064/261] 8310308: IR Framework: check for type and size of vector nodes 8314513: [IR Framework] Some internal IR Framework tests are failing after JDK-8310308 on PPC and Cascade Lake Reviewed-by: mbaesken Backport-of: a02d65efccaab5bb7c2f2aad4a2eb5062f545ef8 --- .../jtreg/compiler/c2/TestMinMaxSubword.java | 8 +- .../irTests/TestAutoVecCountingDownLoop.java | 2 +- .../irTests/TestAutoVectorization2DArray.java | 9 +- .../irTests/TestDisableAutoVectOpcodes.java | 4 +- .../c2/irTests/TestVectorConditionalMove.java | 168 +- .../TestVectorizationMismatchedAccess.java | 28 +- .../irTests/TestVectorizationMultiInvar.java | 6 +- .../c2/irTests/TestVectorizationNotRun.java | 2 +- .../irTests/TestVectorizeTypeConversion.java | 21 +- .../irTests/TestVectorizeURShiftSubword.java | 12 +- .../compiler/lib/ir_framework/IRNode.java | 848 ++++- .../jtreg/compiler/lib/ir_framework/README.md | 20 + .../SuccessOnlyConstraintException.java | 35 + .../driver/irmatching/irmethod/IRMethod.java | 9 +- .../driver/irmatching/irrule/IRRule.java | 5 +- .../parsing/CheckAttributeReader.java | 34 +- .../checkattribute/parsing/RawIRNode.java | 81 +- .../irrule/constraint/Constraint.java | 6 + .../constraint/SuccessConstraintCheck.java | 41 + .../irrule/constraint/raw/RawConstraint.java | 3 +- .../constraint/raw/RawCountsConstraint.java | 49 +- .../constraint/raw/RawFailOnConstraint.java | 11 +- .../phase/CompilePhaseIRRuleBuilder.java | 22 +- .../DefaultPhaseRawConstraintParser.java | 15 +- .../irmatching/parser/IRMethodBuilder.java | 8 +- .../irmatching/parser/TestClassParser.java | 7 +- .../driver/irmatching/parser/VMInfo.java | 107 + .../irmatching/parser/VMInfoParser.java | 77 + .../lib/ir_framework/shared/Comparison.java | 6 + .../lib/ir_framework/test/TestVM.java | 1 + .../lib/ir_framework/test/VMInfoPrinter.java | 70 + .../superword/SumRedAbsNeg_Double.java | 2 +- .../superword/SumRedAbsNeg_Float.java | 6 +- .../loopopts/superword/SumRedSqrt_Double.java | 4 +- .../superword/TestCyclicDependency.java | 4 +- .../superword/TestDependencyOffsets.java | 2762 ++++++++--------- ...tIndependentPacksWithCyclicDependency.java | 2 +- .../superword/TestUnorderedReduction.java | 6 +- ...norderedReductionPartialVectorization.java | 7 +- .../vectorapi/TestMaskedMacroLogicVector.java | 12 +- .../vectorapi/TestReverseByteTransforms.java | 18 +- .../TestReverseByteTransformsSVE.java | 6 +- .../TestVectorCompressExpandBits.java | 8 +- .../vectorapi/VectorFPtoIntCastTest.java | 24 +- .../VectorLogicalOpIdentityTest.java | 82 +- .../vectorapi/VectorReverseBytesTest.java | 6 +- .../reshape/tests/TestVectorCast.java | 289 +- .../reshape/utils/VectorReshapeHelper.java | 9 - .../vectorization/TestAutoVecIntMinMax.java | 16 +- .../TestFloatConversionsVector.java | 4 +- .../vectorization/TestOptionVectorizeIR.java | 32 +- .../vectorization/TestReverseBitsVector.java | 12 +- .../vectorization/TestReverseBytes.java | 8 +- .../TestSubwordReverseBytes.java | 4 +- .../runner/ArrayShiftOpTest.java | 14 +- .../runner/ArrayTypeConvertTest.java | 32 +- .../runner/BasicBooleanOpTest.java | 10 +- .../vectorization/runner/BasicByteOpTest.java | 32 +- .../vectorization/runner/BasicCharOpTest.java | 31 +- .../runner/BasicDoubleOpTest.java | 42 +- .../runner/BasicFloatOpTest.java | 42 +- .../vectorization/runner/BasicIntOpTest.java | 28 +- .../vectorization/runner/BasicLongOpTest.java | 30 +- .../runner/BasicShortOpTest.java | 30 +- .../runner/LoopArrayIndexComputeTest.java | 12 +- .../runner/LoopReductionOpTest.java | 10 +- .../ir_framework/examples/IRExample.java | 128 + .../ir_framework/tests/TestBadFormat.java | 45 +- .../ir_framework/tests/TestIRMatching.java | 25 +- .../tests/TestSafepointWhilePrinting.java | 9 + 70 files changed, 3491 insertions(+), 2067 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java diff --git a/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java b/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java index 129fdc7096a..955aa4058f0 100644 --- a/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java +++ b/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java @@ -61,7 +61,7 @@ public class TestMinMaxSubword { // as Java APIs for Math.min/max do not support integer subword types and superword // should not generate vectorized Min/Max nodes for them. @Test - @IR(failOn = {IRNode.MIN_V}) + @IR(failOn = {IRNode.MIN_VI, IRNode.MIN_VF, IRNode.MIN_VD}) public static void testMinShort() { for (int i = 0; i < LENGTH; i++) { sb[i] = (short) Math.min(sa[i], val); @@ -77,7 +77,7 @@ public static void testMinShort_runner() { } @Test - @IR(failOn = {IRNode.MAX_V}) + @IR(failOn = {IRNode.MAX_VI, IRNode.MAX_VF, IRNode.MAX_VD}) public static void testMaxShort() { for (int i = 0; i < LENGTH; i++) { sb[i] = (short) Math.max(sa[i], val); @@ -92,7 +92,7 @@ public static void testMaxShort_runner() { } @Test - @IR(failOn = {IRNode.MIN_V}) + @IR(failOn = {IRNode.MIN_VI, IRNode.MIN_VF, IRNode.MIN_VD}) public static void testMinByte() { for (int i = 0; i < LENGTH; i++) { bb[i] = (byte) Math.min(ba[i], val); @@ -108,7 +108,7 @@ public static void testMinByte_runner() { } @Test - @IR(failOn = {IRNode.MAX_V}) + @IR(failOn = {IRNode.MAX_VI, IRNode.MAX_VF, IRNode.MAX_VD}) public static void testMaxByte() { for (int i = 0; i < LENGTH; i++) { bb[i] = (byte) Math.max(ba[i], val); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java index 9769f8d43a7..994ec1e9cc0 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java @@ -46,7 +46,7 @@ public static void main(String[] args) { @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testCountingDown(int[] a, int[] b) { for (int i = 2000; i > 0; i--) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java index 31fc5361b6b..c9b2904d91c 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java @@ -48,9 +48,12 @@ public static void main(String[] args) { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, " >0 " }) - @IR(counts = { IRNode.ADD_VD, " >0 " }) - @IR(counts = { IRNode.STORE_VECTOR, " >0 " }) + // Given small iteration count, the unrolling factor is not very predictable, + // hence it is difficult to exactly predict the vector size. But let's at least + // check that there is some vectorization of any size. + @IR(counts = { IRNode.LOAD_VECTOR_D, IRNode.VECTOR_SIZE_ANY, " >0 " }) + @IR(counts = { IRNode.ADD_VD, IRNode.VECTOR_SIZE_ANY, " >0 " }) + @IR(counts = { IRNode.STORE_VECTOR, " >0 " }) private static void testDouble(double[][] a , double[][] b, double[][] c) { for(int i = 0; i < a.length; i++) { for (int j = 0; j < a[0].length; j++) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java b/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java index f493b3fc307..31112a74eb1 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java @@ -53,7 +53,7 @@ public static void main(String[] args) { } @Test - @IR(failOn = {IRNode.VECTOR_CAST_D2X}) + @IR(failOn = {IRNode.VECTOR_CAST_D2I}) private static void testConvD2I() { for(int i = 0; i < SIZE; i++) { inta[i] = (int) (doublea[i]); @@ -61,7 +61,7 @@ private static void testConvD2I() { } @Test - @IR(failOn = {IRNode.VECTOR_CAST_L2X}) + @IR(failOn = {IRNode.VECTOR_CAST_L2F}) private static void testConvL2F() { for(int i = 0; i < SIZE; i++) { floata[i] = (float) (longa[i]); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java index 29f6675bb6e..b052beea86f 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java @@ -206,7 +206,10 @@ private double cmoveDGTforD(double a, double b, double c, double d) { // Compare 2 values, and pick one of them @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFGT(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -215,7 +218,10 @@ private static void testCMoveVFGT(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFGTSwap(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -224,7 +230,10 @@ private static void testCMoveVFGTSwap(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFLT(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -233,7 +242,10 @@ private static void testCMoveVFLT(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFLTSwap(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -242,7 +254,10 @@ private static void testCMoveVFLTSwap(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFEQ(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -251,7 +266,10 @@ private static void testCMoveVFEQ(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDLE(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -260,7 +278,10 @@ private static void testCMoveVDLE(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDLESwap(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -269,7 +290,10 @@ private static void testCMoveVDLESwap(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDGE(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -278,7 +302,10 @@ private static void testCMoveVDGE(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDGESwap(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -287,7 +314,10 @@ private static void testCMoveVDGESwap(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDNE(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -297,7 +327,10 @@ private static void testCMoveVDNE(double[] a, double[] b, double[] c) { // Extensions: compare 2 values, and pick from 2 consts @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -306,7 +339,10 @@ private static void testCMoveFGTforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGEforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -315,7 +351,10 @@ private static void testCMoveFGEforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFLTforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -324,7 +363,10 @@ private static void testCMoveFLTforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFLEforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -333,7 +375,10 @@ private static void testCMoveFLEforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFEQforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -342,7 +387,10 @@ private static void testCMoveFEQforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFNEQforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -351,7 +399,10 @@ private static void testCMoveFNEQforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDGTforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -360,7 +411,10 @@ private static void testCMoveDGTforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDGEforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -369,7 +423,10 @@ private static void testCMoveDGEforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDLTforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -378,7 +435,10 @@ private static void testCMoveDLTforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDLEforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -387,7 +447,10 @@ private static void testCMoveDLEforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDEQforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -396,7 +459,10 @@ private static void testCMoveDEQforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDNEQforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -411,7 +477,7 @@ private static void testCMoveDNEQforDConst(double[] a, double[] b, double[] c) { // compilation does not know that). // So far, vectorization only works for CMoveF/D, with same data-width comparison (F/I for F, D/L for D). @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveIGTforI(int[] a, int[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -422,7 +488,7 @@ private static void testCMoveIGTforI(int[] a, int[] b, int[] c, int[] d, int[] r } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveIGTforL(int[] a, int[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -433,7 +499,11 @@ private static void testCMoveIGTforL(int[] a, int[] b, long[] c, long[] d, long[ } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.VECTOR_MASK_CMP_I, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.VECTOR_BLEND_F, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveIGTforF(int[] a, int[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { @@ -445,7 +515,7 @@ private static void testCMoveIGTforF(int[] a, int[] b, float[] c, float[] d, flo } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveIGTforD(int[] a, int[] b, double[] c, double[] d, double[] r, double[] r2) { for (int i = 0; i < a.length; i++) { double cc = c[i]; @@ -456,7 +526,7 @@ private static void testCMoveIGTforD(int[] a, int[] b, double[] c, double[] d, d } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveLGTforI(long[] a, long[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -467,7 +537,7 @@ private static void testCMoveLGTforI(long[] a, long[] b, int[] c, int[] d, int[] } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveLGTforL(long[] a, long[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -478,7 +548,7 @@ private static void testCMoveLGTforL(long[] a, long[] b, long[] c, long[] d, lon } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveLGTforF(long[] a, long[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { float cc = c[i]; @@ -489,7 +559,11 @@ private static void testCMoveLGTforF(long[] a, long[] b, float[] c, float[] d, f } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.LOAD_VECTOR_D, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.VECTOR_MASK_CMP_L, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.VECTOR_BLEND_D, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"}) // Requires avx2, else L is restricted to 16 byte, and D has 32. That leads to a vector elements mismatch of 2 to 4. private static void testCMoveLGTforD(long[] a, long[] b, double[] c, double[] d, double[] r, double[] r2) { @@ -502,7 +576,7 @@ private static void testCMoveLGTforD(long[] a, long[] b, double[] c, double[] d, } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveFGTforI(float[] a, float[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -513,7 +587,7 @@ private static void testCMoveFGTforI(float[] a, float[] b, int[] c, int[] d, int } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveFGTforL(float[] a, float[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -524,7 +598,10 @@ private static void testCMoveFGTforL(float[] a, float[] b, long[] c, long[] d, l } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforF(float[] a, float[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { @@ -536,7 +613,7 @@ private static void testCMoveFGTforF(float[] a, float[] b, float[] c, float[] d, } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveFGTforD(float[] a, float[] b, double[] c, double[] d, double[] r, double[] r2) { for (int i = 0; i < a.length; i++) { double cc = c[i]; @@ -547,7 +624,7 @@ private static void testCMoveFGTforD(float[] a, float[] b, double[] c, double[] } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveDGTforI(double[] a, double[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -558,7 +635,7 @@ private static void testCMoveDGTforI(double[] a, double[] b, int[] c, int[] d, i } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveDGTforL(double[] a, double[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -569,7 +646,7 @@ private static void testCMoveDGTforL(double[] a, double[] b, long[] c, long[] d, } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveDGTforF(double[] a, double[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { float cc = c[i]; @@ -580,7 +657,10 @@ private static void testCMoveDGTforF(double[] a, double[] b, float[] c, float[] } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDGTforD(double[] a, double[] b, double[] c, double[] d, double[] r, double[] r2) { for (int i = 0; i < a.length; i++) { @@ -593,7 +673,10 @@ private static void testCMoveDGTforD(double[] a, double[] b, double[] c, double[ // Use some constants in the comparison @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforFCmpCon1(float a, float[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < b.length; i++) { @@ -605,7 +688,10 @@ private static void testCMoveFGTforFCmpCon1(float a, float[] b, float[] c, float } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforFCmpCon2(float[] a, float b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { @@ -618,7 +704,7 @@ private static void testCMoveFGTforFCmpCon2(float[] a, float b, float[] c, float // A case that is currently not supported and is not expected to vectorize @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveVDUnsupported() { double[] doublec = new double[SIZE]; int seed = 1001; diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java index 0e9e48160b5..4117bc98c3c 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java @@ -150,7 +150,7 @@ static private void runAndVerify3(Runnable test, int offset) { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong1(byte[] dest, long[] src) { for (int i = 0; i < src.length; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i, src[i]); @@ -163,7 +163,7 @@ public static void testByteLong1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong2(byte[] dest, long[] src) { for (int i = 1; i < src.length; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i - 1), src[i]); @@ -176,7 +176,7 @@ public static void testByteLong2_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong3(byte[] dest, long[] src) { for (int i = 0; i < src.length - 1; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + 1), src[i]); @@ -189,7 +189,7 @@ public static void testByteLong3_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong4(byte[] dest, long[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, 8 * i + baseOffset, src[i]); @@ -203,7 +203,7 @@ public static void testByteLong4_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong5(byte[] dest, long[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + baseOffset), src[i]); @@ -217,7 +217,7 @@ public static void testByteLong5_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteByte1(byte[] dest, byte[] src) { for (int i = 0; i < src.length / 8; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i, UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -231,7 +231,7 @@ public static void testByteByte1_runner() { // It would be legal to vectorize this one but it's not currently @Test - //@IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + //@IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteByte2(byte[] dest, byte[] src) { for (int i = 1; i < src.length / 8; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i - 1), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -244,7 +244,7 @@ public static void testByteByte2_runner() { } @Test - @IR(failOn = { IRNode.LOAD_VECTOR, IRNode.STORE_VECTOR }) + @IR(failOn = { IRNode.LOAD_VECTOR_L, IRNode.STORE_VECTOR }) public static void testByteByte3(byte[] dest, byte[] src) { for (int i = 0; i < src.length / 8 - 1; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + 1), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -257,7 +257,7 @@ public static void testByteByte3_runner() { } @Test - @IR(failOn = { IRNode.LOAD_VECTOR, IRNode.STORE_VECTOR }) + @IR(failOn = { IRNode.LOAD_VECTOR_L, IRNode.STORE_VECTOR }) public static void testByteByte4(byte[] dest, byte[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, 8 * i + baseOffset, UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -271,7 +271,7 @@ public static void testByteByte4_runner() { } @Test - @IR(failOn = { IRNode.LOAD_VECTOR, IRNode.STORE_VECTOR }) + @IR(failOn = { IRNode.LOAD_VECTOR_L, IRNode.STORE_VECTOR }) public static void testByteByte5(byte[] dest, byte[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + baseOffset), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -285,7 +285,7 @@ public static void testByteByte5_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong1(long dest, long[] src) { for (int i = 0; i < src.length; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * i, src[i]); @@ -298,7 +298,7 @@ public static void testOffHeapLong1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong2(long dest, long[] src) { for (int i = 1; i < src.length; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * (i - 1), src[i]); @@ -311,7 +311,7 @@ public static void testOffHeapLong2_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong3(long dest, long[] src) { for (int i = 0; i < src.length - 1; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * (i + 1), src[i]); @@ -324,7 +324,7 @@ public static void testOffHeapLong3_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong4(long dest, long[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * i + baseOffset, src[i]); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java index 6b5c886cf86..72276254ab2 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java @@ -60,7 +60,7 @@ public static void main(String[] args) { static long baseOffset = 0; @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong1(byte[] dest, long[] src) { for (int i = 0; i < src.length; i++) { long j = Objects.checkIndex(i * 8, (long)(src.length * 8)); @@ -75,7 +75,7 @@ public static void testByteLong1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_B, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testLoopNest1(byte[] dest, byte[] src, long start1, long stop1, long start2, long stop2, @@ -106,7 +106,7 @@ public static void testLoopNest1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_I, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testLoopNest2(int[] dest, int[] src, long start1, long stop1, long start2, long stop2, diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java index 26a4550c5c8..5968b7221c7 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java @@ -51,7 +51,7 @@ public static void main(String[] args) { static long[] longArray = new long[size]; @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void test(byte[] dest, long[] src) { for (int i = 0; i < src.length; i++) { if ((i < 0) || (8 > sizeBytes - i)) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java index 9255bf4aeee..67c26ecbddf 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java @@ -55,8 +55,9 @@ public static void main(String[] args) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", - IRNode.VECTOR_CAST_I2X, ">0", + // Mixing types of different sizes has the effect that some vectors are shorter than the type allows. + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_double)", ">0", + IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE + "min(max_int, max_double)", ">0", IRNode.STORE_VECTOR, ">0"}, // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. @@ -68,9 +69,11 @@ private static void testConvI2D(double[] d, int[] a) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", - IRNode.VECTOR_CAST_I2X, ">0", - IRNode.VECTOR_CAST_L2X, ">0", + // Mixing types of different sizes has the effect that some vectors are shorter than the type allows. + @IR(counts = {IRNode.LOAD_VECTOR_L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", + IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", + IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", + IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", IRNode.STORE_VECTOR, ">0"}) private static void testConvI2L(int[] d1, int d2[], long[] a1, long[] a2) { for(int i = 0; i < d1.length; i++) { @@ -80,9 +83,11 @@ private static void testConvI2L(int[] d1, int d2[], long[] a1, long[] a2) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", - IRNode.VECTOR_CAST_D2X, ">0", - IRNode.VECTOR_CAST_F2X, ">0", + // Mixing types of different sizes has the effect that some vectors are shorter than the type allows. + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", + IRNode.LOAD_VECTOR_D, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", + IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", + IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", IRNode.STORE_VECTOR, ">0"}) private static void testConvF2D(double[] d1, double[] d2, float[] a1, float[] a2) { for(int i = 0; i < d1.length; i++) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java index 187e05855ff..ebe3fe63ccf 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java @@ -70,7 +70,7 @@ public static void main(String[] args) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) public void testByte0() { for(int i = 0; i < NUM; i++) { byteb[i] = (byte) (bytea[i] >>> 3); @@ -78,7 +78,7 @@ public void testByte0() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) public void testByte1() { for(int i = 0; i < NUM; i++) { byteb[i] = (byte) (bytea[i] >>> 24); @@ -86,7 +86,7 @@ public void testByte1() { } @Test - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.RSHIFT_VB, IRNode.STORE_VECTOR}) + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.RSHIFT_VB, IRNode.STORE_VECTOR}) public void testByte2() { for(int i = 0; i < NUM; i++) { byteb[i] = (byte) (bytea[i] >>> 25); @@ -94,7 +94,7 @@ public void testByte2() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_S, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) public void testShort0() { for(int i = 0; i < NUM; i++) { shortb[i] = (short) (shorta[i] >>> 10); @@ -102,7 +102,7 @@ public void testShort0() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_S, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) public void testShort1() { for(int i = 0; i < NUM; i++) { shortb[i] = (short) (shorta[i] >>> 16); @@ -110,7 +110,7 @@ public void testShort1() { } @Test - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.RSHIFT_VS, IRNode.STORE_VECTOR}) + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.RSHIFT_VS, IRNode.STORE_VECTOR}) public void testShort2() { for(int i = 0; i < NUM; i++) { shortb[i] = (short) (shorta[i] >>> 17); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index f6b7b1f9162..a555249637b 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -24,6 +24,7 @@ package compiler.lib.ir_framework; import compiler.lib.ir_framework.driver.irmatching.mapping.*; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.CheckedTestFrameworkException; import compiler.lib.ir_framework.shared.TestFormat; import compiler.lib.ir_framework.shared.TestFormatException; @@ -69,6 +70,17 @@ * Using this IR node expects another user provided string in the constraint list of * {@link IR#failOn()} and {@link IR#counts()}. They cannot be used as normal IR nodes. * Trying to do so will result in a format violation error. + *
  • Vector IR nodes: The IR node placeholder string contains an additional {@link #VECTOR_PREFIX}. + * Using this IR node, one can check for the type and size of a vector. The type must + * be directly specified in {@link #vectorNode}. The size can be specified directly with + * an additional argument using {@link #VECTOR_SIZE}, followed by a size tag or a comma + * separated list of sizes. If the size argument is not given, then a default size of + * {@link #VECTOR_SIZE_MAX} is taken, which is the number of elements that can fit in a + * vector of the specified type (depends on the VM flag MaxVectorSize and CPU features). + * However, when using {@link IR#failOn} or {@link IR#counts()} with comparison {@code <}, + * or {@code <=} or {@code =0}, the default size is {@link #VECTOR_SIZE_ANY}, allowing any + * size. The motivation for these default values is that in most cases one wants to have + * vectorization with maximal vector width, or no vectorization of any vector width. * */ public class IRNode { @@ -80,6 +92,11 @@ public class IRNode { * Prefix for composite IR nodes. */ private static final String COMPOSITE_PREFIX = PREFIX + "C#"; + /** + * Prefix for vector IR nodes. + */ + private static final String VECTOR_PREFIX = PREFIX + "V#"; + private static final String POSTFIX = "#_"; private static final String START = "(\\d+(\\s){2}("; @@ -90,20 +107,44 @@ public class IRNode { public static final String IS_REPLACED = "#IS_REPLACED#"; // Is replaced by an additional user-defined string. + public static final String VECTOR_SIZE = "_@"; + public static final String VECTOR_SIZE_TAG_ANY = "any"; + public static final String VECTOR_SIZE_TAG_MAX = "max_for_type"; + public static final String VECTOR_SIZE_ANY = VECTOR_SIZE + VECTOR_SIZE_TAG_ANY; // default for counts "=0" and failOn + public static final String VECTOR_SIZE_MAX = VECTOR_SIZE + VECTOR_SIZE_TAG_MAX; // default in counts + public static final String VECTOR_SIZE_2 = VECTOR_SIZE + "2"; + public static final String VECTOR_SIZE_4 = VECTOR_SIZE + "4"; + public static final String VECTOR_SIZE_8 = VECTOR_SIZE + "8"; + public static final String VECTOR_SIZE_16 = VECTOR_SIZE + "16"; + public static final String VECTOR_SIZE_32 = VECTOR_SIZE + "32"; + public static final String VECTOR_SIZE_64 = VECTOR_SIZE + "64"; + + private static final String TYPE_BYTE = "byte"; + private static final String TYPE_CHAR = "char"; + private static final String TYPE_SHORT = "short"; + private static final String TYPE_INT = "int"; + private static final String TYPE_LONG = "long"; + private static final String TYPE_FLOAT = "float"; + private static final String TYPE_DOUBLE = "double"; /** * IR placeholder string to regex-for-compile-phase map. */ private static final Map IR_NODE_MAPPINGS = new HashMap<>(); + /** + * Map every vectorNode to a type string. + */ + private static final Map VECTOR_NODE_TYPE = new HashMap<>(); + /* * Start of IR placeholder string definitions followed by a static block defining the regex-for-compile-phase mapping. * An IR node placeholder string must start with PREFIX for normal IR nodes or COMPOSITE_PREFIX for composite IR - * nodes (see class description above). + * nodes, or VECTOR_PREFIX for vector nodes (see class description above). * * An IR node definition looks like this: * - * public static final String IR_NODE = [PREFIX|COMPOSITE_PREFIX] + "IR_NODE" + POSTFIX; + * public static final String IR_NODE = [PREFIX|COMPOSITE_PREFIX|VECTOR_PREFIX] + "IR_NODE" + POSTFIX; * static { * // Define IR_NODE to regex-for-compile-phase mapping. Create a new IRNodeMapEntry object and add it to * // IR_NODE_MAPPINGS. This can be done by using the helper methods defined after all IR node placeholder string @@ -131,9 +172,36 @@ public class IRNode { beforeMatchingNameRegex(ABS_L, "AbsL"); } - public static final String ABS_V = PREFIX + "ABS_V" + POSTFIX; + public static final String ABS_VB = VECTOR_PREFIX + "ABS_VB" + POSTFIX; + static { + vectorNode(ABS_VB, "AbsVB", TYPE_BYTE); + } + + // ABS_VC / AbsVC does not exist (char is 2 byte unsigned) + + public static final String ABS_VS = VECTOR_PREFIX + "ABS_VS" + POSTFIX; + static { + vectorNode(ABS_VS, "AbsVS", TYPE_SHORT); + } + + public static final String ABS_VI = VECTOR_PREFIX + "ABS_VI" + POSTFIX; + static { + vectorNode(ABS_VI, "AbsVI", TYPE_INT); + } + + public static final String ABS_VL = VECTOR_PREFIX + "ABS_VL" + POSTFIX; + static { + vectorNode(ABS_VL, "AbsVL", TYPE_LONG); + } + + public static final String ABS_VF = VECTOR_PREFIX + "ABS_VF" + POSTFIX; + static { + vectorNode(ABS_VF, "AbsVF", TYPE_FLOAT); + } + + public static final String ABS_VD = VECTOR_PREFIX + "ABS_VD" + POSTFIX; static { - beforeMatchingNameRegex(ABS_V, "AbsV(B|S|I|L|F|D)"); + vectorNode(ABS_VD, "AbsVD", TYPE_DOUBLE); } public static final String ADD = PREFIX + "ADD" + POSTFIX; @@ -151,24 +219,34 @@ public class IRNode { beforeMatchingNameRegex(ADD_L, "AddL"); } - public static final String ADD_V = PREFIX + "ADD_V" + POSTFIX; + public static final String ADD_VD = VECTOR_PREFIX + "ADD_VD" + POSTFIX; + static { + vectorNode(ADD_VD, "AddVD", TYPE_DOUBLE); + } + + public static final String ADD_VI = VECTOR_PREFIX + "ADD_VI" + POSTFIX; static { - beforeMatchingNameRegex(ADD_V, "AddV(B|S|I|L|F|D)"); + vectorNode(ADD_VI, "AddVI", TYPE_INT); } - public static final String ADD_VD = PREFIX + "ADD_VD" + POSTFIX; + public static final String ADD_VF = VECTOR_PREFIX + "ADD_VF" + POSTFIX; static { - beforeMatchingNameRegex(ADD_VD, "AddVD"); + vectorNode(ADD_VF, "AddVF", TYPE_FLOAT); } - public static final String ADD_VI = PREFIX + "ADD_VI" + POSTFIX; + public static final String ADD_VB = VECTOR_PREFIX + "ADD_VB" + POSTFIX; static { - beforeMatchingNameRegex(ADD_VI, "AddVI"); + vectorNode(ADD_VB, "AddVB", TYPE_BYTE); } - public static final String ADD_VF = PREFIX + "ADD_VF" + POSTFIX; + public static final String ADD_VS = VECTOR_PREFIX + "ADD_VS" + POSTFIX; static { - beforeMatchingNameRegex(ADD_VF, "AddVF"); + vectorNode(ADD_VS, "AddVS", TYPE_SHORT); + } + + public static final String ADD_VL = VECTOR_PREFIX + "ADD_VL" + POSTFIX; + static { + vectorNode(ADD_VL, "AddVL", TYPE_LONG); } public static final String ADD_REDUCTION_V = PREFIX + "ADD_REDUCTION_V" + POSTFIX; @@ -235,9 +313,29 @@ public class IRNode { beforeMatchingNameRegex(AND_L, "AndL"); } - public static final String AND_V = PREFIX + "AND_V" + POSTFIX; + public static final String AND_VB = VECTOR_PREFIX + "AND_VB" + POSTFIX; + static { + vectorNode(AND_VB, "AndV", TYPE_BYTE); + } + + public static final String AND_VC = VECTOR_PREFIX + "AND_VC" + POSTFIX; + static { + vectorNode(AND_VC, "AndV", TYPE_CHAR); + } + + public static final String AND_VS = VECTOR_PREFIX + "AND_VS" + POSTFIX; + static { + vectorNode(AND_VS, "AndV", TYPE_SHORT); + } + + public static final String AND_VI = VECTOR_PREFIX + "AND_VI" + POSTFIX; + static { + vectorNode(AND_VI, "AndV", TYPE_INT); + } + + public static final String AND_VL = VECTOR_PREFIX + "AND_VL" + POSTFIX; static { - beforeMatchingNameRegex(AND_V, "AndV"); + vectorNode(AND_VL, "AndV", TYPE_LONG); } public static final String AND_V_MASK = PREFIX + "AND_V_MASK" + POSTFIX; @@ -386,9 +484,14 @@ public class IRNode { beforeMatchingNameRegex(DIV_L, "DivL"); } - public static final String DIV_V = PREFIX + "DIV_V" + POSTFIX; + public static final String DIV_VF = VECTOR_PREFIX + "DIV_VF" + POSTFIX; static { - beforeMatchingNameRegex(DIV_V, "DivV(F|D)"); + vectorNode(DIV_VF, "DivVF", TYPE_FLOAT); + } + + public static final String DIV_VD = VECTOR_PREFIX + "DIV_VD" + POSTFIX; + static { + vectorNode(DIV_VD, "DivVD", TYPE_DOUBLE); } public static final String DYNAMIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "DYNAMIC_CALL_OF_METHOD" + POSTFIX; @@ -418,9 +521,14 @@ public class IRNode { optoOnly(FIELD_ACCESS, regex); } - public static final String FMA_V = PREFIX + "FMA_V" + POSTFIX; + public static final String FMA_VF = VECTOR_PREFIX + "FMA_VF" + POSTFIX; + static { + vectorNode(FMA_VF, "FmaVF", TYPE_FLOAT); + } + + public static final String FMA_VD = VECTOR_PREFIX + "FMA_VD" + POSTFIX; static { - beforeMatchingNameRegex(FMA_V, "FmaV(F|D)"); + vectorNode(FMA_VD, "FmaVD", TYPE_DOUBLE); } public static final String IF = PREFIX + "IF" + POSTFIX; @@ -582,9 +690,39 @@ public class IRNode { loadOfNodes(LOAD_US_OF_CLASS, "LoadUS"); } - public static final String LOAD_VECTOR = PREFIX + "LOAD_VECTOR" + POSTFIX; + public static final String LOAD_VECTOR_B = VECTOR_PREFIX + "LOAD_VECTOR_B" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_B, "LoadVector", TYPE_BYTE); + } + + public static final String LOAD_VECTOR_C = VECTOR_PREFIX + "LOAD_VECTOR_C" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_C, "LoadVector", TYPE_CHAR); + } + + public static final String LOAD_VECTOR_S = VECTOR_PREFIX + "LOAD_VECTOR_S" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_S, "LoadVector", TYPE_SHORT); + } + + public static final String LOAD_VECTOR_I = VECTOR_PREFIX + "LOAD_VECTOR_I" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_I, "LoadVector", TYPE_INT); + } + + public static final String LOAD_VECTOR_L = VECTOR_PREFIX + "LOAD_VECTOR_L" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_L, "LoadVector", TYPE_LONG); + } + + public static final String LOAD_VECTOR_F = VECTOR_PREFIX + "LOAD_VECTOR_F" + POSTFIX; static { - beforeMatchingNameRegex(LOAD_VECTOR, "LoadVector"); + vectorNode(LOAD_VECTOR_F, "LoadVector", TYPE_FLOAT); + } + + public static final String LOAD_VECTOR_D = VECTOR_PREFIX + "LOAD_VECTOR_D" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_D, "LoadVector", TYPE_DOUBLE); } public static final String LOAD_VECTOR_GATHER = PREFIX + "LOAD_VECTOR_GATHER" + POSTFIX; @@ -624,9 +762,29 @@ public class IRNode { beforeMatchingNameRegex(LSHIFT_L, "LShiftL"); } - public static final String LSHIFT_V = PREFIX + "LSHIFT_V" + POSTFIX; + public static final String LSHIFT_VB = VECTOR_PREFIX + "LSHIFT_VB" + POSTFIX; + static { + vectorNode(LSHIFT_VB, "LShiftVB", TYPE_BYTE); + } + + public static final String LSHIFT_VS = VECTOR_PREFIX + "LSHIFT_VS" + POSTFIX; + static { + vectorNode(LSHIFT_VS, "LShiftVS", TYPE_SHORT); + } + + public static final String LSHIFT_VC = VECTOR_PREFIX + "LSHIFT_VC" + POSTFIX; static { - beforeMatchingNameRegex(LSHIFT_V, "LShiftV(B|S|I|L)"); + vectorNode(LSHIFT_VC, "LShiftVS", TYPE_CHAR); // using short op with char type + } + + public static final String LSHIFT_VI = VECTOR_PREFIX + "LSHIFT_VI" + POSTFIX; + static { + vectorNode(LSHIFT_VI, "LShiftVI", TYPE_INT); + } + + public static final String LSHIFT_VL = VECTOR_PREFIX + "LSHIFT_VL" + POSTFIX; + static { + vectorNode(LSHIFT_VL, "LShiftVL", TYPE_LONG); } public static final String MACRO_LOGIC_V = PREFIX + "MACRO_LOGIC_V" + POSTFIX; @@ -669,9 +827,19 @@ public class IRNode { beforeMatchingNameRegex(MAX_L, "MaxL"); } - public static final String MAX_V = PREFIX + "MAX_V" + POSTFIX; + public static final String MAX_VI = VECTOR_PREFIX + "MAX_VI" + POSTFIX; static { - beforeMatchingNameRegex(MAX_V, "MaxV"); + vectorNode(MAX_VI, "MaxV", TYPE_INT); + } + + public static final String MAX_VF = VECTOR_PREFIX + "MAX_VF" + POSTFIX; + static { + vectorNode(MAX_VF, "MaxV", TYPE_FLOAT); + } + + public static final String MAX_VD = VECTOR_PREFIX + "MAX_VD" + POSTFIX; + static { + vectorNode(MAX_VD, "MaxV", TYPE_DOUBLE); } public static final String MEMBAR = PREFIX + "MEMBAR" + POSTFIX; @@ -719,9 +887,19 @@ public class IRNode { beforeMatchingNameRegex(MIN_L, "MinL"); } - public static final String MIN_V = PREFIX + "MIN_V" + POSTFIX; + public static final String MIN_VI = VECTOR_PREFIX + "MIN_VI" + POSTFIX; + static { + vectorNode(MIN_VI, "MinV", TYPE_INT); + } + + public static final String MIN_VF = VECTOR_PREFIX + "MIN_VF" + POSTFIX; static { - beforeMatchingNameRegex(MIN_V, "MinV"); + vectorNode(MIN_VF, "MinV", TYPE_FLOAT); + } + + public static final String MIN_VD = VECTOR_PREFIX + "MIN_VD" + POSTFIX; + static { + vectorNode(MIN_VD, "MinV", TYPE_DOUBLE); } public static final String MUL = PREFIX + "MUL" + POSTFIX; @@ -749,29 +927,34 @@ public class IRNode { beforeMatchingNameRegex(MUL_L, "MulL"); } - public static final String MUL_V = PREFIX + "MUL_V" + POSTFIX; + public static final String MUL_VL = VECTOR_PREFIX + "MUL_VL" + POSTFIX; + static { + vectorNode(MUL_VL, "MulVL", TYPE_LONG); + } + + public static final String MUL_VI = VECTOR_PREFIX + "MUL_VI" + POSTFIX; static { - beforeMatchingNameRegex(MUL_V, "MulV(B|S|I|L|F|D)"); + vectorNode(MUL_VI, "MulVI", TYPE_INT); } - public static final String MUL_VL = PREFIX + "MUL_VL" + POSTFIX; + public static final String MUL_VF = VECTOR_PREFIX + "MUL_VF" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VL, "MulVL"); + vectorNode(MUL_VF, "MulVF", TYPE_FLOAT); } - public static final String MUL_VI = PREFIX + "MUL_VI" + POSTFIX; + public static final String MUL_VD = VECTOR_PREFIX + "MUL_VD" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VI, "MulVI"); + vectorNode(MUL_VD, "MulVD", TYPE_DOUBLE); } - public static final String MUL_VF = PREFIX + "MUL_VF" + POSTFIX; + public static final String MUL_VB = VECTOR_PREFIX + "MUL_VB" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VF, "MulVF"); + vectorNode(MUL_VB, "MulVB", TYPE_BYTE); } - public static final String MUL_VD = PREFIX + "MUL_VD" + POSTFIX; + public static final String MUL_VS = VECTOR_PREFIX + "MUL_VS" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VD, "MulVD"); + vectorNode(MUL_VS, "MulVS", TYPE_SHORT); } public static final String MUL_REDUCTION_VD = PREFIX + "MUL_REDUCTION_VD" + POSTFIX; @@ -804,9 +987,14 @@ public class IRNode { superWordNodes(MAX_REDUCTION_V, "MaxReductionV"); } - public static final String NEG_V = PREFIX + "NEG_V" + POSTFIX; + public static final String NEG_VF = VECTOR_PREFIX + "NEG_VF" + POSTFIX; static { - beforeMatchingNameRegex(NEG_V, "NegV(F|D)"); + vectorNode(NEG_VF, "NegVF", TYPE_FLOAT); + } + + public static final String NEG_VD = VECTOR_PREFIX + "NEG_VD" + POSTFIX; + static { + vectorNode(NEG_VD, "NegVD", TYPE_DOUBLE); } public static final String NULL_ASSERT_TRAP = PREFIX + "NULL_ASSERT_TRAP" + POSTFIX; @@ -819,9 +1007,24 @@ public class IRNode { trapNodes(NULL_CHECK_TRAP,"null_check"); } - public static final String OR_V = PREFIX + "OR_V" + POSTFIX; + public static final String OR_VB = VECTOR_PREFIX + "OR_VB" + POSTFIX; + static { + vectorNode(OR_VB, "OrV", TYPE_BYTE); + } + + public static final String OR_VS = VECTOR_PREFIX + "OR_VS" + POSTFIX; + static { + vectorNode(OR_VS, "OrV", TYPE_SHORT); + } + + public static final String OR_VI = VECTOR_PREFIX + "OR_VI" + POSTFIX; static { - beforeMatchingNameRegex(OR_V, "OrV"); + vectorNode(OR_VI, "OrV", TYPE_INT); + } + + public static final String OR_VL = VECTOR_PREFIX + "OR_VL" + POSTFIX; + static { + vectorNode(OR_VL, "OrV", TYPE_LONG); } public static final String OR_V_MASK = PREFIX + "OR_V_MASK" + POSTFIX; @@ -850,24 +1053,24 @@ public class IRNode { beforeMatchingNameRegex(POPCOUNT_L, "PopCountL"); } - public static final String POPCOUNT_VI = PREFIX + "POPCOUNT_VI" + POSTFIX; + public static final String POPCOUNT_VI = VECTOR_PREFIX + "POPCOUNT_VI" + POSTFIX; static { - superWordNodes(POPCOUNT_VI, "PopCountVI"); + vectorNode(POPCOUNT_VI, "PopCountVI", TYPE_INT); } - public static final String POPCOUNT_VL = PREFIX + "POPCOUNT_VL" + POSTFIX; + public static final String POPCOUNT_VL = VECTOR_PREFIX + "POPCOUNT_VL" + POSTFIX; static { - superWordNodes(POPCOUNT_VL, "PopCountVL"); + vectorNode(POPCOUNT_VL, "PopCountVL", TYPE_LONG); } - public static final String COUNTTRAILINGZEROS_VL = PREFIX + "COUNTTRAILINGZEROS_VL" + POSTFIX; + public static final String COUNTTRAILINGZEROS_VL = VECTOR_PREFIX + "COUNTTRAILINGZEROS_VL" + POSTFIX; static { - superWordNodes(COUNTTRAILINGZEROS_VL, "CountTrailingZerosV"); + vectorNode(COUNTTRAILINGZEROS_VL, "CountTrailingZerosV", TYPE_LONG); } - public static final String COUNTLEADINGZEROS_VL = PREFIX + "COUNTLEADINGZEROS_VL" + POSTFIX; + public static final String COUNTLEADINGZEROS_VL = VECTOR_PREFIX + "COUNTLEADINGZEROS_VL" + POSTFIX; static { - superWordNodes(COUNTLEADINGZEROS_VL, "CountLeadingZerosV"); + vectorNode(COUNTLEADINGZEROS_VL, "CountLeadingZerosV", TYPE_LONG); } public static final String POPULATE_INDEX = PREFIX + "POPULATE_INDEX" + POSTFIX; @@ -936,9 +1139,24 @@ public class IRNode { CompilePhase.BEFORE_MATCHING)); } - public static final String REVERSE_BYTES_V = PREFIX + "REVERSE_BYTES_V" + POSTFIX; + public static final String REVERSE_BYTES_VB = VECTOR_PREFIX + "REVERSE_BYTES_VB" + POSTFIX; + static { + vectorNode(REVERSE_BYTES_VB, "ReverseBytesV", TYPE_BYTE); + } + + public static final String REVERSE_BYTES_VS = VECTOR_PREFIX + "REVERSE_BYTES_VS" + POSTFIX; + static { + vectorNode(REVERSE_BYTES_VS, "ReverseBytesV", TYPE_SHORT); + } + + public static final String REVERSE_BYTES_VI = VECTOR_PREFIX + "REVERSE_BYTES_VI" + POSTFIX; + static { + vectorNode(REVERSE_BYTES_VI, "ReverseBytesV", TYPE_INT); + } + + public static final String REVERSE_BYTES_VL = VECTOR_PREFIX + "REVERSE_BYTES_VL" + POSTFIX; static { - beforeMatchingNameRegex(REVERSE_BYTES_V, "ReverseBytesV"); + vectorNode(REVERSE_BYTES_VL, "ReverseBytesV", TYPE_LONG); } public static final String REVERSE_I = PREFIX + "REVERSE_I" + POSTFIX; @@ -951,19 +1169,24 @@ public class IRNode { beforeMatchingNameRegex(REVERSE_L, "ReverseL"); } - public static final String REVERSE_V = PREFIX + "REVERSE_V" + POSTFIX; + public static final String REVERSE_VI = VECTOR_PREFIX + "REVERSE_VI" + POSTFIX; + static { + vectorNode(REVERSE_VI, "ReverseV", TYPE_INT); + } + + public static final String REVERSE_VL = VECTOR_PREFIX + "REVERSE_VL" + POSTFIX; static { - beforeMatchingNameRegex(REVERSE_V, "ReverseV"); + vectorNode(REVERSE_VL, "ReverseV", TYPE_LONG); } - public static final String ROUND_VD = PREFIX + "ROUND_VD" + POSTFIX; + public static final String ROUND_VD = VECTOR_PREFIX + "ROUND_VD" + POSTFIX; static { - beforeMatchingNameRegex(ROUND_VD, "RoundVD"); + vectorNode(ROUND_VD, "RoundVD", TYPE_LONG); } - public static final String ROUND_VF = PREFIX + "ROUND_VF" + POSTFIX; + public static final String ROUND_VF = VECTOR_PREFIX + "ROUND_VF" + POSTFIX; static { - beforeMatchingNameRegex(ROUND_VF, "RoundVF"); + vectorNode(ROUND_VF, "RoundVF", TYPE_INT); } public static final String ROTATE_LEFT = PREFIX + "ROTATE_LEFT" + POSTFIX; @@ -986,9 +1209,9 @@ public class IRNode { beforeMatchingNameRegex(ROTATE_RIGHT_V, "RotateRightV"); } - public static final String ROUND_DOUBLE_MODE_V = PREFIX + "ROUND_DOUBLE_MODE_V" + POSTFIX; + public static final String ROUND_DOUBLE_MODE_V = VECTOR_PREFIX + "ROUND_DOUBLE_MODE_V" + POSTFIX; static { - beforeMatchingNameRegex(ROUND_DOUBLE_MODE_V, "RoundDoubleModeV"); + vectorNode(ROUND_DOUBLE_MODE_V, "RoundDoubleModeV", TYPE_DOUBLE); } public static final String RSHIFT = PREFIX + "RSHIFT" + POSTFIX; @@ -1006,19 +1229,29 @@ public class IRNode { beforeMatchingNameRegex(RSHIFT_L, "RShiftL"); } - public static final String RSHIFT_VB = PREFIX + "RSHIFT_VB" + POSTFIX; + public static final String RSHIFT_VB = VECTOR_PREFIX + "RSHIFT_VB" + POSTFIX; static { - beforeMatchingNameRegex(RSHIFT_VB, "RShiftVB"); + vectorNode(RSHIFT_VB, "RShiftVB", TYPE_BYTE); } - public static final String RSHIFT_VS = PREFIX + "RSHIFT_VS" + POSTFIX; + public static final String RSHIFT_VS = VECTOR_PREFIX + "RSHIFT_VS" + POSTFIX; static { - beforeMatchingNameRegex(RSHIFT_VS, "RShiftVS"); + vectorNode(RSHIFT_VS, "RShiftVS", TYPE_SHORT); } - public static final String RSHIFT_V = PREFIX + "RSHIFT_V" + POSTFIX; + public static final String RSHIFT_VC = VECTOR_PREFIX + "RSHIFT_VC" + POSTFIX; static { - beforeMatchingNameRegex(RSHIFT_V, "RShiftV(B|S|I|L)"); + vectorNode(RSHIFT_VC, "RShiftVS", TYPE_CHAR); // short computation with char type + } + + public static final String RSHIFT_VI = VECTOR_PREFIX + "RSHIFT_VI" + POSTFIX; + static { + vectorNode(RSHIFT_VI, "RShiftVI", TYPE_INT); + } + + public static final String RSHIFT_VL = VECTOR_PREFIX + "RSHIFT_VL" + POSTFIX; + static { + vectorNode(RSHIFT_VL, "RShiftVL", TYPE_LONG); } public static final String SAFEPOINT = PREFIX + "SAFEPOINT" + POSTFIX; @@ -1032,19 +1265,24 @@ public class IRNode { optoOnly(SCOPE_OBJECT, regex); } - public static final String SIGNUM_VD = PREFIX + "SIGNUM_VD" + POSTFIX; + public static final String SIGNUM_VD = VECTOR_PREFIX + "SIGNUM_VD" + POSTFIX; static { - beforeMatchingNameRegex(SIGNUM_VD, "SignumVD"); + vectorNode(SIGNUM_VD, "SignumVD", TYPE_DOUBLE); } - public static final String SIGNUM_VF = PREFIX + "SIGNUM_VF" + POSTFIX; + public static final String SIGNUM_VF = VECTOR_PREFIX + "SIGNUM_VF" + POSTFIX; static { - beforeMatchingNameRegex(SIGNUM_VF, "SignumVF"); + vectorNode(SIGNUM_VF, "SignumVF", TYPE_FLOAT); } - public static final String SQRT_V = PREFIX + "SQRT_V" + POSTFIX; + public static final String SQRT_VF = VECTOR_PREFIX + "SQRT_VF" + POSTFIX; static { - beforeMatchingNameRegex(SQRT_V, "SqrtV(F|D)"); + vectorNode(SQRT_VF, "SqrtVF", TYPE_FLOAT); + } + + public static final String SQRT_VD = VECTOR_PREFIX + "SQRT_VD" + POSTFIX; + static { + vectorNode(SQRT_VD, "SqrtVD", TYPE_DOUBLE); } public static final String STORE = PREFIX + "STORE" + POSTFIX; @@ -1183,9 +1421,34 @@ public class IRNode { beforeMatchingNameRegex(SUB_L, "SubL"); } - public static final String SUB_V = PREFIX + "SUB_V" + POSTFIX; + public static final String SUB_VB = VECTOR_PREFIX + "SUB_VB" + POSTFIX; + static { + vectorNode(SUB_VB, "SubVB", TYPE_BYTE); + } + + public static final String SUB_VS = VECTOR_PREFIX + "SUB_VS" + POSTFIX; + static { + vectorNode(SUB_VS, "SubVS", TYPE_SHORT); + } + + public static final String SUB_VI = VECTOR_PREFIX + "SUB_VI" + POSTFIX; static { - beforeMatchingNameRegex(SUB_V, "SubV(B|S|I|L|F|D)"); + vectorNode(SUB_VI, "SubVI", TYPE_INT); + } + + public static final String SUB_VL = VECTOR_PREFIX + "SUB_VL" + POSTFIX; + static { + vectorNode(SUB_VL, "SubVL", TYPE_LONG); + } + + public static final String SUB_VF = VECTOR_PREFIX + "SUB_VF" + POSTFIX; + static { + vectorNode(SUB_VF, "SubVF", TYPE_FLOAT); + } + + public static final String SUB_VD = VECTOR_PREFIX + "SUB_VD" + POSTFIX; + static { + vectorNode(SUB_VD, "SubVD", TYPE_DOUBLE); } public static final String SUBTYPE_CHECK = PREFIX + "SUBTYPE_CHECK" + POSTFIX; @@ -1263,9 +1526,29 @@ public class IRNode { beforeMatchingNameRegex(URSHIFT_S, "URShiftS"); } - public static final String URSHIFT_V = PREFIX + "URSHIFT_V" + POSTFIX; + public static final String URSHIFT_VB = VECTOR_PREFIX + "URSHIFT_VB" + POSTFIX; static { - beforeMatchingNameRegex(URSHIFT_V, "URShiftV(B|S|I|L)"); + vectorNode(URSHIFT_VB, "URShiftVB", TYPE_BYTE); + } + + public static final String URSHIFT_VS = VECTOR_PREFIX + "URSHIFT_VS" + POSTFIX; + static { + vectorNode(URSHIFT_VS, "URShiftVS", TYPE_SHORT); + } + + public static final String URSHIFT_VC = VECTOR_PREFIX + "URSHIFT_VC" + POSTFIX; + static { + vectorNode(URSHIFT_VC, "URShiftVS", TYPE_CHAR); // short computation with char type + } + + public static final String URSHIFT_VI = VECTOR_PREFIX + "URSHIFT_VI" + POSTFIX; + static { + vectorNode(URSHIFT_VI, "URShiftVI", TYPE_INT); + } + + public static final String URSHIFT_VL = VECTOR_PREFIX + "URSHIFT_VL" + POSTFIX; + static { + vectorNode(URSHIFT_VL, "URShiftVL", TYPE_LONG); } public static final String VAND_NOT_I = PREFIX + "VAND_NOT_I" + POSTFIX; @@ -1278,54 +1561,199 @@ public class IRNode { machOnlyNameRegex(VAND_NOT_L, "vand_notL"); } - public static final String VECTOR_BLEND = PREFIX + "VECTOR_BLEND" + POSTFIX; + public static final String VECTOR_BLEND_B = VECTOR_PREFIX + "VECTOR_BLEND_B" + POSTFIX; + static { + vectorNode(VECTOR_BLEND_B, "VectorBlend", TYPE_BYTE); + } + + public static final String VECTOR_BLEND_F = VECTOR_PREFIX + "VECTOR_BLEND_F" + POSTFIX; + static { + vectorNode(VECTOR_BLEND_F, "VectorBlend", TYPE_FLOAT); + } + + public static final String VECTOR_BLEND_D = VECTOR_PREFIX + "VECTOR_BLEND_D" + POSTFIX; + static { + vectorNode(VECTOR_BLEND_D, "VectorBlend", TYPE_DOUBLE); + } + + public static final String VECTOR_MASK_CMP_I = VECTOR_PREFIX + "VECTOR_MASK_CMP_I" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_I, "VectorMaskCmp", TYPE_INT); + } + + public static final String VECTOR_MASK_CMP_L = VECTOR_PREFIX + "VECTOR_MASK_CMP_L" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_L, "VectorMaskCmp", TYPE_LONG); + } + + public static final String VECTOR_MASK_CMP_F = VECTOR_PREFIX + "VECTOR_MASK_CMP_F" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_F, "VectorMaskCmp", TYPE_FLOAT); + } + + public static final String VECTOR_MASK_CMP_D = VECTOR_PREFIX + "VECTOR_MASK_CMP_D" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_D, "VectorMaskCmp", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_B2S = VECTOR_PREFIX + "VECTOR_CAST_B2S" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2S, "VectorCastB2X", TYPE_SHORT); + } + + public static final String VECTOR_CAST_B2I = VECTOR_PREFIX + "VECTOR_CAST_B2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2I, "VectorCastB2X", TYPE_INT); + } + + public static final String VECTOR_CAST_B2L = VECTOR_PREFIX + "VECTOR_CAST_B2L" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2L, "VectorCastB2X", TYPE_LONG); + } + + public static final String VECTOR_CAST_B2F = VECTOR_PREFIX + "VECTOR_CAST_B2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2F, "VectorCastB2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_B2D = VECTOR_PREFIX + "VECTOR_CAST_B2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2D, "VectorCastB2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_D2B = VECTOR_PREFIX + "VECTOR_CAST_D2B" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2B, "VectorCastD2X", TYPE_BYTE); + } + + public static final String VECTOR_CAST_D2S = VECTOR_PREFIX + "VECTOR_CAST_D2S" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2S, "VectorCastD2X", TYPE_SHORT); + } + + public static final String VECTOR_CAST_D2I = VECTOR_PREFIX + "VECTOR_CAST_D2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2I, "VectorCastD2X", TYPE_INT); + } + + public static final String VECTOR_CAST_D2L = VECTOR_PREFIX + "VECTOR_CAST_D2L" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2L, "VectorCastD2X", TYPE_LONG); + } + + public static final String VECTOR_CAST_D2F = VECTOR_PREFIX + "VECTOR_CAST_D2F" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_BLEND, "VectorBlend"); + vectorNode(VECTOR_CAST_D2F, "VectorCastD2X", TYPE_FLOAT); } - public static final String VECTOR_MASK_CMP = PREFIX + "VECTOR_MASK_CMP" + POSTFIX; + public static final String VECTOR_CAST_F2B = VECTOR_PREFIX + "VECTOR_CAST_F2B" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_MASK_CMP, "VectorMaskCmp"); + vectorNode(VECTOR_CAST_F2B, "VectorCastF2X", TYPE_BYTE); } - public static final String VECTOR_CAST_B2X = PREFIX + "VECTOR_CAST_B2X" + POSTFIX; + public static final String VECTOR_CAST_F2S = VECTOR_PREFIX + "VECTOR_CAST_F2S" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_B2X, "VectorCastB2X"); + vectorNode(VECTOR_CAST_F2S, "VectorCastF2X", TYPE_SHORT); } - public static final String VECTOR_CAST_D2X = PREFIX + "VECTOR_CAST_D2X" + POSTFIX; + public static final String VECTOR_CAST_F2I = VECTOR_PREFIX + "VECTOR_CAST_F2I" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_D2X, "VectorCastD2X"); + vectorNode(VECTOR_CAST_F2I, "VectorCastF2X", TYPE_INT); } - public static final String VECTOR_CAST_F2X = PREFIX + "VECTOR_CAST_F2X" + POSTFIX; + public static final String VECTOR_CAST_F2L = VECTOR_PREFIX + "VECTOR_CAST_F2L" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_F2X, "VectorCastF2X"); + vectorNode(VECTOR_CAST_F2L, "VectorCastF2X", TYPE_LONG); } - public static final String VECTOR_CAST_I2X = PREFIX + "VECTOR_CAST_I2X" + POSTFIX; + public static final String VECTOR_CAST_F2D = VECTOR_PREFIX + "VECTOR_CAST_F2D" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_I2X, "VectorCastI2X"); + vectorNode(VECTOR_CAST_F2D, "VectorCastF2X", TYPE_DOUBLE); } - public static final String VECTOR_CAST_L2X = PREFIX + "VECTOR_CAST_L2X" + POSTFIX; + public static final String VECTOR_CAST_I2B = VECTOR_PREFIX + "VECTOR_CAST_I2B" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_L2X, "VectorCastL2X"); + vectorNode(VECTOR_CAST_I2B, "VectorCastI2X", TYPE_BYTE); } - public static final String VECTOR_CAST_S2X = PREFIX + "VECTOR_CAST_S2X" + POSTFIX; + public static final String VECTOR_CAST_I2S = VECTOR_PREFIX + "VECTOR_CAST_I2S" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_S2X, "VectorCastS2X"); + vectorNode(VECTOR_CAST_I2S, "VectorCastI2X", TYPE_SHORT); } - public static final String VECTOR_CAST_F2HF = PREFIX + "VECTOR_CAST_F2HF" + POSTFIX; + public static final String VECTOR_CAST_I2L = VECTOR_PREFIX + "VECTOR_CAST_I2L" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_F2HF, "VectorCastF2HF"); + vectorNode(VECTOR_CAST_I2L, "VectorCastI2X", TYPE_LONG); } - public static final String VECTOR_CAST_HF2F = PREFIX + "VECTOR_CAST_HF2F" + POSTFIX; + public static final String VECTOR_CAST_I2F = VECTOR_PREFIX + "VECTOR_CAST_I2F" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_HF2F, "VectorCastHF2F"); + vectorNode(VECTOR_CAST_I2F, "VectorCastI2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_I2D = VECTOR_PREFIX + "VECTOR_CAST_I2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_I2D, "VectorCastI2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_L2B = VECTOR_PREFIX + "VECTOR_CAST_L2B" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2B, "VectorCastL2X", TYPE_BYTE); + } + + public static final String VECTOR_CAST_L2S = VECTOR_PREFIX + "VECTOR_CAST_L2S" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2S, "VectorCastL2X", TYPE_SHORT); + } + + public static final String VECTOR_CAST_L2I = VECTOR_PREFIX + "VECTOR_CAST_L2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2I, "VectorCastL2X", TYPE_INT); + } + + public static final String VECTOR_CAST_L2F = VECTOR_PREFIX + "VECTOR_CAST_L2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2F, "VectorCastL2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_L2D = VECTOR_PREFIX + "VECTOR_CAST_L2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2D, "VectorCastL2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_S2B = VECTOR_PREFIX + "VECTOR_CAST_S2B" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2B, "VectorCastS2X", TYPE_BYTE); + } + + public static final String VECTOR_CAST_S2I = VECTOR_PREFIX + "VECTOR_CAST_S2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2I, "VectorCastS2X", TYPE_INT); + } + + public static final String VECTOR_CAST_S2L = VECTOR_PREFIX + "VECTOR_CAST_S2L" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2L, "VectorCastS2X", TYPE_LONG); + } + + public static final String VECTOR_CAST_S2F = VECTOR_PREFIX + "VECTOR_CAST_S2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2F, "VectorCastS2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_S2D = VECTOR_PREFIX + "VECTOR_CAST_S2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2D, "VectorCastS2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_F2HF = VECTOR_PREFIX + "VECTOR_CAST_F2HF" + POSTFIX; + static { + vectorNode(VECTOR_CAST_F2HF, "VectorCastF2HF", TYPE_SHORT); + } + + public static final String VECTOR_CAST_HF2F = VECTOR_PREFIX + "VECTOR_CAST_HF2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_HF2F, "VectorCastHF2F", TYPE_FLOAT); } public static final String VECTOR_MASK_CAST = PREFIX + "VECTOR_MASK_CAST" + POSTFIX; @@ -1338,19 +1766,34 @@ public class IRNode { beforeMatchingNameRegex(VECTOR_REINTERPRET, "VectorReinterpret"); } - public static final String VECTOR_UCAST_B2X = PREFIX + "VECTOR_UCAST_B2X" + POSTFIX; + public static final String VECTOR_UCAST_B2S = VECTOR_PREFIX + "VECTOR_UCAST_B2S" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_UCAST_B2X, "VectorUCastB2X"); + vectorNode(VECTOR_UCAST_B2S, "VectorUCastB2X", TYPE_SHORT); } - public static final String VECTOR_UCAST_I2X = PREFIX + "VECTOR_UCAST_I2X" + POSTFIX; + public static final String VECTOR_UCAST_B2I = VECTOR_PREFIX + "VECTOR_UCAST_B2I" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_UCAST_I2X, "VectorUCastI2X"); + vectorNode(VECTOR_UCAST_B2I, "VectorUCastB2X", TYPE_INT); } - public static final String VECTOR_UCAST_S2X = PREFIX + "VECTOR_UCAST_S2X" + POSTFIX; + public static final String VECTOR_UCAST_B2L = VECTOR_PREFIX + "VECTOR_UCAST_B2L" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_UCAST_S2X, "VectorUCastS2X"); + vectorNode(VECTOR_UCAST_B2L, "VectorUCastB2X", TYPE_LONG); + } + + public static final String VECTOR_UCAST_I2L = VECTOR_PREFIX + "VECTOR_UCAST_I2L" + POSTFIX; + static { + vectorNode(VECTOR_UCAST_I2L, "VectorUCastI2X", TYPE_LONG); + } + + public static final String VECTOR_UCAST_S2I = VECTOR_PREFIX + "VECTOR_UCAST_S2I" + POSTFIX; + static { + vectorNode(VECTOR_UCAST_S2I, "VectorUCastS2X", TYPE_INT); + } + + public static final String VECTOR_UCAST_S2L = VECTOR_PREFIX + "VECTOR_UCAST_S2L" + POSTFIX; + static { + vectorNode(VECTOR_UCAST_S2L, "VectorUCastS2X", TYPE_LONG); } public static final String VECTOR_TEST = PREFIX + "VECTOR_TEST" + POSTFIX; @@ -1498,9 +1941,24 @@ public class IRNode { beforeMatchingNameRegex(XOR_L, "XorL"); } - public static final String XOR_V = PREFIX + "XOR_V" + POSTFIX; + public static final String XOR_VB = VECTOR_PREFIX + "XOR_VB" + POSTFIX; + static { + vectorNode(XOR_VB, "XorV", TYPE_BYTE); + } + + public static final String XOR_VS = VECTOR_PREFIX + "XOR_VS" + POSTFIX; + static { + vectorNode(XOR_VS, "XorV", TYPE_SHORT); + } + + public static final String XOR_VI = VECTOR_PREFIX + "XOR_VI" + POSTFIX; + static { + vectorNode(XOR_VI, "XorV", TYPE_INT); + } + + public static final String XOR_VL = VECTOR_PREFIX + "XOR_VL" + POSTFIX; static { - beforeMatchingNameRegex(XOR_V, "XorV"); + vectorNode(XOR_VL, "XorV", TYPE_LONG); } public static final String XOR_V_MASK = PREFIX + "XOR_V_MASK" + POSTFIX; @@ -1523,14 +1981,24 @@ public class IRNode { machOnlyNameRegex(XOR3_SVE, "veor3_sve"); } - public static final String COMPRESS_BITSV = PREFIX + "COMPRESS_BITSV" + POSTFIX; + public static final String COMPRESS_BITS_VI = VECTOR_PREFIX + "COMPRESS_BITS_VI" + POSTFIX; + static { + vectorNode(COMPRESS_BITS_VI, "CompressBitsV", TYPE_INT); + } + + public static final String COMPRESS_BITS_VL = VECTOR_PREFIX + "COMPRESS_BITS_VL" + POSTFIX; static { - beforeMatchingNameRegex(COMPRESS_BITSV, "CompressBitsV"); + vectorNode(COMPRESS_BITS_VL, "CompressBitsV", TYPE_LONG); } - public static final String EXPAND_BITSV = PREFIX + "EXPAND_BITSV" + POSTFIX; + public static final String EXPAND_BITS_VI = VECTOR_PREFIX + "EXPAND_BITS_VI" + POSTFIX; static { - beforeMatchingNameRegex(EXPAND_BITSV, "ExpandBitsV"); + vectorNode(EXPAND_BITS_VI, "ExpandBitsV", TYPE_INT); + } + + public static final String EXPAND_BITS_VL = VECTOR_PREFIX + "EXPAND_BITS_VL" + POSTFIX; + static { + vectorNode(EXPAND_BITS_VL, "ExpandBitsV", TYPE_LONG); } public static final String Z_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX; @@ -1572,6 +2040,20 @@ private static void beforeMatchingNameRegex(String irNodePlaceholder, String irN IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex)); } + /** + * Apply {@code irNodeRegex} as regex for the IR vector node name on all machine independent ideal graph phases up to and + * including {@link CompilePhase#BEFORE_MATCHING}. Since this is a vector node, we can also check the vector element + * type {@code typeString} and the vector size (number of elements), {@see VECTOR_SIZE}. + */ + private static void vectorNode(String irNodePlaceholder, String irNodeRegex, String typeString) { + TestFramework.check(isVectorIRNode(irNodePlaceholder), "vectorNode: failed prefix check for irNodePlaceholder " + + irNodePlaceholder + " -> did you use VECTOR_PREFIX?"); + // IS_REPLACED is later replaced with the specific type and size of the vector. + String regex = START + irNodeRegex + MID + IS_REPLACED + END; + IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex)); + VECTOR_NODE_TYPE.put(irNodePlaceholder, typeString); + } + private static void allocNodes(String irNode, String irNodeName, String optoRegex) { String idealIndependentRegex = START + irNodeName + "\\b" + MID + END; Map intervalToRegexMap = new HashMap<>(); @@ -1687,6 +2169,149 @@ public static boolean isCompositeIRNode(String irCompositeNodeString) { return irCompositeNodeString.startsWith(COMPOSITE_PREFIX); } + /** + * Is {@code irVectorNodeString} an IR vector node placeholder string? + */ + public static boolean isVectorIRNode(String irVectorNodeString) { + return irVectorNodeString.startsWith(VECTOR_PREFIX); + } + + /** + * Is {@code irVectorSizeString} a vector size string? + */ + public static boolean isVectorSize(String irVectorSizeString) { + return irVectorSizeString.startsWith(VECTOR_SIZE); + } + + /** + * Parse {@code sizeString} and generate a regex pattern to match for the size in the IR dump. + */ + public static String parseVectorNodeSize(String sizeString, String typeString, VMInfo vmInfo) { + if (sizeString.equals(VECTOR_SIZE_TAG_ANY)) { + return "\\\\d+"; // match with any number + } + // Try to parse any tags, convert to comma separated list of ints + sizeString = parseVectorNodeSizeTag(sizeString, typeString, vmInfo); + // Parse comma separated list of numbers + String[] sizes = sizeString.split(","); + String regex = ""; + for (int i = 0; i < sizes.length; i++) { + int size = 0; + try { + size = Integer.parseInt(sizes[i]); + } catch (NumberFormatException e) { + throw new TestFormatException("Vector node has invalid size \"" + sizes[i] + "\", in \"" + sizeString + "\""); + } + TestFormat.checkNoReport(size > 1, "Vector node size must be 2 or larger, but got \"" + sizes[i] + "\", in \"" + sizeString + "\""); + regex += ((i > 0) ? "|" : "") + size; + } + if (sizes.length > 1) { + regex = "(" + regex + ")"; + } + return regex; + } + + /** + * If {@code sizeTagString} is a size tag, return the list of accepted sizes, else return sizeTagString. + */ + public static String parseVectorNodeSizeTag(String sizeTagString, String typeString, VMInfo vmInfo) { + // Parse out "min(a,b,c,...)" + if (sizeTagString.startsWith("min(") && sizeTagString.endsWith(")")) { + return parseVectorNodeSizeTagMin(sizeTagString, typeString, vmInfo); + } + + // Parse individual tags + return switch (sizeTagString) { + case VECTOR_SIZE_TAG_MAX -> String.valueOf(getMaxElementsForType(typeString, vmInfo)); + case "max_byte" -> String.valueOf(getMaxElementsForType(TYPE_BYTE, vmInfo)); + case "max_char" -> String.valueOf(getMaxElementsForType(TYPE_CHAR, vmInfo)); + case "max_short" -> String.valueOf(getMaxElementsForType(TYPE_SHORT, vmInfo)); + case "max_int" -> String.valueOf(getMaxElementsForType(TYPE_INT, vmInfo)); + case "max_long" -> String.valueOf(getMaxElementsForType(TYPE_LONG, vmInfo)); + case "max_float" -> String.valueOf(getMaxElementsForType(TYPE_FLOAT, vmInfo)); + case "max_double" -> String.valueOf(getMaxElementsForType(TYPE_DOUBLE, vmInfo)); + case "LoopMaxUnroll" -> String.valueOf(vmInfo.getLongValue("LoopMaxUnroll")); + default -> sizeTagString; + }; + } + + /** + * Parse {@code sizeTagString}, which must be a min-clause. + */ + public static String parseVectorNodeSizeTagMin(String sizeTagString, String typeString, VMInfo vmInfo) { + String[] tags = sizeTagString.substring(4, sizeTagString.length() - 1).split(","); + TestFormat.checkNoReport(tags.length > 1, "Vector node size \"min(...)\" must have at least 2 comma separated arguments, got \"" + sizeTagString + "\""); + int minVal = 1024; + for (int i = 0; i < tags.length; i++) { + String tag = parseVectorNodeSizeTag(tags[i].trim(), typeString, vmInfo); + int tag_val = 0; + try { + tag_val = Integer.parseInt(tag); + } catch (NumberFormatException e) { + throw new TestFormatException("Vector node has invalid size in \"min(...)\", argument " + i + ", \"" + tag + "\", in \"" + sizeTagString + "\""); + } + minVal = Math.min(minVal, tag_val); + } + return String.valueOf(minVal); + } + + /** + * Return maximal number of elements that can fit in a vector of the specified type. + */ + public static long getMaxElementsForType(String typeString, VMInfo vmInfo) { + long maxVectorSize = vmInfo.getLongValue("MaxVectorSize"); + TestFormat.checkNoReport(maxVectorSize > 0, "VMInfo: MaxVectorSize is not larger than zero"); + long maxBytes = maxVectorSize; + + if (Platform.isX64() || Platform.isX86()) { + maxBytes = Math.min(maxBytes, getMaxElementsForTypeOnX86(typeString, vmInfo)); + } + + // compute elements per vector: vector bytes divided by bytes per element + int bytes = getTypeSizeInBytes(typeString); + return maxBytes / bytes; + } + + /** + * Return maximal number of elements that can fit in a vector of the specified type, on x86 / x64. + */ + public static long getMaxElementsForTypeOnX86(String typeString, VMInfo vmInfo) { + // restrict maxBytes for specific features, see Matcher::vector_width_in_bytes in x86.ad: + boolean avx1 = vmInfo.hasCPUFeature("avx"); + boolean avx2 = vmInfo.hasCPUFeature("avx2"); + boolean avx512 = vmInfo.hasCPUFeature("avx512f"); + boolean avx512bw = vmInfo.hasCPUFeature("avx512bw"); + long maxBytes; + if (avx512) { + maxBytes = 64; + } else if (avx2) { + maxBytes = 32; + } else { + maxBytes = 16; + } + if (avx1 && (typeString.equals(TYPE_FLOAT) || typeString.equals(TYPE_DOUBLE))) { + maxBytes = avx512 ? 64 : 32; + } + if (avx512 && (typeString.equals(TYPE_BYTE) || typeString.equals(TYPE_SHORT) || typeString.equals(TYPE_CHAR))) { + maxBytes = avx512bw ? 64 : 32; + } + + return maxBytes; + } + + /** + * Return size in bytes of type named by {@code typeString}, return 0 if it does not name a type. + */ + public static int getTypeSizeInBytes(String typeString) { + return switch (typeString) { + case TYPE_BYTE -> 1; + case TYPE_CHAR, TYPE_SHORT -> 2; + case TYPE_INT, TYPE_FLOAT -> 4; + case TYPE_LONG, TYPE_DOUBLE -> 8; + default -> 0; + }; + } + /** * Returns "IRNode.XYZ", where XYZ is one of the IR node placeholder variable names defined above. */ @@ -1696,6 +2321,10 @@ public static String getIRNodeAccessString(String irNodeString) { TestFramework.check(irNodeString.length() > COMPOSITE_PREFIX.length() + POSTFIX.length(), "Invalid composite node placeholder: " + irNodeString); prefixLength = COMPOSITE_PREFIX.length(); + } else if (isVectorIRNode(irNodeString)) { + TestFramework.check(irNodeString.length() > VECTOR_PREFIX.length() + POSTFIX.length(), + "Invalid vector node placeholder: " + irNodeString); + prefixLength = VECTOR_PREFIX.length(); } else { prefixLength = PREFIX.length(); } @@ -1770,4 +2399,11 @@ public static CompilePhase getDefaultPhase(String irNode) { TestFormat.checkNoReport(entry != null, failMsg); return entry.defaultCompilePhase(); } + + public static String getVectorNodeType(String irNode) { + String typeString = VECTOR_NODE_TYPE.get(irNode); + String failMsg = "\"" + irNode + "\" is not a Vector IR node defined in class IRNode"; + TestFormat.check(typeString != null, failMsg); + return typeString; + } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/README.md b/test/hotspot/jtreg/compiler/lib/ir_framework/README.md index 64302ca4bd6..bd66d765284 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/README.md +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/README.md @@ -71,6 +71,26 @@ public void test() { } ``` +#### Vector IR Nodes +For vector nodes, we not only check for the presence of the node, but also its type and size (number of elements in the vector). Every node has an associated type, for example `IRNode.LOAD_VECTOR_I` has type `int` and `IRNode.LOAD_VECTOR_F` has type `float`. The size can be explicitly specified as an additional argument. For example: + +``` +@IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIf = {"MaxVectorSize", "=64"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) +static float[] test() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; +} +``` + +However, the size does not have to be specified. In most cases, one either wants to have vectorization at the maximal possible vector width, or no vectorization at all. Hence, for lower bound counts ('>' or '>=') and equal count comparisons with strictly positive count (e.g. "=2") the default size is `IRNode.VECTOR_SIZE_MAX`, and for upper bound counts ('<' or '<=' or '=0' or failOn) the default is `IRNode.VECTOR_SIZE_ANY`. On machines with 'canTrustVectorSize == false' (default Cascade Lake) the maximal vector width is not predictable currently (32 byte for SuperWord and 64 byte for VectorAPI). Hence, on such a machine we have to automatically weaken the IR rules. All lower bound counts are performed checking with `IRNode.VECTOR_SIZE_ANY`. Upper bound counts with no user specified size are performed with `IRNode.VECTOR_SIZE_ANY` but upper bound counts with a user specified size are not checked at all. Equal count comparisons with strictly positive count are also not checked at all. Details and reasoning can be found in [RawIRNode](./driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java). + +More examples can be found in [IRExample](../../../testlibrary_tests/ir_framework/examples/IRExample.java). You can also find many examples in the Vector API and SuperWord tests, when searching for `IRNode.VECTOR_SIZE` or `IRNode.LOAD_VECTOR`. + #### User-defined Regexes The user can also directly specify user-defined regexes in combination with a required compile phase (there is no default compile phase known by the framework for custom regexes). If such a user-defined regex represents a not yet supported C2 IR node, it is highly encouraged to directly add a new IR node placeholder string definition to [IRNode](./IRNode.java) for it instead together with a static regex mapping block. diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java new file mode 100644 index 00000000000..452e9a666c9 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023, 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. + */ + +package compiler.lib.ir_framework.driver; + +import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; + +/** + * Exception used to signal that a {@link Constraint} should always succeed. + */ +public class SuccessOnlyConstraintException extends RuntimeException { + public SuccessOnlyConstraintException(String message) { + super("Unhandled SuccessOnlyConstraintException, should have created a Constraint that always succeeds:" + System.lineSeparator() + message); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java index 40d36a6090e..dbd431d22e0 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java @@ -31,6 +31,7 @@ import compiler.lib.ir_framework.driver.irmatching.Matchable; import compiler.lib.ir_framework.driver.irmatching.MatchableMatcher; import compiler.lib.ir_framework.driver.irmatching.irrule.IRRule; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.TestFormat; import compiler.lib.ir_framework.shared.TestFormatException; @@ -50,16 +51,16 @@ public class IRMethod implements IRMethodMatchable { private final Method method; private final MatchableMatcher matcher; - public IRMethod(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation) { + public IRMethod(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation, VMInfo vmInfo) { this.method = method; - this.matcher = new MatchableMatcher(createIRRules(method, ruleIds, irAnnos, compilation)); + this.matcher = new MatchableMatcher(createIRRules(method, ruleIds, irAnnos, compilation, vmInfo)); } - private List createIRRules(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation) { + private List createIRRules(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation, VMInfo vmInfo) { List irRules = new ArrayList<>(); for (int ruleId : ruleIds) { try { - irRules.add(new IRRule(ruleId, irAnnos[ruleId - 1], compilation)); + irRules.add(new IRRule(ruleId, irAnnos[ruleId - 1], compilation, vmInfo)); } catch (TestFormatException e) { String postfixErrorMsg = " for IR rule " + ruleId + " at " + method + "."; TestFormat.failNoThrow(e.getMessage() + postfixErrorMsg); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java index ff768d6540f..749942eabd6 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java @@ -31,6 +31,7 @@ import compiler.lib.ir_framework.driver.irmatching.MatchableMatcher; import compiler.lib.ir_framework.driver.irmatching.irrule.phase.CompilePhaseIRRule; import compiler.lib.ir_framework.driver.irmatching.irrule.phase.CompilePhaseIRRuleBuilder; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; /** * This class represents a generic {@link IR @IR} rule of an IR method. It contains a list of compile phase specific @@ -44,10 +45,10 @@ public class IRRule implements Matchable { private final IR irAnno; private final MatchableMatcher matcher; - public IRRule(int ruleId, IR irAnno, Compilation compilation) { + public IRRule(int ruleId, IR irAnno, Compilation compilation, VMInfo vmInfo) { this.ruleId = ruleId; this.irAnno = irAnno; - this.matcher = new MatchableMatcher(new CompilePhaseIRRuleBuilder(irAnno, compilation).build()); + this.matcher = new MatchableMatcher(new CompilePhaseIRRuleBuilder(irAnno, compilation).build(vmInfo)); } @Override diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java index 14ba26aeb38..ab3a8971562 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java @@ -60,16 +60,34 @@ public void read(Collection result) { public final CheckAttributeString readUserPostfix(String node) { if (IRNode.isCompositeIRNode(node)) { - String irNode = IRNode.getIRNodeAccessString(node); - int nextIndex = iterator.nextIndex(); - TestFormat.checkNoReport(iterator.hasNext(), "Must provide additional value at index " + - nextIndex + " right after " + irNode); - CheckAttributeString userPostfix = new CheckAttributeString(iterator.next()); - TestFormat.checkNoReport(userPostfix.isValidUserPostfix(), "Provided empty string for composite node " + - irNode + " at index " + nextIndex); - return userPostfix; + return readUserPostfixForCompositeIRNode(node); + } else if (IRNode.isVectorIRNode(node)) { + return readUserPostfixForVectorIRNode(node); } else { return CheckAttributeString.invalid(); } } + + private final CheckAttributeString readUserPostfixForCompositeIRNode(String node) { + String irNode = IRNode.getIRNodeAccessString(node); + int nextIndex = iterator.nextIndex(); + TestFormat.checkNoReport(iterator.hasNext(), "Must provide additional value at index " + + nextIndex + " right after " + irNode); + CheckAttributeString userPostfix = new CheckAttributeString(iterator.next()); + TestFormat.checkNoReport(userPostfix.isValidUserPostfix(), "Provided empty string for composite node " + + irNode + " at index " + nextIndex); + return userPostfix; + } + + private final CheckAttributeString readUserPostfixForVectorIRNode(String node) { + if (iterator.hasNext()) { + String maybeVectorType = iterator.next(); + if (IRNode.isVectorSize(maybeVectorType)) { + return new CheckAttributeString(maybeVectorType); + } + // If we do not find that pattern, then revert the iterator once + iterator.previous(); + } + return CheckAttributeString.invalid(); + } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java index 2684e14344a..e7db6c4844c 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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,6 +25,10 @@ import compiler.lib.ir_framework.CompilePhase; import compiler.lib.ir_framework.IRNode; +import compiler.lib.ir_framework.shared.Comparison; +import compiler.lib.ir_framework.shared.TestFormat; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; +import compiler.lib.ir_framework.driver.SuccessOnlyConstraintException; /** * This class represents a "raw IR node" as read from a check attribute. It has a node part that either represents an @@ -51,14 +55,85 @@ public CompilePhase defaultCompilePhase() { return IRNode.getDefaultPhase(node); } - public String regex(CompilePhase compilePhase) { + public String regex(CompilePhase compilePhase, VMInfo vmInfo, Comparison.Bound bound) { String nodeRegex = node; if (IRNode.isIRNode(node)) { nodeRegex = IRNode.getRegexForCompilePhase(node, compilePhase); - if (userPostfix.isValid()) { + if (IRNode.isVectorIRNode(node)) { + nodeRegex = regexForVectorIRNode(nodeRegex, vmInfo, bound); + } else if (userPostfix.isValid()) { nodeRegex = nodeRegex.replaceAll(IRNode.IS_REPLACED, userPostfix.value()); } } return nodeRegex; } + + private String regexForVectorIRNode(String nodeRegex, VMInfo vmInfo, Comparison.Bound bound) { + String type = IRNode.getVectorNodeType(node); + TestFormat.checkNoReport(IRNode.getTypeSizeInBytes(type) > 0, + "Vector node's type must have valid type, got \"" + type + "\" for \"" + node + "\""); + String size = null; + if (userPostfix.isValid()) { + // Size is explicitly stated + String value = userPostfix.value(); + TestFormat.checkNoReport(value.startsWith(IRNode.VECTOR_SIZE), + "Vector node's vector size must start with IRNode.VECTOR_SIZE, got: \"" + value + "\""); + size = value.substring(2); + + if (!vmInfo.canTrustVectorSize()) { + // Parse it already just to get errors before we overwrite size + IRNode.parseVectorNodeSize(size, type, vmInfo); + } + } + + // Set default values in some cases: + if (!userPostfix.isValid() || !vmInfo.canTrustVectorSize()) { + switch (bound) { + case LOWER -> { + // For lower bound we check for the maximal size by default. But if we cannot trust the + // vector size we at least check there are vectors of any size. + if (vmInfo.canTrustVectorSize()) { + // No size specified, so assume maximal size + size = IRNode.VECTOR_SIZE_TAG_MAX; + } else { + System.out.println("WARNING: you are on a system with \"canTrustVectorSize == false\" (default Cascade Lake)."); + System.out.println(" The lower bound rule for \"" + node + "\" is now performed with"); + System.out.println(" \"IRNode.VECTOR_SIZE_TAG_ANY\" instead of \"IRNode.VECTOR_SIZE_TAG_MAX\"."); + size = IRNode.VECTOR_SIZE_TAG_ANY; + } + } + case UPPER -> { + if (userPostfix.isValid()) { + TestFormat.checkNoReport(!vmInfo.canTrustVectorSize(), "sanity"); + // If we have a size specified but cannot trust the size, and must check an upper + // bound, this can be impossible to count correctly - if we have an incorrect size + // we may count either too many nodes. We just create an impossible regex which will + // always have count zero and make the upper bound rule pass. + System.out.println("WARNING: you are on a system with \"canTrustVectorSize == false\" (default Cascade Lake)."); + System.out.println(" The upper bound rule for \"" + node + "\" cannot be checked."); + throw new SuccessOnlyConstraintException("upper bound with specified size"); + } else { + // For upper bound we check for vectors of any size by default. + size = IRNode.VECTOR_SIZE_TAG_ANY; + } + } + case EQUAL -> { + if (vmInfo.canTrustVectorSize()) { + // No size specified, so assume maximal size + size = IRNode.VECTOR_SIZE_TAG_MAX; + } else { + // Equal comparison to a strictly positive number would lead us to an impossible + // situation: we might have to know the exact vector size or else we count too many + // or too few cases. We therefore skip such a constraint and treat it as success. + System.out.println("WARNING: you are on a system with \"canTrustVectorSize == false\" (default Cascade Lake)."); + System.out.println(" The equal count comparison rule for \"" + node + "\" cannot be checked."); + throw new SuccessOnlyConstraintException("equal count comparison"); + } + } + } + } + String sizeRegex = IRNode.parseVectorNodeSize(size, type, vmInfo); + return nodeRegex.replaceAll(IRNode.IS_REPLACED, + "vector[A-Za-z]\\\\[" + sizeRegex + "\\\\]:\\\\{" + type + "\\\\}"); + } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java index 42c1b10e518..02a2d5a4918 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java @@ -61,6 +61,12 @@ public static Constraint createCounts(String nodeRegex, int constraintId, Compar return new Constraint(new CountsConstraintCheck(nodeRegex, constraintId, comparison), nodeRegex, compilationOutput); } + public static Constraint createSuccess() { + String nodeRegex = "impossible_regex"; + String compilationOutput = ""; // empty + return new Constraint(new SuccessConstraintCheck(), nodeRegex, compilationOutput); + } + public String nodeRegex() { return nodeRegex; } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java new file mode 100644 index 00000000000..f74e31828ec --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023, 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. + */ + +package compiler.lib.ir_framework.driver.irmatching.irrule.constraint; + +import compiler.lib.ir_framework.driver.irmatching.MatchResult; + +import java.util.List; + +/** + * This class provides a check that always succeeds. + * + * @see Constraint + */ +class SuccessConstraintCheck implements ConstraintCheck { + + @Override + public MatchResult check(List matchedNodes) { + return SuccessResult.getInstance(); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java index 03a7f127f3d..1c2fba218db 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java @@ -27,6 +27,7 @@ import compiler.lib.ir_framework.IR; import compiler.lib.ir_framework.IRNode; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; /** * Interface to represent a single raw constraint as found in the {@link IR @IR} annotation (i.e. {@link IRNode} @@ -38,5 +39,5 @@ */ public interface RawConstraint { CompilePhase defaultCompilePhase(); - Constraint parse(CompilePhase compilePhase, String compilationOutput); + Constraint parse(CompilePhase compilePhase, String compilationOutput, VMInfo vmInfo); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java index 76c4a65483c..9934a830a06 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java @@ -26,10 +26,15 @@ import compiler.lib.ir_framework.CompilePhase; import compiler.lib.ir_framework.IR; +import compiler.lib.ir_framework.IRNode; import compiler.lib.ir_framework.TestFramework; import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.parsing.RawIRNode; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; +import compiler.lib.ir_framework.driver.SuccessOnlyConstraintException; import compiler.lib.ir_framework.shared.Comparison; +import compiler.lib.ir_framework.shared.TestFormat; +import compiler.lib.ir_framework.shared.TestFormatException; /** * This class represents a raw constraint of a {@link IR#counts()} attribute. @@ -52,9 +57,49 @@ public CompilePhase defaultCompilePhase() { return rawIRNode.defaultCompilePhase(); } + private Comparison.Bound getComparisonBound() { + switch (comparison.getComparator()) { + case "<" -> { + TestFormat.checkNoReport(comparison.getGivenValue() > 0, "Node count comparison \"<" + + comparison.getGivenValue() + "\" is not allowed: always false."); + TestFormat.checkNoReport(comparison.getGivenValue() > 1, "Node count comparison \"<" + + comparison.getGivenValue() + "\" should be rewritten as \"=0\""); + return Comparison.Bound.UPPER; + } + case "<=" -> { + TestFormat.checkNoReport(comparison.getGivenValue() >= 0, "Node count comparison \"<=" + + comparison.getGivenValue() + "\" is not allowed: always false."); + TestFormat.checkNoReport(comparison.getGivenValue() >= 1, "Node count comparison \"<=" + + comparison.getGivenValue() + "\" should be rewritten as \"=0\""); + return Comparison.Bound.UPPER; + } + case "=" -> { + // "=0" is same as setting upper bound - just like for failOn. But if we compare equals a + // strictly positive number it is like setting both upper and lower bound (equal). + return comparison.getGivenValue() > 0 ? Comparison.Bound.EQUAL : Comparison.Bound.UPPER; + } + case ">" -> { + TestFormat.checkNoReport(comparison.getGivenValue() >= 0, "Node count comparison \">" + + comparison.getGivenValue() + "\" is useless, please only use positive numbers."); + return Comparison.Bound.LOWER; + } + case ">=" -> { + TestFormat.checkNoReport(comparison.getGivenValue() > 0, "Node count comparison \">=" + + comparison.getGivenValue() + "\" is useless, please only use strictly positive numbers with greater-equal."); + return Comparison.Bound.LOWER; + } + case "!=" -> throw new TestFormatException("Not-equal comparator not supported. Please rewrite the rule."); + default -> throw new TestFormatException("Comparator not handled: " + comparison.getComparator()); + } + } + @Override - public Constraint parse(CompilePhase compilePhase, String compilationOutput) { + public Constraint parse(CompilePhase compilePhase, String compilationOutput, VMInfo vmInfo) { TestFramework.check(compilePhase != CompilePhase.DEFAULT, "must not be default"); - return Constraint.createCounts(rawIRNode.regex(compilePhase), constraintIndex, comparison, compilationOutput); + try { + return Constraint.createCounts(rawIRNode.regex(compilePhase, vmInfo, getComparisonBound()), constraintIndex, comparison, compilationOutput); + } catch (SuccessOnlyConstraintException e) { + return Constraint.createSuccess(); + } } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java index 18ec1936273..4bd334f1f08 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java @@ -26,8 +26,11 @@ import compiler.lib.ir_framework.CompilePhase; import compiler.lib.ir_framework.IR; import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.driver.SuccessOnlyConstraintException; import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.parsing.RawIRNode; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; +import compiler.lib.ir_framework.shared.Comparison; /** * This class represents a raw constraint of a {@link IR#failOn()} attribute. @@ -49,9 +52,13 @@ public CompilePhase defaultCompilePhase() { } @Override - public Constraint parse(CompilePhase compilePhase, String compilationOutput) { + public Constraint parse(CompilePhase compilePhase, String compilationOutput, VMInfo vmInfo) { TestFramework.check(compilePhase != CompilePhase.DEFAULT, "must not be default"); - return Constraint.createFailOn(rawIRNode.regex(compilePhase), constraintIndex, compilationOutput); + try { + return Constraint.createFailOn(rawIRNode.regex(compilePhase, vmInfo, Comparison.Bound.UPPER), constraintIndex, compilationOutput); + } catch (SuccessOnlyConstraintException e) { + return Constraint.createSuccess(); + } } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java index 7c89ac433a6..5d327135c22 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java @@ -34,6 +34,7 @@ import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.parsing.RawFailOn; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.raw.RawConstraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.TestFormat; import java.util.*; @@ -60,24 +61,24 @@ public CompilePhaseIRRuleBuilder(IR irAnno, Compilation compilation) { this.rawCountsConstraints = new RawCounts(irAnno.counts()).createRawConstraints(); } - public SortedSet build() { + public SortedSet build(VMInfo vmInfo) { CompilePhase[] compilePhases = irAnno.phase(); TestFormat.checkNoReport(new HashSet<>(List.of(compilePhases)).size() == compilePhases.length, "Cannot specify a compile phase twice"); for (CompilePhase compilePhase : compilePhases) { if (compilePhase == CompilePhase.DEFAULT) { - createCompilePhaseIRRulesForDefault(); + createCompilePhaseIRRulesForDefault(vmInfo); } else { - createCompilePhaseIRRule(compilePhase); + createCompilePhaseIRRule(compilePhase, vmInfo); } } return compilePhaseIRRules; } - private void createCompilePhaseIRRulesForDefault() { + private void createCompilePhaseIRRulesForDefault(VMInfo vmInfo) { DefaultPhaseRawConstraintParser parser = new DefaultPhaseRawConstraintParser(compilation); Map> checkAttributesForCompilePhase = - parser.parse(rawFailOnConstraints, rawCountsConstraints); + parser.parse(rawFailOnConstraints, rawCountsConstraints, vmInfo); checkAttributesForCompilePhase.forEach((compilePhase, constraints) -> { if (compilation.hasOutput(compilePhase)) { compilePhaseIRRules.add(new CompilePhaseIRRule(compilePhase, constraints, @@ -88,9 +89,9 @@ private void createCompilePhaseIRRulesForDefault() { }); } - private void createCompilePhaseIRRule(CompilePhase compilePhase) { - List failOnConstraints = parseRawConstraints(rawFailOnConstraints, compilePhase); - List countsConstraints = parseRawConstraints(rawCountsConstraints, compilePhase); + private void createCompilePhaseIRRule(CompilePhase compilePhase, VMInfo vmInfo) { + List failOnConstraints = parseRawConstraints(rawFailOnConstraints, compilePhase, vmInfo); + List countsConstraints = parseRawConstraints(rawCountsConstraints, compilePhase, vmInfo); if (compilation.hasOutput(compilePhase)) { createValidCompilePhaseIRRule(compilePhase, failOnConstraints, countsConstraints); } else { @@ -113,10 +114,11 @@ private void createValidCompilePhaseIRRule(CompilePhase compilePhase, List parseRawConstraints(List rawConstraints, - CompilePhase compilePhase) { + CompilePhase compilePhase, + VMInfo vmInfo) { List constraintResultList = new ArrayList<>(); for (RawConstraint rawConstraint : rawConstraints) { - constraintResultList.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase))); + constraintResultList.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase), vmInfo)); } return constraintResultList; } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java index cf530fb19a2..1f837883978 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java @@ -31,6 +31,7 @@ import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.FailOn; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.raw.RawConstraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.TestFrameworkException; import java.util.ArrayList; @@ -52,22 +53,26 @@ public DefaultPhaseRawConstraintParser(Compilation compilation) { } public Map> parse(List rawFailOnConstraints, - List rawCountsConstraints) { + List rawCountsConstraints, + VMInfo vmInfo) { Map failOnForCompilePhase = parseRawConstraints(rawFailOnConstraints, - CheckAttributeType.FAIL_ON); + CheckAttributeType.FAIL_ON, + vmInfo); Map countsForCompilePhase = parseRawConstraints(rawCountsConstraints, - CheckAttributeType.COUNTS); + CheckAttributeType.COUNTS, + vmInfo); return mergeCheckAttributesForCompilePhase(failOnForCompilePhase, countsForCompilePhase); } private Map parseRawConstraints(List rawConstraints, - CheckAttributeType checkAttributeType) { + CheckAttributeType checkAttributeType, + VMInfo vmInfo) { Map> matchableForCompilePhase = new HashMap<>(); for (RawConstraint rawConstraint : rawConstraints) { CompilePhase compilePhase = rawConstraint.defaultCompilePhase(); List checkAttribute = matchableForCompilePhase.computeIfAbsent(compilePhase, k -> new ArrayList<>()); - checkAttribute.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase))); + checkAttribute.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase), vmInfo)); } return replaceConstraintsWithCheckAttribute(matchableForCompilePhase, checkAttributeType); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java index fb7db3e3a3b..beed44a01c5 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java @@ -51,18 +51,18 @@ public IRMethodBuilder(TestMethods testMethods, LoggedMethods loggedMethods) { * Create IR methods for all test methods identified by {@link IREncodingParser} by combining them with the parsed * compilation output from {@link HotSpotPidFileParser}. */ - public SortedSet build() { + public SortedSet build(VMInfo vmInfo) { SortedSet irMethods = new TreeSet<>(); testMethods.testMethods().forEach( - (methodName, testMethod) -> irMethods.add(createIRMethod(methodName, testMethod))); + (methodName, testMethod) -> irMethods.add(createIRMethod(methodName, testMethod, vmInfo))); return irMethods; } - private IRMethodMatchable createIRMethod(String methodName, TestMethod testMethod) { + private IRMethodMatchable createIRMethod(String methodName, TestMethod testMethod, VMInfo vmInfo) { LoggedMethod loggedMethod = loggedMethods.get(methodName); if (loggedMethod != null) { return new IRMethod(testMethod.method(), testMethod.irRuleIds(), testMethod.irAnnos(), - new Compilation(loggedMethod.compilationOutput())); + new Compilation(loggedMethod.compilationOutput()), vmInfo); } else { return new NotCompiledIRMethod(testMethod.method(), testMethod.irRuleIds().length); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java index ea4b0acf0bb..776642d460c 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java @@ -54,10 +54,11 @@ public TestClassParser(Class testClass) { public Matchable parse(String hotspotPidFileName, String irEncoding) { IREncodingParser irEncodingParser = new IREncodingParser(testClass); TestMethods testMethods = irEncodingParser.parse(irEncoding); + VMInfo vmInfo = VMInfoParser.parseVMInfo(irEncoding); if (testMethods.hasTestMethods()) { HotSpotPidFileParser hotSpotPidFileParser = new HotSpotPidFileParser(testClass.getName(), testMethods); LoggedMethods loggedMethods = hotSpotPidFileParser.parse(hotspotPidFileName); - return createTestClass(testMethods, loggedMethods); + return createTestClass(testMethods, loggedMethods, vmInfo); } return new NonIRTestClass(); } @@ -66,9 +67,9 @@ public Matchable parse(String hotspotPidFileName, String irEncoding) { * Create test class with IR methods for all test methods identified by {@link IREncodingParser} by combining them * with the parsed compilation output from {@link HotSpotPidFileParser}. */ - private Matchable createTestClass(TestMethods testMethods, LoggedMethods loggedMethods) { + private Matchable createTestClass(TestMethods testMethods, LoggedMethods loggedMethods, VMInfo vmInfo) { IRMethodBuilder irMethodBuilder = new IRMethodBuilder(testMethods, loggedMethods); - SortedSet irMethods = irMethodBuilder.build(); + SortedSet irMethods = irMethodBuilder.build(vmInfo); TestFormat.throwIfAnyFailures(); return new TestClass(irMethods); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java new file mode 100644 index 00000000000..d76dea902c2 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2023, 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. + */ + +package compiler.lib.ir_framework.driver.irmatching.parser; + +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.shared.TestFrameworkException; + +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * This class stores the key value mapping from the VMInfo. + * + * @see IREncodingParser + */ +public class VMInfo { + /** + * Stores the key-value mapping. + */ + private final Map keyValueMap; + + private static final Pattern CPU_SKYLAKE_PATTERN = + Pattern.compile("family 6 model 85 stepping (\\d) "); + + public VMInfo(Map map) { + this.keyValueMap = map; + + TestFramework.check(isKey("cpuFeatures"), "VMInfo does not contain cpuFeatures"); + TestFramework.check(isKey("MaxVectorSize"), "VMInfo does not contain MaxVectorSize"); + TestFramework.check(isKey("MaxVectorSizeIsDefault"), "VMInfo does not contain MaxVectorSizeIsDefault"); + TestFramework.check(isKey("LoopMaxUnroll"), "VMInfo does not contain LoopMaxUnroll"); + TestFramework.check(isKey("UseAVX"), "VMInfo does not contain UseAVX"); + TestFramework.check(isKey("UseAVXIsDefault"), "VMInfo does not contain UseAVXIsDefault"); + } + + public String getStringValue(String key) { + TestFramework.check(isKey(key), "VMInfo does not contain \"" + key + "\""); + return keyValueMap.get(key); + } + + public long getLongValue(String key) { + try { + return Long.parseLong(getStringValue(key)); + } catch (NumberFormatException e) { + throw new TestFrameworkException("VMInfo value for \"" + key + "\" is not a long, got \"" + getStringValue(key) + "\""); + } + } + + public boolean hasCPUFeature(String feature) { + String features = getStringValue("cpuFeatures") + ","; + return features.contains(" " + feature + ","); + } + + public boolean isCascadeLake() { + Matcher matcher = CPU_SKYLAKE_PATTERN.matcher(getStringValue("cpuFeatures")); + if (!matcher.find()) { + return false; // skylake pattern not found + } + String stepping = matcher.group(1).trim(); + return Long.parseLong(stepping) >= 5; // this makes it Cascade Lake + } + + public boolean isDefaultCascadeLake() { + // See VM_Version::is_default_intel_cascade_lake + return isCascadeLake() && + getLongValue("MaxVectorSizeIsDefault") == 1 && + getLongValue("UseAVXIsDefault") == 1 && + getLongValue("UseAVX") > 2; + } + + /** + * Some platforms do not behave as expected, and one cannot trust that the vectors + * make use of the full MaxVectorSize. For Cascade Lake, we only use 32 bytes for + * SuperWord by default even though MaxVectorSize is 64. But the VectorAPI still + * uses 64 bytes. Thus MaxVectorSize is not a reliable indicator for the expected + * maximal vector size on that platform. + */ + public boolean canTrustVectorSize() { + return !isDefaultCascadeLake(); + } + + public boolean isKey(String key) { + return keyValueMap.containsKey(key); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java new file mode 100644 index 00000000000..a8e6782ab12 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023, 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. + */ + +package compiler.lib.ir_framework.driver.irmatching.parser; + +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.shared.TestFrameworkException; +import compiler.lib.ir_framework.test.VMInfoPrinter; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Class to parse the VMInfo emitted by the test VM and creating {@link VMInfo} objects for each entry. + * + * @see VMInfo + */ +public class VMInfoParser { + + private static final Pattern VM_INFO_PATTERN = + Pattern.compile("(?<=" + VMInfoPrinter.START_VM_INFO + "\r?\n).*\\R([\\s\\S]*)(?=" + VMInfoPrinter.END_VM_INFO + ")"); + + /** + * Extract VMInfo from the irEncoding. + */ + public static VMInfo parseVMInfo(String irEncoding) { + Map map = new HashMap<>(); + String[] lines = getVMInfoLines(irEncoding); + for (String s : lines) { + String line = s.trim(); + String[] splitLine = line.split(":", 2); + if (splitLine.length != 2) { + throw new TestFrameworkException("Invalid VMInfo key:value encoding. Found: " + splitLine[0]); + } + String key = splitLine[0]; + String value = splitLine[1]; + map.put(key, value); + } + return new VMInfo(map); + } + + /** + * Extract the VMInfo from the irEncoding string, strip away the header and return the individual key-value lines. + */ + private static String[] getVMInfoLines(String irEncoding) { + Matcher matcher = VM_INFO_PATTERN.matcher(irEncoding); + TestFramework.check(matcher.find(), "Did not find VMInfo in:" + System.lineSeparator() + irEncoding); + String lines = matcher.group(1).trim(); + if (lines.isEmpty()) { + // Nothing to IR match. + return new String[0]; + } + return lines.split("\\R"); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java b/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java index d9e124a2efd..fc553212e4d 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java @@ -38,6 +38,12 @@ public class Comparison> { private final BiPredicate comparisonPredicate; private final String comparator; + public enum Bound { + LOWER, + UPPER, + EQUAL, + } + public Comparison(T givenValue, String comparator, BiPredicate comparisonPredicate) { this.givenValue = givenValue; this.comparator = comparator; diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java index 697f97ea1bc..be65bd6e207 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java @@ -266,6 +266,7 @@ private void setupTests() { addBaseTests(); if (PRINT_VALID_IR_RULES) { irMatchRulePrinter.emit(); + VMInfoPrinter.emit(); } TestFormat.throwIfAnyFailures(); declaredTests.clear(); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java new file mode 100644 index 00000000000..14636da4cbe --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023, 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. + */ + +package compiler.lib.ir_framework.test; + +import compiler.lib.ir_framework.shared.TestFrameworkSocket; +import jdk.test.whitebox.WhiteBox; + +/** + * Prints some test VM info to the socket. + */ +public class VMInfoPrinter { + public static final String START_VM_INFO = "##### IRMatchingVMInfo - used by TestFramework #####"; + public static final String END_VM_INFO = "----- END VMInfo -----"; + + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + + public static void emit() { + StringBuilder vmInfo = new StringBuilder(); + vmInfo.append(START_VM_INFO).append(System.lineSeparator()); + vmInfo.append(":").append(System.lineSeparator()); + + // CPU feature independent info + String cpuFeatures = WHITE_BOX.getCPUFeatures(); + vmInfo.append("cpuFeatures:").append(cpuFeatures).append(System.lineSeparator()); + long maxVectorSize = WHITE_BOX.getIntxVMFlag("MaxVectorSize"); + vmInfo.append("MaxVectorSize:").append(maxVectorSize).append(System.lineSeparator()); + boolean maxVectorSizeIsDefault = WHITE_BOX.isDefaultVMFlag("MaxVectorSize"); + vmInfo.append("MaxVectorSizeIsDefault:") + .append(maxVectorSizeIsDefault ? 1 : 0) + .append(System.lineSeparator()); + long loopMaxUnroll = WHITE_BOX.getIntxVMFlag("LoopMaxUnroll"); + vmInfo.append("LoopMaxUnroll:").append(loopMaxUnroll).append(System.lineSeparator()); + + // CPU feature dependent info + long useAVX = 0; + boolean useAVXIsDefault = true; + if (cpuFeatures.contains(" sse, ")) { + useAVX = WHITE_BOX.getIntVMFlag("UseAVX"); + useAVXIsDefault = WHITE_BOX.isDefaultVMFlag("UseAVX"); + } + vmInfo.append("UseAVX:").append(useAVX).append(System.lineSeparator()); + vmInfo.append("UseAVXIsDefault:") + .append(useAVXIsDefault ? 1 : 0) + .append(System.lineSeparator()); + + vmInfo.append(END_VM_INFO); + TestFrameworkSocket.write(vmInfo.toString(), "VMInfo"); + } +} diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java index 32c1053e6dc..0122f1c34cd 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java @@ -92,7 +92,7 @@ public static void sumReductionInit( (with or without store) in SuperWord::profitable. */ @Test @IR(applyIf = {"SuperWordReductions", "false"}, - failOn = {IRNode.ADD_REDUCTION_VD, IRNode.ABS_V, IRNode.NEG_V}) + failOn = {IRNode.ADD_REDUCTION_VD, IRNode.ABS_VD, IRNode.NEG_VD}) public static double sumReductionImplement( double[] a, double[] b, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java index f3eb427e0ea..f886daf903f 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java @@ -90,10 +90,12 @@ public static void sumReductionInit( @Test @IR(applyIf = {"SuperWordReductions", "false"}, - failOn = {IRNode.ADD_REDUCTION_VF, IRNode.ABS_V, IRNode.NEG_V}) + failOn = {IRNode.ADD_REDUCTION_VF, IRNode.ABS_VF, IRNode.NEG_VF}) @IR(applyIfCPUFeature = {"sse2", "true"}, applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"}, - counts = {IRNode.ADD_REDUCTION_VF, ">= 1", IRNode.ABS_V, ">= 1", IRNode.NEG_V, ">= 1"}) + counts = {IRNode.ADD_REDUCTION_VF, ">= 1", + IRNode.ABS_VF, IRNode.VECTOR_SIZE + "min(LoopMaxUnroll, max_float)", ">= 1", + IRNode.NEG_VF, IRNode.VECTOR_SIZE + "min(LoopMaxUnroll, max_float)", ">= 1"}) public static float sumReductionImplement( float[] a, float[] b, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java index 76453b21e84..d0fd27d25b4 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java @@ -87,10 +87,10 @@ public static void sumReductionInit( Require avx for SQRT_VD. */ @Test @IR(applyIf = {"SuperWordReductions", "false"}, - failOn = {IRNode.ADD_REDUCTION_VD, IRNode.SQRT_V}) + failOn = {IRNode.ADD_REDUCTION_VD, IRNode.SQRT_VD}) @IR(applyIfCPUFeature = {"avx", "true"}, applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"}, - counts = {IRNode.ADD_REDUCTION_VD, ">= 1", IRNode.SQRT_V, ">= 1"}) + counts = {IRNode.ADD_REDUCTION_VD, ">= 1", IRNode.SQRT_VD, ">= 1"}) public static double sumReductionWithStoreImplement( double[] a, double[] b, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java index 803c7e9841d..94e47f3f747 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java @@ -240,7 +240,7 @@ public void runTest9() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test0(int[] dataI, float[] dataF) { for (int i = 0; i < RANGE; i++) { @@ -346,7 +346,7 @@ static void test7(int[] dataI, float[] dataF) { } @Test - @IR(counts = {IRNode.ADD_VF, "> 0"}, + @IR(counts = {IRNode.ADD_VF, IRNode.VECTOR_SIZE + "min(max_int, max_float)", "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) // Some aarch64 machines have AlignVector == true, like ThunderX2 diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java index 9130571a406..36015a03541 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java @@ -28,7 +28,7 @@ * Note: CompileCommand Option Vectorize is enabled. * * Note: this test is auto-generated. Please modify / generate with script: - * https://bugs.openjdk.org/browse/JDK-8298935 + * https://bugs.openjdk.org/browse/JDK-8310308 * * Types: int, long, short, char, byte, float, double * Offsets: 0, -1, 1, -2, 2, -3, 3, -4, 4, -7, 7, -8, 8, -14, 14, -16, 16, -18, 18, -20, 20, -31, 31, -32, 32, -63, 63, -64, 64, -65, 65, -128, 128, -129, 129, -192, 192 @@ -1391,19 +1391,19 @@ public static void main(String args[]) { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP0(int[] data) { @@ -1423,35 +1423,35 @@ public static void runIntP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM1(int[] data) { @@ -1499,19 +1499,19 @@ public static void runIntP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM2(int[] data) { @@ -1532,22 +1532,22 @@ public static void runIntM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP2(int[] data) { @@ -1567,35 +1567,35 @@ public static void runIntP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM3(int[] data) { @@ -1616,22 +1616,22 @@ public static void runIntM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP3(int[] data) { @@ -1651,19 +1651,19 @@ public static void runIntP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM4(int[] data) { @@ -1683,26 +1683,26 @@ public static void runIntM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP4(int[] data) { @@ -1722,35 +1722,35 @@ public static void runIntP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM7(int[] data) { @@ -1770,22 +1770,22 @@ public static void runIntM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP7(int[] data) { @@ -1805,19 +1805,19 @@ public static void runIntP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM8(int[] data) { @@ -1837,32 +1837,32 @@ public static void runIntM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP8(int[] data) { @@ -1882,19 +1882,19 @@ public static void runIntP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM14(int[] data) { @@ -1914,20 +1914,20 @@ public static void runIntM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP14(int[] data) { @@ -1947,19 +1947,19 @@ public static void runIntP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM16(int[] data) { @@ -1979,35 +1979,35 @@ public static void runIntM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP16(int[] data) { @@ -2027,19 +2027,19 @@ public static void runIntP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM18(int[] data) { @@ -2059,19 +2059,19 @@ public static void runIntM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP18(int[] data) { @@ -2091,19 +2091,19 @@ public static void runIntP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM20(int[] data) { @@ -2123,23 +2123,23 @@ public static void runIntM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP20(int[] data) { @@ -2159,35 +2159,35 @@ public static void runIntP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM31(int[] data) { @@ -2207,19 +2207,19 @@ public static void runIntM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP31(int[] data) { @@ -2239,19 +2239,19 @@ public static void runIntP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM32(int[] data) { @@ -2271,35 +2271,35 @@ public static void runIntM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP32(int[] data) { @@ -2319,35 +2319,35 @@ public static void runIntP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM63(int[] data) { @@ -2367,19 +2367,19 @@ public static void runIntM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP63(int[] data) { @@ -2399,19 +2399,19 @@ public static void runIntP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM64(int[] data) { @@ -2431,35 +2431,35 @@ public static void runIntM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP64(int[] data) { @@ -2479,35 +2479,35 @@ public static void runIntP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM65(int[] data) { @@ -2527,19 +2527,19 @@ public static void runIntM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP65(int[] data) { @@ -2559,19 +2559,19 @@ public static void runIntP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM128(int[] data) { @@ -2591,35 +2591,35 @@ public static void runIntM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP128(int[] data) { @@ -2639,35 +2639,35 @@ public static void runIntP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM129(int[] data) { @@ -2687,19 +2687,19 @@ public static void runIntM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP129(int[] data) { @@ -2719,19 +2719,19 @@ public static void runIntP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM192(int[] data) { @@ -2751,35 +2751,35 @@ public static void runIntM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP192(int[] data) { @@ -2799,19 +2799,19 @@ public static void runIntP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP0(long[] data) { @@ -2831,35 +2831,35 @@ public static void runLongP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM1(long[] data) { @@ -2907,19 +2907,19 @@ public static void runLongP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM2(long[] data) { @@ -2939,26 +2939,26 @@ public static void runLongM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP2(long[] data) { @@ -2978,35 +2978,35 @@ public static void runLongP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM3(long[] data) { @@ -3026,22 +3026,22 @@ public static void runLongM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP3(long[] data) { @@ -3061,19 +3061,19 @@ public static void runLongP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM4(long[] data) { @@ -3093,32 +3093,32 @@ public static void runLongM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP4(long[] data) { @@ -3138,35 +3138,35 @@ public static void runLongP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM7(long[] data) { @@ -3186,20 +3186,20 @@ public static void runLongM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP7(long[] data) { @@ -3219,19 +3219,19 @@ public static void runLongP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM8(long[] data) { @@ -3251,35 +3251,35 @@ public static void runLongM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP8(long[] data) { @@ -3299,19 +3299,19 @@ public static void runLongP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM14(long[] data) { @@ -3331,23 +3331,23 @@ public static void runLongM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP14(long[] data) { @@ -3367,19 +3367,19 @@ public static void runLongP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM16(long[] data) { @@ -3399,35 +3399,35 @@ public static void runLongM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP16(long[] data) { @@ -3447,19 +3447,19 @@ public static void runLongP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM18(long[] data) { @@ -3479,23 +3479,23 @@ public static void runLongM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP18(long[] data) { @@ -3515,19 +3515,19 @@ public static void runLongP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM20(long[] data) { @@ -3547,31 +3547,31 @@ public static void runLongM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP20(long[] data) { @@ -3591,35 +3591,35 @@ public static void runLongP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM31(long[] data) { @@ -3639,19 +3639,19 @@ public static void runLongM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP31(long[] data) { @@ -3671,19 +3671,19 @@ public static void runLongP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM32(long[] data) { @@ -3703,35 +3703,35 @@ public static void runLongM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP32(long[] data) { @@ -3751,35 +3751,35 @@ public static void runLongP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM63(long[] data) { @@ -3799,19 +3799,19 @@ public static void runLongM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP63(long[] data) { @@ -3831,19 +3831,19 @@ public static void runLongP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM64(long[] data) { @@ -3863,35 +3863,35 @@ public static void runLongM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP64(long[] data) { @@ -3911,35 +3911,35 @@ public static void runLongP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM65(long[] data) { @@ -3959,19 +3959,19 @@ public static void runLongM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP65(long[] data) { @@ -3991,19 +3991,19 @@ public static void runLongP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM128(long[] data) { @@ -4023,35 +4023,35 @@ public static void runLongM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP128(long[] data) { @@ -4071,35 +4071,35 @@ public static void runLongP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM129(long[] data) { @@ -4119,19 +4119,19 @@ public static void runLongM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP129(long[] data) { @@ -4151,19 +4151,19 @@ public static void runLongP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM192(long[] data) { @@ -4183,35 +4183,35 @@ public static void runLongM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP192(long[] data) { @@ -4231,19 +4231,19 @@ public static void runLongP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP0(short[] data) { @@ -4263,35 +4263,35 @@ public static void runShortP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM1(short[] data) { @@ -4339,19 +4339,19 @@ public static void runShortP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM2(short[] data) { @@ -4372,22 +4372,22 @@ public static void runShortM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP2(short[] data) { @@ -4407,35 +4407,35 @@ public static void runShortP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM3(short[] data) { @@ -4456,22 +4456,22 @@ public static void runShortM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP3(short[] data) { @@ -4491,19 +4491,19 @@ public static void runShortP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM4(short[] data) { @@ -4524,22 +4524,22 @@ public static void runShortM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP4(short[] data) { @@ -4559,35 +4559,35 @@ public static void runShortP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM7(short[] data) { @@ -4608,22 +4608,22 @@ public static void runShortM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP7(short[] data) { @@ -4643,19 +4643,19 @@ public static void runShortP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM8(short[] data) { @@ -4675,26 +4675,26 @@ public static void runShortM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP8(short[] data) { @@ -4714,19 +4714,19 @@ public static void runShortP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM14(short[] data) { @@ -4746,22 +4746,22 @@ public static void runShortM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP14(short[] data) { @@ -4781,19 +4781,19 @@ public static void runShortP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM16(short[] data) { @@ -4813,32 +4813,32 @@ public static void runShortM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP16(short[] data) { @@ -4858,19 +4858,19 @@ public static void runShortP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM18(short[] data) { @@ -4890,20 +4890,20 @@ public static void runShortM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 36 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 36"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP18(short[] data) { @@ -4923,19 +4923,19 @@ public static void runShortP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM20(short[] data) { @@ -4955,20 +4955,20 @@ public static void runShortM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 40 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 40"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP20(short[] data) { @@ -4988,35 +4988,35 @@ public static void runShortP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM31(short[] data) { @@ -5036,20 +5036,20 @@ public static void runShortM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 62 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 62"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP31(short[] data) { @@ -5069,19 +5069,19 @@ public static void runShortP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM32(short[] data) { @@ -5101,35 +5101,35 @@ public static void runShortM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP32(short[] data) { @@ -5149,35 +5149,35 @@ public static void runShortP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM63(short[] data) { @@ -5197,19 +5197,19 @@ public static void runShortM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP63(short[] data) { @@ -5229,19 +5229,19 @@ public static void runShortP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM64(short[] data) { @@ -5261,35 +5261,35 @@ public static void runShortM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP64(short[] data) { @@ -5309,35 +5309,35 @@ public static void runShortP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM65(short[] data) { @@ -5357,19 +5357,19 @@ public static void runShortM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP65(short[] data) { @@ -5389,19 +5389,19 @@ public static void runShortP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM128(short[] data) { @@ -5421,35 +5421,35 @@ public static void runShortM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP128(short[] data) { @@ -5469,35 +5469,35 @@ public static void runShortP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM129(short[] data) { @@ -5517,19 +5517,19 @@ public static void runShortM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP129(short[] data) { @@ -5549,19 +5549,19 @@ public static void runShortP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM192(short[] data) { @@ -5581,35 +5581,35 @@ public static void runShortM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP192(short[] data) { @@ -5629,19 +5629,19 @@ public static void runShortP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP0(char[] data) { @@ -5661,35 +5661,35 @@ public static void runCharP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM1(char[] data) { @@ -5737,19 +5737,19 @@ public static void runCharP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM2(char[] data) { @@ -5770,22 +5770,22 @@ public static void runCharM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP2(char[] data) { @@ -5805,35 +5805,35 @@ public static void runCharP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM3(char[] data) { @@ -5854,22 +5854,22 @@ public static void runCharM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP3(char[] data) { @@ -5889,19 +5889,19 @@ public static void runCharP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM4(char[] data) { @@ -5922,22 +5922,22 @@ public static void runCharM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP4(char[] data) { @@ -5957,35 +5957,35 @@ public static void runCharP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM7(char[] data) { @@ -6006,22 +6006,22 @@ public static void runCharM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP7(char[] data) { @@ -6041,19 +6041,19 @@ public static void runCharP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM8(char[] data) { @@ -6073,26 +6073,26 @@ public static void runCharM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP8(char[] data) { @@ -6112,19 +6112,19 @@ public static void runCharP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM14(char[] data) { @@ -6144,22 +6144,22 @@ public static void runCharM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP14(char[] data) { @@ -6179,19 +6179,19 @@ public static void runCharP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM16(char[] data) { @@ -6211,32 +6211,32 @@ public static void runCharM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP16(char[] data) { @@ -6256,19 +6256,19 @@ public static void runCharP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM18(char[] data) { @@ -6288,20 +6288,20 @@ public static void runCharM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 36 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 36"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP18(char[] data) { @@ -6321,19 +6321,19 @@ public static void runCharP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM20(char[] data) { @@ -6353,20 +6353,20 @@ public static void runCharM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 40 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 40"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP20(char[] data) { @@ -6386,35 +6386,35 @@ public static void runCharP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM31(char[] data) { @@ -6434,20 +6434,20 @@ public static void runCharM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 62 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 62"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP31(char[] data) { @@ -6467,19 +6467,19 @@ public static void runCharP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM32(char[] data) { @@ -6499,35 +6499,35 @@ public static void runCharM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP32(char[] data) { @@ -6547,35 +6547,35 @@ public static void runCharP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM63(char[] data) { @@ -6595,19 +6595,19 @@ public static void runCharM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP63(char[] data) { @@ -6627,19 +6627,19 @@ public static void runCharP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM64(char[] data) { @@ -6659,35 +6659,35 @@ public static void runCharM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP64(char[] data) { @@ -6707,35 +6707,35 @@ public static void runCharP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM65(char[] data) { @@ -6755,19 +6755,19 @@ public static void runCharM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP65(char[] data) { @@ -6787,19 +6787,19 @@ public static void runCharP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM128(char[] data) { @@ -6819,35 +6819,35 @@ public static void runCharM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP128(char[] data) { @@ -6867,35 +6867,35 @@ public static void runCharP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM129(char[] data) { @@ -6915,19 +6915,19 @@ public static void runCharM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP129(char[] data) { @@ -6947,19 +6947,19 @@ public static void runCharP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM192(char[] data) { @@ -6979,35 +6979,35 @@ public static void runCharM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP192(char[] data) { @@ -7027,19 +7027,19 @@ public static void runCharP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP0(byte[] data) { @@ -7059,35 +7059,35 @@ public static void runByteP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM1(byte[] data) { @@ -7135,35 +7135,35 @@ public static void runByteP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM2(byte[] data) { @@ -7211,35 +7211,35 @@ public static void runByteP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM3(byte[] data) { @@ -7287,19 +7287,19 @@ public static void runByteP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM4(byte[] data) { @@ -7320,22 +7320,22 @@ public static void runByteM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP4(byte[] data) { @@ -7355,35 +7355,35 @@ public static void runByteP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM7(byte[] data) { @@ -7404,22 +7404,22 @@ public static void runByteM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP7(byte[] data) { @@ -7439,19 +7439,19 @@ public static void runByteP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM8(byte[] data) { @@ -7472,22 +7472,22 @@ public static void runByteM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP8(byte[] data) { @@ -7507,35 +7507,35 @@ public static void runByteP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM14(byte[] data) { @@ -7556,22 +7556,22 @@ public static void runByteM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP14(byte[] data) { @@ -7591,19 +7591,19 @@ public static void runByteP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM16(byte[] data) { @@ -7623,26 +7623,26 @@ public static void runByteM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP16(byte[] data) { @@ -7662,35 +7662,35 @@ public static void runByteP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM18(byte[] data) { @@ -7710,22 +7710,22 @@ public static void runByteM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 18 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 18"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 18 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 18"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 18 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 18"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP18(byte[] data) { @@ -7745,19 +7745,19 @@ public static void runByteP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM20(byte[] data) { @@ -7777,22 +7777,22 @@ public static void runByteM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 20 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 20"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 20 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 20"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 20 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 20"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP20(byte[] data) { @@ -7812,35 +7812,35 @@ public static void runByteP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM31(byte[] data) { @@ -7860,22 +7860,22 @@ public static void runByteM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 31 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 31"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 31 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 31"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 31 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 31"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP31(byte[] data) { @@ -7895,19 +7895,19 @@ public static void runByteP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM32(byte[] data) { @@ -7927,32 +7927,32 @@ public static void runByteM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP32(byte[] data) { @@ -7972,35 +7972,35 @@ public static void runByteP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM63(byte[] data) { @@ -8020,20 +8020,20 @@ public static void runByteM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 63 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 63"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP63(byte[] data) { @@ -8053,19 +8053,19 @@ public static void runByteP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM64(byte[] data) { @@ -8085,35 +8085,35 @@ public static void runByteM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP64(byte[] data) { @@ -8133,35 +8133,35 @@ public static void runByteP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM65(byte[] data) { @@ -8181,19 +8181,19 @@ public static void runByteM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP65(byte[] data) { @@ -8213,19 +8213,19 @@ public static void runByteP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM128(byte[] data) { @@ -8245,35 +8245,35 @@ public static void runByteM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP128(byte[] data) { @@ -8293,35 +8293,35 @@ public static void runByteP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM129(byte[] data) { @@ -8341,19 +8341,19 @@ public static void runByteM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP129(byte[] data) { @@ -8373,19 +8373,19 @@ public static void runByteP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM192(byte[] data) { @@ -8405,35 +8405,35 @@ public static void runByteM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP192(byte[] data) { @@ -8453,19 +8453,19 @@ public static void runByteP192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP0(float[] data) { @@ -8485,35 +8485,35 @@ public static void runFloatP0() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM1(float[] data) { @@ -8561,19 +8561,19 @@ public static void runFloatP1() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM2(float[] data) { @@ -8594,22 +8594,22 @@ public static void runFloatM2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP2(float[] data) { @@ -8629,35 +8629,35 @@ public static void runFloatP2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM3(float[] data) { @@ -8678,22 +8678,22 @@ public static void runFloatM3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP3(float[] data) { @@ -8713,19 +8713,19 @@ public static void runFloatP3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM4(float[] data) { @@ -8745,26 +8745,26 @@ public static void runFloatM4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP4(float[] data) { @@ -8784,35 +8784,35 @@ public static void runFloatP4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM7(float[] data) { @@ -8832,22 +8832,22 @@ public static void runFloatM7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP7(float[] data) { @@ -8867,19 +8867,19 @@ public static void runFloatP7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM8(float[] data) { @@ -8899,32 +8899,32 @@ public static void runFloatM8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP8(float[] data) { @@ -8944,19 +8944,19 @@ public static void runFloatP8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM14(float[] data) { @@ -8976,20 +8976,20 @@ public static void runFloatM14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP14(float[] data) { @@ -9009,19 +9009,19 @@ public static void runFloatP14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM16(float[] data) { @@ -9041,35 +9041,35 @@ public static void runFloatM16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP16(float[] data) { @@ -9089,19 +9089,19 @@ public static void runFloatP16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM18(float[] data) { @@ -9121,19 +9121,19 @@ public static void runFloatM18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP18(float[] data) { @@ -9153,19 +9153,19 @@ public static void runFloatP18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM20(float[] data) { @@ -9185,23 +9185,23 @@ public static void runFloatM20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP20(float[] data) { @@ -9221,35 +9221,35 @@ public static void runFloatP20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM31(float[] data) { @@ -9269,19 +9269,19 @@ public static void runFloatM31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP31(float[] data) { @@ -9301,19 +9301,19 @@ public static void runFloatP31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM32(float[] data) { @@ -9333,35 +9333,35 @@ public static void runFloatM32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP32(float[] data) { @@ -9381,35 +9381,35 @@ public static void runFloatP32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM63(float[] data) { @@ -9429,19 +9429,19 @@ public static void runFloatM63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP63(float[] data) { @@ -9461,19 +9461,19 @@ public static void runFloatP63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM64(float[] data) { @@ -9493,35 +9493,35 @@ public static void runFloatM64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP64(float[] data) { @@ -9541,35 +9541,35 @@ public static void runFloatP64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM65(float[] data) { @@ -9589,19 +9589,19 @@ public static void runFloatM65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP65(float[] data) { @@ -9621,19 +9621,19 @@ public static void runFloatP65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM128(float[] data) { @@ -9653,35 +9653,35 @@ public static void runFloatM128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP128(float[] data) { @@ -9701,35 +9701,35 @@ public static void runFloatP128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM129(float[] data) { @@ -9749,19 +9749,19 @@ public static void runFloatM129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP129(float[] data) { @@ -9781,19 +9781,19 @@ public static void runFloatP129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM192(float[] data) { @@ -9813,35 +9813,35 @@ public static void runFloatM192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP192(float[] data) { @@ -9861,19 +9861,19 @@ public static void runFloatP192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP0(double[] data) { @@ -9893,35 +9893,35 @@ public static void runDoubleP0() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM1(double[] data) { @@ -9969,19 +9969,19 @@ public static void runDoubleP1() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM2(double[] data) { @@ -10001,26 +10001,26 @@ public static void runDoubleM2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP2(double[] data) { @@ -10040,35 +10040,35 @@ public static void runDoubleP2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM3(double[] data) { @@ -10088,22 +10088,22 @@ public static void runDoubleM3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP3(double[] data) { @@ -10123,19 +10123,19 @@ public static void runDoubleP3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM4(double[] data) { @@ -10155,32 +10155,32 @@ public static void runDoubleM4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP4(double[] data) { @@ -10200,35 +10200,35 @@ public static void runDoubleP4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM7(double[] data) { @@ -10248,20 +10248,20 @@ public static void runDoubleM7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP7(double[] data) { @@ -10281,19 +10281,19 @@ public static void runDoubleP7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM8(double[] data) { @@ -10313,35 +10313,35 @@ public static void runDoubleM8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP8(double[] data) { @@ -10361,19 +10361,19 @@ public static void runDoubleP8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM14(double[] data) { @@ -10393,23 +10393,23 @@ public static void runDoubleM14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP14(double[] data) { @@ -10429,19 +10429,19 @@ public static void runDoubleP14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM16(double[] data) { @@ -10461,35 +10461,35 @@ public static void runDoubleM16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP16(double[] data) { @@ -10509,19 +10509,19 @@ public static void runDoubleP16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM18(double[] data) { @@ -10541,23 +10541,23 @@ public static void runDoubleM18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP18(double[] data) { @@ -10577,19 +10577,19 @@ public static void runDoubleP18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM20(double[] data) { @@ -10609,31 +10609,31 @@ public static void runDoubleM20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP20(double[] data) { @@ -10653,35 +10653,35 @@ public static void runDoubleP20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM31(double[] data) { @@ -10701,19 +10701,19 @@ public static void runDoubleM31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP31(double[] data) { @@ -10733,19 +10733,19 @@ public static void runDoubleP31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM32(double[] data) { @@ -10765,35 +10765,35 @@ public static void runDoubleM32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP32(double[] data) { @@ -10813,35 +10813,35 @@ public static void runDoubleP32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM63(double[] data) { @@ -10861,19 +10861,19 @@ public static void runDoubleM63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP63(double[] data) { @@ -10893,19 +10893,19 @@ public static void runDoubleP63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM64(double[] data) { @@ -10925,35 +10925,35 @@ public static void runDoubleM64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP64(double[] data) { @@ -10973,35 +10973,35 @@ public static void runDoubleP64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM65(double[] data) { @@ -11021,19 +11021,19 @@ public static void runDoubleM65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP65(double[] data) { @@ -11053,19 +11053,19 @@ public static void runDoubleP65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM128(double[] data) { @@ -11085,35 +11085,35 @@ public static void runDoubleM128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP128(double[] data) { @@ -11133,35 +11133,35 @@ public static void runDoubleP128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM129(double[] data) { @@ -11181,19 +11181,19 @@ public static void runDoubleM129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP129(double[] data) { @@ -11213,19 +11213,19 @@ public static void runDoubleP129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM192(double[] data) { @@ -11245,35 +11245,35 @@ public static void runDoubleM192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP192(double[] data) { diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java index c384253d6e6..b2748348036 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java @@ -143,7 +143,7 @@ public void runTest1() { } @Test - @IR(counts = {IRNode.ADD_VI, "> 0", IRNode.MUL_VF, "> 0", IRNode.VECTOR_CAST_F2X, "> 0", IRNode.VECTOR_CAST_I2X, "> 0"}, + @IR(counts = {IRNode.ADD_VI, "> 0", IRNode.MUL_VF, "> 0", IRNode.VECTOR_CAST_F2I, "> 0", IRNode.VECTOR_CAST_I2F, "> 0"}, applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"}) static void test1(int[] dataIa, int[] dataIb, float[] dataFa, float[] dataFb) { for (int i = 0; i < RANGE; i+=2) { diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java index 52b319a85b7..30cdc05bfe5 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java @@ -116,7 +116,7 @@ public void runTests() throws Exception { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "= 0", IRNode.ADD_REDUCTION_VI, "> 0"}, // count can be high applyIfAnd = {"MaxVectorSize", "=16", "AlignVector", "false"}, @@ -156,7 +156,7 @@ static int ref1(int[] data, int sum) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.ADD_REDUCTION_VI, "> 0", IRNode.ADD_REDUCTION_VI, "<= 2"}, // count must be low @@ -192,7 +192,7 @@ static int ref2(int[] data, int sum) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.ADD_VI, "= 0", // reduction not moved out of loop IRNode.ADD_REDUCTION_VI, "> 0",}, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java index 9d851a3688b..431bbe9ac4f 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java @@ -59,8 +59,9 @@ public void runTests() throws Exception { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", - IRNode.OR_REDUCTION_V, "> 0",}, + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0", + IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0", + IRNode.OR_REDUCTION_V, "> 0",}, applyIfCPUFeatureOr = {"avx2", "true"}) static long test1(int[] data, long sum) { for (int i = 0; i < data.length; i++) { @@ -75,7 +76,7 @@ static long test1(int[] data, long sum) { // PhaseIdealLoop::move_unordered_reduction_out_of_loop int v = data[i]; // int read data[0] = 0; // ruin the first pack - sum |= v; // long reduction + sum |= v; // long reduction (and implicit cast from int to long) } return sum; } diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java b/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java index a213d481799..69473ff72b3 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java @@ -280,17 +280,23 @@ public void testInt4Kernel(VectorSpecies SPECIES, int[] r, int[] a, int[] b, int } @Test - @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, counts = {IRNode.AND_V, " > 0 ", IRNode.XOR_V, " > 0 "}) + @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, + counts = {IRNode.AND_VI, IRNode.VECTOR_SIZE_4, " > 0 ", + IRNode.XOR_VI, IRNode.VECTOR_SIZE_4, " > 0 "}) public void testInt4_Int128(int[] r, int[] a, int[] b, int[] c, boolean [] mask) { testInt4Kernel(IntVector.SPECIES_128, r, a, b, c, mask); } @Test - @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, counts = {IRNode.AND_V, " > 0 ", IRNode.XOR_V, " > 0 "}) + @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, + counts = {IRNode.AND_VI, IRNode.VECTOR_SIZE_8, " > 0 ", + IRNode.XOR_VI, IRNode.VECTOR_SIZE_8, " > 0 "}) public void testInt4_Int256(int[] r, int[] a, int[] b, int[] c, boolean [] mask) { testInt4Kernel(IntVector.SPECIES_256, r, a, b, c, mask); } @Test - @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, counts = {IRNode.AND_V, " > 0 ", IRNode.XOR_V, " > 0 "}) + @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, + counts = {IRNode.AND_VI, IRNode.VECTOR_SIZE_16, " > 0 ", + IRNode.XOR_VI, IRNode.VECTOR_SIZE_16, " > 0 "}) public void testInt4_Int512(int[] r, int[] a, int[] b, int[] c, boolean [] mask) { testInt4Kernel(IntVector.SPECIES_512, r, a, b, c, mask); } diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java index d9d282c52d4..ad5dd8aa3e7 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java @@ -81,7 +81,7 @@ public static void main(String args[]) { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VL, " > 0 "}) public void test_reversebytes_long_transform1(long[] lout, long[] linp) { VectorMask mask = VectorMask.fromLong(LSPECIES, 3); for (int i = 0; i < LSPECIES.loopBound(linp.length); i+=LSPECIES.length()) { @@ -100,7 +100,7 @@ public void kernel_test_reversebytes_long_transform1() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VL, " > 0 "}) public void test_reversebytes_long_transform2(long[] lout, long[] linp) { VectorMask mask1 = VectorMask.fromLong(LSPECIES, 3); VectorMask mask2 = VectorMask.fromLong(LSPECIES, 3); @@ -120,7 +120,7 @@ public void kernel_test_reversebytes_long_transform2() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_VL}) public void test_reversebytes_long_transform3(long[] lout, long[] linp) { for (int i = 0; i < LSPECIES.loopBound(linp.length); i+=LSPECIES.length()) { LongVector.fromArray(LSPECIES, linp, i) @@ -138,7 +138,7 @@ public void kernel_test_reversebytes_long_transform3() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VI, " > 0 "}) public void test_reversebytes_int_transform1(int[] iout, int[] iinp) { VectorMask mask = VectorMask.fromLong(ISPECIES, 3); for (int i = 0; i < ISPECIES.loopBound(iinp.length); i+=ISPECIES.length()) { @@ -157,7 +157,7 @@ public void kernel_test_reversebytes_int_transform1() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VI, " > 0 "}) public void test_reversebytes_int_transform2(int[] iout, int[] iinp) { VectorMask mask1 = VectorMask.fromLong(ISPECIES, 3); VectorMask mask2 = VectorMask.fromLong(ISPECIES, 3); @@ -177,7 +177,7 @@ public void kernel_test_reversebytes_int_transform2() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_VI}) public void test_reversebytes_int_transform3(int[] iout, int[] iinp) { for (int i = 0; i < ISPECIES.loopBound(iinp.length); i+=ISPECIES.length()) { IntVector.fromArray(ISPECIES, iinp, i) @@ -195,7 +195,7 @@ public void kernel_test_reversebytes_int_transform3() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VS, " > 0 "}) public void test_reversebytes_short_transform1(short[] sout, short[] sinp) { VectorMask mask = VectorMask.fromLong(SSPECIES, 3); for (int i = 0; i < SSPECIES.loopBound(sinp.length); i+=SSPECIES.length()) { @@ -214,7 +214,7 @@ public void kernel_test_reversebytes_short_transform1() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VS, " > 0 "}) public void test_reversebytes_short_transform2(short[] sout, short[] sinp) { VectorMask mask1 = VectorMask.fromLong(SSPECIES, 3); VectorMask mask2 = VectorMask.fromLong(SSPECIES, 3); @@ -234,7 +234,7 @@ public void kernel_test_reversebytes_short_transform2() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_VS}) public void test_reversebytes_short_transform3(short[] sout, short[] sinp) { for (int i = 0; i < SSPECIES.loopBound(sinp.length); i+=SSPECIES.length()) { ShortVector.fromArray(SSPECIES, sinp, i) diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java index 1774162b163..13c5c4d6fdf 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java @@ -78,7 +78,7 @@ public static void main(String args[]) { } @Test - @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_VL}) public void test_reversebytes_long_transform(long[] lout, long[] linp) { VectorMask mask = VectorMask.fromLong(LSPECIES, 3); for (int i = 0; i < LSPECIES.loopBound(linp.length); i+=LSPECIES.length()) { @@ -97,7 +97,7 @@ public void kernel_test_reversebytes_long_transform() { } @Test - @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_VI}) public void test_reversebytes_int_transform(int[] iout, int[] iinp) { VectorMask mask = VectorMask.fromLong(ISPECIES, 3); for (int i = 0; i < ISPECIES.loopBound(iinp.length); i+=ISPECIES.length()) { @@ -116,7 +116,7 @@ public void kernel_test_reversebytes_int_transform() { } @Test - @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_VS}) public void test_reversebytes_short_transform(short[] sout, short[] sinp) { VectorMask mask = VectorMask.fromLong(SSPECIES, 3); for (int i = 0; i < SSPECIES.loopBound(sinp.length); i+=SSPECIES.length()) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java b/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java index 3b92960c181..f5174b7e6dc 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java @@ -77,7 +77,7 @@ public class TestVectorCompressExpandBits { // Test for vectorized Integer.compress operation in SVE2 @Test - @IR(counts = {IRNode.COMPRESS_BITSV, "> 0"}) + @IR(counts = {IRNode.COMPRESS_BITS_VI, "> 0"}) public static void testIntCompress() { for (int i = 0; i < LENGTH; i += I_SPECIES.length()) { IntVector av = IntVector.fromArray(I_SPECIES, ia, i); @@ -96,7 +96,7 @@ public static void testIntCompress_runner() { // Test for vectorized Integer.expand operation in SVE2 @Test - @IR(counts = {IRNode.EXPAND_BITSV, "> 0"}) + @IR(counts = {IRNode.EXPAND_BITS_VI, "> 0"}) public static void testIntExpand() { for (int i = 0; i < LENGTH; i += I_SPECIES.length()) { IntVector av = IntVector.fromArray(I_SPECIES, ia, i); @@ -115,7 +115,7 @@ public static void testIntExpand_runner() { // Test for vectorized Long.compress operation in SVE2 @Test - @IR(counts = {IRNode.COMPRESS_BITSV, "> 0"}) + @IR(counts = {IRNode.COMPRESS_BITS_VL, "> 0"}) public static void testLongCompress() { for (int i = 0; i < LENGTH; i += L_SPECIES.length()) { LongVector av = LongVector.fromArray(L_SPECIES, la, i); @@ -134,7 +134,7 @@ public static void testLongCompress_runner() { // Test for vectorized Long.expand operation in SVE2 @Test - @IR(counts = {IRNode.EXPAND_BITSV, "> 0"}) + @IR(counts = {IRNode.EXPAND_BITS_VL, "> 0"}) public static void testLongExpand() { for (int i = 0; i < LENGTH; i += L_SPECIES.length()) { LongVector av = LongVector.fromArray(L_SPECIES, la, i); diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java index ddc543e4a33..8d5d872375f 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java @@ -86,7 +86,8 @@ public VectorFPtoIntCastTest() { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void float2int() { var cvec = (IntVector)fvec512.convertShape(VectorOperators.F2I, ispec512, 0); cvec.intoArray(int_arr, 0); @@ -103,7 +104,8 @@ public void checkf2int(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512dq", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512dq", "true"}) public void float2long() { var cvec = (LongVector)fvec512.convertShape(VectorOperators.F2L, lspec512, 0); cvec.intoArray(long_arr, 0); @@ -120,7 +122,8 @@ public void checkf2long(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void float2short() { var cvec = (ShortVector)fvec512.convertShape(VectorOperators.F2S, sspec256, 0); cvec.intoArray(short_arr, 0); @@ -137,7 +140,8 @@ public void checkf2short(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void float2byte() { var cvec = (ByteVector)fvec512.convertShape(VectorOperators.F2B, bspec128, 0); cvec.intoArray(byte_arr, 0); @@ -154,7 +158,8 @@ public void checkf2byte(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void double2int() { var cvec = (IntVector)dvec512.convertShape(VectorOperators.D2I, ispec256, 0); cvec.intoArray(int_arr, 0); @@ -171,7 +176,8 @@ public void checkd2int(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512dq", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512dq", "true"}) public void double2long() { var cvec = (LongVector)dvec512.convertShape(VectorOperators.D2L, lspec512, 0); cvec.intoArray(long_arr, 0); @@ -188,7 +194,8 @@ public void checkd2long(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void double2short() { var cvec = (ShortVector)dvec512.convertShape(VectorOperators.D2S, sspec128, 0); cvec.intoArray(short_arr, 0); @@ -205,7 +212,8 @@ public void checkd2short(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void double2byte() { var cvec = (ByteVector)dvec512.convertShape(VectorOperators.D2B, bspec64, 0); cvec.intoArray(byte_arr, 0); diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java index 86dccb66e9b..b0037973ad1 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java @@ -104,7 +104,7 @@ private static long and(long a, long b) { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VB, counts = {IRNode.LOAD_VECTOR_B, ">=1"}) public static void testAndMinusOne() { ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); av.and((byte) -1).intoArray(br, 0); @@ -117,7 +117,7 @@ public static void testAndMinusOne() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VS, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testAndZero() { ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); av.and((short) 0).intoArray(sr, 0); @@ -130,7 +130,7 @@ public static void testAndZero() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VI, counts = {IRNode.LOAD_VECTOR_I, ">=1"}) public static void testAndSame() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); av.and(av).intoArray(ir, 0); @@ -143,7 +143,7 @@ public static void testAndSame() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VL, counts = {IRNode.LOAD_VECTOR_L, ">=1"}) public static void testMaskedAndMinusOne1() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -163,8 +163,8 @@ public static void testMaskedAndMinusOne1() { // Masked AndV in this test should not be optimized out on SVE. @Test @Warmup(10000) - @IR(counts = {IRNode.LOAD_VECTOR, ">=1"}) - @IR(failOn = IRNode.AND_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">=1"}) + @IR(failOn = IRNode.AND_VB, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedAndMinusOne2() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -185,7 +185,7 @@ public static void testMaskedAndMinusOne2() { @Test @Warmup(10000) @IR(counts = {IRNode.STORE_VECTOR, ">=1"}) - @IR(failOn = IRNode.AND_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(failOn = IRNode.AND_VS, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedAndZero1() { VectorMask mask = VectorMask.fromArray(S_SPECIES, m, 0); ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); @@ -204,7 +204,7 @@ public static void testMaskedAndZero1() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VI, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskedAndZero2() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -223,7 +223,7 @@ public static void testMaskedAndZero2() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VL, counts = {IRNode.LOAD_VECTOR_L, ">=1"}) public static void testMaskedAndSame() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -242,7 +242,7 @@ public static void testMaskedAndSame() { // Transform AndV(AndV(a, b), b) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VI, "1"}) public static void testAndSameValue1() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -257,7 +257,7 @@ public static void testAndSameValue1() { // Transform AndV(AndV(a, b), a) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VL, "1"}) public static void testAndSameValue2() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -272,7 +272,7 @@ public static void testAndSameValue2() { // Transform AndV(b, AndV(a, b)) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VI, "1"}) public static void testAndSameValue3() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -287,7 +287,7 @@ public static void testAndSameValue3() { // Transform AndV(a, AndV(a, b)) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VL, "1"}) public static void testAndSameValue4() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -302,7 +302,7 @@ public static void testAndSameValue4() { // Transform AndV(AndV(a, b, m), b, m) ==> AndV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.AND_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testAndMaskSameValue1() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -323,7 +323,7 @@ public static void testAndMaskSameValue1() { // Transform AndV(AndV(a, b, m), a, m) ==> AndV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.AND_VL, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testAndMaskSameValue2() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -344,7 +344,7 @@ public static void testAndMaskSameValue2() { // Transform AndV(a, AndV(a, b, m), m) ==> AndV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.AND_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testAndMaskSameValue3() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -368,7 +368,7 @@ private static long or(long a, long b) { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VB, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testOrMinusOne() { ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); av.or((byte) -1).intoArray(br, 0); @@ -381,7 +381,7 @@ public static void testOrMinusOne() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VS, counts = {IRNode.LOAD_VECTOR_S, ">=1"}) public static void testOrZero() { ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); av.or((short) 0).intoArray(sr, 0); @@ -394,7 +394,7 @@ public static void testOrZero() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VI, counts = {IRNode.LOAD_VECTOR_I, ">=1"}) public static void testOrSame() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); av.or(av).intoArray(ir, 0); @@ -409,7 +409,7 @@ public static void testOrSame() { @Test @Warmup(10000) @IR(counts = {IRNode.STORE_VECTOR, ">=1"}) - @IR(failOn = IRNode.OR_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(failOn = IRNode.OR_VB, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedOrMinusOne1() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -428,7 +428,7 @@ public static void testMaskedOrMinusOne1() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VB, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskedOrMinusOne2() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -447,7 +447,7 @@ public static void testMaskedOrMinusOne2() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VS, counts = {IRNode.LOAD_VECTOR_S, ">=1"}) public static void testMaskedOrZero1() { VectorMask mask = VectorMask.fromArray(S_SPECIES, m, 0); ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); @@ -467,8 +467,8 @@ public static void testMaskedOrZero1() { // Masked OrV in this test should not be optimized out on SVE. @Test @Warmup(10000) - @IR(counts = {IRNode.LOAD_VECTOR, ">=1"}) - @IR(failOn = IRNode.OR_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">=1"}) + @IR(failOn = IRNode.OR_VB, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedOrZero2() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -487,7 +487,7 @@ public static void testMaskedOrZero2() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VL, counts = {IRNode.LOAD_VECTOR_L, ">=1"}) public static void testMaskedOrSame() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -506,7 +506,7 @@ public static void testMaskedOrSame() { // Transform OrV(OrV(a, b), b) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VI, "1"}) public static void testOrSameValue1() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -521,7 +521,7 @@ public static void testOrSameValue1() { // Transform OrV(OrV(a, b), a) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VL, "1"}) public static void testOrSameValue2() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -536,7 +536,7 @@ public static void testOrSameValue2() { // Transform OrV(b, OrV(a, b)) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VI, "1"}) public static void testOrSameValue3() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -551,7 +551,7 @@ public static void testOrSameValue3() { // Transform OrV(a, OrV(a, b)) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VL, "1"}) public static void testOrSameValue4() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -566,7 +566,7 @@ public static void testOrSameValue4() { // Transform OrV(OrV(a, b, m), b, m) ==> OrV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.OR_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testOrMaskSameValue1() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -587,7 +587,7 @@ public static void testOrMaskSameValue1() { // Transform OrV(OrV(a, b, m), a, m) ==> OrV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.OR_VL, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testOrMaskSameValue2() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -608,7 +608,7 @@ public static void testOrMaskSameValue2() { // Transform OrV(a, OrV(a, b, m), m) ==> OrV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.OR_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testOrMaskSameValue3() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -632,7 +632,7 @@ private static long xor(long a, long b) { @Test @Warmup(10000) - @IR(failOn = IRNode.XOR_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.XOR_VB, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testXorSame() { ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); av.lanewise(VectorOperators.XOR, av).intoArray(br, 0); @@ -647,7 +647,7 @@ public static void testXorSame() { @Test @Warmup(10000) @IR(counts = {IRNode.STORE_VECTOR, ">=1"}) - @IR(failOn = IRNode.XOR_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(failOn = IRNode.XOR_VS, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedXorSame() { VectorMask mask = VectorMask.fromArray(S_SPECIES, m, 0); ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); @@ -666,7 +666,7 @@ public static void testMaskedXorSame() { // Following are the vector mask logic operations tests @Test @Warmup(10000) - @IR(failOn = {IRNode.AND_V, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.AND_VI, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskAndMinusOne() { VectorMask ma = VectorMask.fromArray(I_SPECIES, m, 0); VectorMask mb = I_SPECIES.maskAll(true); @@ -680,7 +680,7 @@ public static void testMaskAndMinusOne() { @Test @Warmup(10000) - @IR(failOn = {IRNode.AND_V, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.AND_VS, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskAndZero() { VectorMask ma = VectorMask.fromArray(S_SPECIES, m, 0); VectorMask mb = S_SPECIES.maskAll(false); @@ -694,7 +694,7 @@ public static void testMaskAndZero() { @Test @Warmup(10000) - @IR(failOn = {IRNode.AND_V, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.AND_VB, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskAndSame() { VectorMask ma = VectorMask.fromArray(B_SPECIES, m, 0); ma.and(ma).intoArray(mr, 0); @@ -707,7 +707,7 @@ public static void testMaskAndSame() { @Test @Warmup(10000) - @IR(failOn = {IRNode.OR_V, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.OR_VS, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskOrMinusOne() { VectorMask ma = VectorMask.fromArray(S_SPECIES, m, 0); VectorMask mb = S_SPECIES.maskAll(true); @@ -721,7 +721,7 @@ public static void testMaskOrMinusOne() { @Test @Warmup(10000) - @IR(failOn = {IRNode.OR_V, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.OR_VI, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskOrZero() { VectorMask ma = VectorMask.fromArray(I_SPECIES, m, 0); VectorMask mb = I_SPECIES.maskAll(false); @@ -735,7 +735,7 @@ public static void testMaskOrZero() { @Test @Warmup(10000) - @IR(failOn = {IRNode.OR_V, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.OR_VB, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskOrSame() { VectorMask ma = VectorMask.fromArray(B_SPECIES, m, 0); ma.or(ma).intoArray(mr, 0); @@ -748,7 +748,7 @@ public static void testMaskOrSame() { @Test @Warmup(10000) - @IR(failOn = {IRNode.XOR_V, IRNode.XOR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.XOR_VI, IRNode.XOR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskXorSame() { VectorMask ma = I_SPECIES.maskAll(true); ma.not().intoArray(mr, 0); diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java index 7205c262280..154567922bd 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java @@ -70,7 +70,7 @@ public class VectorReverseBytesTest { } @Test - @IR(failOn = IRNode.REVERSE_BYTES_V) + @IR(failOn = IRNode.REVERSE_BYTES_VB) public static void testReverseBytesV() { for (int i = 0; i < LENGTH; i += B_SPECIES.length()) { ByteVector v = ByteVector.fromArray(B_SPECIES, input, i); @@ -84,8 +84,8 @@ public static void testReverseBytesV() { } @Test - @IR(failOn = IRNode.REVERSE_BYTES_V) - @IR(failOn = IRNode.VECTOR_BLEND) + @IR(failOn = IRNode.REVERSE_BYTES_VB) + @IR(failOn = IRNode.VECTOR_BLEND_B) public static void testReverseBytesVMasked() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); for (int i = 0; i < LENGTH; i += B_SPECIES.length()) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java index 47dcbab8f71..63058e6d453 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java @@ -26,6 +26,7 @@ import compiler.lib.ir_framework.IR; import compiler.lib.ir_framework.Run; import compiler.lib.ir_framework.Test; +import compiler.lib.ir_framework.IRNode; import static compiler.vectorapi.reshape.utils.VectorReshapeHelper.*; import static jdk.incubator.vector.VectorOperators.*; @@ -44,7 +45,7 @@ */ public class TestVectorCast { @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toS64(byte[] input, short[] output) { vectorCast(B2S, BSPEC64, SSPEC64, input, output); } @@ -55,7 +56,7 @@ public static void runB64toS64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toS128(byte[] input, short[] output) { vectorCast(B2S, BSPEC64, SSPEC128, input, output); } @@ -66,7 +67,7 @@ public static void runB64toS128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testB128toS256(byte[] input, short[] output) { vectorCast(B2S, BSPEC128, SSPEC256, input, output); } @@ -77,7 +78,7 @@ public static void runB128toS256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_32, "1"}) public static void testB256toS512(byte[] input, short[] output) { vectorCast(B2S, BSPEC256, SSPEC512, input, output); } @@ -88,7 +89,7 @@ public static void runB256toS512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toI64(byte[] input, int[] output) { vectorCast(B2I, BSPEC64, ISPEC64, input, output); } @@ -99,7 +100,7 @@ public static void runB64toI64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toI128(byte[] input, int[] output) { vectorCast(B2I, BSPEC64, ISPEC128, input, output); } @@ -110,7 +111,7 @@ public static void runB64toI128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toI256(byte[] input, int[] output) { vectorCast(B2I, BSPEC64, ISPEC256, input, output); } @@ -121,7 +122,7 @@ public static void runB64toI256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testB128toI512(byte[] input, int[] output) { vectorCast(B2I, BSPEC128, ISPEC512, input, output); } @@ -132,7 +133,7 @@ public static void runB128toI512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toL64(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC64, input, output); } @@ -143,7 +144,7 @@ public static void runB64toL64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toL128(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC128, input, output); } @@ -154,7 +155,7 @@ public static void runB64toL128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toL256(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC256, input, output); } @@ -165,7 +166,7 @@ public static void runB64toL256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toL512(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC512, input, output); } @@ -176,7 +177,7 @@ public static void runB64toL512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toF64(byte[] input, float[] output) { vectorCast(B2F, BSPEC64, FSPEC64, input, output); } @@ -187,7 +188,7 @@ public static void runB64toF64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toF128(byte[] input, float[] output) { vectorCast(B2F, BSPEC64, FSPEC128, input, output); } @@ -198,7 +199,7 @@ public static void runB64toF128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toF256(byte[] input, float[] output) { vectorCast(B2F, BSPEC64, FSPEC256, input, output); } @@ -209,7 +210,7 @@ public static void runB64toF256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_16, "1"}) public static void testB128toF512(byte[] input, float[] output) { vectorCast(B2F, BSPEC128, FSPEC512, input, output); } @@ -220,7 +221,7 @@ public static void runB128toF512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toD64(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC64, input, output); } @@ -231,7 +232,7 @@ public static void runB64toD64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toD128(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC128, input, output); } @@ -242,7 +243,7 @@ public static void runB64toD128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toD256(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC256, input, output); } @@ -253,7 +254,7 @@ public static void runB64toD256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toD512(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC512, input, output); } @@ -264,7 +265,7 @@ public static void runB64toD512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toB64(short[] input, byte[] output) { vectorCast(S2B, SSPEC64, BSPEC64, input, output); } @@ -275,7 +276,7 @@ public static void runS64toB64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toB64(short[] input, byte[] output) { vectorCast(S2B, SSPEC128, BSPEC64, input, output); } @@ -286,7 +287,7 @@ public static void runS128toB64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_16, "1"}) public static void testS256toB128(short[] input, byte[] output) { vectorCast(S2B, SSPEC256, BSPEC128, input, output); } @@ -297,7 +298,7 @@ public static void runS256toB128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_32, "1"}) public static void testS512toB256(short[] input, byte[] output) { vectorCast(S2B, SSPEC512, BSPEC256, input, output); } @@ -308,7 +309,7 @@ public static void runS512toB256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toI64(short[] input, int[] output) { vectorCast(S2I, SSPEC64, ISPEC64, input, output); } @@ -319,7 +320,7 @@ public static void runS64toI64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toI128(short[] input, int[] output) { vectorCast(S2I, SSPEC64, ISPEC128, input, output); } @@ -330,7 +331,7 @@ public static void runS64toI128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toI256(short[] input, int[] output) { vectorCast(S2I, SSPEC128, ISPEC256, input, output); } @@ -341,7 +342,7 @@ public static void runS128toI256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testS256toI512(short[] input, int[] output) { vectorCast(S2I, SSPEC256, ISPEC512, input, output); } @@ -352,7 +353,7 @@ public static void runS256toI512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toL64(short[] input, long[] output) { vectorCast(S2L, SSPEC64, LSPEC64, input, output); } @@ -363,7 +364,7 @@ public static void runS64toL64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toL128(short[] input, long[] output) { vectorCast(S2L, SSPEC64, LSPEC128, input, output); } @@ -374,7 +375,7 @@ public static void runS64toL128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toL256(short[] input, long[] output) { vectorCast(S2L, SSPEC64, LSPEC256, input, output); } @@ -385,7 +386,7 @@ public static void runS64toL256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toL512(short[] input, long[] output) { vectorCast(S2L, SSPEC128, LSPEC512, input, output); } @@ -396,7 +397,7 @@ public static void runS128toL512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toF64(short[] input, float[] output) { vectorCast(S2F, SSPEC64, FSPEC64, input, output); } @@ -407,7 +408,7 @@ public static void runS64toF64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toF128(short[] input, float[] output) { vectorCast(S2F, SSPEC64, FSPEC128, input, output); } @@ -418,7 +419,7 @@ public static void runS64toF128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toF256(short[] input, float[] output) { vectorCast(S2F, SSPEC128, FSPEC256, input, output); } @@ -429,7 +430,7 @@ public static void runS128toF256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_16, "1"}) public static void testS256toF512(short[] input, float[] output) { vectorCast(S2F, SSPEC256, FSPEC512, input, output); } @@ -440,7 +441,7 @@ public static void runS256toF512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toD64(short[] input, double[] output) { vectorCast(S2D, SSPEC64, DSPEC64, input, output); } @@ -451,7 +452,7 @@ public static void runS64toD64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toD128(short[] input, double[] output) { vectorCast(S2D, SSPEC64, DSPEC128, input, output); } @@ -462,7 +463,7 @@ public static void runS64toD128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toD256(short[] input, double[] output) { vectorCast(S2D, SSPEC64, DSPEC256, input, output); } @@ -473,7 +474,7 @@ public static void runS64toD256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toD512(short[] input, double[] output) { vectorCast(S2D, SSPEC128, DSPEC512, input, output); } @@ -484,7 +485,7 @@ public static void runS128toD512() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toB64(int[] input, byte[] output) { vectorCast(I2B, ISPEC64, BSPEC64, input, output); } @@ -495,7 +496,7 @@ public static void runI64toB64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toB64(int[] input, byte[] output) { vectorCast(I2B, ISPEC128, BSPEC64, input, output); } @@ -506,7 +507,7 @@ public static void runI128toB64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toB64(int[] input, byte[] output) { vectorCast(I2B, ISPEC256, BSPEC64, input, output); } @@ -517,7 +518,7 @@ public static void runI256toB64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_16, "1"}) public static void testI512toB128(int[] input, byte[] output) { vectorCast(I2B, ISPEC512, BSPEC128, input, output); } @@ -528,7 +529,7 @@ public static void runI512toB128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toS64(int[] input, short[] output) { vectorCast(I2S, ISPEC64, SSPEC64, input, output); } @@ -539,7 +540,7 @@ public static void runI64toS64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toS64(int[] input, short[] output) { vectorCast(I2S, ISPEC128, SSPEC64, input, output); } @@ -550,7 +551,7 @@ public static void runI128toS64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toS128(int[] input, short[] output) { vectorCast(I2S, ISPEC256, SSPEC128, input, output); } @@ -561,7 +562,7 @@ public static void runI256toS128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testI512toS256(int[] input, short[] output) { vectorCast(I2S, ISPEC512, SSPEC256, input, output); } @@ -572,7 +573,7 @@ public static void runI512toS256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toL64(int[] input, long[] output) { vectorCast(I2L, ISPEC64, LSPEC64, input, output); } @@ -583,7 +584,7 @@ public static void runI64toL64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toL128(int[] input, long[] output) { vectorCast(I2L, ISPEC64, LSPEC128, input, output); } @@ -594,7 +595,7 @@ public static void runI64toL128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toL256(int[] input, long[] output) { vectorCast(I2L, ISPEC128, LSPEC256, input, output); } @@ -605,7 +606,7 @@ public static void runI128toL256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toL512(int[] input, long[] output) { vectorCast(I2L, ISPEC256, LSPEC512, input, output); } @@ -616,7 +617,7 @@ public static void runI256toL512() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toF64(int[] input, float[] output) { vectorCast(I2F, ISPEC64, FSPEC64, input, output); } @@ -627,7 +628,7 @@ public static void runI64toF64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toF128(int[] input, float[] output) { vectorCast(I2F, ISPEC128, FSPEC128, input, output); } @@ -638,7 +639,7 @@ public static void runI128toF128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toF256(int[] input, float[] output) { vectorCast(I2F, ISPEC256, FSPEC256, input, output); } @@ -649,7 +650,7 @@ public static void runI256toF256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_16, "1"}) public static void testI512toF512(int[] input, float[] output) { vectorCast(I2F, ISPEC512, FSPEC512, input, output); } @@ -660,7 +661,7 @@ public static void runI512toF512() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toD64(int[] input, double[] output) { vectorCast(I2D, ISPEC64, DSPEC64, input, output); } @@ -671,7 +672,7 @@ public static void runI64toD64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toD128(int[] input, double[] output) { vectorCast(I2D, ISPEC64, DSPEC128, input, output); } @@ -682,7 +683,7 @@ public static void runI64toD128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toD256(int[] input, double[] output) { vectorCast(I2D, ISPEC128, DSPEC256, input, output); } @@ -693,7 +694,7 @@ public static void runI128toD256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toD512(int[] input, double[] output) { vectorCast(I2D, ISPEC256, DSPEC512, input, output); } @@ -704,7 +705,7 @@ public static void runI256toD512() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC64, BSPEC64, input, output); } @@ -715,7 +716,7 @@ public static void runL64toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC128, BSPEC64, input, output); } @@ -726,7 +727,7 @@ public static void runL128toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC256, BSPEC64, input, output); } @@ -737,7 +738,7 @@ public static void runL256toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC512, BSPEC64, input, output); } @@ -748,7 +749,7 @@ public static void runL512toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toS64(long[] input, short[] output) { vectorCast(L2S, LSPEC64, SSPEC64, input, output); } @@ -759,7 +760,7 @@ public static void runL64toS64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toS64(long[] input, short[] output) { vectorCast(L2S, LSPEC128, SSPEC64, input, output); } @@ -770,7 +771,7 @@ public static void runL128toS64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toS64(long[] input, short[] output) { vectorCast(L2S, LSPEC256, SSPEC64, input, output); } @@ -781,7 +782,7 @@ public static void runL256toS64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toS128(long[] input, short[] output) { vectorCast(L2S, LSPEC512, SSPEC128, input, output); } @@ -792,7 +793,7 @@ public static void runL512toS128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toI64(long[] input, int[] output) { vectorCast(L2I, LSPEC64, ISPEC64, input, output); } @@ -803,7 +804,7 @@ public static void runL64toI64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toI64(long[] input, int[] output) { vectorCast(L2I, LSPEC128, ISPEC64, input, output); } @@ -814,7 +815,7 @@ public static void runL128toI64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toI128(long[] input, int[] output) { vectorCast(L2I, LSPEC256, ISPEC128, input, output); } @@ -825,7 +826,7 @@ public static void runL256toI128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toI256(long[] input, int[] output) { vectorCast(L2I, LSPEC512, ISPEC256, input, output); } @@ -836,7 +837,7 @@ public static void runL512toI256() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toF64(long[] input, float[] output) { vectorCast(L2F, LSPEC64, FSPEC64, input, output); } @@ -847,7 +848,7 @@ public static void runL64toF64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toF64(long[] input, float[] output) { vectorCast(L2F, LSPEC128, FSPEC64, input, output); } @@ -858,7 +859,7 @@ public static void runL128toF64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toF128(long[] input, float[] output) { vectorCast(L2F, LSPEC256, FSPEC128, input, output); } @@ -869,7 +870,7 @@ public static void runL256toF128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toF256(long[] input, float[] output) { vectorCast(L2F, LSPEC512, FSPEC256, input, output); } @@ -880,7 +881,7 @@ public static void runL512toF256() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toD64(long[] input, double[] output) { vectorCast(L2D, LSPEC64, DSPEC64, input, output); } @@ -891,7 +892,7 @@ public static void runL64toD64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toD128(long[] input, double[] output) { vectorCast(L2D, LSPEC128, DSPEC128, input, output); } @@ -902,7 +903,7 @@ public static void runL128toD128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toD256(long[] input, double[] output) { vectorCast(L2D, LSPEC256, DSPEC256, input, output); } @@ -913,7 +914,7 @@ public static void runL256toD256() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toD512(long[] input, double[] output) { vectorCast(L2D, LSPEC512, DSPEC512, input, output); } @@ -924,7 +925,7 @@ public static void runL512toD512() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toB64(float[] input, byte[] output) { vectorCast(F2B, FSPEC64, BSPEC64, input, output); } @@ -935,7 +936,7 @@ public static void runF64toB64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toB64(float[] input, byte[] output) { vectorCast(F2B, FSPEC128, BSPEC64, input, output); } @@ -946,7 +947,7 @@ public static void runF128toB64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toB64(float[] input, byte[] output) { vectorCast(F2B, FSPEC256, BSPEC64, input, output); } @@ -957,7 +958,7 @@ public static void runF256toB64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_16, "1"}) public static void testF512toB128(float[] input, byte[] output) { vectorCast(F2B, FSPEC512, BSPEC128, input, output); } @@ -968,7 +969,7 @@ public static void runF512toB128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toS64(float[] input, short[] output) { vectorCast(F2S, FSPEC64, SSPEC64, input, output); } @@ -979,7 +980,7 @@ public static void runF64toS64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toS64(float[] input, short[] output) { vectorCast(F2S, FSPEC128, SSPEC64, input, output); } @@ -990,7 +991,7 @@ public static void runF128toS64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toS128(float[] input, short[] output) { vectorCast(F2S, FSPEC256, SSPEC128, input, output); } @@ -1001,7 +1002,7 @@ public static void runF256toS128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testF512toS256(float[] input, short[] output) { vectorCast(F2S, FSPEC512, SSPEC256, input, output); } @@ -1012,7 +1013,7 @@ public static void runF512toS256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toI64(float[] input, int[] output) { vectorCast(F2I, FSPEC64, ISPEC64, input, output); } @@ -1023,7 +1024,7 @@ public static void runF64toI64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toI128(float[] input, int[] output) { vectorCast(F2I, FSPEC128, ISPEC128, input, output); } @@ -1034,7 +1035,7 @@ public static void runF128toI128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toI256(float[] input, int[] output) { vectorCast(F2I, FSPEC256, ISPEC256, input, output); } @@ -1045,7 +1046,7 @@ public static void runF256toI256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testF512toI512(float[] input, int[] output) { vectorCast(F2I, FSPEC512, ISPEC512, input, output); } @@ -1056,7 +1057,7 @@ public static void runF512toI512() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toL64(float[] input, long[] output) { vectorCast(F2L, FSPEC64, LSPEC64, input, output); } @@ -1067,7 +1068,7 @@ public static void runF64toL64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toL128(float[] input, long[] output) { vectorCast(F2L, FSPEC64, LSPEC128, input, output); } @@ -1078,7 +1079,7 @@ public static void runF64toL128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toL256(float[] input, long[] output) { vectorCast(F2L, FSPEC128, LSPEC256, input, output); } @@ -1089,7 +1090,7 @@ public static void runF128toL256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toL512(float[] input, long[] output) { vectorCast(F2L, FSPEC256, LSPEC512, input, output); } @@ -1100,7 +1101,7 @@ public static void runF256toL512() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testF64toD64(float[] input, double[] output) { vectorCast(F2D, FSPEC64, DSPEC64, input, output); } @@ -1111,7 +1112,7 @@ public static void runF64toD64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toD128(float[] input, double[] output) { vectorCast(F2D, FSPEC64, DSPEC128, input, output); } @@ -1122,7 +1123,7 @@ public static void runF64toD128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toD256(float[] input, double[] output) { vectorCast(F2D, FSPEC128, DSPEC256, input, output); } @@ -1133,7 +1134,7 @@ public static void runF128toD256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toD512(float[] input, double[] output) { vectorCast(F2D, FSPEC256, DSPEC512, input, output); } @@ -1144,7 +1145,7 @@ public static void runF256toD512() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC64, BSPEC64, input, output); } @@ -1155,7 +1156,7 @@ public static void runD64toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC128, BSPEC64, input, output); } @@ -1166,7 +1167,7 @@ public static void runD128toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC256, BSPEC64, input, output); } @@ -1177,7 +1178,7 @@ public static void runD256toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC512, BSPEC64, input, output); } @@ -1188,7 +1189,7 @@ public static void runD512toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toS64(double[] input, short[] output) { vectorCast(D2S, DSPEC64, SSPEC64, input, output); } @@ -1199,7 +1200,7 @@ public static void runD64toS64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toS64(double[] input, short[] output) { vectorCast(D2S, DSPEC128, SSPEC64, input, output); } @@ -1210,7 +1211,7 @@ public static void runD128toS64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toS64(double[] input, short[] output) { vectorCast(D2S, DSPEC256, SSPEC64, input, output); } @@ -1221,7 +1222,7 @@ public static void runD256toS64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toS128(double[] input, short[] output) { vectorCast(D2S, DSPEC512, SSPEC128, input, output); } @@ -1232,7 +1233,7 @@ public static void runD512toS128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toI64(double[] input, int[] output) { vectorCast(D2I, DSPEC64, ISPEC64, input, output); } @@ -1243,7 +1244,7 @@ public static void runD64toI64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toI64(double[] input, int[] output) { vectorCast(D2I, DSPEC128, ISPEC64, input, output); } @@ -1254,7 +1255,7 @@ public static void runD128toI64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toI128(double[] input, int[] output) { vectorCast(D2I, DSPEC256, ISPEC128, input, output); } @@ -1265,7 +1266,7 @@ public static void runD256toI128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toI256(double[] input, int[] output) { vectorCast(D2I, DSPEC512, ISPEC256, input, output); } @@ -1276,7 +1277,7 @@ public static void runD512toI256() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toL64(double[] input, long[] output) { vectorCast(D2L, DSPEC64, LSPEC64, input, output); } @@ -1287,7 +1288,7 @@ public static void runD64toL64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toL128(double[] input, long[] output) { vectorCast(D2L, DSPEC128, LSPEC128, input, output); } @@ -1298,7 +1299,7 @@ public static void runD128toL128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toL256(double[] input, long[] output) { vectorCast(D2L, DSPEC256, LSPEC256, input, output); } @@ -1309,7 +1310,7 @@ public static void runD256toL256() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toL512(double[] input, long[] output) { vectorCast(D2L, DSPEC512, LSPEC512, input, output); } @@ -1320,7 +1321,7 @@ public static void runD512toL512() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testD64toF64(double[] input, float[] output) { vectorCast(D2F, DSPEC64, FSPEC64, input, output); } @@ -1331,7 +1332,7 @@ public static void runD64toF64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toF64(double[] input, float[] output) { vectorCast(D2F, DSPEC128, FSPEC64, input, output); } @@ -1342,7 +1343,7 @@ public static void runD128toF64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toF128(double[] input, float[] output) { vectorCast(D2F, DSPEC256, FSPEC128, input, output); } @@ -1353,7 +1354,7 @@ public static void runD256toF128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toF256(double[] input, float[] output) { vectorCast(D2F, DSPEC512, FSPEC256, input, output); } @@ -1364,7 +1365,7 @@ public static void runD512toF256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testUB64toS64(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC64, SSPEC64, input, output); } @@ -1375,7 +1376,7 @@ public static void runUB64toS64() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testUB64toS128(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC64, SSPEC128, input, output); } @@ -1386,7 +1387,7 @@ public static void runUB64toS128() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testUB128toS256(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC128, SSPEC256, input, output); } @@ -1397,7 +1398,7 @@ public static void runUB128toS256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_32, "1"}) public static void testUB256toS512(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC256, SSPEC512, input, output); } @@ -1408,7 +1409,7 @@ public static void runUB256toS512() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testUB64toI64(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC64, ISPEC64, input, output); } @@ -1419,7 +1420,7 @@ public static void runUB64toI64() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testUB64toI128(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC64, ISPEC128, input, output); } @@ -1430,7 +1431,7 @@ public static void runUB64toI128() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testUB64toI256(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC64, ISPEC256, input, output); } @@ -1441,7 +1442,7 @@ public static void runUB64toI256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testUB128toI512(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC128, ISPEC512, input, output); } @@ -1452,7 +1453,7 @@ public static void runUB128toI512() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUB64toL64(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC64, input, output); } @@ -1463,7 +1464,7 @@ public static void runUB64toL64() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUB64toL128(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC128, input, output); } @@ -1474,7 +1475,7 @@ public static void runUB64toL128() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testUB64toL256(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC256, input, output); } @@ -1485,7 +1486,7 @@ public static void runUB64toL256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testUB64toL512(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC512, input, output); } @@ -1496,7 +1497,7 @@ public static void runUB64toL512() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testUS64toI64(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC64, ISPEC64, input, output); } @@ -1507,7 +1508,7 @@ public static void runUS64toI64() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testUS64toI128(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC64, ISPEC128, input, output); } @@ -1518,7 +1519,7 @@ public static void runUS64toI128() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testUS128toI256(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC128, ISPEC256, input, output); } @@ -1529,7 +1530,7 @@ public static void runUS128toI256() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testUS256toI512(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC256, ISPEC512, input, output); } @@ -1540,7 +1541,7 @@ public static void runUS256toI512() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUS64toL64(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC64, LSPEC64, input, output); } @@ -1551,7 +1552,7 @@ public static void runUS64toL64() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUS64toL128(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC64, LSPEC128, input, output); } @@ -1562,7 +1563,7 @@ public static void runUS64toL128() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testUS64toL256(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC64, LSPEC256, input, output); } @@ -1573,7 +1574,7 @@ public static void runUS64toL256() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testUS128toL512(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC128, LSPEC512, input, output); } @@ -1584,7 +1585,7 @@ public static void runUS128toL512() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUI64toL64(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC64, LSPEC64, input, output); } @@ -1595,7 +1596,7 @@ public static void runUI64toL64() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUI64toL128(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC64, LSPEC128, input, output); } @@ -1606,7 +1607,7 @@ public static void runUI64toL128() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testUI128toL256(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC128, LSPEC256, input, output); } @@ -1617,7 +1618,7 @@ public static void runUI128toL256() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testUI256toL512(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC256, LSPEC512, input, output); } diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java index 0349ae01871..349429b6c80 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java @@ -71,15 +71,6 @@ public class VectorReshapeHelper { public static final VectorSpecies FSPEC512 = FloatVector.SPECIES_512; public static final VectorSpecies DSPEC512 = DoubleVector.SPECIES_512; - public static final String B2X_NODE = IRNode.VECTOR_CAST_B2X; - public static final String S2X_NODE = IRNode.VECTOR_CAST_S2X; - public static final String I2X_NODE = IRNode.VECTOR_CAST_I2X; - public static final String L2X_NODE = IRNode.VECTOR_CAST_L2X; - public static final String F2X_NODE = IRNode.VECTOR_CAST_F2X; - public static final String D2X_NODE = IRNode.VECTOR_CAST_D2X; - public static final String UB2X_NODE = IRNode.VECTOR_UCAST_B2X; - public static final String US2X_NODE = IRNode.VECTOR_UCAST_S2X; - public static final String UI2X_NODE = IRNode.VECTOR_UCAST_I2X; public static final String REINTERPRET_NODE = IRNode.VECTOR_REINTERPRET; public static void runMainHelper(Class testClass, Stream testMethods, String... flags) { diff --git a/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java b/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java index e15a4c834cd..e3baed37804 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java @@ -62,8 +62,8 @@ public static void main(String[] args) { // Test for auto-vectorization of Math.min operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MIN_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MIN_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntMin(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { @@ -73,8 +73,8 @@ private static void testIntMin(int[] a, int[] b) { // Test for auto-vectorization of StrictMath.min operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MIN_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MIN_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntStrictMin(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { @@ -84,8 +84,8 @@ private static void testIntStrictMin(int[] a, int[] b) { // Test for auto-vectorization of Math.max operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MAX_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MAX_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntMax(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { @@ -95,8 +95,8 @@ private static void testIntMax(int[] a, int[] b) { // Test for auto-vectorization of StrictMath.max operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MAX_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MAX_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntStrictMax(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java b/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java index 531d82abcc2..4452e576867 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java @@ -51,7 +51,7 @@ public static void main(String args[]) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2HF, "> 0"}) + @IR(counts = {IRNode.VECTOR_CAST_F2HF, IRNode.VECTOR_SIZE + "min(max_float, max_short)", "> 0"}) public void test_float_float16(short[] sout, float[] finp) { for (int i = 0; i < finp.length; i++) { sout[i] = Float.floatToFloat16(finp[i]); @@ -78,7 +78,7 @@ public void kernel_test_float_float16() { } @Test - @IR(counts = {IRNode.VECTOR_CAST_HF2F, "> 0"}) + @IR(counts = {IRNode.VECTOR_CAST_HF2F, IRNode.VECTOR_SIZE + "min(max_float, max_short)", "> 0"}) public void test_float16_float(float[] fout, short[] sinp) { for (int i = 0; i < sinp.length; i++) { fout[i] = Float.float16ToFloat(sinp[i]); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java b/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java index 8c5217c1d51..7d100704013 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java @@ -34,8 +34,8 @@ import compiler.lib.ir_framework.*; public class TestOptionVectorizeIR { - static final int RANGE = 512; - static final int ITER = 100; + static int RANGE = 1024*2; + static int ITER = 100; int[] gold1 = new int[RANGE]; int[] gold2 = new int[RANGE]; int[] gold3 = new int[RANGE]; @@ -220,7 +220,7 @@ static void test1(int[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test2(int[] data) { @@ -231,7 +231,7 @@ static void test2(int[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.REPLICATE_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.REPLICATE_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test3(int[] data, int A, int B) { @@ -273,7 +273,7 @@ static void test6(int[] data) { // ------------------------- Long ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test10(long[] data) { @@ -283,7 +283,7 @@ static void test10(long[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test11(long[] data) { @@ -347,7 +347,7 @@ public void runTest13() { // ------------------------- Short ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test20(short[] data) { @@ -357,7 +357,7 @@ static void test20(short[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test21(short[] data) { @@ -420,7 +420,7 @@ public void runTest23() { // ------------------------- Byte ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.ADD_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test30(byte[] data) { @@ -430,7 +430,7 @@ static void test30(byte[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.ADD_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test31(byte[] data) { @@ -493,7 +493,7 @@ public void runTest33() { // ------------------------- Char ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test40(char[] data) { @@ -503,7 +503,7 @@ static void test40(char[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test41(char[] data) { @@ -565,7 +565,7 @@ public void runTest43() { // ------------------------- Float ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.ADD_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test50(float[] data) { @@ -575,7 +575,7 @@ static void test50(float[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.ADD_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test51(float[] data) { @@ -637,7 +637,7 @@ public void runTest53() { // ------------------------- Double ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.ADD_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test60(double[] data) { @@ -647,7 +647,7 @@ static void test60(double[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.ADD_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test61(double[] data) { diff --git a/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java b/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java index a30015d73f8..1144186d8e5 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java @@ -73,7 +73,7 @@ public static void main(String args[]) { } @Test - @IR(counts = {IRNode.REVERSE_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_VL, "> 0"}) public void test_reverse_long1(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverse(linp[i]); @@ -89,7 +89,7 @@ public void kernel_test_reverse_long1() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_L}) + @IR(failOn = {IRNode.REVERSE_VL, IRNode.REVERSE_L}) public void test_reverse_long2(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverse(Long.reverse(linp[i])); @@ -105,7 +105,7 @@ public void kernel_test_reverse_long2() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_L}) + @IR(failOn = {IRNode.REVERSE_VL, IRNode.REVERSE_L}) public void test_reverse_long3(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverse(linp[i] ^ linp[i]); @@ -121,7 +121,7 @@ public void kernel_test_reverse_long3() { } @Test - @IR(counts = {IRNode.REVERSE_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_VI, "> 0"}) public void test_reverse_int1(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverse(iinp[i]); @@ -137,7 +137,7 @@ public void kernel_test_reverse_int1() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_I}) + @IR(failOn = {IRNode.REVERSE_VI, IRNode.REVERSE_I}) public void test_reverse_int2(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverse(Integer.reverse(iinp[i])); @@ -153,7 +153,7 @@ public void kernel_test_reverse_int2() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_I}) + @IR(failOn = {IRNode.REVERSE_VI, IRNode.REVERSE_I}) public void test_reverse_int3(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverse(iinp[i] ^ iinp[i]); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java b/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java index 2d399fbd274..47813e2790e 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java @@ -74,7 +74,7 @@ public static void main(String args[]) { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VL, "> 0"}) public void test_reverse_bytes_long(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverseBytes(linp[i]); @@ -90,7 +90,7 @@ public void kernel_test_reverse_bytes_long() { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VI, "> 0"}) public void test_reverse_bytes_int(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverseBytes(iinp[i]); @@ -106,7 +106,7 @@ public void kernel_test_reverse_bytes_int() { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VS, "> 0"}) public void test_reverse_bytes_short(short[] sout, short[] sinp) { for (int i = 0; i < sout.length; i+=1) { sout[i] = Short.reverseBytes(sinp[i]); @@ -122,7 +122,7 @@ public void kernel_test_reverse_bytes_short() { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VS, "> 0"}) public void test_reverse_bytes_char(char[] cout, char[] cinp) { for (int i = 0; i < cout.length; i+=1) { cout[i] = Character.reverseBytes(cinp[i]); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java b/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java index 69e97e5c0ef..d1baf7fae4d 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java @@ -54,7 +54,7 @@ public class TestSubwordReverseBytes { } @Test - @IR(failOn = {IRNode.REVERSE_BYTES_V}) + @IR(failOn = {IRNode.REVERSE_BYTES_VS}) public static int[] testShortReverseBytes() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -75,7 +75,7 @@ public static void testShort() { } @Test - @IR(failOn = {IRNode.REVERSE_BYTES_V}) + @IR(failOn = {IRNode.REVERSE_BYTES_VS}) public static int[] testCharacterReverseBytes() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java index 1d73221a549..0d53c748979 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java @@ -98,7 +98,7 @@ public long[] longCombinedRotateShift() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VI, ">0"}) public int[] intShiftLargeDistConstant() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +109,7 @@ public int[] intShiftLargeDistConstant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VI, ">0"}) public int[] intShiftLargeDistInvariant() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +120,7 @@ public int[] intShiftLargeDistInvariant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] shortShiftLargeDistConstant() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public short[] shortShiftLargeDistConstant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] shortShiftLargeDistInvariant() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -142,7 +142,7 @@ public short[] shortShiftLargeDistInvariant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VL, ">0"}) public long[] longShiftLargeDistConstant() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -153,7 +153,7 @@ public long[] longShiftLargeDistConstant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VL, ">0"}) public long[] longShiftLargeDistInvariant() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -186,7 +186,7 @@ public short[] loopIndexShiftDistance() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] vectorUnsignedShiftRight() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java index f7f3dc39431..a4640bbc302 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java @@ -132,7 +132,7 @@ public byte[] NarrowToByte() { // ---------------- Convert I/L to F/D ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_I2X, ">0"}) + counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0"}) public float[] convertIntToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -146,7 +146,7 @@ public float[] convertIntToFloat() { // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. applyIf = {"AlignVector", "false"}, - counts = {IRNode.VECTOR_CAST_I2X, ">0"}) + counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE + "min(max_int, max_double)", ">0"}) public double[] convertIntToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -157,7 +157,7 @@ public double[] convertIntToDouble() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx512dq", "true"}, - counts = {IRNode.VECTOR_CAST_L2X, ">0"}) + counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE + "min(max_long, max_float)", ">0"}) public float[] convertLongToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -168,7 +168,7 @@ public float[] convertLongToFloat() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx512dq", "true"}, - counts = {IRNode.VECTOR_CAST_L2X, ">0"}) + counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0"}) public double[] convertLongToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -180,7 +180,7 @@ public double[] convertLongToDouble() { // ---------------- Convert Subword-I to F/D ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.VECTOR_CAST_S2X, ">0"}) + counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE + "min(max_short, max_float)", ">0"}) public float[] convertShortToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -192,7 +192,7 @@ public float[] convertShortToFloat() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, applyIf = {"MaxVectorSize", ">=32"}, - counts = {IRNode.VECTOR_CAST_S2X, ">0"}) + counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE + "min(max_short, max_double)", ">0"}) public double[] convertShortToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -222,7 +222,7 @@ public double[] convertCharToDouble() { // ---------------- Convert F/D to I/L ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE + "min(max_float, max_int)", ">0"}) public int[] convertFloatToInt() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -236,7 +236,7 @@ public int[] convertFloatToInt() { // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. applyIf = {"AlignVector", "false"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE + "min(max_float, max_long)", ">0"}) public long[] convertFloatToLong() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -247,7 +247,7 @@ public long[] convertFloatToLong() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE + "min(max_double, max_int)", ">0"}) public int[] convertDoubleToInt() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -258,7 +258,7 @@ public int[] convertDoubleToInt() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx512dq", "true"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE + "min(max_double, max_long)", ">0"}) public long[] convertDoubleToLong() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -270,7 +270,7 @@ public long[] convertDoubleToLong() { // ---------------- Convert F/D to Subword-I ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE + "min(max_float, max_short)", ">0"}) public short[] convertFloatToShort() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -281,7 +281,7 @@ public short[] convertFloatToShort() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE + "min(max_float, max_char)", ">0"}) public char[] convertFloatToChar() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -293,7 +293,7 @@ public char[] convertFloatToChar() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx", "true"}, applyIf = {"MaxVectorSize", ">=32"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE + "min(max_double, max_short)", ">0"}) public short[] convertDoubleToShort() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -305,7 +305,7 @@ public short[] convertDoubleToShort() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx", "true"}, applyIf = {"MaxVectorSize", ">=32"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE + "min(max_double, max_char)", ">0"}) public char[] convertDoubleToChar() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -320,7 +320,7 @@ public char[] convertDoubleToChar() { // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. applyIf = {"AlignVector", "false"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0"}) public double[] convertFloatToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -331,7 +331,7 @@ public double[] convertFloatToDouble() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE + "min(max_double, max_float)", ">0"}) public float[] convertDoubleToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java index b4c5108c631..e1d30a5c839 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java @@ -44,7 +44,7 @@ public class BasicBooleanOpTest extends VectorizationTestRunner { - private static final int SIZE = 543; + private static final int SIZE = 6543; private boolean[] a; private boolean[] b; @@ -72,9 +72,9 @@ public boolean[] vectorNot() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VB, ">0"}) @IR(applyIfCPUFeatureAnd = {"avx512f", "false", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VB, ">0"}) @IR(applyIfCPUFeature = {"avx512f", "true"}, counts = {IRNode.MACRO_LOGIC_V, ">0"}) public boolean[] vectorAnd() { @@ -87,7 +87,7 @@ public boolean[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VB, ">0"}) public boolean[] vectorOr() { boolean[] res = new boolean[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +98,7 @@ public boolean[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VB, ">0"}) public boolean[] vectorXor() { boolean[] res = new boolean[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java index 03716157ca6..1ed615317d1 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java @@ -34,6 +34,8 @@ * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI + * -XX:CompileCommand=CompileOnly,compiler.vectorization.runner.BasicByteOpTest::* + * -XX:LoopUnrollLimit=1000 * compiler.vectorization.runner.BasicByteOpTest * * @requires vm.compiler2.enabled & vm.flagless @@ -45,7 +47,7 @@ public class BasicByteOpTest extends VectorizationTestRunner { - private static final int SIZE = 543; + private static int SIZE = 6543; private byte[] a; private byte[] b; @@ -65,7 +67,7 @@ public BasicByteOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VB, ">0"}) public byte[] vectorNeg() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +78,7 @@ public byte[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VB, ">0"}) public byte[] vectorAbs() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +89,7 @@ public byte[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VB, ">0"}) public byte[] vectorAdd() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +100,7 @@ public byte[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VB, ">0"}) public byte[] vectorSub() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +111,7 @@ public byte[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VB, ">0"}) public byte[] vectorMul() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +122,7 @@ public byte[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VB, ">0", IRNode.ADD_VB, ">0"}) public byte[] vectorMulAdd() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +133,7 @@ public byte[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VB, ">0", IRNode.SUB_VB, ">0"}) public byte[] vectorMulSub() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -143,7 +145,7 @@ public byte[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VB, ">0"}) public byte[] vectorNot() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -154,7 +156,7 @@ public byte[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VB, ">0"}) public byte[] vectorAnd() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -165,7 +167,7 @@ public byte[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VB, ">0"}) public byte[] vectorOr() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -176,7 +178,7 @@ public byte[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VB, ">0"}) public byte[] vectorXor() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -188,7 +190,7 @@ public byte[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VB, ">0"}) public byte[] vectorShiftLeft() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -199,7 +201,7 @@ public byte[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VB, ">0"}) public byte[] vectorSignedShiftRight() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -210,7 +212,7 @@ public byte[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VB, ">0"}) public byte[] vectorUnsignedShiftRight() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java index e43f5c888a6..4b91360fc54 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java @@ -67,7 +67,7 @@ public BasicCharOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public char[] vectorNeg() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -79,7 +79,7 @@ public char[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) - @IR(failOn = {IRNode.ABS_V}) + @IR(failOn = {IRNode.ABS_VI, IRNode.ABS_VB, IRNode.ABS_VL}) // AVS_VC does not exist public char[] vectorAbs() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -90,7 +90,7 @@ public char[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VS, ">0"}) // char add same as for short public char[] vectorAdd() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -101,7 +101,7 @@ public char[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public char[] vectorSub() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -112,7 +112,7 @@ public char[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VS, ">0"}) public char[] vectorMul() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -123,7 +123,8 @@ public char[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", + IRNode.ADD_VS, ">0"}) // char add same as for short public char[] vectorMulAdd() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -134,7 +135,7 @@ public char[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", IRNode.SUB_VS, ">0"}) public char[] vectorMulSub() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -146,7 +147,7 @@ public char[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public char[] vectorNot() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -157,7 +158,7 @@ public char[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VS, ">0"}) public char[] vectorAnd() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -168,7 +169,7 @@ public char[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VS, ">0"}) public char[] vectorOr() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -179,7 +180,7 @@ public char[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public char[] vectorXor() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -191,7 +192,7 @@ public char[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VC, ">0"}) public char[] vectorShiftLeft() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -202,7 +203,7 @@ public char[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VC, ">0"}) public char[] vectorSignedShiftRight() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -213,7 +214,7 @@ public char[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VC, ">0"}) public char[] vectorUnsignedShiftRight() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -225,7 +226,7 @@ public char[] vectorUnsignedShiftRight() { // ------------- ReverseBytes ------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.REVERSE_BYTES_V, ">0"}) + counts = {IRNode.REVERSE_BYTES_VS, ">0"}) public char[] reverseBytesWithChar() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java index 9bb0c670c55..06b48649c25 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java @@ -65,7 +65,7 @@ public BasicDoubleOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.NEG_V, ">0"}) + counts = {IRNode.NEG_VD, ">0"}) public double[] vectorNeg() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +76,7 @@ public double[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VD, ">0"}) public double[] vectorAbs() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +87,7 @@ public double[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.SQRT_V, ">0"}) + counts = {IRNode.SQRT_VD, ">0"}) public double[] vectorSqrt() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public double[] vectorRint() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VD, ">0"}) public double[] vectorAdd() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -142,7 +142,7 @@ public double[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VD, ">0"}) public double[] vectorSub() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -153,7 +153,7 @@ public double[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VD, ">0"}) public double[] vectorMul() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -164,7 +164,7 @@ public double[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.DIV_V, ">0"}) + counts = {IRNode.DIV_VD, ">0"}) public double[] vectorDiv() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -175,7 +175,7 @@ public double[] vectorDiv() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MAX_V, ">0"}) + counts = {IRNode.MAX_VD, ">0"}) public double[] vectorMax() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -186,7 +186,7 @@ public double[] vectorMax() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MIN_V, ">0"}) + counts = {IRNode.MIN_VD, ">0"}) public double[] vectorMin() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -197,9 +197,9 @@ public double[] vectorMin() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorMulAdd() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -210,9 +210,9 @@ public double[] vectorMulAdd() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorMulSub1() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -223,9 +223,9 @@ public double[] vectorMulSub1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorMulSub2() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -236,9 +236,9 @@ public double[] vectorMulSub2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorNegateMulAdd1() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -249,9 +249,9 @@ public double[] vectorNegateMulAdd1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorNegateMulAdd2() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -262,9 +262,9 @@ public double[] vectorNegateMulAdd2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorNegateMulSub() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java index a07fcfa9ca2..fae5ca4c125 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java @@ -65,7 +65,7 @@ public BasicFloatOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse", "true"}, - counts = {IRNode.NEG_V, ">0"}) + counts = {IRNode.NEG_VF, ">0"}) public float[] vectorNeg() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +76,7 @@ public float[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VF, ">0"}) public float[] vectorAbs() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +87,7 @@ public float[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.SQRT_V, ">0"}) + counts = {IRNode.SQRT_VF, ">0"}) public float[] vectorSqrt() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +98,7 @@ public float[] vectorSqrt() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VF, ">0"}) public float[] vectorAdd() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +109,7 @@ public float[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VF, ">0"}) public float[] vectorSub() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +120,7 @@ public float[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VF, ">0"}) public float[] vectorMul() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public float[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.DIV_V, ">0"}) + counts = {IRNode.DIV_VF, ">0"}) public float[] vectorDiv() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -142,7 +142,7 @@ public float[] vectorDiv() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MAX_V, ">0"}) + counts = {IRNode.MAX_VF, ">0"}) public float[] vectorMax() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -153,7 +153,7 @@ public float[] vectorMax() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MIN_V, ">0"}) + counts = {IRNode.MIN_VF, ">0"}) public float[] vectorMin() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -164,9 +164,9 @@ public float[] vectorMin() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorMulAdd() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -177,9 +177,9 @@ public float[] vectorMulAdd() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorMulSub1() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -190,9 +190,9 @@ public float[] vectorMulSub1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorMulSub2() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -203,9 +203,9 @@ public float[] vectorMulSub2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorNegateMulAdd1() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -216,9 +216,9 @@ public float[] vectorNegateMulAdd1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorNegateMulAdd2() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -229,9 +229,9 @@ public float[] vectorNegateMulAdd2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorNegateMulSub() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java index 4d86cd11345..d392214c969 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java @@ -65,7 +65,7 @@ public BasicIntOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VI, ">0"}) public int[] vectorNeg() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +76,7 @@ public int[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VI, ">0"}) public int[] vectorAbs() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +87,7 @@ public int[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VI, ">0"}) public int[] vectorAdd() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +98,7 @@ public int[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VI, ">0"}) public int[] vectorSub() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +109,7 @@ public int[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] vectorMul() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +120,7 @@ public int[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VI, ">0", IRNode.ADD_VI, ">0"}) public int[] vectorMulAdd() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public int[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VI, ">0", IRNode.SUB_VI, ">0"}) public int[] vectorMulSub() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -154,7 +154,7 @@ public int[] vectorPopCount() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VI, ">0"}) public int[] vectorNot() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -165,7 +165,7 @@ public int[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VI, ">0"}) public int[] vectorAnd() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -176,7 +176,7 @@ public int[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VI, ">0"}) public int[] vectorOr() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -187,7 +187,7 @@ public int[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VI, ">0"}) public int[] vectorXor() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -199,7 +199,7 @@ public int[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VI, ">0"}) public int[] vectorShiftLeft() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -210,7 +210,7 @@ public int[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VI, ">0"}) public int[] vectorSignedShiftRight() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -221,7 +221,7 @@ public int[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VI, ">0"}) public int[] vectorUnsignedShiftRight() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java index 8adce9eceff..1e41ae97ea2 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java @@ -66,7 +66,7 @@ public BasicLongOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VL, ">0"}) public long[] vectorNeg() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -77,7 +77,7 @@ public long[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx512vl", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VL, ">0"}) public long[] vectorAbs() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -88,7 +88,7 @@ public long[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VL, ">0"}) public long[] vectorAdd() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -99,7 +99,7 @@ public long[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VL, ">0"}) public long[] vectorSub() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -110,7 +110,7 @@ public long[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx512dq", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VL, ">0"}) public long[] vectorMul() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -121,9 +121,9 @@ public long[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "sse4.1", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VL, ">0"}) @IR(applyIfCPUFeatureOr = {"sve", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VL, ">0"}) public long[] vectorMulAdd() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -134,7 +134,7 @@ public long[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VL, ">0", IRNode.SUB_VL, ">0"}) public long[] vectorMulSub() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -146,7 +146,7 @@ public long[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VL, ">0"}) public long[] vectorNot() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -157,7 +157,7 @@ public long[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VL, ">0"}) public long[] vectorAnd() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -168,7 +168,7 @@ public long[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VL, ">0"}) public long[] vectorOr() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -179,7 +179,7 @@ public long[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VL, ">0"}) public long[] vectorXor() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -191,7 +191,7 @@ public long[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VL, ">0"}) public long[] vectorShiftLeft() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -202,7 +202,7 @@ public long[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VL, ">0"}) public long[] vectorSignedShiftRight() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -213,7 +213,7 @@ public long[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VL, ">0"}) public long[] vectorUnsignedShiftRight() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java index b2a096758bc..b47267e5507 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java @@ -67,7 +67,7 @@ public BasicShortOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public short[] vectorNeg() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -78,7 +78,7 @@ public short[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VS, ">0"}) public short[] vectorAbs() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -89,7 +89,7 @@ public short[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VS, ">0"}) public short[] vectorAdd() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -100,7 +100,7 @@ public short[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public short[] vectorSub() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -111,7 +111,7 @@ public short[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VS, ">0"}) public short[] vectorMul() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -122,7 +122,7 @@ public short[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", IRNode.ADD_VS, ">0"}) public short[] vectorMulAdd() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -133,7 +133,7 @@ public short[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", IRNode.SUB_VS, ">0"}) public short[] vectorMulSub() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -145,7 +145,7 @@ public short[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public short[] vectorNot() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -156,7 +156,7 @@ public short[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VS, ">0"}) public short[] vectorAnd() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -167,7 +167,7 @@ public short[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VS, ">0"}) public short[] vectorOr() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -178,7 +178,7 @@ public short[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public short[] vectorXor() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -190,7 +190,7 @@ public short[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VS, ">0"}) public short[] vectorShiftLeft() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -201,7 +201,7 @@ public short[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] vectorSignedShiftRight() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -237,7 +237,7 @@ public short[] vectorMax() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] vectorUnsignedShiftRight() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -249,7 +249,7 @@ public short[] vectorUnsignedShiftRight() { // ------------- ReverseBytes ------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.REVERSE_BYTES_V, ">0"}) + counts = {IRNode.REVERSE_BYTES_VS, ">0"}) public short[] reverseBytesWithShort() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java index e09c58d8dbd..0c908c18fde 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java @@ -48,7 +48,7 @@ public class LoopArrayIndexComputeTest extends VectorizationTestRunner { - private static final int SIZE = 543; + private static final int SIZE = 6543; private int[] ints; private short[] shorts; @@ -95,7 +95,7 @@ public int[] indexPlusConstant() { @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexMinusConstant() { int[] res = new int[SIZE]; for (int i = SIZE / 2; i < SIZE; i++) { @@ -108,7 +108,7 @@ public int[] indexMinusConstant() { @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexPlusInvariant() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); @@ -122,7 +122,7 @@ public int[] indexPlusInvariant() { @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexMinusInvariant() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); @@ -136,7 +136,7 @@ public int[] indexMinusInvariant() { @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexWithInvariantAndConstant() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); @@ -150,7 +150,7 @@ public int[] indexWithInvariantAndConstant() { @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VI, ">0"}) public int[] indexWithTwoInvariants() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java index 99f889ae74c..72667a66d82 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java @@ -79,9 +79,8 @@ public LoopReductionOpTest() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse3", "true"}, - counts = {IRNode.LOAD_VECTOR, ">0"}) - @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse3", "true"}, - counts = {IRNode.ADD_REDUCTION_V, ">0"}) + counts = {IRNode.LOAD_VECTOR_I, ">0", + IRNode.ADD_REDUCTION_V, ">0"}) public int reductionAddSumOfArray() { int res = 0; for (int i = 0; i < SIZE; i++) { @@ -121,9 +120,8 @@ public int reductionAddLoopInv() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.LOAD_VECTOR, ">0"}) - @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.ADD_REDUCTION_V, ">0"}) + counts = {IRNode.LOAD_VECTOR_I, ">0", + IRNode.ADD_REDUCTION_V, ">0"}) public int reductionAddSumOfMultiple() { int res = 0; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java index 2c1a228f76f..539673a6c28 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java @@ -119,6 +119,109 @@ public void mixFailOnAndCounts() { public void compilePhases() { iFld = 42; } + + // Rules for vector nodes. + @Test + // By default, we search for the maximal size possible + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // We can also specify that we want the maximum explicitly + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_MAX, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Explicitly take the maximum size for this type (here int) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "max_for_type", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Exlicitly take the maximum size for the int type + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "max_int", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // As a last resort, we can match with any size + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_ANY, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Specify comma separated list of numbers, match for any of them + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "2,4,8,16,32,64", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Two or more arguments to min(...): the minimal value is applied + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type, max_int, LoopMaxUnroll, 64)", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static int[] testVectorNode() { + int[] a = new int[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; + } + + // Rules for vector nodes. + @Test + // By default, we search for the maximal size possible + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // In some cases, we can know the exact size, here 16 + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIf = {"MaxVectorSize", "=64"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIf = {"MaxVectorSize", "=32"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // In some cases, we can know the exact size, here 4 + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_4, "> 0"}, + applyIf = {"MaxVectorSize", "=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] testVectorNodeExactSize1() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; + } + + // Rules for vector nodes. Same as badTestVectorNodeSize but with good rules. + @Test + // In some cases, we can know the exact size, here 4 + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_4, "> 0"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Hence, we know any other sizes are impossible. + // We can also specify that explicitly for failOn + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_2, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_8, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_16, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_32, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_64, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "2,8,16,32,64"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] testVectorNodeExactSize2() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length/8; i++) { + a[i*8 + 0]++; // block of 4, then gap of 4 + a[i*8 + 1]++; + a[i*8 + 2]++; + a[i*8 + 3]++; + } + return a; + } + + @Test + // Here, we can pack at most 8 given the 8-blocks and 8-gaps. + // But we can also never pack more than max_float + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "min(8, max_float)", "> 0"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] testVectorNodeSizeMinClause() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length/16; i++) { + a[i*16 + 0]++; // block of 8, then gap of 8 + a[i*16 + 1]++; + a[i*16 + 2]++; + a[i*16 + 3]++; + a[i*16 + 4]++; + a[i*16 + 5]++; + a[i*16 + 6]++; + a[i*16 + 7]++; + } + return a; + } } class FailingExamples { @@ -194,4 +297,29 @@ public void testNotCompiled() { public void badStandAloneNotCompiled() { testNotCompiled(); } + + // Failing rules for vector nodes. Same as testVectorNodeExactSize2 but with bad rules. + @Test + // By default we look for the IRNode.VECTOR_SIZE_MAX, which is more than 4. + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0"}, + applyIf = {"MaxVectorSize", ">16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // By default, we look for IRNode.VECTOR_SIZE_ANY. But there are some of size 4. + @IR(failOn = {IRNode.LOAD_VECTOR_F}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // By default, we look for IRNode.VECTOR_SIZE_ANY. But there are at least two of size 4. + @IR(counts = {IRNode.LOAD_VECTOR_F, "<2"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] badTestVectorNodeSize() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length/8; i++) { + a[i*8 + 0]++; // block of 4, then gap of 4 + a[i*8 + 1]++; + a[i*8 + 2]++; + a[i*8 + 3]++; + } + return a; + } } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java index 9dd605b3f65..99bf338e072 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java @@ -999,7 +999,7 @@ public void emtpyUserProvidedPostfix() {} public void missingCountString() {} @Test - @FailCount(45) + @FailCount(51) @IR(counts = {IRNode.STORE, IRNode.STORE}) @IR(counts = {IRNode.STORE, IRNode.STORE, IRNode.STORE, IRNode.STORE}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", IRNode.STORE}) @@ -1025,6 +1025,12 @@ public void missingCountString() {} @IR(counts = {IRNode.STORE, " > 3.0"}) @IR(counts = {IRNode.STORE, " > a3"}) @IR(counts = {IRNode.STORE, " > 0x1"}) + @IR(counts = {IRNode.STORE, "!= 1000"}) + @IR(counts = {IRNode.STORE, "< 0"}) + @IR(counts = {IRNode.STORE, "< 1"}) + @IR(counts = {IRNode.STORE, "<= 0"}) + @IR(counts = {IRNode.STORE, "> -1"}) + @IR(counts = {IRNode.STORE, ">= 0"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", "<"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", "!"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", "!3"}) @@ -1046,6 +1052,27 @@ public void missingCountString() {} @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", " > a3"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", " > 0x1"}) public void wrongCountString() {} + + @Test + @FailCount(8) + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_MAX, "> 0"}) // valid + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_ANY, "> 0"}) // valid + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "", "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "xxx", "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min()", "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type)", "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "2,4,8,16,32,64,max_int", "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "2,4,8,16,32,64,-3", "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type, xxx)", "> 0"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type, min(max_for_type, max_for_type))", "> 0"}) + public int[] badVectorNodeSize() { + int[] a = new int[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; + } } class BadIRNodeForPhase { @@ -1096,18 +1123,18 @@ public void loops() {} @Test @FailCount(6) - @IR(failOn = IRNode.LOAD_VECTOR, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works @IR(failOn = IRNode.STORE_VECTOR, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works - @IR(failOn = IRNode.LOAD_VECTOR, phase = CompilePhase.BEFORE_MATCHING) // works + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = CompilePhase.BEFORE_MATCHING) // works @IR(failOn = IRNode.STORE_VECTOR, phase = CompilePhase.BEFORE_MATCHING) // works - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = CompilePhase.BEFORE_MATCHING) // works - @IR(failOn = IRNode.LOAD_VECTOR, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = CompilePhase.BEFORE_MATCHING) // works + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) @IR(failOn = IRNode.STORE_VECTOR, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) - @IR(failOn = IRNode.LOAD_VECTOR, phase = CompilePhase.FINAL_CODE) + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = CompilePhase.FINAL_CODE) @IR(failOn = IRNode.STORE_VECTOR, phase = CompilePhase.FINAL_CODE) - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = CompilePhase.FINAL_CODE) + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = CompilePhase.FINAL_CODE) public void vector() {} @Test diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java index 5160ccb8e3b..4794a9c8127 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java @@ -100,12 +100,12 @@ public static void main(String[] args) { GoodFailOnRegexConstraint.create(MultipleFailOnBad.class, "fail10()", 1, 2, 3) ); - runCheck(BadCountsConstraint.create(BadCount.class, "bad1()", 1, 1, "Load"), + runCheck(BadCountsConstraint.create(BadCount.class, "bad1()", 1, 2, "Load"), GoodCountsConstraint.create(BadCount.class, "bad1()", 2), GoodCountsConstraint.create(BadCount.class, "bad2()", 1), - BadCountsConstraint.create(BadCount.class, "bad2()", 2, 1, "Store"), - BadCountsConstraint.create(BadCount.class, "bad3()", 1, 1, "Load"), - BadCountsConstraint.create(BadCount.class, "bad3()", 2, 1, "Store") + BadCountsConstraint.create(BadCount.class, "bad2()", 2, 2, "Store"), + BadCountsConstraint.create(BadCount.class, "bad3()", 1, 2, "Load"), + BadCountsConstraint.create(BadCount.class, "bad3()", 2, 2, "Store") ); runCheck(GoodRuleConstraint.create(Calls.class, "calls()", 1), @@ -629,10 +629,6 @@ class CountComparisons { IRNode.STORE, "<=1", IRNode.STORE, " <= 1", IRNode.STORE, " <= 1", - IRNode.STORE, "!= 0", - IRNode.STORE, "!=0", - IRNode.STORE, " != 0", - IRNode.STORE, " != 0", IRNode.STORE, "> 0", IRNode.STORE, ">0", IRNode.STORE, " > 0", @@ -823,27 +819,32 @@ public void good11() { class BadCount { int iFld; + int iFld2; int result; + int result2; @Test - @IR(counts = {IRNode.LOAD, "!= 1"}) // fail + @IR(counts = {IRNode.LOAD, "> 1000"}) // fail @IR(counts = {IRNode.STORE, "> 0"}) public void bad1() { result = iFld; + result2 = iFld2; } @Test - @IR(counts = {IRNode.LOAD, "1"}) // fail - @IR(counts = {IRNode.STORE, "< 1"}) + @IR(counts = {IRNode.LOAD, "2"}) // fail + @IR(counts = {IRNode.STORE, "< 2"}) public void bad2() { result = iFld; + result2 = iFld2; } @Test @IR(counts = {IRNode.LOAD, "0"}) // fail - @IR(counts = {IRNode.STORE, " <= 0"}) // fail + @IR(counts = {IRNode.STORE, " <= 1"}) // fail public void bad3() { result = iFld; + result2 = iFld2; } } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java index ee5ee38e331..99de3c1510c 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java @@ -75,6 +75,15 @@ public void test() throws IOException { testCompilePhaseBackToBackFirst,1 testCompilePhaseBackToBackLast,1 ----- END ----- + ##### IRMatchingVMInfo - used by TestFramework ##### + : + cpuFeatures:empty_cpu_info + MaxVectorSize:64 + MaxVectorSizeIsDefault:1 + LoopMaxUnroll:64 + UseAVX:1 + UseAVXIsDefault:1 + ----- END VMInfo ----- """; TestClassParser testClassParser = new TestClassParser(TestSafepointWhilePrinting.class); Matchable testClassMatchable = testClassParser.parse(hotspotPidFileName, irEncoding); From 0f1154dc5c021d5c23edbfaa47ea71dd71eeb6e6 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:10:00 +0000 Subject: [PATCH 065/261] 8314320: Mark runtime/CommandLine/ tests as flagless Backport-of: f481477144d25bf2b5ee44f202705588bd99d4f4 --- .../CommandLine/BooleanFlagWithInvalidValue.java | 3 ++- .../CommandLine/CompilerConfigFileWarning.java | 1 + .../jtreg/runtime/CommandLine/ConfigFileParsing.java | 3 ++- .../jtreg/runtime/CommandLine/ConfigFileWarning.java | 3 ++- .../CommandLine/DoubleFlagWithIntegerValue.java | 3 ++- .../runtime/CommandLine/FlagWithInvalidValue.java | 3 ++- .../CommandLine/IgnoreUnrecognizedVMOptions.java | 4 ++-- .../NonBooleanFlagWithInvalidBooleanPrefix.java | 3 ++- .../CommandLine/ObsoleteFlagErrorMessage.java | 3 ++- .../OptionsValidation/TestJcmdOutput.java | 3 ++- .../OptionsValidation/TestOptionsWithRanges.java | 12 +++++++++++- .../TestOptionsWithRangesDynamic.java | 3 ++- .../TestOptionsWithRanges_generate.sh | 5 +++-- .../jtreg/runtime/CommandLine/TestHexArguments.java | 3 ++- .../CommandLine/TestLongUnrecognizedVMOption.java | 3 ++- .../runtime/CommandLine/TestNullTerminatedFlags.java | 4 ++-- .../jtreg/runtime/CommandLine/TestVMOptions.java | 3 ++- .../runtime/CommandLine/TraceExceptionsTest.java | 3 ++- .../runtime/CommandLine/UnrecognizedVMOption.java | 3 ++- .../jtreg/runtime/CommandLine/VMAliasOptions.java | 3 ++- .../runtime/CommandLine/VMDeprecatedOptions.java | 3 ++- .../jtreg/runtime/CommandLine/VMOptionWarning.java | 3 ++- .../CommandLine/VMOptionsFile/TestVMOptionsFile.java | 3 ++- 23 files changed, 55 insertions(+), 25 deletions(-) diff --git a/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java b/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java index 0c59079bb8e..55278a67bc2 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +25,7 @@ * @test * @bug 8006298 * @summary Setting an invalid value for a bool argument should result in a useful error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java b/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java index 24738786115..6d8e2eeac61 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java @@ -25,6 +25,7 @@ * @test * @bug 7167142 * @summary Warn if unused .hotspot_compiler file is present + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java index b2b31ce6f75..471c71a0046 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +25,7 @@ * @test ConfigFileParsing * @bug 7158804 * @summary Improve config file parsing + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java index 862ef4c9ce0..62aef23b580 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +25,7 @@ * @test * @bug 7167142 * @summary Warn if unused .hotspot_rc file is present + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java b/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java index f26b7399671..52188885c41 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,6 +25,7 @@ * @test DoubleFlagWithIntegerValue * @bug 8178364 * @summary Command-line flags of type double should accept integer values + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java b/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java index 053aa1c850d..5cfc3497a94 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +25,7 @@ * @test * @bug 8006298 * @summary Setting a flag to an invalid value should print a useful error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java b/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java index 0ebfdb56c4a..36f58fb3a97 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -29,7 +29,7 @@ * @test * @bug 8129855 * @summary -XX:+IgnoreUnrecognizedVMOptions should work according to the spec from JDK-8129855 - * + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java b/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java index b1fff188907..0aead709245 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java +++ b/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +25,7 @@ * @test * @bug 8006298 * @summary Using a bool (+/-) prefix on non-bool flag should result in a useful error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java b/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java index 485d3cc57f5..8de8292611b 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 @@ * @modules java.base/jdk.internal.misc * @library /test/lib * @requires vm.debug == true + * @requires vm.flagless * @run driver ObsoleteFlagErrorMessage */ diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java index b946945a800..b56cc376788 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,6 +26,7 @@ * @summary Verify jcmd error message for out-of-range value and for * value which is not allowed by constraint. Also check that * jcmd does not print an error message to the target process output. + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java index ffa88a9d009..a5d7a6bfa74 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (1 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -38,6 +39,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (2 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -49,6 +51,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (3 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -60,6 +63,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (4 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -71,6 +75,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (5 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -82,6 +87,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (6 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -93,6 +99,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (7 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -104,6 +111,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (8 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -115,6 +123,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (9 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -126,6 +135,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (10 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java index 04bc2f76965..480e8929ff8 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @summary Test writeable VM Options with ranges. + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * jdk.attach/sun.tools.attach diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh index 1fe8015c54d..73d8f2b31af 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023, 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 @@ -24,12 +24,13 @@ echo "// --- start auto-generated" echo "// the following portion is auto-generated by $0. Do not edit manually." -for i in {1..10}; do +for i in {1..10}; do cat < Date: Fri, 22 Dec 2023 10:11:57 +0000 Subject: [PATCH 066/261] 8314830: runtime/ErrorHandling/ tests ignore external VM flags Reviewed-by: shade Backport-of: b685ee00b273f029aa2ed5015e64cf409b0b0408 --- .../ErrorHandling/BadNativeStackInErrorHandlingTest.java | 3 ++- .../jtreg/runtime/ErrorHandling/ClassPathEnvVar.java | 3 ++- .../jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java | 3 ++- .../jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java | 3 ++- .../runtime/ErrorHandling/MachCodeFramesInErrorFile.java | 3 ++- .../NestedThreadsListHandleInErrorHandlingTest.java | 3 ++- .../jtreg/runtime/ErrorHandling/ProblematicFrameTest.java | 3 ++- .../jtreg/runtime/ErrorHandling/ReattemptErrorTest.java | 1 + .../jtreg/runtime/ErrorHandling/ResourceMarkTest.java | 3 ++- .../runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java | 3 ++- .../jtreg/runtime/ErrorHandling/SecondaryErrorTest.java | 4 +++- .../runtime/ErrorHandling/ShowRegistersOnAssertTest.java | 1 + .../runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java | 1 + .../runtime/ErrorHandling/TestExitOnOutOfMemoryError.java | 3 ++- .../TestGZippedHeapDumpOnOutOfMemoryError.java | 2 ++ .../ErrorHandling/TestHeapDumpOnOutOfMemoryError.java | 4 +++- .../jtreg/runtime/ErrorHandling/TestHeapDumpPath.java | 3 ++- test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java | 3 ++- .../jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java | 3 ++- .../jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java | 3 ++- .../ErrorHandling/ThreadsListHandleInErrorHandlingTest.java | 3 ++- .../runtime/ErrorHandling/TimeoutInErrorHandlingTest.java | 4 +++- .../jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java | 6 +++--- 23 files changed, 47 insertions(+), 21 deletions(-) diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java index 0da66113db4..af4553f0022 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -35,6 +35,7 @@ * @bug 8194652 * @summary Printing native stack shows an "error occurred during error reporting". * @modules java.base/jdk.internal.misc + * @requires vm.flagless * @requires vm.debug * @requires vm.flavor != "zero" * @library /test/lib diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java b/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java index e0aeb937910..68fbf40e441 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8271003 * @summary CLASSPATH env variable setting should not be truncated in a hs err log. + * @requires vm.flagless * @requires vm.debug * @library /test/lib * @run driver ClassPathEnvVar diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java index c9b9e433e18..ea8e944aebb 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, SAP. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -30,6 +30,7 @@ * in the error file name) * @library /test/lib * @modules java.base/jdk.internal.misc + * @requires vm.flagless * @requires (vm.debug == true) * @run driver ErrorFileOverwriteTest */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java index 154d5cf0e12..3c32c6f8141 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, SAP. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,6 +29,7 @@ * @summary Test ErrorFileToStderr and ErrorFileToStdout * @library /test/lib * @modules java.base/jdk.internal.misc + * @requires vm.flagless * @requires (vm.debug == true) * @run driver ErrorFileRedirectTest */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java index fabc477a631..8dced9a3a9c 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @bug 8272586 + * @requires vm.flagless * @requires vm.compiler2.enabled * @summary Test that abstract machine code is dumped for the top frames in a hs-err log * @library /test/lib diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java index 75ce802890e..d57a2bf29c2 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -33,6 +33,7 @@ /* * @test + * @requires vm.flagless * @requires (vm.debug == true) * @bug 8167108 * @summary Nested ThreadsListHandle info should be in error handling output. diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java index 0f0b48bedec..dc54b09156c 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ * java.compiler * java.management * jdk.internal.jvmstat/sun.jvmstat.monitor + * @requires vm.flagless * @run driver ProblematicFrameTest */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java index daadf00714c..279b07ffff7 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java @@ -26,6 +26,7 @@ * @test * @summary Check secondary error handling * @library /test/lib + * @requires vm.flagless * @requires vm.debug * @requires os.family != "windows" * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java index 1e5550afcad..77f8be01887 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ * @bug 8284274 * @summary Test that reporting doesn't crash because missing ResourceMarks * @library /test/lib + * @requires vm.flagless * @requires vm.debug * @requires os.family != "windows" * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java index 8c9d70373f7..01c5c5e7953 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2015, 2022 SAP SE. All rights reserved. - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -37,6 +37,7 @@ * @summary SafeFetch32 and SafeFetchN do not work in error handling * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @requires vm.debug * @requires vm.flavor != "zero" * @author Thomas Stuefe (SAP) diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java index 2a3ddd808e9..9f689380c70 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2022 SAP SE. All rights reserved. - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ * @test * @summary Check secondary error handling * @library /test/lib + * @requires vm.flagless * @requires vm.debug * @requires os.family != "windows" * @modules java.base/jdk.internal.misc @@ -38,6 +39,7 @@ * @test * @summary Check secondary error handling * @library /test/lib + * @requires vm.flagless * @requires vm.debug * @requires os.family != "windows" * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java index b5ce0952ff6..f2214204f4e 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java @@ -28,6 +28,7 @@ * @bug 8191101 * @summary Show Registers on assert/guarantee * @library /test/lib + * @requires vm.flagless * @requires (vm.debug == true) & (os.family == "linux") * @author Thomas Stuefe (SAP) * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java index a4c470e5ba4..da46cd9e811 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java @@ -26,6 +26,7 @@ * @summary Test using -XX:+CrashOnOutOfMemoryError * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @run driver TestCrashOnOutOfMemoryError * @bug 8138745 */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java index 2159442c08c..e56ed4a1b03 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,6 +26,7 @@ * @summary Test using -XX:ExitOnOutOfMemoryError * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @run driver TestExitOnOutOfMemoryError * @bug 8138745 */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java index 40f6a6e4705..a2a0154f0b3 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 SAP SE. All rights reserved. + * Copyright (c) 2023, 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 +33,7 @@ * @test * @summary Test verifies that -XX:HeapDumpGzipLevel=1 works * @library /test/lib + * @requires vm.flagless * @run driver/timeout=240 TestGZippedHeapDumpOnOutOfMemoryError run 1 */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java index d5293cde704..9324adbb2e0 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,6 +25,7 @@ * @test TestHeapDumpOnOutOfMemoryError * @summary Test verifies that -XX:HeapDumpOnOutOfMemoryError dumps heap when OutOfMemory is thrown in heap * @library /test/lib + * @requires vm.flagless * @run driver TestHeapDumpOnOutOfMemoryError run heap */ @@ -32,6 +33,7 @@ * @test TestHeapDumpOnOutOfMemoryError * @summary Test verifies that -XX:HeapDumpOnOutOfMemoryError dumps heap when OutOfMemory is thrown in metaspace. * @library /test/lib + * @requires vm.flagless * @run driver/timeout=240 TestHeapDumpOnOutOfMemoryError run metaspace */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java index b1c4dc0c357..0cc6dbc765f 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,6 +25,7 @@ * @test TestHeapDumpPath * @summary Test verifies that -XX:HeapDumpPath= supports directory as a parameter. * @library /test/lib + * @requires vm.flagless * @run driver TestHeapDumpPath */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java index 776d1c9dfe7..00475f8bdd7 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ * @summary Test using -XX:OnError= * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @requires vm.debug * @run driver TestOnError */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java index 6d72bd59b6d..fe3c5c34f80 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,6 +26,7 @@ * @summary Test using single and multiple -XX:OnOutOfMemoryError= * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @run driver TestOnOutOfMemoryError * @bug 8078470 8177522 */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java index 5943137511e..c1e098b781d 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +27,7 @@ * @test segv * @summary Test that for a given crash situation we see the correct siginfo in the hs-err file * @library /test/lib + * @requires vm.flagless * @requires vm.debug * @requires os.family != "windows" * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java index 682753b2464..f2930e5c5bd 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -38,6 +38,7 @@ * @summary ThreadsListHandle info should be in error handling output. * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @run driver ThreadsListHandleInErrorHandlingTest */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java index 0c3c2997b0e..0ff835a8c0d 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2017, 2022 SAP SE. All rights reserved. * Copyright (c) 2023, Red Hat, Inc. and/or its affiliates. - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,6 +42,7 @@ * @summary Hanging Error Reporting steps may lead to torn error logs * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @requires (vm.debug == true) & (os.family != "windows") * @run driver TimeoutInErrorHandlingTest * @author Thomas Stuefe (SAP) @@ -53,6 +54,7 @@ * @summary Error handling step timeouts should never be blocked by OnError etc. * @modules java.base/jdk.internal.misc * @library /test/lib + * @requires vm.flagless * @requires (vm.debug == true) & (os.family != "windows") * @run driver TimeoutInErrorHandlingTest with-on-error */ diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java index b8170ee2426..348ce77c4dc 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2022 SAP. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,6 +29,7 @@ * @summary No hs-err file if fatal error is raised during dynamic initialization. * @library /test/lib * @modules java.base/jdk.internal.misc + * @requires vm.flagless * @requires (vm.debug == true) * @requires os.family == "linux" * @run driver VeryEarlyAssertTest @@ -49,8 +50,7 @@ public class VeryEarlyAssertTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-version"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-version"); Map env = pb.environment(); env.put("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION", "1"); From dd080d3b5bb4ca63eaef7fa2727556d22140e0b4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:15:46 +0000 Subject: [PATCH 067/261] 8316445: Mark com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java as vm.flagless Backport-of: ca5eee2fe37959f54c5efe557f271dea0a0baef4 --- test/jdk/TEST.ROOT | 1 + .../HotSpotDiagnosticMXBean/CheckOrigin.java | 3 ++- test/jtreg-ext/requires/VMProps.java | 14 +++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index 962ee15fc17..b59f90f12c4 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -53,6 +53,7 @@ requires.extraPropDefns.vmOpts = \ requires.properties= \ sun.arch.data.model \ java.runtime.name \ + vm.flagless \ vm.gc.G1 \ vm.gc.Serial \ vm.gc.Parallel \ diff --git a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index a1fb82bcbb5..133ca19be74 100644 --- a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +25,7 @@ * @test * @bug 8028994 * @author Staffan Larsen + * @requires vm.flagless * @library /test/lib * @modules jdk.attach/sun.tools.attach * jdk.management diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 3be9344ace0..e119c1bd6d4 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -656,15 +656,19 @@ private String isFlagless() { // check -X flags var ignoredXFlags = Set.of( // default, yet still seen to be explicitly set - "mixed" + "mixed", + // -XmxmNNNm added by run-test framework for non-hotspot tests + "mx" ); result &= allFlags.stream() .filter(s -> s.startsWith("-X") && !s.startsWith("-XX:")) // map to names: - // remove -X - .map(s -> s.substring(2)) - // remove :.* from flags with values - .map(s -> s.contains(":") ? s.substring(0, s.indexOf(':')) : s) + // remove -X + .map(s -> s.substring(2)) + // remove :.* from flags with values + .map(s -> s.contains(":") ? s.substring(0, s.indexOf(':')) : s) + // remove size like 4G, 768m which might be set for non-hotspot tests + .map(s -> s.replaceAll("(\\d+)[mMgGkK]", "")) // skip known-to-be-there flags .filter(s -> !ignoredXFlags.contains(s)) .findAny() From 235ed4c888360b03087d3c5278b0761108c733f7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:19:07 +0000 Subject: [PATCH 068/261] 8317358: G1: Make TestMaxNewSize use createTestJvm Backport-of: 1a098356dd3a157b12c2b5c527e61c8a628bdb2d --- .../jtreg/gc/arguments/TestMaxNewSize.java | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java b/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java index 03376308e39..6abcc9f84fe 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java +++ b/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +28,8 @@ * @bug 7057939 * @summary Make sure that MaxNewSize always has a useful value after argument * processing. - * @requires vm.gc.Serial + * @key flag-sensitive + * @requires vm.gc.Serial & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null * @library /test/lib * @library / * @modules java.base/jdk.internal.misc @@ -42,7 +43,8 @@ * @bug 7057939 * @summary Make sure that MaxNewSize always has a useful value after argument * processing. - * @requires vm.gc.Parallel + * @key flag-sensitive + * @requires vm.gc.Parallel & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null * @library /test/lib * @library / * @modules java.base/jdk.internal.misc @@ -56,7 +58,8 @@ * @bug 7057939 * @summary Make sure that MaxNewSize always has a useful value after argument * processing. - * @requires vm.gc.G1 + * @key flag-sensitive + * @requires vm.gc.G1 & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null * @library /test/lib * @library / * @modules java.base/jdk.internal.misc @@ -79,46 +82,23 @@ public class TestMaxNewSize { private static void checkMaxNewSize(String[] flags, int heapsize) throws Exception { BigInteger actual = new BigInteger(getMaxNewSize(flags)); - System.out.println(actual); - if (actual.compareTo(new BigInteger((new Long(heapsize)).toString())) == 1) { + System.out.println("asserting: " + actual + " <= " + heapsize); + if (actual.compareTo(new BigInteger("" + heapsize)) > 0) { throw new RuntimeException("MaxNewSize value set to \"" + actual + "\", expected otherwise when running with the following flags: " + Arrays.asList(flags).toString()); } } - private static void checkIncompatibleNewSize(String[] flags) throws Exception { - ArrayList finalargs = new ArrayList(); - finalargs.addAll(Arrays.asList(flags)); - finalargs.add("-version"); - - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(finalargs); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Initial young gen size set larger than the maximum young gen size"); - } - - private static boolean isRunningG1(String[] args) { - for (int i = 0; i < args.length; i++) { - if (args[i].contains("+UseG1GC")) { - return true; - } - } - return false; - } - private static String getMaxNewSize(String[] flags) throws Exception { ArrayList finalargs = new ArrayList(); finalargs.addAll(Arrays.asList(flags)); - if (isRunningG1(flags)) { - finalargs.add("-XX:G1HeapRegionSize=1M"); - } finalargs.add("-XX:+PrintFlagsFinal"); finalargs.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = GCArguments.createTestJvm(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); - //System.out.println(stdout); return getFlagValue("MaxNewSize", stdout); } From c39247c5a6f041007bb8a365663a409d7360d420 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:20:59 +0000 Subject: [PATCH 069/261] 8318689: jtreg is confused when folder name is the same as the test name Backport-of: a9b31b587c7487b2222773debde1ce2227884959 --- .../javax/security/auth/Subject/{DoAs.java => DoAsTest.java} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename test/jdk/javax/security/auth/Subject/{DoAs.java => DoAsTest.java} (95%) diff --git a/test/jdk/javax/security/auth/Subject/DoAs.java b/test/jdk/javax/security/auth/Subject/DoAsTest.java similarity index 95% rename from test/jdk/javax/security/auth/Subject/DoAs.java rename to test/jdk/javax/security/auth/Subject/DoAsTest.java index db89c8936cd..56183e06819 100644 --- a/test/jdk/javax/security/auth/Subject/DoAs.java +++ b/test/jdk/javax/security/auth/Subject/DoAsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,7 +32,7 @@ import java.util.Set; import javax.security.auth.Subject; -public class DoAs { +public class DoAsTest { public static void main(String[] args) throws Exception { final Set outer = new HashSet<>(Arrays.asList("Outer")); From e579716e51d5d1686f884cf393635e3031947f1e Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:23:03 +0000 Subject: [PATCH 070/261] 8319456: jdk/jfr/event/gc/collection/TestGCCauseWith[Serial|Parallel].java : GC cause 'GCLocker Initiated GC' not in the valid causes Backport-of: 7c7f8ea30da7fe552bcd4f2b593fa9aad27dcdb4 --- .../jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java | 2 +- test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java index 9f1e1dbab34..0715d3c5c2d 100644 --- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java +++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java @@ -39,7 +39,7 @@ public static void main(String[] args) throws Exception { String testID = "ParallelOld"; String[] vmFlags = {"-XX:+UseParallelGC"}; String[] gcNames = {GCHelper.gcParallelScavenge, GCHelper.gcParallelOld}; - String[] gcCauses = {"Allocation Failure", "Ergonomics", "System.gc()"}; + String[] gcCauses = {"Allocation Failure", "Ergonomics", "System.gc()", "GCLocker Initiated GC"}; GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses); } } diff --git a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java index 0d1811f6677..403bd077585 100644 --- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java +++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java @@ -39,7 +39,7 @@ public static void main(String[] args) throws Exception { String testID = "Serial"; String[] vmFlags = {"-XX:+UseSerialGC"}; String[] gcNames = {GCHelper.gcDefNew, GCHelper.gcSerialOld}; - String[] gcCauses = {"Allocation Failure", "System.gc()"}; + String[] gcCauses = {"Allocation Failure", "System.gc()", "GCLocker Initiated GC"}; GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses); } } From 561ac59dca89f100c0e105a96ddeaae34da7f95f Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:25:11 +0000 Subject: [PATCH 071/261] 8322417: Console read line with zero out should zero out when throwing exception Backport-of: 2f917bff5cbb71dccd70960f563ca1a05d109fda --- .../share/classes/jdk/internal/io/JdkConsoleImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java b/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java index 370fc73fcd0..247545f8721 100644 --- a/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java +++ b/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java @@ -119,8 +119,17 @@ public char[] readPassword(String fmt, Object ... args) { else ioe.addSuppressed(x); } - if (ioe != null) + if (ioe != null) { + java.util.Arrays.fill(passwd, ' '); + try { + if (reader instanceof LineReader lr) { + lr.zeroOut(); + } + } catch (IOException x) { + // ignore + } throw ioe; + } } pw.println(); } From 18f23901cc22eed7a3e87f37840c69ae4cf314c5 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 22 Dec 2023 10:27:14 +0000 Subject: [PATCH 072/261] 8322418: Problem list gc/TestAllocHumongousFragment.java subtests for 8298781 Backport-of: 6de23bf36e125c77f6f17235d81a33ff25b942fe --- test/hotspot/jtreg/ProblemList.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 0459a0b8b87..dbb17c1d43c 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -82,6 +82,11 @@ gc/epsilon/TestMemoryMXBeans.java 8206434 generic-all gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java 8156755 generic-all gc/g1/logging/TestG1LoggingFailure.java 8169634 generic-all gc/g1/humongousObjects/TestHeapCounters.java 8178918 generic-all +gc/TestAllocHumongousFragment.java#adaptive 8298781 generic-all +gc/TestAllocHumongousFragment.java#aggressive 8298781 generic-all +gc/TestAllocHumongousFragment.java#iu-aggressive 8298781 generic-all +gc/TestAllocHumongousFragment.java#g1 8298781 generic-all +gc/TestAllocHumongousFragment.java#static 8298781 generic-all gc/stress/gclocker/TestExcessGCLockerCollections.java 8229120 generic-all gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all From ca26279e36d77f07fa4d2b5e1f431f11e80a2f1c Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Fri, 22 Dec 2023 15:54:59 +0000 Subject: [PATCH 073/261] 8320830: [AIX] Dont mix os::dll_load() with direct dlclose() calls Backport-of: 61653a1ff166816a6af6875c42bcd85023f3859d --- src/hotspot/os/aix/libodm_aix.cpp | 6 +++--- src/hotspot/os/aix/libperfstat_aix.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/os/aix/libodm_aix.cpp b/src/hotspot/os/aix/libodm_aix.cpp index d62a94939a4..9fe0fb7abd8 100644 --- a/src/hotspot/os/aix/libodm_aix.cpp +++ b/src/hotspot/os/aix/libodm_aix.cpp @@ -35,7 +35,7 @@ dynamicOdm::dynamicOdm() { const char* libodmname = "/usr/lib/libodm.a(shr_64.o)"; char ebuf[512]; - void* _libhandle = os::dll_load(libodmname, ebuf, sizeof(ebuf)); + _libhandle = os::dll_load(libodmname, ebuf, sizeof(ebuf)); if (!_libhandle) { trcVerbose("Cannot load %s (error %s)", libodmname, ebuf); @@ -48,14 +48,14 @@ dynamicOdm::dynamicOdm() { _odm_terminate = (fun_odm_terminate )dlsym(_libhandle, "odm_terminate" ); if (!_odm_initialize || !_odm_set_path || !_odm_mount_class || !_odm_get_obj || !_odm_terminate) { trcVerbose("Couldn't find all required odm symbols from %s", libodmname); - dlclose(_libhandle); + os::dll_unload(_libhandle); _libhandle = nullptr; return; } } dynamicOdm::~dynamicOdm() { - if (_libhandle) { dlclose(_libhandle); } + if (_libhandle) { os::dll_unload(_libhandle); } } diff --git a/src/hotspot/os/aix/libperfstat_aix.cpp b/src/hotspot/os/aix/libperfstat_aix.cpp index 69f62245365..f547b4c78e7 100644 --- a/src/hotspot/os/aix/libperfstat_aix.cpp +++ b/src/hotspot/os/aix/libperfstat_aix.cpp @@ -114,7 +114,7 @@ bool libperfstat::init() { void libperfstat::cleanup() { if (g_libhandle) { - dlclose(g_libhandle); + os::dll_unload(g_libhandle); g_libhandle = nullptr; } From 8695daa275c6980decabb246e065e9e4bf2a854d Mon Sep 17 00:00:00 2001 From: Sandhya Viswanathan Date: Fri, 22 Dec 2023 18:11:19 +0000 Subject: [PATCH 074/261] 8321215: Incorrect x86 instruction encoding for VSIB addressing mode Reviewed-by: shade Backport-of: 027b5dbb6a299e49d3dcbe67d529d6edc67f16d9 --- src/hotspot/cpu/x86/assembler_x86.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index a228bd28db7..ff0fee0f5de 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -315,7 +315,7 @@ class Address { } bool xmmindex_needs_rex() const { - return _xmmindex->is_valid() && _xmmindex->encoding() >= 8; + return _xmmindex->is_valid() && ((_xmmindex->encoding() & 8) == 8); } relocInfo::relocType reloc() const { return _rspec.type(); } From 72c372fe7fb2d03bb77f19ddf9c6dd32d901637c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 22 Dec 2023 18:11:36 +0000 Subject: [PATCH 075/261] 8321542: C2: Missing ChaCha20 stub for x86_32 leads to crashes Backport-of: 5718039a46ae51fa9b7042fe7163e3637e981b05 --- src/hotspot/cpu/x86/vm_version_x86.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index b4e9e721b5a..1f9238c60cb 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1124,6 +1124,7 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); } +#ifdef _LP64 // ChaCha20 Intrinsics // As long as the system supports AVX as a baseline we can do a // SIMD-enabled block function. StubGenerator makes the determination @@ -1139,6 +1140,13 @@ void VM_Version::get_processor_features() { } FLAG_SET_DEFAULT(UseChaCha20Intrinsics, false); } +#else + // No support currently for ChaCha20 intrinsics on 32-bit platforms + if (UseChaCha20Intrinsics) { + warning("ChaCha20 intrinsics are not available on this CPU."); + FLAG_SET_DEFAULT(UseChaCha20Intrinsics, false); + } +#endif // _LP64 // Base64 Intrinsics (Check the condition for which the intrinsic will be active) if (UseAVX >= 2) { From b64402f41f226a5d08bf70626fc81c88d9f3bba5 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sat, 23 Dec 2023 10:51:09 +0000 Subject: [PATCH 076/261] 8316447: 8 sun/management/jmxremote tests ignore VM flags Backport-of: 053f45695f9a914452f39029bd9ac7eb329e6883 --- .../bootstrap/AbstractFilePermissionTest.java | 5 ++--- .../jmxremote/bootstrap/CustomLauncherTest.java | 6 ++---- .../bootstrap/JMXAgentInterfaceBinding.java | 14 ++------------ .../bootstrap/JMXInterfaceBindingTest.java | 7 ++----- .../jmxremote/bootstrap/LocalManagementTest.java | 6 +++--- .../jmxremote/bootstrap/RmiRegistrySslTest.java | 4 ++-- .../jmxremote/startstop/JMXStartStopTest.java | 6 +----- .../startstop/JMXStatusPerfCountersTest.java | 5 ++--- .../jmxremote/startstop/JMXStatusTest.java | 4 +--- 9 files changed, 17 insertions(+), 40 deletions(-) diff --git a/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java b/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java index 767eaec79dd..02ae638ff18 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -173,8 +173,7 @@ private int doTest() throws Exception { command.add(className); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( - command.toArray(new String[command.size()])); + ProcessBuilder processBuilder = ProcessTools.createTestJvm(command); System.out.println("test cmdline: " + Arrays.toString(processBuilder.command().toArray()).replace(",", "")); OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); diff --git a/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java b/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java index 5a2aaa2a82b..1ad154ac8a9 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/CustomLauncherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -95,9 +95,7 @@ public static void main(String[] args) throws Exception { System.out.println(" PID : " + serverPrc.pid()); System.out.println(" shutdown port : " + port.get()); - ProcessBuilder client = ProcessTools.createJavaProcessBuilder( - "-cp", - Utils.TEST_CLASS_PATH, + ProcessBuilder client = ProcessTools.createTestJvm( "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED", "TestManager", String.valueOf(serverPrc.pid()), diff --git a/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java b/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java index 93200bd6341..92f7b2b3172 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java @@ -230,12 +230,10 @@ private static class MainThread extends Thread { private static final String EXP_TERM_MSG_REG = "Exit: ([0-9]+)"; private static final Pattern EXIT_PATTERN = Pattern.compile(EXP_TERM_MSG_REG); private static final String COOP_EXIT = "MainThread: Cooperative Exit"; - private static final int WAIT_FOR_JMX_AGENT_TIMEOUT_MS = 20_000; private final String addr; private final int jmxPort; private final int rmiPort; private final boolean useSSL; - private boolean jmxAgentStarted = false; private volatile Exception excptn; private MainThread(InetAddress bindAddress, int jmxPort, int rmiPort, boolean useSSL) { @@ -269,20 +267,12 @@ private void waitUntilReadyForConnections() { JMXConnectorThread connectionTester = new JMXConnectorThread( addr, jmxPort, rmiPort, useSSL, latch); connectionTester.start(); - boolean expired = false; try { - expired = !latch.await(WAIT_FOR_JMX_AGENT_TIMEOUT_MS, TimeUnit.MILLISECONDS); - System.out.println( - "MainThread: Finished waiting for JMX agent to become available: expired == " - + expired); - jmxAgentStarted = !expired; + latch.await(); + System.out.println("MainThread: Finished waiting for JMX agent to become available."); } catch (InterruptedException e) { throw new RuntimeException("Test failed", e); } - if (!jmxAgentStarted) { - throw new RuntimeException( - "Test failed. JMX server agents not becoming available."); - } if (connectionTester.isFailed() || !connectionTester.jmxConnectionWorked() || !connectionTester.rmiConnectionWorked()) { diff --git a/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java index ab029b26268..4cec7142495 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java @@ -42,7 +42,7 @@ * @modules java.management.rmi * * @build JMXAgentInterfaceBinding - * @run main/timeout=60 JMXInterfaceBindingTest + * @run main JMXInterfaceBindingTest */ public class JMXInterfaceBindingTest { @@ -65,7 +65,6 @@ public class JMXInterfaceBindingTest { "ssl" + File.separator + "truststore"; - public static final String TEST_CLASSPATH = System.getProperty("test.classes", "."); public void run(List addrs) { System.out.println("DEBUG: Running tests with plain sockets."); @@ -198,8 +197,6 @@ private Process createTestProcess() { " == (%s,%d,%d)", address, jmxPort, rmiPort); System.out.println(msg); List args = new ArrayList<>(); - args.add("-classpath"); - args.add(TEST_CLASSPATH); args.add("-Dcom.sun.management.jmxremote.host=" + address); args.add("-Dcom.sun.management.jmxremote.port=" + jmxPort); args.add("-Dcom.sun.management.jmxremote.rmi.port=" + rmiPort); @@ -221,7 +218,7 @@ private Process createTestProcess() { args.add(Boolean.toString(useSSL)); try { - ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[]{})); + ProcessBuilder builder = ProcessTools.createTestJvm(args.toArray(new String[]{})); System.out.println(ProcessTools.getCommandLine(builder)); Process process = builder.start(); output = new OutputAnalyzer(process); diff --git a/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java b/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java index 571aa93f23b..e03d6766522 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -107,7 +107,7 @@ private static boolean doTest(String testId, String arg) throws Exception { args.add(arg); } args.add("TestApplication"); - ProcessBuilder server = ProcessTools.createJavaProcessBuilder( + ProcessBuilder server = ProcessTools.createTestJvm( args.toArray(new String[args.size()]) ); @@ -133,7 +133,7 @@ private static boolean doTest(String testId, String arg) throws Exception { System.out.println(" PID : " + serverPrc.pid()); System.out.println(" shutdown port : " + port.get()); - ProcessBuilder client = ProcessTools.createJavaProcessBuilder( + ProcessBuilder client = ProcessTools.createTestJvm( "-cp", TEST_CLASSPATH, "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED", diff --git a/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java b/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java index 45ebd6930a3..525f2db5b59 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -188,7 +188,7 @@ private int doTest(String... args) throws Exception { command.add(TEST_CLASS_PATH); command.add(className); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(command.toArray(new String[command.size()])); + ProcessBuilder processBuilder = ProcessTools.createTestJvm(command); OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java index 2a611803a18..3210b921f2c 100644 --- a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java +++ b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java @@ -391,8 +391,6 @@ public synchronized void stop() private static TestAppRun doTest(String name, String ... args) throws Exception { List pbArgs = new ArrayList<>(Arrays.asList( - "-cp", - System.getProperty("test.class.path"), "-Duser.language=en", "-Duser.country=US", "-XX:+UsePerfData" @@ -400,9 +398,7 @@ private static TestAppRun doTest(String name, String ... args) pbArgs.addAll(Arrays.asList(args)); pbArgs.add(TEST_APP_NAME); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - pbArgs.toArray(new String[pbArgs.size()]) - ); + ProcessBuilder pb = ProcessTools.createTestJvm(pbArgs); TestAppRun s = new TestAppRun(pb, name); s.start(); return s; diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java index 9a12db38a2f..1b33edaedff 100644 --- a/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java +++ b/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -59,9 +59,8 @@ public class JMXStatusPerfCountersTest { @BeforeClass public static void setupClass() throws Exception { - testAppPb = ProcessTools.createJavaProcessBuilder( + testAppPb = ProcessTools.createTestJvm( "-XX:+UsePerfData", - "-cp", System.getProperty("test.class.path"), TEST_APP_NAME ); } diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java index 0813be10bff..f198a887e5e 100644 --- a/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java +++ b/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java @@ -84,12 +84,10 @@ abstract public class JMXStatusTest { @BeforeTest public final void setup() throws Exception { List args = new ArrayList<>(); - args.add("-cp"); - args.add(System.getProperty("test.class.path")); args.add("-XX:+UsePerfData"); args.addAll(getCustomVmArgs()); args.add(TEST_APP_NAME); - testAppPb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[args.size()])); + testAppPb = ProcessTools.createTestJvm(args); jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false); } From 52c0fc5c604609bdd120fe09c921829c6854f960 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sat, 23 Dec 2023 10:54:44 +0000 Subject: [PATCH 077/261] 8316464: 3 sun/tools tests ignore VM flags Backport-of: 993951b85e016475f4cd5079ae21bd5ce1f2830c --- test/jdk/sun/tools/jcmd/TestProcessHelper.java | 3 ++- test/jdk/sun/tools/jinfo/JInfoTest.java | 12 +++++------- test/jdk/sun/tools/jstat/JStatInterval.java | 7 +++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/test/jdk/sun/tools/jcmd/TestProcessHelper.java b/test/jdk/sun/tools/jcmd/TestProcessHelper.java index 121591fce21..139f21e2d9d 100644 --- a/test/jdk/sun/tools/jcmd/TestProcessHelper.java +++ b/test/jdk/sun/tools/jcmd/TestProcessHelper.java @@ -50,8 +50,9 @@ * @test * @bug 8205654 * @summary Unit test for sun.tools.ProcessHelper class. The test launches Java processes with different Java options - * and checks that sun.tools.ProcessHelper.getMainClass(pid) method returns a correct main class. return a . + * and checks that sun.tools.ProcessHelper.getMainClass(pid) method returns a correct main class. * + * @requires vm.flagless * @requires os.family == "linux" * @modules jdk.jcmd/sun.tools.common:+open * java.base/jdk.internal.classfile diff --git a/test/jdk/sun/tools/jinfo/JInfoTest.java b/test/jdk/sun/tools/jinfo/JInfoTest.java index bea0e4b796c..79512ddf0df 100644 --- a/test/jdk/sun/tools/jinfo/JInfoTest.java +++ b/test/jdk/sun/tools/jinfo/JInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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,9 +60,8 @@ private static void setFlag() throws Exception { LingeredApp app1 = new JInfoTestLingeredApp(); LingeredApp app2 = new JInfoTestLingeredApp(); try { - String[] params = new String[0];; - LingeredApp.startAppExactJvmOpts(app1, params); - LingeredApp.startAppExactJvmOpts(app2, params); + LingeredApp.startApp(app1); + LingeredApp.startApp(app2); OutputAnalyzer output = jinfo("-flag", "MinHeapFreeRatio=1", "JInfoTestLingeredApp"); output.shouldHaveExitValue(0); output = jinfo("-flag", "MinHeapFreeRatio", "JInfoTestLingeredApp"); @@ -89,9 +88,8 @@ private static void classNameMatch() throws Exception { LingeredApp app1 = new JInfoTestLingeredApp(); LingeredApp app2 = new JInfoTestLingeredApp(); try { - String[] params = new String[0]; - LingeredApp.startAppExactJvmOpts(app1, params); - LingeredApp.startAppExactJvmOpts(app2, params); + LingeredApp.startApp(app1); + LingeredApp.startApp(app2); OutputAnalyzer output = jinfo("JInfoTestLingeredApp"); output.shouldHaveExitValue(0); // "Runtime Environment" written once per proc diff --git a/test/jdk/sun/tools/jstat/JStatInterval.java b/test/jdk/sun/tools/jstat/JStatInterval.java index c3ff9404745..1dfa1f9187b 100644 --- a/test/jdk/sun/tools/jstat/JStatInterval.java +++ b/test/jdk/sun/tools/jstat/JStatInterval.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -24,6 +24,7 @@ /** * @test * @bug 8035668 + * @requires vm.flagless * @library /test/lib * @summary Test checks case when target application finishes execution and jstat didn't complete work. jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes @@ -60,9 +61,7 @@ public static void main(String[] args) { } } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-cp", - System.getProperty("test.class.path"), + ProcessBuilder pb = ProcessTools.createTestJvm( "-XX:+UsePerfData", Application.class.getName() ); From 5dad7db84bbd020442026535759073a17184dc01 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sat, 23 Dec 2023 10:56:36 +0000 Subject: [PATCH 078/261] 8318983: Fix comment typo in PKCS12Passwd.java Backport-of: 949846986f572dfb82912e7d71e7bfd37a90871e --- test/jdk/sun/security/tools/keytool/PKCS12Passwd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/sun/security/tools/keytool/PKCS12Passwd.java b/test/jdk/sun/security/tools/keytool/PKCS12Passwd.java index e5a60b5c06c..9f381cf49bf 100644 --- a/test/jdk/sun/security/tools/keytool/PKCS12Passwd.java +++ b/test/jdk/sun/security/tools/keytool/PKCS12Passwd.java @@ -108,7 +108,7 @@ public static void main(String[] args) throws Exception { check("p12", "newpass", "newpass"); - // Conversely, a JKS keystore can be laoded as a PKCS12, and it follows + // Conversely, a JKS keystore can be loaded as a PKCS12, and it follows // PKCS12 rules that both passwords are changed at the same time and // some commands are rejected. From b9d45b1539f650609f7d8115777dcc741702edb6 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sun, 24 Dec 2023 10:44:02 +0000 Subject: [PATCH 079/261] 8317144: Exclude sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java on Linux ppc64le Backport-of: bc5a39bb54725a38db716691091b43a1868601c6 --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 1cf258eb4d9..c1f7170bac8 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -624,6 +624,7 @@ sun/security/pkcs11/rsa/TestKeyPairGenerator.java 8295343 linux-al sun/security/pkcs11/rsa/TestKeyFactory.java 8295343 linux-all sun/security/pkcs11/KeyStore/Basic.java 8295343 linux-all sun/security/pkcs11/Cipher/TestKATForGCM.java 8240611 linux-x64,macosx-x64 +sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8316183 linux-ppc64le ############################################################################ From a17d0c4b3dce135d70775d978bc92613d9037381 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sun, 24 Dec 2023 10:45:39 +0000 Subject: [PATCH 080/261] 8315034: File.mkdirs() occasionally fails to create folders on Windows shared folder Backport-of: 7ad700596fbc58c27fedfa46755e80ea57712fac --- src/java.base/windows/native/libjava/canonicalize_md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java.base/windows/native/libjava/canonicalize_md.c b/src/java.base/windows/native/libjava/canonicalize_md.c index 1ec990ff5a4..ecfdf63d091 100644 --- a/src/java.base/windows/native/libjava/canonicalize_md.c +++ b/src/java.base/windows/native/libjava/canonicalize_md.c @@ -138,7 +138,8 @@ lastErrorReportable() || (errval == ERROR_BAD_NET_NAME) || (errval == ERROR_ACCESS_DENIED) || (errval == ERROR_NETWORK_UNREACHABLE) - || (errval == ERROR_NETWORK_ACCESS_DENIED)) { + || (errval == ERROR_NETWORK_ACCESS_DENIED) + || (errval == ERROR_NO_MORE_FILES)) { return 0; } return 1; From 98c94fd1b96f7ca5bbe9da6e927726a440bcc032 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 28 Dec 2023 12:25:47 +0000 Subject: [PATCH 081/261] 8264899: C1: -XX:AbortVMOnException does not work if all methods in the call stack are compiled with C1 and there are no exception handlers Backport-of: 826dcb5424a931953ac1964e7893aec7ec839862 --- .../cpu/aarch64/c1_Runtime1_aarch64.cpp | 9 ++ src/hotspot/cpu/arm/c1_Runtime1_arm.cpp | 7 ++ src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp | 6 ++ src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp | 8 ++ src/hotspot/cpu/s390/c1_Runtime1_s390.cpp | 6 ++ src/hotspot/cpu/x86/c1_Runtime1_x86.cpp | 8 ++ src/hotspot/share/c1/c1_Runtime1.cpp | 13 +++ src/hotspot/share/c1/c1_Runtime1.hpp | 4 +- .../ErrorHandling/TestAbortVmOnException.java | 89 +++++++++++++++++++ 9 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java diff --git a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp index bdba111f6df..4b7d2959a63 100644 --- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp @@ -478,6 +478,15 @@ void Runtime1::generate_unwind_exception(StubAssembler *sasm) { const Register exception_pc = r3; const Register handler_addr = r1; + if (AbortVMOnException) { + __ mov(rscratch1, exception_oop); + __ enter(); + save_live_registers(sasm); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, check_abort_on_vm_exception), rscratch1); + restore_live_registers(sasm); + __ leave(); + } + // verify that only r0, is valid at this time __ invalidate_registers(false, true, true, true, true, true); diff --git a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp index 537bf98c3e4..62faa617083 100644 --- a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp +++ b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp @@ -350,6 +350,13 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { void Runtime1::generate_unwind_exception(StubAssembler* sasm) { + + if (AbortVMOnException) { + save_live_registers(sasm); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, check_abort_on_vm_exception), Rexception_obj); + restore_live_registers(sasm); + } + // FP no longer used to find the frame start // on entry, remove_frame() has already been called (restoring FP and LR) diff --git a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp index 348de609901..2ba6a6bca4e 100644 --- a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp @@ -552,6 +552,12 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Rexception_save = R31, Rcaller_sp = R30; __ set_info("unwind_exception", dont_gc_arguments); + if (AbortVMOnException) { + save_live_registers(sasm); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, check_abort_on_vm_exception), Rexception); + restore_live_registers(sasm, noreg, noreg); + } + __ ld(Rcaller_sp, 0, R1_SP); __ push_frame_reg_args(0, R0); // dummy frame for C call __ mr(Rexception_save, Rexception); // save over C call diff --git a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp index 80555b87729..ea086d46bda 100644 --- a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp @@ -498,6 +498,14 @@ void Runtime1::generate_unwind_exception(StubAssembler *sasm) { // other registers used in this stub const Register handler_addr = x11; + if (AbortVMOnException) { + __ enter(); + save_live_registers(sasm); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, check_abort_on_vm_exception), x10); + restore_live_registers(sasm); + __ leave(); + } + // verify that only x10, is valid at this time __ invalidate_registers(false, true, true, true, true, true); diff --git a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp index 28acb398c1f..257148827be 100644 --- a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp +++ b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp @@ -233,6 +233,12 @@ void Runtime1::generate_unwind_exception(StubAssembler *sasm) { // Other registers used in this stub. const Register handler_addr = Z_R4; + if (AbortVMOnException) { + save_live_registers(sasm); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, check_abort_on_vm_exception), Z_EXC_OOP); + restore_live_registers(sasm); + } + // Verify that only exception_oop, is valid at this time. __ invalidate_registers(Z_EXC_OOP, Z_EXC_PC); diff --git a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp index 7dd83bcc7a5..8b56f464f27 100644 --- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp +++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp @@ -798,6 +798,14 @@ void Runtime1::generate_unwind_exception(StubAssembler *sasm) { const Register handler_addr = rbx; const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); + if (AbortVMOnException) { + __ enter(); + save_live_registers(sasm, 2); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, check_abort_on_vm_exception), rax); + restore_live_registers(sasm); + __ leave(); + } + // verify that only rax, is valid at this time __ invalidate_registers(false, true, true, true, true, true); diff --git a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp index 3183bb04e77..41a6b151b28 100644 --- a/src/hotspot/share/c1/c1_Runtime1.cpp +++ b/src/hotspot/share/c1/c1_Runtime1.cpp @@ -1504,6 +1504,19 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* current)) JRT_END +// Check exception if AbortVMOnException flag set +JRT_LEAF(void, Runtime1::check_abort_on_vm_exception(oopDesc* ex)) + ResourceMark rm; + const char* message = nullptr; + if (ex->is_a(vmClasses::Throwable_klass())) { + oop msg = java_lang_Throwable::message(ex); + if (msg != nullptr) { + message = java_lang_String::as_utf8_string(msg); + } + } + Exceptions::debug_check_abort(ex->klass()->external_name(), message); +JRT_END + #ifndef PRODUCT void Runtime1::print_statistics() { tty->print_cr("C1 Runtime statistics:"); diff --git a/src/hotspot/share/c1/c1_Runtime1.hpp b/src/hotspot/share/c1/c1_Runtime1.hpp index 3dcb27476a6..525cfd7f92e 100644 --- a/src/hotspot/share/c1/c1_Runtime1.hpp +++ b/src/hotspot/share/c1/c1_Runtime1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, 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,8 @@ class Runtime1: public AllStatic { static void predicate_failed_trap(JavaThread* current); + static void check_abort_on_vm_exception(oopDesc* ex); + static void print_statistics() PRODUCT_RETURN; }; diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java new file mode 100644 index 00000000000..447b690fa02 --- /dev/null +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestAbortVmOnException + * @summary Test -XX:AbortVMOnException=MyAbortException with C1 compilation + * @library /test/lib + * @run driver TestAbortVmOnException + * @bug 8264899 + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +import java.io.IOException; + + +public class TestAbortVmOnException { + + public static void main(String[] args) throws Exception { + if (args.length == 1) { + if (args[0].equals("throwExceptionWithMessage")) { + throw new MyAbortException("MyExceptionMessage"); + } else { + throw new MyAbortException(); + } + } + // Run process throwing MyException + Process myExceptionThrowingProcess = runProcess( "MyAbortException", false, null); + parseOutput(myExceptionThrowingProcess, "fatal error: Saw MyAbortException, aborting"); + // Run process throwing MyException with message + Process myExceptionThrowingWithMessageProcess = runProcess( "MyAbortException", true, null); + parseOutput(myExceptionThrowingWithMessageProcess, "fatal error: Saw MyAbortException: MyExceptionMessage, aborting"); + // Run process throwing MyException with message and check message + Process myExceptionThrowingWithMessageCheckProcess = runProcess( "MyAbortException", true, "MyExceptionMessage"); + parseOutput(myExceptionThrowingWithMessageCheckProcess, "fatal error: Saw MyAbortException: MyExceptionMessage, aborting"); + System.out.println("PASSED"); + } + + private static Process runProcess(String exceptionName, boolean withMessage, String exceptionMessage) throws IOException { + if (exceptionMessage == null) { + return ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + "-XX:AbortVMOnException=" + exceptionName, "-Xcomp", "-Xbatch", "-XX:TieredStopAtLevel=3", TestAbortVmOnException.class.getName(), + withMessage ? "throwExceptionWithMessage" : "throwException").start(); + } else { + return ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + "-XX:AbortVMOnException=" + exceptionName, "-XX:AbortVMOnExceptionMessage=" + exceptionMessage, + "-Xcomp", "-Xbatch", "-XX:TieredStopAtLevel=3", TestAbortVmOnException.class.getName(), + withMessage ? "throwExceptionWithMessage" : "throwException").start(); + } + } + + private static void parseOutput(Process process, String expectedString) throws IOException { + OutputAnalyzer output = new OutputAnalyzer(process); + output.stdoutShouldNotBeEmpty(); + output.shouldContain(expectedString); + } + +} + +class MyAbortException extends RuntimeException { + public MyAbortException() { + super(); + } + + public MyAbortException(String message) { + super(message); + } +} From a607f49ca22aaf461c2e3c2455e9f1cbdf692611 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 28 Dec 2023 12:26:10 +0000 Subject: [PATCH 082/261] 8316309: AArch64: VMError::print_native_stack() crashes on Java native method frame Backport-of: 2d38495b61ec4a8144fe187b5b11883add3dfd49 --- src/hotspot/cpu/aarch64/frame_aarch64.hpp | 2 +- .../cpu/aarch64/frame_aarch64.inline.hpp | 4 +- .../os_cpu/bsd_aarch64/os_bsd_aarch64.cpp | 2 +- .../os_cpu/linux_aarch64/os_linux_aarch64.cpp | 17 ++- src/hotspot/share/utilities/vmError.cpp | 2 +- .../ErrorHandling/StackWalkNativeToJava.java | 134 ++++++++++++++++++ 6 files changed, 155 insertions(+), 6 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java diff --git a/src/hotspot/cpu/aarch64/frame_aarch64.hpp b/src/hotspot/cpu/aarch64/frame_aarch64.hpp index 3d1f588359f..e58d66d5cf5 100644 --- a/src/hotspot/cpu/aarch64/frame_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/frame_aarch64.hpp @@ -165,7 +165,7 @@ frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc); - frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb); + frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, bool allow_cb_null = false); // used for fast frame construction by continuations frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, const ImmutableOopMap* oop_map, bool on_heap); diff --git a/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp index b969e180e4a..39dc16d2748 100644 --- a/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp @@ -92,7 +92,7 @@ inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) { init(sp, fp, pc); } -inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb) { +inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, bool allow_cb_null) { assert(pauth_ptr_is_raw(pc), "cannot be signed"); intptr_t a = intptr_t(sp); intptr_t b = intptr_t(fp); @@ -103,7 +103,7 @@ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address assert(pc != nullptr, "no pc?"); _cb = cb; _oop_map = nullptr; - assert(_cb != nullptr, "pc: " INTPTR_FORMAT, p2i(pc)); + assert(_cb != nullptr || allow_cb_null, "pc: " INTPTR_FORMAT, p2i(pc)); _on_heap = false; DEBUG_ONLY(_frame_index = -1;) diff --git a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp index e2696a52475..feda935c6c1 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp +++ b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp @@ -177,7 +177,7 @@ frame os::fetch_compiled_frame_from_context(const void* ucVoid) { // JVM compiled with -fno-omit-frame-pointer, so RFP is saved on the stack. frame os::get_sender_for_C_frame(frame* fr) { - return frame(fr->link(), fr->link(), fr->sender_pc()); + return frame(fr->sender_sp(), fr->link(), fr->sender_pc()); } NOINLINE frame os::current_frame() { diff --git a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp index 70581166cf1..86721c94797 100644 --- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp +++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp @@ -152,8 +152,23 @@ frame os::fetch_compiled_frame_from_context(const void* ucVoid) { // By default, gcc always saves frame pointer rfp on this stack. This // may get turned off by -fomit-frame-pointer. +// The "Procedure Call Standard for the Arm 64-bit Architecture" doesn't +// specify a location for the frame record within a stack frame (6.4.6). +// GCC currently chooses to save it at the top of the frame (lowest address). +// This means that using fr->sender_sp() to set the caller's frame _unextended_sp, +// as we do in x86, is wrong. Using fr->link() instead only makes sense for +// native frames. Setting a correct value for _unextended_sp is important +// if this value is later used to get that frame's caller. This will happen +// if we end up calling frame::sender_for_compiled_frame(), which will be the +// case if the _pc is associated with a CodeBlob that has a _frame_size > 0 +// (nmethod, runtime stub, safepoint stub, etc). frame os::get_sender_for_C_frame(frame* fr) { - return frame(fr->link(), fr->link(), fr->sender_pc()); + address pc = fr->sender_pc(); + CodeBlob* cb = CodeCache::find_blob(pc); + bool use_codeblob = cb != nullptr && cb->frame_size() > 0; + assert(!use_codeblob || !Interpreter::contains(pc), "should not be an interpreter frame"); + intptr_t* sender_sp = use_codeblob ? (fr->link() + frame::metadata_words - cb->frame_size()) : fr->link(); + return frame(sender_sp, sender_sp, fr->link(), pc, cb, true /* allow_cb_null */); } NOINLINE frame os::current_frame() { diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 6d122b36f3c..5c0b4440e2c 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -426,7 +426,7 @@ static frame next_frame(frame fr, Thread* t) { if (!t->is_in_full_stack((address)(fr.real_fp() + 1))) { return invalid; } - if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) { + if (fr.is_interpreted_frame() || (fr.cb() != nullptr && fr.cb()->frame_size() > 0)) { RegisterMap map(JavaThread::cast(t), RegisterMap::UpdateMap::skip, RegisterMap::ProcessFrames::include, diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java b/test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java new file mode 100644 index 00000000000..0c9c846c8b6 --- /dev/null +++ b/test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.Utils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/* + * @test StackWalkNativeToJava + * @bug 8316309 + * @summary Check that walking the stack works fine when going from C++ frame to Java frame. + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" + * @requires os.family != "windows" + * @requires vm.flagless + * @library /test/lib + * @run driver StackWalkNativeToJava + */ + +public class StackWalkNativeToJava { + + public static void main(String[] args) throws Exception { + // Check stack walking works fine when sender of C++ frame + // is a Java native method. + testStackWalkNativeToJavaNative("-Xint"); + testStackWalkNativeToJavaNative("-Xcomp", "-XX:CompileCommand=dontinline,StackWalkNativeToJava$TestNativeToJavaNative::*"); + + // Check stack walking works fine when sender of C++ frame + // is a runtime stub or interpreted Java method (VM call from Java). + testStackWalkNativeToJava("-Xint"); + testStackWalkNativeToJava("-Xcomp", "-XX:TieredStopAtLevel=3", + "-XX:CompileCommand=dontinline,StackWalkNativeToJava$TestNativeToJava::*"); + } + + public static void testStackWalkNativeToJavaNative(String... extraFlags) throws Exception { + List commands = new ArrayList<>(); + commands.add("-Xbootclasspath/a:."); + commands.add("-XX:-CreateCoredumpOnCrash"); + commands.add("-XX:+UnlockDiagnosticVMOptions"); + commands.add("-XX:AbortVMOnException=java.lang.IllegalMonitorStateException"); + commands.add("-XX:+ErrorFileToStdout"); + commands.addAll(Arrays.asList(extraFlags)); + commands.add("StackWalkNativeToJava$TestNativeToJavaNative"); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(commands); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("java.lang.RuntimeException: Reached statement after obj.wait()"); + output.shouldNotContain("[error occurred during error reporting (printing native stack"); + String[] res = output.getOutput().split("StackWalkNativeToJava\\$TestNativeToJavaNative\\.callNativeMethod\\(\\)V"); + assertTrue(res.length - 1 == 2, res.length - 1); + output.shouldNotHaveExitValue(0); + } + + public static class TestNativeToJavaNative { + public static void main(String[] args) throws Exception { + TestNativeToJavaNative test = new TestNativeToJavaNative(); + test.callNativeMethod(); + } + + public void callNativeMethod() throws Exception { + Object obj = new Object(); + // Trigger a fatal exit due to IllegalMonitorStateException during + // a call to the VM from a Java native method. + obj.wait(); + throw new RuntimeException("Reached statement after obj.wait()"); + } + } + + public static void testStackWalkNativeToJava(String... extraFlags) throws Exception { + List commands = new ArrayList<>(); + commands.add("-Xbootclasspath/a:."); + commands.add("-XX:-CreateCoredumpOnCrash"); + commands.add("-XX:+UnlockDiagnosticVMOptions"); + commands.add("-XX:DiagnoseSyncOnValueBasedClasses=1"); + commands.add("-XX:+ErrorFileToStdout"); + commands.addAll(Arrays.asList(extraFlags)); + commands.add("StackWalkNativeToJava$TestNativeToJava"); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(commands); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("java.lang.RuntimeException: Reached statement after synchronized"); + output.shouldNotContain("[error occurred during error reporting (printing native stack"); + String[] res = output.getOutput().split("StackWalkNativeToJava\\$TestNativeToJava\\.callVMMethod\\(\\)V"); + assertTrue(res.length - 1 == 2, res.length - 1); + output.shouldNotHaveExitValue(0); + } + + public static class TestNativeToJava { + static Integer counter = 0; + + public static void main(String[] args) throws Exception { + TestNativeToJava test = new TestNativeToJava(); + test.callVMMethod(); + } + + public void callVMMethod() throws Exception { + // Trigger a fatal exit for trying to synchronize on a value based class + // during a call to the VM from a Java method. + synchronized (counter) { + counter++; + } + throw new RuntimeException("Reached statement after synchronized"); + } + } + + private static void assertTrue(boolean condition, int count) { + if (!condition) { + throw new RuntimeException("Count error: count was " + count); + } + } +} \ No newline at end of file From 03b01a93bcb0f0eb81a239efaf61f2a55b8bd80f Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 29 Dec 2023 14:07:25 +0000 Subject: [PATCH 083/261] 8304292: Memory leak related to ClassLoader::update_class_path_entry_list Backport-of: 88b4e3b8539c2beb29ad92bd74b300002c2ef84b --- src/hotspot/share/classfile/classLoader.cpp | 16 ++++--- src/hotspot/share/classfile/classLoader.hpp | 2 +- .../runtime/cds/appcds/ClassPathAttr.java | 19 ++++++--- .../cds/appcds/DuplicateClassPaths.java | 42 +++++++++++++++++++ .../cds/appcds/test-classes/cpattr_dup.mf | 3 ++ 5 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp index cc59e16e06d..5e89673a560 100644 --- a/src/hotspot/share/classfile/classLoader.cpp +++ b/src/hotspot/share/classfile/classLoader.cpp @@ -520,7 +520,8 @@ void ClassLoader::setup_app_search_path(JavaThread* current, const char *class_p while (cp_stream.has_next()) { const char* path = cp_stream.get_next(); - update_class_path_entry_list(current, path, false, false, false); + update_class_path_entry_list(current, path, /* check_for_duplicates */ true, + /* is_boot_append */ false, /* from_class_path_attr */ false); } } @@ -665,7 +666,8 @@ void ClassLoader::setup_bootstrap_search_path_impl(JavaThread* current, const ch } else { // Every entry on the boot class path after the initial base piece, // which is set by os::set_boot_path(), is considered an appended entry. - update_class_path_entry_list(current, path, false, true, false); + update_class_path_entry_list(current, path, /* check_for_duplicates */ false, + /* is_boot_append */ true, /* from_class_path_attr */ false); } } } @@ -800,7 +802,7 @@ void ClassLoader::add_to_boot_append_entries(ClassPathEntry *new_entry) { // Note that at dump time, ClassLoader::_app_classpath_entries are NOT used for // loading app classes. Instead, the app class are loaded by the // jdk/internal/loader/ClassLoaders$AppClassLoader instance. -void ClassLoader::add_to_app_classpath_entries(JavaThread* current, +bool ClassLoader::add_to_app_classpath_entries(JavaThread* current, ClassPathEntry* entry, bool check_for_duplicates) { #if INCLUDE_CDS @@ -810,7 +812,7 @@ void ClassLoader::add_to_app_classpath_entries(JavaThread* current, while (e != nullptr) { if (strcmp(e->name(), entry->name()) == 0) { // entry already exists - return; + return false; } e = e->next(); } @@ -829,6 +831,7 @@ void ClassLoader::add_to_app_classpath_entries(JavaThread* current, ClassLoaderExt::process_jar_manifest(current, entry); } #endif + return true; } // Returns true IFF the file/dir exists and the entry was successfully created. @@ -851,7 +854,10 @@ bool ClassLoader::update_class_path_entry_list(JavaThread* current, if (is_boot_append) { add_to_boot_append_entries(new_entry); } else { - add_to_app_classpath_entries(current, new_entry, check_for_duplicates); + if (!add_to_app_classpath_entries(current, new_entry, check_for_duplicates)) { + // new_entry is not saved, free it now + delete new_entry; + } } return true; } else { diff --git a/src/hotspot/share/classfile/classLoader.hpp b/src/hotspot/share/classfile/classLoader.hpp index 5053005288c..4cb1967194a 100644 --- a/src/hotspot/share/classfile/classLoader.hpp +++ b/src/hotspot/share/classfile/classLoader.hpp @@ -221,7 +221,7 @@ class ClassLoader: AllStatic { CDS_ONLY(static ClassPathEntry* _last_module_path_entry;) CDS_ONLY(static void setup_app_search_path(JavaThread* current, const char* class_path);) CDS_ONLY(static void setup_module_search_path(JavaThread* current, const char* path);) - static void add_to_app_classpath_entries(JavaThread* current, + static bool add_to_app_classpath_entries(JavaThread* current, ClassPathEntry* entry, bool check_for_duplicates); CDS_ONLY(static void add_to_module_path_entries(const char* path, diff --git a/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java index 5a3bb39b8b9..f0d797c09ae 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java @@ -55,9 +55,10 @@ static void testNormalOps() throws Exception { "CpAttr2", "CpAttr3", "CpAttr4", "CpAttr5"); buildCpAttr("cpattr5_123456789_223456789_323456789_423456789_523456789_623456789", "cpattr5_extra_long.mf", "CpAttr5", "CpAttr5"); + String[] classlist = { "CpAttr1", "CpAttr2", "CpAttr3", "CpAttr4", "CpAttr5"}; + String jar4 = TestCommon.getTestJar("cpattr4.jar"); for (int i=1; i<=2; i++) { String jar1 = TestCommon.getTestJar("cpattr1.jar"); - String jar4 = TestCommon.getTestJar("cpattr4.jar"); if (i == 2) { // Test case #2 -- same as #1, except we use cpattr1_long.jar, which has a super-long // Class-Path: attribute. @@ -65,11 +66,7 @@ static void testNormalOps() throws Exception { } String cp = jar1 + File.pathSeparator + jar4; - TestCommon.testDump(cp, TestCommon.list("CpAttr1", - "CpAttr2", - "CpAttr3", - "CpAttr4", - "CpAttr5")); + TestCommon.testDump(cp, classlist); TestCommon.run( "-cp", cp, @@ -86,6 +83,16 @@ static void testNormalOps() throws Exception { output.shouldMatch("checking shared classpath entry: .*cpattr3.jar"); }); } + + // test duplicate jars in the "Class-path" attribute in the jar manifest + buildCpAttr("cpattr_dup", "cpattr_dup.mf", "CpAttr1", "CpAttr1"); + String cp = TestCommon.getTestJar("cpattr_dup.jar") + File.pathSeparator + jar4; + TestCommon.testDump(cp, classlist); + + TestCommon.run( + "-cp", cp, + "CpAttr1") + .assertNormalExit(); } static void testNonExistentJars() throws Exception { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java b/test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java new file mode 100644 index 00000000000..ce0e1804997 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @summary duplicate class paths test + * @requires vm.cds + * @library /test/lib + * @compile test-classes/Hello.java + * @run driver DuplicateClassPaths + */ + +import java.io.File; + +public class DuplicateClassPaths { + public static void main(String[] args) throws Exception { + String appJar = JarBuilder.getOrCreateHelloJar(); + String jars = appJar + File.pathSeparator + appJar; + TestCommon.test(jars, TestCommon.list("Hello"), "Hello"); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf new file mode 100644 index 00000000000..ad1f974d82d --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: cpattr2.jar cpattr2.jar +Created-By: 1.9.0-internal (Oracle Corporation) From 4c5502d9ad90947dabd0a96118d721b9659eb5a0 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 29 Dec 2023 14:07:47 +0000 Subject: [PATCH 084/261] 8310919: runtime/ErrorHandling/TestAbortVmOnException.java times out due to core dumps taking a long time on OSX Backport-of: e5744b8120548a161f75aa098826a6798d85f90f --- .../runtime/ErrorHandling/TestAbortVmOnException.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java index 447b690fa02..232cde09043 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java @@ -60,13 +60,14 @@ public static void main(String[] args) throws Exception { private static Process runProcess(String exceptionName, boolean withMessage, String exceptionMessage) throws IOException { if (exceptionMessage == null) { return ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", - "-XX:AbortVMOnException=" + exceptionName, "-Xcomp", "-Xbatch", "-XX:TieredStopAtLevel=3", TestAbortVmOnException.class.getName(), + "-XX:AbortVMOnException=" + exceptionName, "-Xcomp", "-XX:TieredStopAtLevel=3", "-XX:-CreateCoredumpOnCrash", + "-XX:CompileCommand=compileonly,TestAbortVmOnException::*", TestAbortVmOnException.class.getName(), withMessage ? "throwExceptionWithMessage" : "throwException").start(); } else { return ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:AbortVMOnException=" + exceptionName, "-XX:AbortVMOnExceptionMessage=" + exceptionMessage, - "-Xcomp", "-Xbatch", "-XX:TieredStopAtLevel=3", TestAbortVmOnException.class.getName(), - withMessage ? "throwExceptionWithMessage" : "throwException").start(); + "-Xcomp", "-XX:TieredStopAtLevel=3", "-XX:-CreateCoredumpOnCrash", "-XX:CompileCommand=compileonly,TestAbortVmOnException::*", + TestAbortVmOnException.class.getName(),withMessage ? "throwExceptionWithMessage" : "throwException").start(); } } From 9e248626449db64f50f140ecf9037222691b17b4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 29 Dec 2023 14:09:16 +0000 Subject: [PATCH 085/261] 8313720: C2 SuperWord: wrong result with -XX:+UseVectorCmov -XX:+UseCMoveUnconditionally Backport-of: d46f0fb31888db75f5b2b78a162fec16dfc5d0d9 --- src/hotspot/share/opto/superword.cpp | 9 + .../c2/irTests/TestVectorConditionalMove.java | 175 +++++++++++++++++- 2 files changed, 174 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index c1abab86a7a..b952a0759f7 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -1403,6 +1403,7 @@ bool SuperWord::isomorphic(Node* s1, Node* s2) { if (s1->Opcode() != s2->Opcode()) return false; if (s1->req() != s2->req()) return false; if (!same_velt_type(s1, s2)) return false; + if (s1->is_Bool() && s1->as_Bool()->_test._test != s2->as_Bool()->_test._test) return false; Node* s1_ctrl = s1->in(0); Node* s2_ctrl = s2->in(0); // If the control nodes are equivalent, no further checks are required to test for isomorphism. @@ -2799,6 +2800,14 @@ bool SuperWord::output() { Node_List* p_bol = my_pack(bol); assert(p_bol != nullptr, "CMove must have matching Bool pack"); +#ifdef ASSERT + for (uint j = 0; j < p_bol->size(); j++) { + Node* m = p_bol->at(j); + assert(m->as_Bool()->_test._test == bol_test, + "all bool nodes must have same test"); + } +#endif + CmpNode* cmp = bol->in(1)->as_Cmp(); assert(cmp != nullptr, "must have cmp above CMove"); Node_List* p_cmp = my_pack(cmp); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java index b052beea86f..fbba9475cce 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java @@ -31,7 +31,7 @@ /* * @test - * @bug 8289422 8306088 + * @bug 8289422 8306088 8313720 * @key randomness * @summary Auto-vectorization enhancement to support vector conditional move. * @library /test/lib / @@ -398,6 +398,58 @@ private static void testCMoveFNEQforFConst(float[] a, float[] b, float[] c) { } } + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFLTforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1f : -0.1f; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFLEforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1f : -0.1f; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, "=0", + IRNode.VECTOR_MASK_CMP_F, "=0", + IRNode.VECTOR_BLEND_F, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFYYforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1f : -0.1f; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, "=0", + IRNode.VECTOR_MASK_CMP_F, "=0", + IRNode.VECTOR_BLEND_F, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFXXforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1f : -0.1f; + } + } + @Test @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", IRNode.VECTOR_MASK_CMP_D, ">0", @@ -470,6 +522,58 @@ private static void testCMoveDNEQforDConst(double[] a, double[] b, double[] c) { } } + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDLTforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1 : -0.1; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDLEforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1 : -0.1; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, "=0", + IRNode.VECTOR_MASK_CMP_D, "=0", + IRNode.VECTOR_BLEND_D, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDYYforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1 : -0.1; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, "=0", + IRNode.VECTOR_MASK_CMP_D, "=0", + IRNode.VECTOR_BLEND_D, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDXXforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1 : -0.1; + } + } + // Extension: Compare 2 ILFD values, and pick from 2 ILFD values // Note: // To guarantee that CMove is introduced, I need to perform the loads before the branch. To ensure they @@ -719,7 +823,11 @@ private static void testCMoveVDUnsupported() { "testCMoveFGTforFConst", "testCMoveFGEforFConst", "testCMoveFLTforFConst", "testCMoveFLEforFConst", "testCMoveFEQforFConst", "testCMoveFNEQforFConst", "testCMoveDGTforDConst", "testCMoveDGEforDConst", "testCMoveDLTforDConst", - "testCMoveDLEforDConst", "testCMoveDEQforDConst", "testCMoveDNEQforDConst"}) + "testCMoveDLEforDConst", "testCMoveDEQforDConst", "testCMoveDNEQforDConst", + "testCMoveFLTforFConstH2", "testCMoveFLEforFConstH2", + "testCMoveFYYforFConstH2", "testCMoveFXXforFConstH2", + "testCMoveDLTforDConstH2", "testCMoveDLEforDConstH2", + "testCMoveDYYforDConstH2", "testCMoveDXXforDConstH2"}) private void testCMove_runner() { float[] floata = new float[SIZE]; float[] floatb = new float[SIZE]; @@ -818,6 +926,39 @@ private void testCMove_runner() { Asserts.assertEquals(floatc[i], cmoveFNEQforFConst(floata[i], floatb[i])); Asserts.assertEquals(doublec[i], cmoveDNEQforDConst(doublea[i], doubleb[i])); } + + // Hand-unrolled (H2) examples: + testCMoveFLTforFConstH2(floata, floatb, floatc); + testCMoveDLTforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i++) { + Asserts.assertEquals(floatc[i], cmoveFLTforFConst(floata[i], floatb[i])); + Asserts.assertEquals(doublec[i], cmoveDLTforDConst(doublea[i], doubleb[i])); + } + + testCMoveFLEforFConstH2(floata, floatb, floatc); + testCMoveDLEforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i++) { + Asserts.assertEquals(floatc[i], cmoveFLEforFConst(floata[i], floatb[i])); + Asserts.assertEquals(doublec[i], cmoveDLEforDConst(doublea[i], doubleb[i])); + } + + testCMoveFYYforFConstH2(floata, floatb, floatc); + testCMoveDYYforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i+=2) { + Asserts.assertEquals(floatc[i+0], cmoveFLEforFConst(floata[i+0], floatb[i+0])); + Asserts.assertEquals(doublec[i+0], cmoveDLEforDConst(doublea[i+0], doubleb[i+0])); + Asserts.assertEquals(floatc[i+1], cmoveFLTforFConst(floata[i+1], floatb[i+1])); + Asserts.assertEquals(doublec[i+1], cmoveDLTforDConst(doublea[i+1], doubleb[i+1])); + } + + testCMoveFXXforFConstH2(floata, floatb, floatc); + testCMoveDXXforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i+=2) { + Asserts.assertEquals(floatc[i+0], cmoveFLTforFConst(floata[i+0], floatb[i+0])); + Asserts.assertEquals(doublec[i+0], cmoveDLTforDConst(doublea[i+0], doubleb[i+0])); + Asserts.assertEquals(floatc[i+1], cmoveFLEforFConst(floata[i+1], floatb[i+1])); + Asserts.assertEquals(doublec[i+1], cmoveDLEforDConst(doublea[i+1], doubleb[i+1])); + } } @Warmup(0) @@ -984,19 +1125,33 @@ private static void init(long[] a) { private static void init(float[] a) { for (int i = 0; i < SIZE; i++) { - a[i] = RANDOM.nextFloat(); - if (RANDOM.nextInt() % 20 == 0) { - a[i] = Float.NaN; - } + a[i] = switch(RANDOM.nextInt() % 20) { + case 0 -> Float.NaN; + case 1 -> 0; + case 2 -> 1; + case 3 -> Float.POSITIVE_INFINITY; + case 4 -> Float.NEGATIVE_INFINITY; + case 5 -> Float.MAX_VALUE; + case 6 -> Float.MIN_VALUE; + case 7, 8, 9 -> RANDOM.nextFloat(); + default -> Float.intBitsToFloat(RANDOM.nextInt()); + }; } } private static void init(double[] a) { for (int i = 0; i < SIZE; i++) { - a[i] = RANDOM.nextDouble(); - if (RANDOM.nextInt() % 20 == 0) { - a[i] = Double.NaN; - } + a[i] = switch(RANDOM.nextInt() % 20) { + case 0 -> Double.NaN; + case 1 -> 0; + case 2 -> 1; + case 3 -> Double.POSITIVE_INFINITY; + case 4 -> Double.NEGATIVE_INFINITY; + case 5 -> Double.MAX_VALUE; + case 6 -> Double.MIN_VALUE; + case 7, 8, 9 -> RANDOM.nextDouble(); + default -> Double.longBitsToDouble(RANDOM.nextLong()); + }; } } } From 8517987ac16182e7626b4ac73af2b0838191b1cf Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 29 Dec 2023 14:11:10 +0000 Subject: [PATCH 086/261] 8312428: PKCS11 tests fail with NSS 3.91 Backport-of: 1c598c2245c5c348e946f4d0df653daa6e42da94 --- .../pkcs11/MessageDigest/TestCloning.java | 25 +++- test/jdk/sun/security/pkcs11/PSSUtil.java | 84 +++++++++++++ .../Signature/KeyAndParamCheckForPSS.java | 104 +++++++++-------- .../pkcs11/Signature/SignatureTestPSS.java | 110 ++++++++---------- 4 files changed, 208 insertions(+), 115 deletions(-) create mode 100644 test/jdk/sun/security/pkcs11/PSSUtil.java diff --git a/test/jdk/sun/security/pkcs11/MessageDigest/TestCloning.java b/test/jdk/sun/security/pkcs11/MessageDigest/TestCloning.java index c37f6d3324b..58635671f30 100644 --- a/test/jdk/sun/security/pkcs11/MessageDigest/TestCloning.java +++ b/test/jdk/sun/security/pkcs11/MessageDigest/TestCloning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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,6 +39,8 @@ import java.util.Random; import java.util.List; +import jtreg.SkippedException; + public class TestCloning extends PKCS11Test { public static void main(String[] args) throws Exception { @@ -57,15 +59,31 @@ public void main(Provider p) throws Exception { r.nextBytes(data1); r.nextBytes(data2); System.out.println("Testing against provider " + p.getName()); + + boolean skipTest = true; + for (String alg : ALGS) { - System.out.println("Testing " + alg); + System.out.println("Digest algo: " + alg); MessageDigest md = MessageDigest.getInstance(alg, p); - md = testCloning(md, p); + try { + md = testCloning(md, p);; + } catch (CloneNotSupportedException cnse) { + // skip test if clone isn't supported + System.out.println("=> Clone not supported; skip!"); + continue; + } + + // start testing below + skipTest = false; + // repeat the test again after generating digest once for (int j = 0; j < 10; j++) { md = testCloning(md, p); } } + if (skipTest) { + throw new SkippedException("Test Skipped!"); + } } private static MessageDigest testCloning(MessageDigest mdObj, Provider p) @@ -125,4 +143,3 @@ private static void check(byte[] d1, byte[] d2, String copyName) } } } - diff --git a/test/jdk/sun/security/pkcs11/PSSUtil.java b/test/jdk/sun/security/pkcs11/PSSUtil.java new file mode 100644 index 00000000000..d1848804fbf --- /dev/null +++ b/test/jdk/sun/security/pkcs11/PSSUtil.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.Provider; +import java.security.Signature; + +public class PSSUtil { + + /** + * ALGORITHM name, fixed as RSA for PKCS11 + */ + private static final String KEYALG = "RSA"; + private static final String SIGALG = "RSASSA-PSS"; + + public static enum AlgoSupport { + NO, MAYBE, YES + }; + + public static boolean isSignatureSupported(Provider p) { + try { + Signature.getInstance(SIGALG, p); + return true; + } catch (NoSuchAlgorithmException e) { + System.out.println("Skip testing " + SIGALG + + " due to no support"); + return false; + } + } + + public static AlgoSupport isHashSupported(Provider p, String... hashAlgs) { + + AlgoSupport status = AlgoSupport.YES; + for (String h : hashAlgs) { + String sigAlg = (h.startsWith("SHA3-") ? + h : h.replace("-", "")) + "with" + SIGALG; + try { + Signature.getInstance(sigAlg, p); + // Yes, proceed to check next hash algorithm + continue; + } catch (NoSuchAlgorithmException e) { + // continue trying other checks + } + try { + MessageDigest.getInstance(h, p); + status = AlgoSupport.MAYBE; + } catch (NoSuchAlgorithmException e) { + // if not supported as a standalone digest algo, chance of it + // being supported by PSS is very very low + return AlgoSupport.NO; + } + } + return status; + } + + public static KeyPair generateKeys(Provider p, int size) + throws NoSuchAlgorithmException { + KeyPairGenerator kpg = KeyPairGenerator.getInstance(KEYALG, p); + kpg.initialize(size); + return kpg.generateKeyPair(); + } +} diff --git a/test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java b/test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java index f1c0492b5fc..adf7a08908e 100644 --- a/test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java +++ b/test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -24,6 +24,8 @@ import java.security.interfaces.*; import java.security.spec.*; +import jtreg.SkippedException; + /** * @test * @bug 8080462 8226651 8242332 @@ -35,25 +37,19 @@ */ public class KeyAndParamCheckForPSS extends PKCS11Test { - /** - * ALGORITHM name, fixed as RSA for PKCS11 - */ - private static final String KEYALG = "RSA"; private static final String SIGALG = "RSASSA-PSS"; public static void main(String[] args) throws Exception { main(new KeyAndParamCheckForPSS(), args); } + private static boolean skipTest = true; + @Override public void main(Provider p) throws Exception { - Signature sig; - try { - sig = Signature.getInstance(SIGALG, p); - } catch (NoSuchAlgorithmException e) { - System.out.println("Skip testing RSASSA-PSS" + - " due to no support"); - return; + if (!PSSUtil.isSignatureSupported(p)) { + throw new SkippedException("Skip due to no support for " + + SIGALG); } // NOTE: key length >= (digest length + 2) in bytes @@ -76,27 +72,26 @@ public void main(Provider p) throws Exception { runTest(p, 1040, "SHA3-512", "SHA3-256"); runTest(p, 1040, "SHA3-512", "SHA3-384"); runTest(p, 1040, "SHA3-512", "SHA3-512"); + + if (skipTest) { + throw new SkippedException("Test Skipped"); + } } - private void runTest(Provider p, int keySize, String hashAlg, + private static void runTest(Provider p, int keySize, String hashAlg, String mgfHashAlg) throws Exception { - // skip further test if this provider does not support hashAlg or - // mgfHashAlg - try { - MessageDigest.getInstance(hashAlg, p); - MessageDigest.getInstance(mgfHashAlg, p); - } catch (NoSuchAlgorithmException nsae) { - System.out.println("No support for " + hashAlg + ", skip"); + System.out.println("Testing " + hashAlg + " and MGF1" + mgfHashAlg); + PSSUtil.AlgoSupport s = PSSUtil.isHashSupported(p, hashAlg, mgfHashAlg); + if (s == PSSUtil.AlgoSupport.NO) { + System.out.println("=> Skip; no support"); return; } - System.out.println("Testing [" + keySize + " " + hashAlg + "]"); + Signature sig = Signature.getInstance(SIGALG, p); // create a key pair with the supplied size - KeyPairGenerator kpg = KeyPairGenerator.getInstance(KEYALG, p); - kpg.initialize(keySize); - KeyPair kp = kpg.generateKeyPair(); + KeyPair kp = PSSUtil.generateKeys(p, keySize); int bigSaltLen = keySize/8 - 14; AlgorithmParameterSpec paramsBad = new PSSParameterSpec(hashAlg, @@ -108,58 +103,71 @@ private void runTest(Provider p, int keySize, String hashAlg, PublicKey pub = kp.getPublic(); // test#1 - setParameter then initSign - Signature sig = Signature.getInstance("RSASSA-PSS", p); - sig.setParameter(paramsBad); + sig = Signature.getInstance(SIGALG, p); + try { + sig.setParameter(paramsGood); + sig.initSign(priv); + // algorithm support confirmed + skipTest = false; + } catch (Exception ex) { + if (s == PSSUtil.AlgoSupport.MAYBE) { + // confirmed to be unsupported; skip the rest of the test + System.out.println("=> Skip; no PSS support"); + return; + } else { + throw new RuntimeException("Unexpected Exception", ex); + } + } + + sig = Signature.getInstance(SIGALG, p); try { + sig.setParameter(paramsBad); sig.initSign(priv); throw new RuntimeException("Expected IKE not thrown"); } catch (InvalidKeyException ike) { - System.out.println("test#1: got expected IKE"); + // expected } + // test#2 - setParameter then initVerify + sig = Signature.getInstance(SIGALG, p); sig.setParameter(paramsGood); - sig.initSign(priv); - System.out.println("test#1: pass"); + sig.initVerify(pub); - // test#2 - setParameter then initVerify - sig = Signature.getInstance("RSASSA-PSS", p); - sig.setParameter(paramsBad); + sig = Signature.getInstance(SIGALG, p); try { + sig.setParameter(paramsBad); sig.initVerify(pub); throw new RuntimeException("Expected IKE not thrown"); } catch (InvalidKeyException ike) { - System.out.println("test#2: got expected IKE"); + // expected } - sig.setParameter(paramsGood); - sig.initVerify(pub); - - System.out.println("test#2: pass"); - // test#3 - initSign, then setParameter - sig = Signature.getInstance("RSASSA-PSS", p); + sig = Signature.getInstance(SIGALG, p); sig.initSign(priv); + sig.setParameter(paramsGood); + + sig = Signature.getInstance(SIGALG, p); try { + sig.initSign(priv); sig.setParameter(paramsBad); throw new RuntimeException("Expected IAPE not thrown"); } catch (InvalidAlgorithmParameterException iape) { - System.out.println("test#3: got expected IAPE"); + // expected } - sig.setParameter(paramsGood); - System.out.println("test#3: pass"); - // test#4 - initVerify, then setParameter - sig = Signature.getInstance("RSASSA-PSS", p); + sig = Signature.getInstance(SIGALG, p); + sig.setParameter(paramsGood); sig.initVerify(pub); + + sig = Signature.getInstance(SIGALG, p); try { + sig.initVerify(pub); sig.setParameter(paramsBad); throw new RuntimeException("Expected IAPE not thrown"); } catch (InvalidAlgorithmParameterException iape) { - System.out.println("test#4: got expected IAPE"); + // expected } - - sig.setParameter(paramsGood); - System.out.println("test#4: pass"); } } diff --git a/test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java b/test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java index 4c1f7284bbc..c87554a51b1 100644 --- a/test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java +++ b/test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -24,6 +24,7 @@ import java.security.interfaces.*; import java.security.spec.*; import java.util.stream.IntStream; +import jtreg.SkippedException; /** * @test @@ -35,8 +36,6 @@ */ public class SignatureTestPSS extends PKCS11Test { - // PKCS11 does not support RSASSA-PSS keys yet - private static final String KEYALG = "RSA"; private static final String SIGALG = "RSASSA-PSS"; private static final int[] KEYSIZES = { 2048, 3072 }; @@ -44,7 +43,7 @@ public class SignatureTestPSS extends PKCS11Test { "SHA-224", "SHA-256", "SHA-384" , "SHA-512", "SHA3-224", "SHA3-256", "SHA3-384" , "SHA3-512", }; - private Provider prov; + private static final byte[] DATA = generateData(100); /** * How much times signature updated. @@ -56,88 +55,72 @@ public class SignatureTestPSS extends PKCS11Test { */ private static final int UPDATE_TIMES_HUNDRED = 100; + private static boolean skipTest = true; + public static void main(String[] args) throws Exception { main(new SignatureTestPSS(), args); } @Override public void main(Provider p) throws Exception { - Signature sig; - try { - sig = Signature.getInstance(SIGALG, p); - } catch (NoSuchAlgorithmException e) { - System.out.println("Skip testing RSASSA-PSS" + - " due to no support"); - return; + if (!PSSUtil.isSignatureSupported(p)) { + throw new SkippedException("Skip due to no support for " + SIGALG); } - this.prov = p; - for (int i : KEYSIZES) { - runTest(i); - } - } - private void runTest(int keySize) throws Exception { - byte[] data = new byte[100]; - IntStream.range(0, data.length).forEach(j -> { - data[j] = (byte) j; - }); - System.out.println("[KEYSIZE = " + keySize + "]"); - - // create a key pair - KeyPair kpair = generateKeys(KEYALG, keySize); - test(DIGESTS, kpair.getPrivate(), kpair.getPublic(), data); - } - - private void test(String[] digestAlgs, PrivateKey privKey, - PublicKey pubKey, byte[] data) throws RuntimeException { - // For signature algorithm, create and verify a signature - for (String hash : digestAlgs) { - for (String mgfHash : digestAlgs) { - try { - checkSignature(data, pubKey, privKey, hash, mgfHash); - } catch (NoSuchAlgorithmException | InvalidKeyException | - SignatureException | NoSuchProviderException ex) { - throw new RuntimeException(ex); - } catch (InvalidAlgorithmParameterException ex2) { - System.out.println("Skip test due to " + ex2); + for (int kSize : KEYSIZES) { + System.out.println("[KEYSIZE = " + kSize + "]"); + KeyPair kp = PSSUtil.generateKeys(p, kSize); + PrivateKey privKey = kp.getPrivate(); + PublicKey pubKey = kp.getPublic(); + for (String hash : DIGESTS) { + for (String mgfHash : DIGESTS) { + System.out.println(" [Hash = " + hash + + ", MGF1 Hash = " + mgfHash + "]"); + PSSUtil.AlgoSupport s = + PSSUtil.isHashSupported(p, hash, mgfHash); + if (s == PSSUtil.AlgoSupport.NO) { + System.out.println(" => Skip; no support"); + continue; + } + checkSignature(p, DATA, pubKey, privKey, hash, mgfHash, s); } - } - }; - } + }; + } - private KeyPair generateKeys(String keyalg, int size) - throws NoSuchAlgorithmException { - KeyPairGenerator kpg = KeyPairGenerator.getInstance(keyalg, prov); - kpg.initialize(size); - return kpg.generateKeyPair(); + // start testing below + if (skipTest) { + throw new SkippedException("Test Skipped"); + } } - private void checkSignature(byte[] data, PublicKey pub, - PrivateKey priv, String hash, String mgfHash) + private static void checkSignature(Provider p, byte[] data, PublicKey pub, + PrivateKey priv, String hash, String mgfHash, PSSUtil.AlgoSupport s) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, NoSuchProviderException, InvalidAlgorithmParameterException { - String testName = hash + " and MGF1_" + mgfHash; // only test RSASSA-PSS signature against the supplied hash/mgfHash // if they are supported; otherwise PKCS11 library will throw // CKR_MECHANISM_PARAM_INVALID at Signature.initXXX calls + Signature sig = Signature.getInstance(SIGALG, p); + AlgorithmParameterSpec params = new PSSParameterSpec( + hash, "MGF1", new MGF1ParameterSpec(mgfHash), 0, 1); + sig.initSign(priv); + try { - MessageDigest md = MessageDigest.getInstance(hash, prov); - if (!hash.equalsIgnoreCase(mgfHash)) { - md = MessageDigest.getInstance(mgfHash, prov); + sig.setParameter(params); + } catch (InvalidAlgorithmParameterException iape) { + if (s == PSSUtil.AlgoSupport.MAYBE) { + // confirmed to be unsupported; skip the rest of the test + System.out.println(" => Skip; no PSS support"); + return; + } else { + throw new RuntimeException("Unexpected Exception", iape); } - } catch (NoSuchAlgorithmException nsae) { - System.out.println("Skip testing " + hash + "/" + mgfHash); - return; } + // start testing below + skipTest = false; - System.out.println("Testing against " + testName); - Signature sig = Signature.getInstance(SIGALG, prov); - AlgorithmParameterSpec params = new PSSParameterSpec( - hash, "MGF1", new MGF1ParameterSpec(mgfHash), 0, 1); - sig.setParameter(params); - sig.initSign(priv); for (int i = 0; i < UPDATE_TIMES_HUNDRED; i++) { sig.update(data); } @@ -163,5 +146,6 @@ private void checkSignature(byte[] data, PublicKey pub, if (sig.verify(signedData)) { throw new RuntimeException("Failed to detect bad signature"); } + System.out.println(" => Passed"); } } From 80c86c2e65fbeb233359a84ec3f9ee34acdc7fb8 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 29 Dec 2023 14:13:10 +0000 Subject: [PATCH 087/261] 8316001: GC: Make TestArrayAllocatorMallocLimit use createTestJvm Backport-of: 86dde5e02b170c60e18930b66e05f0f3dd482e29 --- .../jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java b/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java index 163be84db03..80f0ec4f0cc 100644 --- a/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java +++ b/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -51,7 +51,7 @@ public static void main(String [] args) throws Exception { private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *"; public static void testDefaultValue() throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createTestJvm( "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); From 191fc6b50a413cba76eb9f4f3f4f1713cc1e3703 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 29 Dec 2023 14:13:29 +0000 Subject: [PATCH 088/261] 8316661: CompilerThread leaks CodeBlob memory when dynamically stopping compiler thread in non-product Backport-of: edcc559f09364da3692862e1f3d0636aa8eec1d4 --- src/hotspot/share/code/codeBlob.hpp | 28 +++++--------------- src/hotspot/share/code/codeCache.cpp | 5 ++-- src/hotspot/share/code/codeCache.hpp | 6 ++--- src/hotspot/share/compiler/compileBroker.cpp | 21 ++++++++------- src/hotspot/share/compiler/compileBroker.hpp | 2 ++ src/hotspot/share/memory/heap.hpp | 3 --- 6 files changed, 26 insertions(+), 39 deletions(-) diff --git a/src/hotspot/share/code/codeBlob.hpp b/src/hotspot/share/code/codeBlob.hpp index eb7f49b185a..6c40fe992ae 100644 --- a/src/hotspot/share/code/codeBlob.hpp +++ b/src/hotspot/share/code/codeBlob.hpp @@ -119,11 +119,6 @@ class CodeBlob { #ifndef PRODUCT AsmRemarks _asm_remarks; DbgStrings _dbg_strings; - - ~CodeBlob() { - _asm_remarks.clear(); - _dbg_strings.clear(); - } #endif // not PRODUCT CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, @@ -132,10 +127,17 @@ class CodeBlob { CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments, bool compiled = false); + + void operator delete(void* p) { } + public: // Only used by unit test. CodeBlob() : _type(compiler_none) {} + virtual ~CodeBlob() { + assert(_oop_maps == nullptr, "Not flushed"); + } + // Returns the space needed for CodeBlob static unsigned int allocation_size(CodeBuffer* cb, int header_size); static unsigned int align_code_offset(int offset); @@ -404,10 +406,6 @@ class BufferBlob: public RuntimeBlob { BufferBlob(const char* name, int size); BufferBlob(const char* name, int size, CodeBuffer* cb); - // This ordinary operator delete is needed even though not used, so the - // below two-argument operator delete will be treated as a placement - // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2. - void operator delete(void* p); void* operator new(size_t s, unsigned size) throw(); public: @@ -492,10 +490,6 @@ class RuntimeStub: public RuntimeBlob { bool caller_must_gc_arguments ); - // This ordinary operator delete is needed even though not used, so the - // below two-argument operator delete will be treated as a placement - // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2. - void operator delete(void* p); void* operator new(size_t s, unsigned size) throw(); public: @@ -532,10 +526,6 @@ class SingletonBlob: public RuntimeBlob { friend class VMStructs; protected: - // This ordinary operator delete is needed even though not used, so the - // below two-argument operator delete will be treated as a placement - // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2. - void operator delete(void* p); void* operator new(size_t s, unsigned size) throw(); public: @@ -750,10 +740,6 @@ class UpcallStub: public RuntimeBlob { intptr_t exception_handler_offset, jobject receiver, ByteSize frame_data_offset); - // This ordinary operator delete is needed even though not used, so the - // below two-argument operator delete will be treated as a placement - // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2. - void operator delete(void* p); void* operator new(size_t s, unsigned size) throw(); struct FrameData { diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index dd95025b968..3bc1db70251 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -472,10 +472,10 @@ CodeHeap* CodeCache::get_code_heap_containing(void* start) { return nullptr; } -CodeHeap* CodeCache::get_code_heap(const CodeBlob* cb) { +CodeHeap* CodeCache::get_code_heap(const void* cb) { assert(cb != nullptr, "CodeBlob is null"); FOR_ALL_HEAPS(heap) { - if ((*heap)->contains_blob(cb)) { + if ((*heap)->contains(cb)) { return *heap; } } @@ -604,6 +604,7 @@ void CodeCache::free(CodeBlob* cb) { heap->set_adapter_count(heap->adapter_count() - 1); } + cb->~CodeBlob(); // Get heap for given CodeBlob and deallocate get_code_heap(cb)->deallocate(cb); diff --git a/src/hotspot/share/code/codeCache.hpp b/src/hotspot/share/code/codeCache.hpp index 5645d5067f6..8abc4043ae6 100644 --- a/src/hotspot/share/code/codeCache.hpp +++ b/src/hotspot/share/code/codeCache.hpp @@ -117,7 +117,7 @@ class CodeCache : AllStatic { // Creates a new heap with the given name and size, containing CodeBlobs of the given type static void add_heap(ReservedSpace rs, const char* name, CodeBlobType code_blob_type); static CodeHeap* get_code_heap_containing(void* p); // Returns the CodeHeap containing the given pointer, or nullptr - static CodeHeap* get_code_heap(const CodeBlob* cb); // Returns the CodeHeap for the given CodeBlob + static CodeHeap* get_code_heap(const void* cb); // Returns the CodeHeap for the given CodeBlob static CodeHeap* get_code_heap(CodeBlobType code_blob_type); // Returns the CodeHeap for the given CodeBlobType // Returns the name of the VM option to set the size of the corresponding CodeHeap static const char* get_code_heap_flag_name(CodeBlobType code_blob_type); @@ -397,10 +397,10 @@ template class CodeBlobIterator : publi // If set to nullptr, initialized by first call to next() _code_blob = nm; if (nm != nullptr) { - while(!(*_heap)->contains_blob(_code_blob)) { + while(!(*_heap)->contains(_code_blob)) { ++_heap; } - assert((*_heap)->contains_blob(_code_blob), "match not found"); + assert((*_heap)->contains(_code_blob), "match not found"); } } diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp index e1226c85136..8a83a864f62 100644 --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -1772,17 +1772,22 @@ bool CompileBroker::init_compiler_runtime() { return true; } +void CompileBroker::free_buffer_blob_if_allocated(CompilerThread* thread) { + BufferBlob* blob = thread->get_buffer_blob(); + if (blob != nullptr) { + blob->flush(); + MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + CodeCache::free(blob); + } +} + /** * If C1 and/or C2 initialization failed, we shut down all compilation. * We do this to keep things simple. This can be changed if it ever turns * out to be a problem. */ void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) { - // Free buffer blob, if allocated - if (thread->get_buffer_blob() != nullptr) { - MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - CodeCache::free(thread->get_buffer_blob()); - } + free_buffer_blob_if_allocated(thread); if (comp->should_perform_shutdown()) { // There are two reasons for shutting down the compiler @@ -1921,11 +1926,7 @@ void CompileBroker::compiler_thread_loop() { // Notify compiler that the compiler thread is about to stop thread->compiler()->stopping_compiler_thread(thread); - // Free buffer blob, if allocated - if (thread->get_buffer_blob() != nullptr) { - MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - CodeCache::free(thread->get_buffer_blob()); - } + free_buffer_blob_if_allocated(thread); return; // Stop this thread. } } diff --git a/src/hotspot/share/compiler/compileBroker.hpp b/src/hotspot/share/compiler/compileBroker.hpp index e87c7f35555..b7f09259fa8 100644 --- a/src/hotspot/share/compiler/compileBroker.hpp +++ b/src/hotspot/share/compiler/compileBroker.hpp @@ -252,6 +252,8 @@ class CompileBroker: AllStatic { static bool wait_for_jvmci_completion(JVMCICompiler* comp, CompileTask* task, JavaThread* thread); #endif + static void free_buffer_blob_if_allocated(CompilerThread* thread); + static void invoke_compiler_on_method(CompileTask* task); static void handle_compile_error(CompilerThread* thread, CompileTask* task, ciEnv* ci_env, int compilable, const char* failure_reason); diff --git a/src/hotspot/share/memory/heap.hpp b/src/hotspot/share/memory/heap.hpp index 97ac11708c1..da02eecae49 100644 --- a/src/hotspot/share/memory/heap.hpp +++ b/src/hotspot/share/memory/heap.hpp @@ -171,9 +171,6 @@ class CodeHeap : public CHeapObj { // Containment means "contained in committed space". bool contains(const void* p) const { return low() <= p && p < high(); } - bool contains_blob(const CodeBlob* blob) const { - return contains((void*)blob); - } void* find_start(void* p) const; // returns the block containing p or null CodeBlob* find_blob(void* start) const; From 3465179458d844fec4d0496aa3d0c31b34c4c345 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sat, 30 Dec 2023 15:12:11 +0000 Subject: [PATCH 089/261] 8311588: C2: RepeatCompilation compiler directive does not choose stress seed randomly Backport-of: 06a1a15d014f5ca48f62f5f0c8e8682086c4ae0b --- src/hotspot/share/opto/compile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index f59f63a2379..35f37b0b945 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -827,7 +827,7 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci, // If any phase is randomized for stress testing, seed random number // generation and log the seed for repeatability. if (StressLCM || StressGCM || StressIGVN || StressCCP) { - if (FLAG_IS_DEFAULT(StressSeed) || (FLAG_IS_ERGO(StressSeed) && RepeatCompilation)) { + if (FLAG_IS_DEFAULT(StressSeed) || (FLAG_IS_ERGO(StressSeed) && directive->RepeatCompilationOption)) { _stress_seed = static_cast(Ticks::now().nanoseconds()); FLAG_SET_ERGO(StressSeed, _stress_seed); } else { From 98fb42563ac1a1d050abdd06be20b8e4a5a03f9b Mon Sep 17 00:00:00 2001 From: Sandhya Viswanathan Date: Sat, 30 Dec 2023 17:36:23 +0000 Subject: [PATCH 090/261] 8320206: Some intrinsics/stubs missing vzeroupper on x86_64 Backport-of: 9b372e28ceb8b054118027626eb454b8a493740b --- src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp | 1 + src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp | 4 ++++ src/hotspot/share/opto/library_call.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp index bb8e8f6b1ea..84f5cc80b0d 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp @@ -330,6 +330,7 @@ address StubGenerator::generate_updateBytesAdler32() { __ movq(r13, xtmp4); __ movq(r12, xtmp3); + __ vzeroupper(); __ leave(); __ ret(0); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp index f94297ce82d..47354f4fc7c 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp @@ -291,6 +291,9 @@ address StubGenerator::generate_chacha20Block_avx() { // registers. That length should be returned through %rax. __ mov64(rax, outlen); + if (outlen == 256) { + __ vzeroupper(); + } __ leave(); __ ret(0); return start; @@ -460,6 +463,7 @@ address StubGenerator::generate_chacha20Block_avx512() { // and that length should be returned through %rax. __ mov64(rax, 1024); + __ vzeroupper(); __ leave(); __ ret(0); return start; diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index ab598878d5b..af2ea609595 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -1108,6 +1108,7 @@ bool LibraryCallKit::inline_countPositives() { Node* ba_start = array_element_address(ba, offset, T_BYTE); Node* result = new CountPositivesNode(control(), memory(TypeAryPtr::BYTES), ba_start, len); set_result(_gvn.transform(result)); + clear_upper_avx(); return true; } @@ -1362,6 +1363,7 @@ bool LibraryCallKit::inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae) { set_control(_gvn.transform(region)); record_for_igvn(region); set_result(_gvn.transform(phi)); + clear_upper_avx(); return true; } From 24b3b2b66f0bed3e9812999a5b6d511f31e9ad1f Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Sun, 31 Dec 2023 09:26:48 +0000 Subject: [PATCH 091/261] 8322772: Clean up code after JDK-8322417 Reviewed-by: mbaesken Backport-of: 32d80e2caf6063b58128bd5f3dc87b276f3bd0cb --- src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java b/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java index 247545f8721..a75ff582085 100644 --- a/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java +++ b/src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java @@ -120,7 +120,7 @@ public char[] readPassword(String fmt, Object ... args) { ioe.addSuppressed(x); } if (ioe != null) { - java.util.Arrays.fill(passwd, ' '); + Arrays.fill(passwd, ' '); try { if (reader instanceof LineReader lr) { lr.zeroOut(); From 3bf9212d432197cf3c4a787bab615b7c8519200b Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 2 Jan 2024 16:58:26 +0000 Subject: [PATCH 092/261] 8314610: hotspot can't compile with the latest of gtest because of Backport-of: febc34dd285c3382716e068748d4a3b0c73d87ad --- .../gtest/gc/shared/test_memset_with_concurrent_readers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp b/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp index 7a3845e336a..875186b83d0 100644 --- a/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp +++ b/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +26,7 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/vmassert_uninstall.hpp" +#include #include #include #include "utilities/vmassert_reinstall.hpp" From dc899e2be287f184b5ea94fa922fb0cabcc26d14 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 2 Jan 2024 20:55:12 +0000 Subject: [PATCH 093/261] 8320937: support latest VS2022 MSC_VER in abstract_vm_version.cpp Backport-of: eb44bafe7709b108acca06b083f306d6ab7a8050 --- src/hotspot/share/runtime/abstract_vm_version.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hotspot/share/runtime/abstract_vm_version.cpp b/src/hotspot/share/runtime/abstract_vm_version.cpp index 2fdb820982a..fee840aba9a 100644 --- a/src/hotspot/share/runtime/abstract_vm_version.cpp +++ b/src/hotspot/share/runtime/abstract_vm_version.cpp @@ -240,6 +240,16 @@ const char* Abstract_VM_Version::internal_vm_info_string() { #define HOTSPOT_BUILD_COMPILER "MS VC++ 17.2 (VS2022)" #elif _MSC_VER == 1933 #define HOTSPOT_BUILD_COMPILER "MS VC++ 17.3 (VS2022)" + #elif _MSC_VER == 1934 + #define HOTSPOT_BUILD_COMPILER "MS VC++ 17.4 (VS2022)" + #elif _MSC_VER == 1935 + #define HOTSPOT_BUILD_COMPILER "MS VC++ 17.5 (VS2022)" + #elif _MSC_VER == 1936 + #define HOTSPOT_BUILD_COMPILER "MS VC++ 17.6 (VS2022)" + #elif _MSC_VER == 1937 + #define HOTSPOT_BUILD_COMPILER "MS VC++ 17.7 (VS2022)" + #elif _MSC_VER == 1938 + #define HOTSPOT_BUILD_COMPILER "MS VC++ 17.8 (VS2022)" #else #define HOTSPOT_BUILD_COMPILER "unknown MS VC++:" XSTR(_MSC_VER) #endif From 91773198439b2f5a633f40cb9aea067d73fb58f5 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 3 Jan 2024 12:38:24 +0000 Subject: [PATCH 094/261] 8319137: release _object in ObjectMonitor dtor to avoid races Reviewed-by: rkennke Backport-of: c39d001c7a1ae9eb322a7bb621a03e18c9bf02a1 --- src/hotspot/share/runtime/objectMonitor.cpp | 14 +------- src/hotspot/share/runtime/objectMonitor.hpp | 1 - src/hotspot/share/runtime/synchronizer.cpp | 39 ++++++--------------- 3 files changed, 12 insertions(+), 42 deletions(-) diff --git a/src/hotspot/share/runtime/objectMonitor.cpp b/src/hotspot/share/runtime/objectMonitor.cpp index 12a0e953771..c8952cf8af3 100644 --- a/src/hotspot/share/runtime/objectMonitor.cpp +++ b/src/hotspot/share/runtime/objectMonitor.cpp @@ -276,24 +276,15 @@ ObjectMonitor::ObjectMonitor(oop object) : { } ObjectMonitor::~ObjectMonitor() { - if (!_object.is_null()) { - // Release object's oop storage if it hasn't already been done. - release_object(); - } + _object.release(_oop_storage); } oop ObjectMonitor::object() const { check_object_context(); - if (_object.is_null()) { - return nullptr; - } return _object.resolve(); } oop ObjectMonitor::object_peek() const { - if (_object.is_null()) { - return nullptr; - } return _object.peek(); } @@ -598,9 +589,6 @@ bool ObjectMonitor::deflate_monitor() { install_displaced_markword_in_object(obj); } - // Release object's oop storage since the ObjectMonitor has been deflated: - release_object(); - // We leave owner == DEFLATER_MARKER and contentions < 0 // to force any racing threads to retry. return true; // Success, ObjectMonitor has been deflated. diff --git a/src/hotspot/share/runtime/objectMonitor.hpp b/src/hotspot/share/runtime/objectMonitor.hpp index 92fb58dadb5..d6c0e31f7a1 100644 --- a/src/hotspot/share/runtime/objectMonitor.hpp +++ b/src/hotspot/share/runtime/objectMonitor.hpp @@ -363,7 +363,6 @@ class ObjectMonitor : public CHeapObj { // Deflation support bool deflate_monitor(); void install_displaced_markword_in_object(const oop obj); - void release_object() { _object.release(_oop_storage); _object.set_null(); } }; #endif // SHARE_RUNTIME_OBJECTMONITOR_HPP diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index a89b1c3e1a3..6e6f2115e1e 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -1646,14 +1646,20 @@ class VM_RendezvousGCThreads : public VM_Operation { }; }; -static size_t delete_monitors(GrowableArray* delete_list) { +static size_t delete_monitors(Thread* current, GrowableArray* delete_list, + LogStream* ls, elapsedTimer* timer_p) { NativeHeapTrimmer::SuspendMark sm("monitor deletion"); - size_t count = 0; + size_t deleted_count = 0; for (ObjectMonitor* monitor: *delete_list) { delete monitor; - count++; + deleted_count++; + if (current->is_Java_thread()) { + // A JavaThread must check for a safepoint/handshake and honor it. + ObjectSynchronizer::chk_for_block_req(JavaThread::cast(current), "deletion", "deleted_count", + deleted_count, ls, timer_p); + } } - return count; + return deleted_count; } // This function is called by the MonitorDeflationThread to deflate @@ -1731,30 +1737,7 @@ size_t ObjectSynchronizer::deflate_idle_monitors(ObjectMonitorsHashtable* table) // After the handshake, safely free the ObjectMonitors that were // deflated and unlinked in this cycle. - if (current->is_Java_thread()) { - if (ls != NULL) { - timer.stop(); - ls->print_cr("before setting blocked: unlinked_count=" SIZE_FORMAT - ", in_use_list stats: ceiling=" SIZE_FORMAT ", count=" - SIZE_FORMAT ", max=" SIZE_FORMAT, - unlinked_count, in_use_list_ceiling(), - _in_use_list.count(), _in_use_list.max()); - } - // Mark the calling JavaThread blocked (safepoint safe) while we free - // the ObjectMonitors so we don't delay safepoints whilst doing that. - ThreadBlockInVM tbivm(JavaThread::cast(current)); - if (ls != NULL) { - ls->print_cr("after setting blocked: in_use_list stats: ceiling=" - SIZE_FORMAT ", count=" SIZE_FORMAT ", max=" SIZE_FORMAT, - in_use_list_ceiling(), _in_use_list.count(), _in_use_list.max()); - timer.start(); - } - deleted_count = delete_monitors(&delete_list); - // ThreadBlockInVM is destroyed here - } else { - // A non-JavaThread can just free the ObjectMonitors: - deleted_count = delete_monitors(&delete_list); - } + deleted_count = delete_monitors(current, &delete_list, ls, &timer); assert(unlinked_count == deleted_count, "must be"); } From 8fbd10bc5db476abf76a55a456f811132041301f Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Wed, 3 Jan 2024 21:00:07 +0000 Subject: [PATCH 095/261] 8301310: The SendRawSysexMessage test may cause a JVM crash Backport-of: d725b73df01ae4478dfaabc47c48cd7231d91afa --- .../share/native/libjsound/MidiOutDevice.c | 8 +++++--- .../midi/SysexMessage/SendRawSysexMessage.java | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/java.desktop/share/native/libjsound/MidiOutDevice.c b/src/java.desktop/share/native/libjsound/MidiOutDevice.c index 3738eba9381..29ef140b89d 100644 --- a/src/java.desktop/share/native/libjsound/MidiOutDevice.c +++ b/src/java.desktop/share/native/libjsound/MidiOutDevice.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -121,6 +121,7 @@ Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage(JNIEnv* e, jobject thisO jbyteArray jData, jint size, jlong timeStamp) { #if USE_PLATFORM_MIDI_OUT == TRUE UBYTE* data; + UBYTE* msg; #endif TRACE0("Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage.\n"); @@ -133,11 +134,12 @@ Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage(JNIEnv* e, jobject thisO } /* "continuation" sysex messages start with F7 (instead of F0), but are sent without the F7. */ + msg = data; if (data[0] == 0xF7 && size > 1) { - data++; + msg++; size--; } - MIDI_OUT_SendLongMessage((MidiDeviceHandle*) (UINT_PTR) deviceHandle, data, + MIDI_OUT_SendLongMessage((MidiDeviceHandle*) (UINT_PTR) deviceHandle, msg, (UINT32) size, (UINT32)timeStamp); // release the byte array (*e)->ReleaseByteArrayElements(e, jData, (jbyte*) data, JNI_ABORT); diff --git a/test/jdk/javax/sound/midi/SysexMessage/SendRawSysexMessage.java b/test/jdk/javax/sound/midi/SysexMessage/SendRawSysexMessage.java index 591def651fb..2a33d28b3f5 100644 --- a/test/jdk/javax/sound/midi/SysexMessage/SendRawSysexMessage.java +++ b/test/jdk/javax/sound/midi/SysexMessage/SendRawSysexMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,9 @@ /** * @test - * @bug 8237495 - * @summary fail with a dereferenced memory error when asked to send a raw 0xF7 + * @bug 8237495 8301310 + * @summary fail with memory errors when asked to send a sysex message starting + * with 0xF7 */ public final class SendRawSysexMessage { @@ -113,6 +114,16 @@ private static void test(MidiDevice.Info info) throws Exception { (byte) SPECIAL_SYSTEM_EXCLUSIVE}), -1); System.err.println("note off"); r.send(new ShortMessage(ShortMessage.NOTE_OFF, 5, 5), -1); + System.err.println("sysex part 1 of 3"); + r.send(new SysexMessage(new byte[]{ + (byte) SYSTEM_EXCLUSIVE, 0x7D, 0x01, 0x02}, 4), -1); + System.err.println("sysex part 2 of 3"); + r.send(new SysexMessage(new byte[]{ + (byte) SPECIAL_SYSTEM_EXCLUSIVE, 0x03, 0x04}, 3), -1); + System.err.println("sysex part 3 of 3"); + r.send(new SysexMessage(new byte[]{ + (byte) SPECIAL_SYSTEM_EXCLUSIVE, 0x05, 0x06, 0x07, + (byte) SPECIAL_SYSTEM_EXCLUSIVE}, 4), -1); System.err.println("done, should quit"); System.err.println(); } From 966071a5f10a7a8910b2639e10c961924a07d675 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 4 Jan 2024 09:02:59 +0000 Subject: [PATCH 096/261] 8309203: C2: remove copy-by-value of GrowableArray for InterfaceSet Backport-of: 21cda19d05b688148f023f6d92778b5da210b709 --- src/hotspot/share/opto/type.cpp | 320 +++++++++++++++++--------------- src/hotspot/share/opto/type.hpp | 142 +++++++------- 2 files changed, 242 insertions(+), 220 deletions(-) diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index 9effdb6a1d1..c1c88a26f6a 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -61,6 +61,7 @@ const Type::TypeInfo Type::_type_info[Type::lastype] = { { Bad, T_NARROWKLASS,"narrowklass:", false, Op_RegN, relocInfo::none }, // NarrowKlass { Bad, T_ILLEGAL, "tuple:", false, Node::NotAMachineReg, relocInfo::none }, // Tuple { Bad, T_ARRAY, "array:", false, Node::NotAMachineReg, relocInfo::none }, // Array + { Bad, T_ARRAY, "interfaces:", false, Node::NotAMachineReg, relocInfo::none }, // Interfaces #if defined(PPC64) { Bad, T_ILLEGAL, "vectormask:", false, Op_RegVectMask, relocInfo::none }, // VectorMask. @@ -120,8 +121,8 @@ const Type* Type:: _zero_type[T_CONFLICT+1]; // Map basic types to array-body alias types. const TypeAryPtr* TypeAryPtr::_array_body_type[T_CONFLICT+1]; -const TypePtr::InterfaceSet* TypeAryPtr::_array_interfaces = nullptr; -const TypePtr::InterfaceSet* TypeAryKlassPtr::_array_interfaces = nullptr; +const TypeInterfaces* TypeAryPtr::_array_interfaces = nullptr; +const TypeInterfaces* TypeAryKlassPtr::_array_interfaces = nullptr; //============================================================================= // Convenience common pre-built types. @@ -571,7 +572,7 @@ void Type::Initialize_shared(Compile* current) { GrowableArray array_interfaces; array_interfaces.push(current->env()->Cloneable_klass()); array_interfaces.push(current->env()->Serializable_klass()); - TypeAryPtr::_array_interfaces = new TypePtr::InterfaceSet(&array_interfaces); + TypeAryPtr::_array_interfaces = TypeInterfaces::make(&array_interfaces); TypeAryKlassPtr::_array_interfaces = TypeAryPtr::_array_interfaces; TypeAryPtr::RANGE = TypeAryPtr::make( TypePtr::BotPTR, TypeAry::make(Type::BOTTOM,TypeInt::POS), nullptr /* current->env()->Object_klass() */, false, arrayOopDesc::length_offset_in_bytes()); @@ -3252,14 +3253,14 @@ void TypeRawPtr::dump2( Dict &d, uint depth, outputStream *st ) const { // Convenience common pre-built type. const TypeOopPtr *TypeOopPtr::BOTTOM; -TypePtr::InterfaceSet::InterfaceSet() - : _list(Compile::current()->type_arena(), 0, 0, nullptr), +TypeInterfaces::TypeInterfaces() + : Type(Interfaces), _list(Compile::current()->type_arena(), 0, 0, nullptr), _hash(0), _exact_klass(nullptr) { DEBUG_ONLY(_initialized = true); } -TypePtr::InterfaceSet::InterfaceSet(GrowableArray* interfaces) - : _list(Compile::current()->type_arena(), interfaces->length(), 0, nullptr), +TypeInterfaces::TypeInterfaces(GrowableArray* interfaces) + : Type(Interfaces), _list(Compile::current()->type_arena(), interfaces->length(), 0, nullptr), _hash(0), _exact_klass(nullptr) { for (int i = 0; i < interfaces->length(); i++) { add(interfaces->at(i)); @@ -3267,13 +3268,18 @@ TypePtr::InterfaceSet::InterfaceSet(GrowableArray* interfaces) initialize(); } -void TypePtr::InterfaceSet::initialize() { +const TypeInterfaces* TypeInterfaces::make(GrowableArray* interfaces) { + TypeInterfaces* result = (interfaces == nullptr) ? new TypeInterfaces() : new TypeInterfaces(interfaces); + return (const TypeInterfaces*)result->hashcons(); +} + +void TypeInterfaces::initialize() { compute_hash(); compute_exact_klass(); DEBUG_ONLY(_initialized = true;) } -int TypePtr::InterfaceSet::compare(ciKlass* const& k1, ciKlass* const& k2) { +int TypeInterfaces::compare(ciInstanceKlass* const& k1, ciInstanceKlass* const& k2) { if ((intptr_t)k1 < (intptr_t)k2) { return -1; } else if ((intptr_t)k1 > (intptr_t)k2) { @@ -3282,24 +3288,20 @@ int TypePtr::InterfaceSet::compare(ciKlass* const& k1, ciKlass* const& k2) { return 0; } -void TypePtr::InterfaceSet::add(ciKlass* interface) { +void TypeInterfaces::add(ciInstanceKlass* interface) { assert(interface->is_interface(), "for interfaces only"); _list.insert_sorted(interface); verify(); } -void TypePtr::InterfaceSet::raw_add(ciKlass* interface) { - assert(interface->is_interface(), "for interfaces only"); - _list.push(interface); -} - -bool TypePtr::InterfaceSet::eq(const InterfaceSet& other) const { - if (_list.length() != other._list.length()) { +bool TypeInterfaces::eq(const Type* t) const { + const TypeInterfaces* other = (const TypeInterfaces*)t; + if (_list.length() != other->_list.length()) { return false; } for (int i = 0; i < _list.length(); i++) { ciKlass* k1 = _list.at(i); - ciKlass* k2 = other._list.at(i); + ciKlass* k2 = other->_list.at(i); if (!k1->equals(k2)) { return false; } @@ -3307,15 +3309,15 @@ bool TypePtr::InterfaceSet::eq(const InterfaceSet& other) const { return true; } -bool TypePtr::InterfaceSet::eq(ciInstanceKlass* k) const { +bool TypeInterfaces::eq(ciInstanceKlass* k) const { assert(k->is_loaded(), "should be loaded"); - GrowableArray* interfaces = k->as_instance_klass()->transitive_interfaces(); + GrowableArray* interfaces = k->transitive_interfaces(); if (_list.length() != interfaces->length()) { return false; } for (int i = 0; i < interfaces->length(); i++) { bool found = false; - _list.find_sorted(interfaces->at(i), found); + _list.find_sorted(interfaces->at(i), found); if (!found) { return false; } @@ -3324,12 +3326,16 @@ bool TypePtr::InterfaceSet::eq(ciInstanceKlass* k) const { } -uint TypePtr::InterfaceSet::hash() const { +uint TypeInterfaces::hash() const { assert(_initialized, "must be"); return _hash; } -void TypePtr::InterfaceSet::compute_hash() { +const Type* TypeInterfaces::xdual() const { + return this; +} + +void TypeInterfaces::compute_hash() { uint hash = 0; for (int i = 0; i < _list.length(); i++) { ciKlass* k = _list.at(i); @@ -3338,17 +3344,17 @@ void TypePtr::InterfaceSet::compute_hash() { _hash = hash; } -static int compare_interfaces(ciKlass** k1, ciKlass** k2) { +static int compare_interfaces(ciInstanceKlass** k1, ciInstanceKlass** k2) { return (int)((*k1)->ident() - (*k2)->ident()); } -void TypePtr::InterfaceSet::dump(outputStream* st) const { +void TypeInterfaces::dump(outputStream* st) const { if (_list.length() == 0) { return; } ResourceMark rm; st->print(" ("); - GrowableArray interfaces; + GrowableArray interfaces; interfaces.appendAll(&_list); // Sort the interfaces so they are listed in the same order from one run to the other of the same compilation interfaces.sort(compare_interfaces); @@ -3363,110 +3369,110 @@ void TypePtr::InterfaceSet::dump(outputStream* st) const { } #ifdef ASSERT -void TypePtr::InterfaceSet::verify() const { +void TypeInterfaces::verify() const { for (int i = 1; i < _list.length(); i++) { - ciKlass* k1 = _list.at(i-1); - ciKlass* k2 = _list.at(i); + ciInstanceKlass* k1 = _list.at(i-1); + ciInstanceKlass* k2 = _list.at(i); assert(compare(k2, k1) > 0, "should be ordered"); assert(k1 != k2, "no duplicate"); } } #endif -TypePtr::InterfaceSet TypeOopPtr::InterfaceSet::union_with(const InterfaceSet& other) const { - InterfaceSet result; +const TypeInterfaces* TypeInterfaces::union_with(const TypeInterfaces* other) const { + GrowableArray result_list; int i = 0; int j = 0; - while (i < _list.length() || j < other._list.length()) { + while (i < _list.length() || j < other->_list.length()) { while (i < _list.length() && - (j >= other._list.length() || - compare(_list.at(i), other._list.at(j)) < 0)) { - result.raw_add(_list.at(i)); + (j >= other->_list.length() || + compare(_list.at(i), other->_list.at(j)) < 0)) { + result_list.push(_list.at(i)); i++; } - while (j < other._list.length() && + while (j < other->_list.length() && (i >= _list.length() || - compare(other._list.at(j), _list.at(i)) < 0)) { - result.raw_add(other._list.at(j)); + compare(other->_list.at(j), _list.at(i)) < 0)) { + result_list.push(other->_list.at(j)); j++; } if (i < _list.length() && - j < other._list.length() && - _list.at(i) == other._list.at(j)) { - result.raw_add(_list.at(i)); + j < other->_list.length() && + _list.at(i) == other->_list.at(j)) { + result_list.push(_list.at(i)); i++; j++; } } - result.initialize(); + const TypeInterfaces* result = TypeInterfaces::make(&result_list); #ifdef ASSERT - result.verify(); + result->verify(); for (int i = 0; i < _list.length(); i++) { - assert(result._list.contains(_list.at(i)), "missing"); + assert(result->_list.contains(_list.at(i)), "missing"); } - for (int i = 0; i < other._list.length(); i++) { - assert(result._list.contains(other._list.at(i)), "missing"); + for (int i = 0; i < other->_list.length(); i++) { + assert(result->_list.contains(other->_list.at(i)), "missing"); } - for (int i = 0; i < result._list.length(); i++) { - assert(_list.contains(result._list.at(i)) || other._list.contains(result._list.at(i)), "missing"); + for (int i = 0; i < result->_list.length(); i++) { + assert(_list.contains(result->_list.at(i)) || other->_list.contains(result->_list.at(i)), "missing"); } #endif return result; } -TypePtr::InterfaceSet TypeOopPtr::InterfaceSet::intersection_with(const InterfaceSet& other) const { - InterfaceSet result; +const TypeInterfaces* TypeInterfaces::intersection_with(const TypeInterfaces* other) const { + GrowableArray result_list; int i = 0; int j = 0; - while (i < _list.length() || j < other._list.length()) { + while (i < _list.length() || j < other->_list.length()) { while (i < _list.length() && - (j >= other._list.length() || - compare(_list.at(i), other._list.at(j)) < 0)) { + (j >= other->_list.length() || + compare(_list.at(i), other->_list.at(j)) < 0)) { i++; } - while (j < other._list.length() && + while (j < other->_list.length() && (i >= _list.length() || - compare(other._list.at(j), _list.at(i)) < 0)) { + compare(other->_list.at(j), _list.at(i)) < 0)) { j++; } if (i < _list.length() && - j < other._list.length() && - _list.at(i) == other._list.at(j)) { - result.raw_add(_list.at(i)); + j < other->_list.length() && + _list.at(i) == other->_list.at(j)) { + result_list.push(_list.at(i)); i++; j++; } } - result.initialize(); + const TypeInterfaces* result = TypeInterfaces::make(&result_list); #ifdef ASSERT - result.verify(); + result->verify(); for (int i = 0; i < _list.length(); i++) { - assert(!other._list.contains(_list.at(i)) || result._list.contains(_list.at(i)), "missing"); + assert(!other->_list.contains(_list.at(i)) || result->_list.contains(_list.at(i)), "missing"); } - for (int i = 0; i < other._list.length(); i++) { - assert(!_list.contains(other._list.at(i)) || result._list.contains(other._list.at(i)), "missing"); + for (int i = 0; i < other->_list.length(); i++) { + assert(!_list.contains(other->_list.at(i)) || result->_list.contains(other->_list.at(i)), "missing"); } - for (int i = 0; i < result._list.length(); i++) { - assert(_list.contains(result._list.at(i)) && other._list.contains(result._list.at(i)), "missing"); + for (int i = 0; i < result->_list.length(); i++) { + assert(_list.contains(result->_list.at(i)) && other->_list.contains(result->_list.at(i)), "missing"); } #endif return result; } // Is there a single ciKlass* that can represent the interface set? -ciKlass* TypePtr::InterfaceSet::exact_klass() const { +ciInstanceKlass* TypeInterfaces::exact_klass() const { assert(_initialized, "must be"); return _exact_klass; } -void TypePtr::InterfaceSet::compute_exact_klass() { +void TypeInterfaces::compute_exact_klass() { if (_list.length() == 0) { _exact_klass = nullptr; return; } - ciKlass* res = nullptr; + ciInstanceKlass* res = nullptr; for (int i = 0; i < _list.length(); i++) { - ciInstanceKlass* interface = _list.at(i)->as_instance_klass(); + ciInstanceKlass* interface = _list.at(i); if (eq(interface)) { assert(res == nullptr, ""); res = interface; @@ -3476,7 +3482,7 @@ void TypePtr::InterfaceSet::compute_exact_klass() { } #ifdef ASSERT -void TypePtr::InterfaceSet::verify_is_loaded() const { +void TypeInterfaces::verify_is_loaded() const { for (int i = 0; i < _list.length(); i++) { ciKlass* interface = _list.at(i); assert(interface->is_loaded(), "Interface not loaded"); @@ -3484,8 +3490,19 @@ void TypePtr::InterfaceSet::verify_is_loaded() const { } #endif +// Can't be implemented because there's no way to know if the type is above or below the center line. +const Type* TypeInterfaces::xmeet(const Type* t) const { + ShouldNotReachHere(); + return Type::xmeet(t); +} + +bool TypeInterfaces::singleton(void) const { + ShouldNotReachHere(); + return Type::singleton(); +} + //------------------------------TypeOopPtr------------------------------------- -TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const InterfaceSet& interfaces, bool xk, ciObject* o, int offset, +TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const TypeInterfaces* interfaces, bool xk, ciObject* o, int offset, int instance_id, const TypePtr* speculative, int inline_depth) : TypePtr(t, ptr, offset, speculative, inline_depth), _const_oop(o), _klass(k), @@ -3497,7 +3514,7 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const InterfaceSet& interfa _instance_id(instance_id) { #ifdef ASSERT if (klass() != nullptr && klass()->is_loaded()) { - interfaces.verify_is_loaded(); + interfaces->verify_is_loaded(); } #endif if (Compile::current()->eliminate_boxing() && (t == InstPtr) && @@ -3574,7 +3591,8 @@ const TypeOopPtr *TypeOopPtr::make(PTR ptr, int offset, int instance_id, ciKlass* k = Compile::current()->env()->Object_klass(); bool xk = false; ciObject* o = nullptr; - return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, InterfaceSet(), xk, o, offset, instance_id, speculative, inline_depth))->hashcons(); + const TypeInterfaces* interfaces = TypeInterfaces::make(); + return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, interfaces, xk, o, offset, instance_id, speculative, inline_depth))->hashcons(); } @@ -3719,7 +3737,7 @@ const TypeOopPtr* TypeOopPtr::make_from_klass_common(ciKlass* klass, bool klass_ klass_is_exact = true; } } - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(klass, true, true, false, interface_handling); + const TypeInterfaces* interfaces = TypePtr::interfaces(klass, true, true, false, interface_handling); return TypeInstPtr::make(TypePtr::BotPTR, klass, interfaces, klass_is_exact, nullptr, 0); } else if (klass->is_obj_array_klass()) { // Element is an object array. Recursively call ourself. @@ -3952,15 +3970,15 @@ int TypeOopPtr::dual_instance_id( ) const { } -TypePtr::InterfaceSet TypeOopPtr::meet_interfaces(const TypeOopPtr* other) const { +const TypeInterfaces* TypeOopPtr::meet_interfaces(const TypeOopPtr* other) const { if (above_centerline(_ptr) && above_centerline(other->_ptr)) { - return _interfaces.union_with(other->_interfaces); + return _interfaces->union_with(other->_interfaces); } else if (above_centerline(_ptr) && !above_centerline(other->_ptr)) { return other->_interfaces; } else if (above_centerline(other->_ptr) && !above_centerline(_ptr)) { return _interfaces; } - return _interfaces.intersection_with(other->_interfaces); + return _interfaces->intersection_with(other->_interfaces); } /** @@ -3989,20 +4007,20 @@ const TypeInstPtr *TypeInstPtr::KLASS; // Is there a single ciKlass* that can represent that type? ciKlass* TypeInstPtr::exact_klass_helper() const { - if (_interfaces.empty()) { + if (_interfaces->empty()) { return _klass; } if (_klass != ciEnv::current()->Object_klass()) { - if (_interfaces.eq(_klass->as_instance_klass())) { + if (_interfaces->eq(_klass->as_instance_klass())) { return _klass; } return nullptr; } - return _interfaces.exact_klass(); + return _interfaces->exact_klass(); } //------------------------------TypeInstPtr------------------------------------- -TypeInstPtr::TypeInstPtr(PTR ptr, ciKlass* k, const InterfaceSet& interfaces, bool xk, ciObject* o, int off, +TypeInstPtr::TypeInstPtr(PTR ptr, ciKlass* k, const TypeInterfaces* interfaces, bool xk, ciObject* o, int off, int instance_id, const TypePtr* speculative, int inline_depth) : TypeOopPtr(InstPtr, ptr, k, interfaces, xk, o, off, instance_id, speculative, inline_depth) { assert(k == nullptr || !k->is_loaded() || !k->is_interface(), "no interface here"); @@ -4014,7 +4032,7 @@ TypeInstPtr::TypeInstPtr(PTR ptr, ciKlass* k, const InterfaceSet& interfaces, bo //------------------------------make------------------------------------------- const TypeInstPtr *TypeInstPtr::make(PTR ptr, ciKlass* k, - const InterfaceSet& interfaces, + const TypeInterfaces* interfaces, bool xk, ciObject* o, int offset, @@ -4046,17 +4064,17 @@ const TypeInstPtr *TypeInstPtr::make(PTR ptr, return result; } -TypePtr::InterfaceSet TypePtr::interfaces(ciKlass*& k, bool klass, bool interface, bool array, InterfaceHandling interface_handling) { +const TypeInterfaces* TypePtr::interfaces(ciKlass*& k, bool klass, bool interface, bool array, InterfaceHandling interface_handling) { if (k->is_instance_klass()) { if (k->is_loaded()) { if (k->is_interface() && interface_handling == ignore_interfaces) { assert(interface, "no interface expected"); k = ciEnv::current()->Object_klass(); - InterfaceSet interfaces; + const TypeInterfaces* interfaces = TypeInterfaces::make(); return interfaces; } GrowableArray* k_interfaces = k->as_instance_klass()->transitive_interfaces(); - InterfaceSet interfaces(k_interfaces); + const TypeInterfaces* interfaces = TypeInterfaces::make(k_interfaces); if (k->is_interface()) { assert(interface, "no interface expected"); k = ciEnv::current()->Object_klass(); @@ -4065,7 +4083,7 @@ TypePtr::InterfaceSet TypePtr::interfaces(ciKlass*& k, bool klass, bool interfac } return interfaces; } - InterfaceSet interfaces; + const TypeInterfaces* interfaces = TypeInterfaces::make(); return interfaces; } assert(array, "no array expected"); @@ -4076,7 +4094,7 @@ TypePtr::InterfaceSet TypePtr::interfaces(ciKlass*& k, bool klass, bool interfac k = ciObjArrayKlass::make(ciEnv::current()->Object_klass(), k->as_array_klass()->dimension()); } } - return *TypeAryPtr::_array_interfaces; + return TypeAryPtr::_array_interfaces; } /** @@ -4130,7 +4148,7 @@ const TypeInstPtr* TypeInstPtr::cast_to_instance_id(int instance_id) const { //------------------------------xmeet_unloaded--------------------------------- // Compute the MEET of two InstPtrs when at least one is unloaded. // Assume classes are different since called after check for same name/class-loader -const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst, const InterfaceSet& interfaces) const { +const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst, const TypeInterfaces* interfaces) const { int off = meet_offset(tinst->offset()); PTR ptr = meet_ptr(tinst->ptr()); int instance_id = meet_instance_id(tinst->instance_id()); @@ -4287,7 +4305,7 @@ const Type *TypeInstPtr::xmeet_helper(const Type *t) const { int instance_id = meet_instance_id(tinst->instance_id()); const TypePtr* speculative = xmeet_speculative(tinst); int depth = meet_inline_depth(tinst->inline_depth()); - InterfaceSet interfaces = meet_interfaces(tinst); + const TypeInterfaces* interfaces = meet_interfaces(tinst); ciKlass* tinst_klass = tinst->klass(); ciKlass* this_klass = klass(); @@ -4347,16 +4365,16 @@ const Type *TypeInstPtr::xmeet_helper(const Type *t) const { return this; // Return the double constant } -template TypePtr::MeetResult TypePtr::meet_instptr(PTR& ptr, InterfaceSet& interfaces, const T* this_type, const T* other_type, - ciKlass*& res_klass, bool& res_xk) { +template TypePtr::MeetResult TypePtr::meet_instptr(PTR& ptr, const TypeInterfaces*& interfaces, const T* this_type, const T* other_type, + ciKlass*& res_klass, bool& res_xk) { ciKlass* this_klass = this_type->klass(); ciKlass* other_klass = other_type->klass(); bool this_xk = this_type->klass_is_exact(); bool other_xk = other_type->klass_is_exact(); PTR this_ptr = this_type->ptr(); PTR other_ptr = other_type->ptr(); - InterfaceSet this_interfaces = this_type->interfaces(); - InterfaceSet other_interfaces = other_type->interfaces(); + const TypeInterfaces* this_interfaces = this_type->interfaces(); + const TypeInterfaces* other_interfaces = other_type->interfaces(); // Check for easy case; klasses are equal (and perhaps not loaded!) // If we have constants, then we created oops so classes are loaded // and we can handle the constants further down. This case handles @@ -4441,7 +4459,7 @@ template TypePtr::MeetResult TypePtr::meet_instptr(PTR& ptr, InterfaceS ptr = NotNull; } - interfaces = this_interfaces.intersection_with(other_interfaces); + interfaces = this_interfaces->intersection_with(other_interfaces); // Now we find the LCA of Java classes ciKlass* k = this_klass->least_common_ancestor(other_klass); @@ -4477,14 +4495,14 @@ bool TypeInstPtr::eq( const Type *t ) const { const TypeInstPtr *p = t->is_instptr(); return klass()->equals(p->klass()) && - _interfaces.eq(p->_interfaces) && + _interfaces->eq(p->_interfaces) && TypeOopPtr::eq(p); // Check sub-type stuff } //------------------------------hash------------------------------------------- // Type-specific hashing function. uint TypeInstPtr::hash(void) const { - return klass()->hash() + TypeOopPtr::hash() + _interfaces.hash(); + return klass()->hash() + TypeOopPtr::hash() + _interfaces->hash(); } bool TypeInstPtr::is_java_subtype_of_helper(const TypeOopPtr* other, bool this_exact, bool other_exact) const { @@ -4507,7 +4525,7 @@ bool TypeInstPtr::maybe_java_subtype_of_helper(const TypeOopPtr* other, bool thi void TypeInstPtr::dump2(Dict &d, uint depth, outputStream* st) const { // Print the name of the klass. klass()->print_name_on(st); - _interfaces.dump(st); + _interfaces->dump(st); switch( _ptr ) { case Constant: @@ -4591,7 +4609,7 @@ const TypeKlassPtr* TypeInstPtr::as_klass_type(bool try_for_exact) const { bool xk = klass_is_exact(); ciInstanceKlass* ik = klass()->as_instance_klass(); if (try_for_exact && !xk && !ik->has_subklass() && !ik->is_final()) { - if (_interfaces.eq(ik)) { + if (_interfaces->eq(ik)) { Compile* C = Compile::current(); Dependencies* deps = C->dependencies(); deps->assert_leaf_type(ik); @@ -4608,12 +4626,12 @@ template bool TypePtr::is_meet_subtype_of_helper_for_instan return false; } - if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces.empty()) { + if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces->empty()) { return true; } return this_one->klass()->is_subtype_of(other->klass()) && - (!this_xk || this_one->_interfaces.contains(other->_interfaces)); + (!this_xk || this_one->_interfaces->contains(other->_interfaces)); } @@ -4623,12 +4641,12 @@ bool TypeInstPtr::is_meet_subtype_of_helper(const TypeOopPtr *other, bool this_x template bool TypePtr::is_meet_subtype_of_helper_for_array(const T1* this_one, const T2* other, bool this_xk, bool other_xk) { static_assert(std::is_base_of::value, ""); - if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces.empty()) { + if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces->empty()) { return true; } if (this_one->is_instance_type(other)) { - return other->klass() == ciEnv::current()->Object_klass() && this_one->_interfaces.contains(other->_interfaces); + return other->klass() == ciEnv::current()->Object_klass() && this_one->_interfaces->contains(other->_interfaces); } int dummy; @@ -4971,9 +4989,9 @@ const Type *TypeAryPtr::xmeet_helper(const Type *t) const { int instance_id = meet_instance_id(tp->instance_id()); const TypePtr* speculative = xmeet_speculative(tp); int depth = meet_inline_depth(tp->inline_depth()); - InterfaceSet interfaces = meet_interfaces(tp); - InterfaceSet tp_interfaces = tp->_interfaces; - InterfaceSet this_interfaces = _interfaces; + const TypeInterfaces* interfaces = meet_interfaces(tp); + const TypeInterfaces* tp_interfaces = tp->_interfaces; + const TypeInterfaces* this_interfaces = _interfaces; switch (ptr) { case TopPTR: @@ -4981,13 +4999,13 @@ const Type *TypeAryPtr::xmeet_helper(const Type *t) const { // For instances when a subclass meets a superclass we fall // below the centerline when the superclass is exact. We need to // do the same here. - if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces.contains(tp_interfaces) && !tp->klass_is_exact()) { + if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces->contains(tp_interfaces) && !tp->klass_is_exact()) { return TypeAryPtr::make(ptr, _ary, _klass, _klass_is_exact, offset, instance_id, speculative, depth); } else { // cannot subclass, so the meet has to fall badly below the centerline ptr = NotNull; instance_id = InstanceBot; - interfaces = this_interfaces.intersection_with(tp_interfaces); + interfaces = this_interfaces->intersection_with(tp_interfaces); return TypeInstPtr::make(ptr, ciEnv::current()->Object_klass(), interfaces, false, nullptr,offset, instance_id, speculative, depth); } case Constant: @@ -5000,7 +5018,7 @@ const Type *TypeAryPtr::xmeet_helper(const Type *t) const { // For instances when a subclass meets a superclass we fall // below the centerline when the superclass is exact. We need // to do the same here. - if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces.contains(tp_interfaces) && !tp->klass_is_exact()) { + if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces->contains(tp_interfaces) && !tp->klass_is_exact()) { // that is, my array type is a subtype of 'tp' klass return make(ptr, (ptr == Constant ? const_oop() : nullptr), _ary, _klass, _klass_is_exact, offset, instance_id, speculative, depth); @@ -5014,7 +5032,7 @@ const Type *TypeAryPtr::xmeet_helper(const Type *t) const { if (instance_id > 0) { instance_id = InstanceBot; } - interfaces = this_interfaces.intersection_with(tp_interfaces); + interfaces = this_interfaces->intersection_with(tp_interfaces); return TypeInstPtr::make(ptr, ciEnv::current()->Object_klass(), interfaces, false, nullptr, offset, instance_id, speculative, depth); default: typerr(t); } @@ -5128,7 +5146,7 @@ const Type *TypeAryPtr::xdual() const { #ifndef PRODUCT void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const { _ary->dump2(d,depth,st); - _interfaces.dump(st); + _interfaces->dump(st); switch( _ptr ) { case Constant: @@ -5578,7 +5596,7 @@ const TypeKlassPtr* TypeKlassPtr::make(ciKlass *klass, InterfaceHandling interfa const TypeKlassPtr* TypeKlassPtr::make(PTR ptr, ciKlass* klass, int offset, InterfaceHandling interface_handling) { if (klass->is_instance_klass()) { - const InterfaceSet interfaces = TypePtr::interfaces(klass, true, true, false, interface_handling); + const TypeInterfaces* interfaces = TypePtr::interfaces(klass, true, true, false, interface_handling); return TypeInstKlassPtr::make(ptr, klass, interfaces, offset); } return TypeAryKlassPtr::make(ptr, klass, offset, interface_handling); @@ -5586,7 +5604,7 @@ const TypeKlassPtr* TypeKlassPtr::make(PTR ptr, ciKlass* klass, int offset, Inte //------------------------------TypeKlassPtr----------------------------------- -TypeKlassPtr::TypeKlassPtr(TYPES t, PTR ptr, ciKlass* klass, const InterfaceSet& interfaces, int offset) +TypeKlassPtr::TypeKlassPtr(TYPES t, PTR ptr, ciKlass* klass, const TypeInterfaces* interfaces, int offset) : TypePtr(t, ptr, offset), _klass(klass), _interfaces(interfaces) { assert(klass == nullptr || !klass->is_loaded() || (klass->is_instance_klass() && !klass->is_interface()) || klass->is_type_array_klass() || !klass->as_obj_array_klass()->base_element_klass()->is_interface(), "no interface here"); @@ -5595,16 +5613,16 @@ TypeKlassPtr::TypeKlassPtr(TYPES t, PTR ptr, ciKlass* klass, const InterfaceSet& // Is there a single ciKlass* that can represent that type? ciKlass* TypeKlassPtr::exact_klass_helper() const { assert(_klass->is_instance_klass() && !_klass->is_interface(), "No interface"); - if (_interfaces.empty()) { + if (_interfaces->empty()) { return _klass; } if (_klass != ciEnv::current()->Object_klass()) { - if (_interfaces.eq(_klass->as_instance_klass())) { + if (_interfaces->eq(_klass->as_instance_klass())) { return _klass; } return nullptr; } - return _interfaces.exact_klass(); + return _interfaces->exact_klass(); } //------------------------------eq--------------------------------------------- @@ -5612,14 +5630,14 @@ ciKlass* TypeKlassPtr::exact_klass_helper() const { bool TypeKlassPtr::eq(const Type *t) const { const TypeKlassPtr *p = t->is_klassptr(); return - _interfaces.eq(p->_interfaces) && + _interfaces->eq(p->_interfaces) && TypePtr::eq(p); } //------------------------------hash------------------------------------------- // Type-specific hashing function. uint TypeKlassPtr::hash(void) const { - return TypePtr::hash() + _interfaces.hash(); + return TypePtr::hash() + _interfaces->hash(); } //------------------------------singleton-------------------------------------- @@ -5646,15 +5664,15 @@ const Type *TypeKlassPtr::filter_helper(const Type *kills, bool include_speculat return ft; } -TypePtr::InterfaceSet TypeKlassPtr::meet_interfaces(const TypeKlassPtr* other) const { +const TypeInterfaces* TypeKlassPtr::meet_interfaces(const TypeKlassPtr* other) const { if (above_centerline(_ptr) && above_centerline(other->_ptr)) { - return _interfaces.union_with(other->_interfaces); + return _interfaces->union_with(other->_interfaces); } else if (above_centerline(_ptr) && !above_centerline(other->_ptr)) { return other->_interfaces; } else if (above_centerline(other->_ptr) && !above_centerline(_ptr)) { return _interfaces; } - return _interfaces.intersection_with(other->_interfaces); + return _interfaces->intersection_with(other->_interfaces); } //------------------------------get_con---------------------------------------- @@ -5694,7 +5712,7 @@ void TypeKlassPtr::dump2(Dict & d, uint depth, outputStream *st) const { } else { ShouldNotReachHere(); } - _interfaces.dump(st); + _interfaces->dump(st); } case BotPTR: if (!WizardMode && !Verbose && _ptr != Constant) break; @@ -5735,7 +5753,7 @@ uint TypeInstKlassPtr::hash(void) const { return klass()->hash() + TypeKlassPtr::hash(); } -const TypeInstKlassPtr *TypeInstKlassPtr::make(PTR ptr, ciKlass* k, const InterfaceSet& interfaces, int offset) { +const TypeInstKlassPtr *TypeInstKlassPtr::make(PTR ptr, ciKlass* k, const TypeInterfaces* interfaces, int offset) { TypeInstKlassPtr *r = (TypeInstKlassPtr*)(new TypeInstKlassPtr(ptr, k, interfaces, offset))->hashcons(); @@ -5787,7 +5805,7 @@ const TypeOopPtr* TypeInstKlassPtr::as_instance_type(bool klass_change) const { assert((deps != nullptr) == (C->method() != nullptr && C->method()->code_size() > 0), "sanity"); // Element is an instance bool klass_is_exact = false; - TypePtr::InterfaceSet interfaces = _interfaces; + const TypeInterfaces* interfaces = _interfaces; if (k->is_loaded()) { // Try to set klass_is_exact. ciInstanceKlass* ik = k->as_instance_klass(); @@ -5796,7 +5814,7 @@ const TypeOopPtr* TypeInstKlassPtr::as_instance_type(bool klass_change) const { && deps != nullptr && UseUniqueSubclasses) { ciInstanceKlass* sub = ik->unique_concrete_subklass(); if (sub != nullptr) { - if (_interfaces.eq(sub)) { + if (_interfaces->eq(sub)) { deps->assert_abstract_with_unique_concrete_subtype(ik, sub); k = ik = sub; xk = sub->is_final(); @@ -5880,7 +5898,7 @@ const Type *TypeInstKlassPtr::xmeet( const Type *t ) const { const TypeInstKlassPtr *tkls = t->is_instklassptr(); int off = meet_offset(tkls->offset()); PTR ptr = meet_ptr(tkls->ptr()); - InterfaceSet interfaces = meet_interfaces(tkls); + const TypeInterfaces* interfaces = meet_interfaces(tkls); ciKlass* res_klass = nullptr; bool res_xk = false; @@ -5903,9 +5921,9 @@ const Type *TypeInstKlassPtr::xmeet( const Type *t ) const { const TypeAryKlassPtr *tp = t->is_aryklassptr(); int offset = meet_offset(tp->offset()); PTR ptr = meet_ptr(tp->ptr()); - InterfaceSet interfaces = meet_interfaces(tp); - InterfaceSet tp_interfaces = tp->_interfaces; - InterfaceSet this_interfaces = _interfaces; + const TypeInterfaces* interfaces = meet_interfaces(tp); + const TypeInterfaces* tp_interfaces = tp->_interfaces; + const TypeInterfaces* this_interfaces = _interfaces; switch (ptr) { case TopPTR: @@ -5913,12 +5931,12 @@ const Type *TypeInstKlassPtr::xmeet( const Type *t ) const { // For instances when a subclass meets a superclass we fall // below the centerline when the superclass is exact. We need to // do the same here. - if (klass()->equals(ciEnv::current()->Object_klass()) && tp_interfaces.contains(this_interfaces) && !klass_is_exact()) { + if (klass()->equals(ciEnv::current()->Object_klass()) && tp_interfaces->contains(this_interfaces) && !klass_is_exact()) { return TypeAryKlassPtr::make(ptr, tp->elem(), tp->klass(), offset); } else { // cannot subclass, so the meet has to fall badly below the centerline ptr = NotNull; - interfaces = _interfaces.intersection_with(tp->_interfaces); + interfaces = _interfaces->intersection_with(tp->_interfaces); return make(ptr, ciEnv::current()->Object_klass(), interfaces, offset); } case Constant: @@ -5931,7 +5949,7 @@ const Type *TypeInstKlassPtr::xmeet( const Type *t ) const { // For instances when a subclass meets a superclass we fall // below the centerline when the superclass is exact. We need // to do the same here. - if (klass()->equals(ciEnv::current()->Object_klass()) && tp_interfaces.contains(this_interfaces) && !klass_is_exact()) { + if (klass()->equals(ciEnv::current()->Object_klass()) && tp_interfaces->contains(this_interfaces) && !klass_is_exact()) { // that is, tp's array type is a subtype of my klass return TypeAryKlassPtr::make(ptr, tp->elem(), tp->klass(), offset); @@ -5941,7 +5959,7 @@ const Type *TypeInstKlassPtr::xmeet( const Type *t ) const { // The meet falls down to Object class below centerline. if( ptr == Constant ) ptr = NotNull; - interfaces = this_interfaces.intersection_with(tp_interfaces); + interfaces = this_interfaces->intersection_with(tp_interfaces); return make(ptr, ciEnv::current()->Object_klass(), interfaces, offset); default: typerr(t); } @@ -5970,11 +5988,11 @@ template bool TypePtr::is_java_subtype_of_helper_for_instan return false; } - if (other->klass()->equals(ciEnv::current()->Object_klass()) && other->_interfaces.empty()) { + if (other->klass()->equals(ciEnv::current()->Object_klass()) && other->_interfaces->empty()) { return true; } - return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces.contains(other->_interfaces); + return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces); } bool TypeInstKlassPtr::is_java_subtype_of_helper(const TypeKlassPtr* other, bool this_exact, bool other_exact) const { @@ -5989,7 +6007,7 @@ template bool TypePtr::is_same_java_type_as_helper_for_inst if (!this_one->is_instance_type(other)) { return false; } - return this_one->_klass->equals(other->_klass) && this_one->_interfaces.eq(other->_interfaces); + return this_one->_klass->equals(other->_klass) && this_one->_interfaces->eq(other->_interfaces); } bool TypeInstKlassPtr::is_same_java_type_as_helper(const TypeKlassPtr* other) const { @@ -6003,7 +6021,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_ins } if (this_one->is_array_type(other)) { - return !this_exact && this_one->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces.contains(this_one->_interfaces); + return !this_exact && this_one->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces->contains(this_one->_interfaces); } assert(this_one->is_instance_type(other), "unsupported"); @@ -6017,7 +6035,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_ins } if (this_exact) { - return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces.contains(other->_interfaces); + return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces); } return true; @@ -6035,7 +6053,7 @@ const TypeKlassPtr* TypeInstKlassPtr::try_improve() const { Compile* C = Compile::current(); Dependencies* deps = C->dependencies(); assert((deps != nullptr) == (C->method() != nullptr && C->method()->code_size() > 0), "sanity"); - TypePtr::InterfaceSet interfaces = _interfaces; + const TypeInterfaces* interfaces = _interfaces; if (k->is_loaded()) { ciInstanceKlass* ik = k->as_instance_klass(); bool klass_is_exact = ik->is_final(); @@ -6043,7 +6061,7 @@ const TypeKlassPtr* TypeInstKlassPtr::try_improve() const { deps != nullptr) { ciInstanceKlass* sub = ik->unique_concrete_subklass(); if (sub != nullptr) { - if (_interfaces.eq(sub)) { + if (_interfaces->eq(sub)) { deps->assert_abstract_with_unique_concrete_subtype(ik, sub); k = ik = sub; klass_is_exact = sub->is_final(); @@ -6337,9 +6355,9 @@ const Type *TypeAryKlassPtr::xmeet( const Type *t ) const { const TypeInstKlassPtr *tp = t->is_instklassptr(); int offset = meet_offset(tp->offset()); PTR ptr = meet_ptr(tp->ptr()); - InterfaceSet interfaces = meet_interfaces(tp); - InterfaceSet tp_interfaces = tp->_interfaces; - InterfaceSet this_interfaces = _interfaces; + const TypeInterfaces* interfaces = meet_interfaces(tp); + const TypeInterfaces* tp_interfaces = tp->_interfaces; + const TypeInterfaces* this_interfaces = _interfaces; switch (ptr) { case TopPTR: @@ -6347,12 +6365,12 @@ const Type *TypeAryKlassPtr::xmeet( const Type *t ) const { // For instances when a subclass meets a superclass we fall // below the centerline when the superclass is exact. We need to // do the same here. - if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces.intersection_with(tp_interfaces).eq(tp_interfaces) && !tp->klass_is_exact()) { + if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces->intersection_with(tp_interfaces)->eq(tp_interfaces) && !tp->klass_is_exact()) { return TypeAryKlassPtr::make(ptr, _elem, _klass, offset); } else { // cannot subclass, so the meet has to fall badly below the centerline ptr = NotNull; - interfaces = this_interfaces.intersection_with(tp->_interfaces); + interfaces = this_interfaces->intersection_with(tp->_interfaces); return TypeInstKlassPtr::make(ptr, ciEnv::current()->Object_klass(), interfaces, offset); } case Constant: @@ -6365,7 +6383,7 @@ const Type *TypeAryKlassPtr::xmeet( const Type *t ) const { // For instances when a subclass meets a superclass we fall // below the centerline when the superclass is exact. We need // to do the same here. - if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces.intersection_with(tp_interfaces).eq(tp_interfaces) && !tp->klass_is_exact()) { + if (tp->klass()->equals(ciEnv::current()->Object_klass()) && this_interfaces->intersection_with(tp_interfaces)->eq(tp_interfaces) && !tp->klass_is_exact()) { // that is, my array type is a subtype of 'tp' klass return make(ptr, _elem, _klass, offset); } @@ -6374,7 +6392,7 @@ const Type *TypeAryKlassPtr::xmeet( const Type *t ) const { // The meet falls down to Object class below centerline. if (ptr == Constant) ptr = NotNull; - interfaces = this_interfaces.intersection_with(tp_interfaces); + interfaces = this_interfaces->intersection_with(tp_interfaces); return TypeInstKlassPtr::make(ptr, ciEnv::current()->Object_klass(), interfaces, offset); default: typerr(t); } @@ -6387,7 +6405,7 @@ const Type *TypeAryKlassPtr::xmeet( const Type *t ) const { template bool TypePtr::is_java_subtype_of_helper_for_array(const T1* this_one, const T2* other, bool this_exact, bool other_exact) { static_assert(std::is_base_of::value, ""); - if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces.empty() && other_exact) { + if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces->empty() && other_exact) { return true; } @@ -6399,7 +6417,7 @@ template bool TypePtr::is_java_subtype_of_helper_for_array( } if (this_one->is_instance_type(other)) { - return other->klass() == ciEnv::current()->Object_klass() && other->_interfaces.intersection_with(this_one->_interfaces).eq(other->_interfaces) && other_exact; + return other->klass() == ciEnv::current()->Object_klass() && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces) && other_exact; } assert(this_one->is_array_type(other), ""); @@ -6459,7 +6477,7 @@ bool TypeAryKlassPtr::is_same_java_type_as_helper(const TypeKlassPtr* other) con template bool TypePtr::maybe_java_subtype_of_helper_for_array(const T1* this_one, const T2* other, bool this_exact, bool other_exact) { static_assert(std::is_base_of::value, ""); - if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces.empty() && other_exact) { + if (other->klass() == ciEnv::current()->Object_klass() && other->_interfaces->empty() && other_exact) { return true; } int dummy; @@ -6468,7 +6486,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_arr return true; } if (this_one->is_instance_type(other)) { - return other->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces.intersection_with(this_one->_interfaces).eq(other->_interfaces); + return other->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces); } assert(this_one->is_array_type(other), ""); @@ -6543,7 +6561,7 @@ void TypeAryKlassPtr::dump2( Dict & d, uint depth, outputStream *st ) const { { st->print("["); _elem->dump2(d, depth, st); - _interfaces.dump(st); + _interfaces->dump(st); st->print(": "); } case BotPTR: diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp index 6cb74c67521..04ef4f6c0e4 100644 --- a/src/hotspot/share/opto/type.hpp +++ b/src/hotspot/share/opto/type.hpp @@ -94,6 +94,8 @@ class Type { Tuple, // Method signature or object layout Array, // Array types + Interfaces, // Set of implemented interfaces for oop types + VectorMask, // Vector predicate/mask type VectorA, // (Scalable) Vector types for vector length agnostic VectorS, // 32bit Vector types @@ -872,6 +874,48 @@ class TypeVectMask : public TypeVect { static const TypeVectMask* make(const Type* elem, uint length); }; +// Set of implemented interfaces. Referenced from TypeOopPtr and TypeKlassPtr. +class TypeInterfaces : public Type { +private: + GrowableArray _list; + uint _hash; + ciInstanceKlass* _exact_klass; + DEBUG_ONLY(bool _initialized;) + + void initialize(); + + void add(ciInstanceKlass* interface); + void verify() const NOT_DEBUG_RETURN; + void compute_hash(); + void compute_exact_klass(); + TypeInterfaces(); + TypeInterfaces(GrowableArray* interfaces); + + NONCOPYABLE(TypeInterfaces); +public: + static const TypeInterfaces* make(GrowableArray* interfaces = nullptr); + bool eq(const Type* other) const; + bool eq(ciInstanceKlass* k) const; + uint hash() const; + const Type *xdual() const; + void dump(outputStream* st) const; + const TypeInterfaces* union_with(const TypeInterfaces* other) const; + const TypeInterfaces* intersection_with(const TypeInterfaces* other) const; + bool contains(const TypeInterfaces* other) const { + return intersection_with(other)->eq(other); + } + bool empty() const { return _list.length() == 0; } + + ciInstanceKlass* exact_klass() const; + void verify_is_loaded() const NOT_DEBUG_RETURN; + + static int compare(ciInstanceKlass* const& k1, ciInstanceKlass* const& k2); + + const Type* xmeet(const Type* t) const; + + bool singleton(void) const; +}; + //------------------------------TypePtr---------------------------------------- // Class of machine Pointer Types: raw data, instances or arrays. // If the _base enum is AnyPtr, then this refers to all of the above. @@ -881,47 +925,7 @@ class TypePtr : public Type { friend class TypeNarrowPtr; friend class Type; protected: - class InterfaceSet { - private: - GrowableArray _list; - uint _hash; - ciKlass* _exact_klass; - DEBUG_ONLY(bool _initialized;) - - void initialize(); - void raw_add(ciKlass* interface); - void add(ciKlass* interface); - void verify() const NOT_DEBUG_RETURN; - void compute_hash(); - void compute_exact_klass(); - public: - InterfaceSet(); - InterfaceSet(GrowableArray* interfaces); - bool eq(const InterfaceSet& other) const; - bool eq(ciInstanceKlass* k) const; - uint hash() const; - void dump(outputStream* st) const; - InterfaceSet union_with(const InterfaceSet& other) const; - InterfaceSet intersection_with(const InterfaceSet& other) const; - bool contains(const InterfaceSet& other) const { - return intersection_with(other).eq(other); - } - bool empty() const { return _list.length() == 0; } - - inline void* operator new(size_t x) throw() { - Compile* compile = Compile::current(); - return compile->type_arena()->AmallocWords(x); - } - inline void operator delete(void* ptr) { - ShouldNotReachHere(); - } - ciKlass* exact_klass() const; - void verify_is_loaded() const NOT_DEBUG_RETURN; - - static int compare(ciKlass* const& k1, ciKlass* const& k2); - }; - - static InterfaceSet interfaces(ciKlass*& k, bool klass, bool interface, bool array, InterfaceHandling interface_handling); + static const TypeInterfaces* interfaces(ciKlass*& k, bool klass, bool interface, bool array, InterfaceHandling interface_handling); public: enum PTR { TopPTR, AnyNull, Constant, Null, NotNull, BotPTR, lastPTR }; @@ -981,7 +985,7 @@ class TypePtr : public Type { NOT_SUBTYPE, LCA }; - template static TypePtr::MeetResult meet_instptr(PTR& ptr, InterfaceSet& interfaces, const T* this_type, + template static TypePtr::MeetResult meet_instptr(PTR& ptr, const TypeInterfaces*& interfaces, const T* this_type, const T* other_type, ciKlass*& res_klass, bool& res_xk); template static MeetResult meet_aryptr(PTR& ptr, const Type*& elem, const T* this_ary, const T* other_ary, @@ -1103,8 +1107,8 @@ class TypeOopPtr : public TypePtr { friend class TypeInstPtr; friend class TypeAryPtr; protected: - TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const InterfaceSet& interfaces, bool xk, ciObject* o, int offset, int instance_id, - const TypePtr* speculative, int inline_depth); + TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const TypeInterfaces* interfaces, bool xk, ciObject* o, int offset, int instance_id, + const TypePtr* speculative, int inline_depth); public: virtual bool eq( const Type *t ) const; virtual uint hash() const; // Type specific hashing @@ -1120,7 +1124,7 @@ class TypeOopPtr : public TypePtr { // If _klass is null, then so is _sig. This is an unloaded klass. ciKlass* _klass; // Klass object - const InterfaceSet _interfaces; + const TypeInterfaces* _interfaces; // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) bool _klass_is_exact; @@ -1138,7 +1142,7 @@ class TypeOopPtr : public TypePtr { int dual_instance_id() const; int meet_instance_id(int uid) const; - InterfaceSet meet_interfaces(const TypeOopPtr* other) const; + const TypeInterfaces* meet_interfaces(const TypeOopPtr* other) const; // Do not allow interface-vs.-noninterface joins to collapse to top. virtual const Type *filter_helper(const Type *kills, bool include_speculative) const; @@ -1252,7 +1256,7 @@ class TypeOopPtr : public TypePtr { ShouldNotReachHere(); return false; } - virtual const InterfaceSet interfaces() const { + virtual const TypeInterfaces* interfaces() const { return _interfaces; }; @@ -1273,7 +1277,7 @@ class TypeOopPtr : public TypePtr { // Class of Java object pointers, pointing either to non-array Java instances // or to a Klass* (including array klasses). class TypeInstPtr : public TypeOopPtr { - TypeInstPtr(PTR ptr, ciKlass* k, const InterfaceSet& interfaces, bool xk, ciObject* o, int offset, int instance_id, + TypeInstPtr(PTR ptr, ciKlass* k, const TypeInterfaces* interfaces, bool xk, ciObject* o, int off, int instance_id, const TypePtr* speculative, int inline_depth); virtual bool eq( const Type *t ) const; virtual uint hash() const; // Type specific hashing @@ -1295,41 +1299,41 @@ class TypeInstPtr : public TypeOopPtr { // Make a pointer to a constant oop. static const TypeInstPtr *make(ciObject* o) { ciKlass* k = o->klass(); - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); + const TypeInterfaces* interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); return make(TypePtr::Constant, k, interfaces, true, o, 0, InstanceBot); } // Make a pointer to a constant oop with offset. static const TypeInstPtr *make(ciObject* o, int offset) { ciKlass* k = o->klass(); - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); + const TypeInterfaces* interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); return make(TypePtr::Constant, k, interfaces, true, o, offset, InstanceBot); } // Make a pointer to some value of type klass. static const TypeInstPtr *make(PTR ptr, ciKlass* klass, InterfaceHandling interface_handling = ignore_interfaces) { - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(klass, true, true, false, interface_handling); + const TypeInterfaces* interfaces = TypePtr::interfaces(klass, true, true, false, interface_handling); return make(ptr, klass, interfaces, false, nullptr, 0, InstanceBot); } // Make a pointer to some non-polymorphic value of exactly type klass. static const TypeInstPtr *make_exact(PTR ptr, ciKlass* klass) { - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(klass, true, false, false, ignore_interfaces); + const TypeInterfaces* interfaces = TypePtr::interfaces(klass, true, false, false, ignore_interfaces); return make(ptr, klass, interfaces, true, nullptr, 0, InstanceBot); } // Make a pointer to some value of type klass with offset. static const TypeInstPtr *make(PTR ptr, ciKlass* klass, int offset) { - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(klass, true, false, false, ignore_interfaces); + const TypeInterfaces* interfaces = TypePtr::interfaces(klass, true, false, false, ignore_interfaces); return make(ptr, klass, interfaces, false, nullptr, offset, InstanceBot); } - static const TypeInstPtr *make(PTR ptr, ciKlass* k, const InterfaceSet& interfaces, bool xk, ciObject* o, int offset, + static const TypeInstPtr *make(PTR ptr, ciKlass* k, const TypeInterfaces* interfaces, bool xk, ciObject* o, int offset, int instance_id = InstanceBot, const TypePtr* speculative = nullptr, int inline_depth = InlineDepthBottom); static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot) { - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); + const TypeInterfaces* interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); return make(ptr, k, interfaces, xk, o, offset, instance_id); } @@ -1357,7 +1361,7 @@ class TypeInstPtr : public TypeOopPtr { // the core of the computation of the meet of 2 types virtual const Type *xmeet_helper(const Type *t) const; - virtual const TypeInstPtr *xmeet_unloaded(const TypeInstPtr *t, const InterfaceSet& interfaces) const; + virtual const TypeInstPtr *xmeet_unloaded(const TypeInstPtr *tinst, const TypeInterfaces* interfaces) const; virtual const Type *xdual() const; // Compute dual right now. const TypeKlassPtr* as_klass_type(bool try_for_exact = false) const; @@ -1376,7 +1380,7 @@ class TypeInstPtr : public TypeOopPtr { virtual bool is_meet_subtype_of_helper(const TypeOopPtr* other, bool this_xk, bool other_xk) const; virtual bool is_meet_same_type_as(const TypePtr* other) const { - return _klass->equals(other->is_instptr()->_klass) && _interfaces.eq(other->is_instptr()->_interfaces); + return _klass->equals(other->is_instptr()->_klass) && _interfaces->eq(other->is_instptr()->_interfaces); } }; @@ -1390,7 +1394,7 @@ class TypeAryPtr : public TypeOopPtr { TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id, bool is_autobox_cache, const TypePtr* speculative, int inline_depth) - : TypeOopPtr(AryPtr,ptr,k,*_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth), + : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth), _ary(ary), _is_autobox_cache(is_autobox_cache) { @@ -1413,7 +1417,7 @@ class TypeAryPtr : public TypeOopPtr { // A pointer to delay allocation to Type::Initialize_shared() - static const InterfaceSet* _array_interfaces; + static const TypeInterfaces* _array_interfaces; ciKlass* exact_klass_helper() const; // Only guaranteed non null for array of basic types ciKlass* klass() const; @@ -1551,7 +1555,7 @@ class TypeKlassPtr : public TypePtr { friend class TypeAryKlassPtr; friend class TypePtr; protected: - TypeKlassPtr(TYPES t, PTR ptr, ciKlass* klass, const InterfaceSet& interfaces, int offset); + TypeKlassPtr(TYPES t, PTR ptr, ciKlass* klass, const TypeInterfaces* interfaces, int offset); virtual const Type *filter_helper(const Type *kills, bool include_speculative) const; @@ -1563,8 +1567,8 @@ class TypeKlassPtr : public TypePtr { protected: ciKlass* _klass; - const InterfaceSet _interfaces; - InterfaceSet meet_interfaces(const TypeKlassPtr* other) const; + const TypeInterfaces* _interfaces; + const TypeInterfaces* meet_interfaces(const TypeKlassPtr* other) const; virtual bool must_be_exact() const { ShouldNotReachHere(); return false; } virtual ciKlass* exact_klass_helper() const; virtual ciKlass* klass() const { return _klass; } @@ -1623,7 +1627,7 @@ class TypeKlassPtr : public TypePtr { ShouldNotReachHere(); return false; } - virtual const InterfaceSet interfaces() const { + virtual const TypeInterfaces* interfaces() const { return _interfaces; }; @@ -1643,7 +1647,7 @@ class TypeKlassPtr : public TypePtr { // Instance klass pointer, mirrors TypeInstPtr class TypeInstKlassPtr : public TypeKlassPtr { - TypeInstKlassPtr(PTR ptr, ciKlass* klass, const InterfaceSet& interfaces, int offset) + TypeInstKlassPtr(PTR ptr, ciKlass* klass, const TypeInterfaces* interfaces, int offset) : TypeKlassPtr(InstKlassPtr, ptr, klass, interfaces, offset) { assert(klass->is_instance_klass() && (!klass->is_loaded() || !klass->is_interface()), ""); } @@ -1662,13 +1666,13 @@ class TypeInstKlassPtr : public TypeKlassPtr { bool maybe_java_subtype_of_helper(const TypeKlassPtr* other, bool this_exact, bool other_exact) const; static const TypeInstKlassPtr *make(ciKlass* k, InterfaceHandling interface_handling) { - InterfaceSet interfaces = TypePtr::interfaces(k, true, true, false, interface_handling); + const TypeInterfaces* interfaces = TypePtr::interfaces(k, true, true, false, interface_handling); return make(TypePtr::Constant, k, interfaces, 0); } - static const TypeInstKlassPtr* make(PTR ptr, ciKlass* k, const InterfaceSet& interfaces, int offset); + static const TypeInstKlassPtr* make(PTR ptr, ciKlass* k, const TypeInterfaces* interfaces, int offset); static const TypeInstKlassPtr* make(PTR ptr, ciKlass* k, int offset) { - const TypePtr::InterfaceSet interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); + const TypeInterfaces* interfaces = TypePtr::interfaces(k, true, false, false, ignore_interfaces); return make(ptr, k, interfaces, offset); } @@ -1703,9 +1707,9 @@ class TypeAryKlassPtr : public TypeKlassPtr { const Type *_elem; - static const InterfaceSet* _array_interfaces; + static const TypeInterfaces* _array_interfaces; TypeAryKlassPtr(PTR ptr, const Type *elem, ciKlass* klass, int offset) - : TypeKlassPtr(AryKlassPtr, ptr, klass, *_array_interfaces, offset), _elem(elem) { + : TypeKlassPtr(AryKlassPtr, ptr, klass, _array_interfaces, offset), _elem(elem) { assert(klass == nullptr || klass->is_type_array_klass() || !klass->as_obj_array_klass()->base_element_klass()->is_interface(), ""); } From 57b5147260464214122cb5200566c2b4d2889c75 Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Thu, 4 Jan 2024 09:11:43 +0000 Subject: [PATCH 097/261] 8315986: [macos14] javax/swing/JMenuItem/4654927/bug4654927.java: component must be showing on the screen to determine its location Backport-of: e7486e8cfc9a3f5cbe3515c68e325a25863c162e --- .../swing/JMenuItem/4654927/bug4654927.java | 92 +++++++++---------- 1 file changed, 42 insertions(+), 50 deletions(-) diff --git a/test/jdk/javax/swing/JMenuItem/4654927/bug4654927.java b/test/jdk/javax/swing/JMenuItem/4654927/bug4654927.java index b1a757e9f83..46628cf99b9 100644 --- a/test/jdk/javax/swing/JMenuItem/4654927/bug4654927.java +++ b/test/jdk/javax/swing/JMenuItem/4654927/bug4654927.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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,15 +26,20 @@ * @key headful * @bug 4654927 * @summary Clicking on Greyed Menuitems closes the Menubar Dropdown - * @author Alexander Potochkin * @library ../../regtesthelpers * @build Util * @run main bug4654927 */ -import javax.swing.*; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; -import java.awt.*; +import java.awt.Point; +import java.awt.Robot; import java.awt.event.InputEvent; import java.util.concurrent.Callable; @@ -48,78 +53,65 @@ public static void main(String[] args) throws Exception { try { String systemLAF = UIManager.getSystemLookAndFeelClassName(); // the test is not applicable to Motif L&F - if(systemLAF.endsWith("MotifLookAndFeel")){ + if (systemLAF.endsWith("MotifLookAndFeel")) { return; } UIManager.setLookAndFeel(systemLAF); Robot robot = new Robot(); - robot.setAutoDelay(10); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(100); - SwingUtilities.invokeAndWait(new Runnable() { + SwingUtilities.invokeAndWait(() -> createAndShowUI()); - public void run() { - createAndShowUI(); - } - }); robot.waitForIdle(); + robot.delay(1000); // test mouse press - Point point = Util.getCenterPoint(menu); - robot.mouseMove(point.x, point.y); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + Point menuLocation = Util.getCenterPoint(menu); + System.out.println("Menu Location " + menuLocation); + robot.mouseMove(menuLocation.x, menuLocation.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); + robot.delay(250); - point = Util.getCenterPoint(menuItem); - robot.mouseMove(point.x, point.y); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + Point itemLocation = Util.getCenterPoint(menuItem); + System.out.println("MenuItem Location " + itemLocation); + robot.mouseMove(itemLocation.x, itemLocation.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); + robot.delay(250); if (!isMenuItemShowing()) { throw new RuntimeException("Popup is unexpectedly closed"); } - // test mouse drag - point = Util.getCenterPoint(menu); - robot.mouseMove(point.x, point.y); - Point menuLocation = Util.invokeOnEDT(new Callable() { - - @Override - public Point call() throws Exception { - return menu.getLocationOnScreen(); - } - }); - - Point itemLocation = Util.invokeOnEDT(new Callable() { - - @Override - public Point call() throws Exception { - return menuItem.getLocationOnScreen(); - } - }); - - int x0 = menuLocation.x + 10; - int y0 = menuLocation.y + 10; - int x1 = itemLocation.x + 10; - int y1 = itemLocation.y + 10; - // close menu - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mouseMove(menuLocation.x, menuLocation.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); + robot.delay(250); - robot.mousePress(InputEvent.BUTTON1_MASK); - Util.glide(robot, x0, y0, x1, y1); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + // test mouse drag + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(250); + Util.glide(robot, menuLocation.x, menuLocation.y, + itemLocation.x, itemLocation.y); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); if (!isMenuItemShowing()) { throw new RuntimeException("Popup is unexpectedly closed"); } } finally { - if (frame != null) SwingUtilities.invokeAndWait(() -> frame.dispose()); + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); } } @@ -151,6 +143,6 @@ private static void createAndShowUI() { frame.setSize(200, 200); frame.setLocationRelativeTo(null); frame.setVisible(true); - } } + From 58b1b0cc359b5c14895c07560166779ec70975c9 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Thu, 4 Jan 2024 19:17:58 +0000 Subject: [PATCH 098/261] 8315042: NPE in PKCS7.parseOldSignedData Backport-of: 8c0d026d0f508e0c896fd28d725915c52d1b689d --- .../classes/sun/security/pkcs/PKCS7.java | 4 ++ .../x509/X509CRLImpl/UnexpectedNPE.java | 63 ++++++++----------- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/src/java.base/share/classes/sun/security/pkcs/PKCS7.java b/src/java.base/share/classes/sun/security/pkcs/PKCS7.java index cb278402094..302b5922bbc 100644 --- a/src/java.base/share/classes/sun/security/pkcs/PKCS7.java +++ b/src/java.base/share/classes/sun/security/pkcs/PKCS7.java @@ -152,6 +152,10 @@ private void parse(DerInputStream derin, boolean oldStyle) ObjectIdentifier contentType = block.contentType; DerValue content = block.getContent(); + if (content == null) { + throw new ParsingException("content is null"); + } + if (contentType.equals(ContentInfo.SIGNED_DATA_OID)) { parseSignedData(content); } else if (contentType.equals(ContentInfo.OLD_SIGNED_DATA_OID)) { diff --git a/test/jdk/sun/security/x509/X509CRLImpl/UnexpectedNPE.java b/test/jdk/sun/security/x509/X509CRLImpl/UnexpectedNPE.java index 8c14c48ee28..fb85353ee3f 100644 --- a/test/jdk/sun/security/x509/X509CRLImpl/UnexpectedNPE.java +++ b/test/jdk/sun/security/x509/X509CRLImpl/UnexpectedNPE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -23,56 +23,43 @@ /* * @test - * @bug 5052433 - * @summary NullPointerException for generateCRL and generateCRLs methods. + * @bug 5052433 8315042 + * @summary Verify that generateCRL and generateCRLs methods do not throw + * NullPointerException. They should throw CRLException instead. + * @library /test/lib */ import java.security.NoSuchProviderException; import java.security.cert.*; import java.io.ByteArrayInputStream; +import java.util.Base64; -public class UnexpectedNPE { - CertificateFactory cf = null ; +import jdk.test.lib.Utils; - public UnexpectedNPE() {} +public class UnexpectedNPE { + static CertificateFactory cf = null; - public static void main( String[] av ) { + public static void main(String[] av ) throws CertificateException, + NoSuchProviderException { byte[] encoded_1 = { 0x00, 0x00, 0x00, 0x00 }; byte[] encoded_2 = { 0x30, 0x01, 0x00, 0x00 }; byte[] encoded_3 = { 0x30, 0x01, 0x00 }; + byte[] encoded_4 = Base64.getDecoder().decode( + "MAsGCSqGSMP7TQEHAjI1Bgn///////8wCwUyAQ=="); - UnexpectedNPE unpe = new UnexpectedNPE() ; - - if(!unpe.run(encoded_1)) { - throw new SecurityException("CRLException has not been thrown"); - } + cf = CertificateFactory.getInstance("X.509", "SUN"); - if(!unpe.run(encoded_2)) { - throw new SecurityException("CRLException has not been thrown"); - } - - if(!unpe.run(encoded_2)) { - throw new SecurityException("CRLException has not been thrown"); - } + run(encoded_1); + run(encoded_2); + run(encoded_3); + run(encoded_4); } - private boolean run(byte[] buf) { - if (cf == null) { - try { - cf = CertificateFactory.getInstance("X.509", "SUN"); - } catch (CertificateException e) { - throw new SecurityException("Cannot get CertificateFactory"); - } catch (NoSuchProviderException npe) { - throw new SecurityException("Cannot get CertificateFactory"); - } - } - try { - cf.generateCRL(new ByteArrayInputStream(buf)); - } catch (CRLException ce) { - System.out.println("NPE checking passed"); - return true; - } - - System.out.println("CRLException has not been thrown"); - return false; + private static void run(byte[] buf) { + Utils.runAndCheckException( + () -> cf.generateCRL(new ByteArrayInputStream(buf)), + CRLException.class); + Utils.runAndCheckException( + () -> cf.generateCRLs(new ByteArrayInputStream(buf)), + CRLException.class); } } From 9f6036053e802c6e16289a02051f3d624be810c5 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 5 Jan 2024 09:58:07 +0000 Subject: [PATCH 099/261] 8321974: Crash in ciKlass::is_subtype_of because TypeAryPtr::_klass is not initialized Backport-of: c8ad7b7f84ead3f850f034e1db6335bbbac41589 --- src/hotspot/share/opto/type.cpp | 46 +++++----------- src/hotspot/share/opto/type.hpp | 2 +- .../c2/TestUninitializedKlassField.java | 54 +++++++++++++++++++ 3 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestUninitializedKlassField.java diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index c1c88a26f6a..4e0bd43be5c 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -4663,7 +4663,7 @@ template bool TypePtr::is_meet_subtype_of_helper_for_array } if (other_elem == nullptr && this_elem == nullptr) { - return this_one->_klass->is_subtype_of(other->_klass); + return this_one->klass()->is_subtype_of(other->klass()); } return false; @@ -5992,7 +5992,7 @@ template bool TypePtr::is_java_subtype_of_helper_for_instan return true; } - return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces); + return this_one->klass()->is_subtype_of(other->klass()) && this_one->_interfaces->contains(other->_interfaces); } bool TypeInstKlassPtr::is_java_subtype_of_helper(const TypeKlassPtr* other, bool this_exact, bool other_exact) const { @@ -6007,7 +6007,7 @@ template bool TypePtr::is_same_java_type_as_helper_for_inst if (!this_one->is_instance_type(other)) { return false; } - return this_one->_klass->equals(other->_klass) && this_one->_interfaces->eq(other->_interfaces); + return this_one->klass()->equals(other->klass()) && this_one->_interfaces->eq(other->_interfaces); } bool TypeInstKlassPtr::is_same_java_type_as_helper(const TypeKlassPtr* other) const { @@ -6021,7 +6021,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_ins } if (this_one->is_array_type(other)) { - return !this_exact && this_one->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces->contains(this_one->_interfaces); + return !this_exact && this_one->klass()->equals(ciEnv::current()->Object_klass()) && other->_interfaces->contains(this_one->_interfaces); } assert(this_one->is_instance_type(other), "unsupported"); @@ -6030,12 +6030,12 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_ins return this_one->is_java_subtype_of(other); } - if (!this_one->_klass->is_subtype_of(other->_klass) && !other->_klass->is_subtype_of(this_one->_klass)) { + if (!this_one->klass()->is_subtype_of(other->klass()) && !other->klass()->is_subtype_of(this_one->klass())) { return false; } if (this_exact) { - return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces); + return this_one->klass()->is_subtype_of(other->klass()) && this_one->_interfaces->contains(other->_interfaces); } return true; @@ -6115,7 +6115,7 @@ uint TypeAryKlassPtr::hash(void) const { //----------------------compute_klass------------------------------------------ // Compute the defining klass for this class -ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const { +ciKlass* TypeAryPtr::compute_klass() const { // Compute _klass based on element type. ciKlass* k_ary = nullptr; const TypeInstPtr *tinst; @@ -6136,28 +6136,7 @@ ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const { // and object; Top occurs when doing join on Bottom. // Leave k_ary at null. } else { - // Cannot compute array klass directly from basic type, - // since subtypes of TypeInt all have basic type T_INT. -#ifdef ASSERT - if (verify && el->isa_int()) { - // Check simple cases when verifying klass. - BasicType bt = T_ILLEGAL; - if (el == TypeInt::BYTE) { - bt = T_BYTE; - } else if (el == TypeInt::SHORT) { - bt = T_SHORT; - } else if (el == TypeInt::CHAR) { - bt = T_CHAR; - } else if (el == TypeInt::INT) { - bt = T_INT; - } else { - return _klass; // just return specified klass - } - return ciTypeArrayKlass::make(bt); - } -#endif - assert(!el->isa_int(), - "integral arrays must be pre-equipped with a class"); + assert(!el->isa_int(), "integral arrays must be pre-equipped with a class"); // Compute array klass directly from basic type k_ary = ciTypeArrayKlass::make(el->basic_type()); } @@ -6433,7 +6412,7 @@ template bool TypePtr::is_java_subtype_of_helper_for_array( return this_one->is_reference_type(this_elem)->is_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact); } if (this_elem == nullptr && other_elem == nullptr) { - return this_one->_klass->is_subtype_of(other->_klass); + return this_one->klass()->is_subtype_of(other->klass()); } return false; } @@ -6465,8 +6444,7 @@ template bool TypePtr::is_same_java_type_as_helper_for_arra return this_one->is_reference_type(this_elem)->is_same_java_type_as(this_one->is_reference_type(other_elem)); } if (other_elem == nullptr && this_elem == nullptr) { - assert(this_one->_klass != nullptr && other->_klass != nullptr, ""); - return this_one->_klass->equals(other->_klass); + return this_one->klass()->equals(other->klass()); } return false; } @@ -6486,7 +6464,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_arr return true; } if (this_one->is_instance_type(other)) { - return other->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces); + return other->klass()->equals(ciEnv::current()->Object_klass()) && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces); } assert(this_one->is_array_type(other), ""); @@ -6505,7 +6483,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_arr return this_one->is_reference_type(this_elem)->maybe_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact); } if (other_elem == nullptr && this_elem == nullptr) { - return this_one->_klass->is_subtype_of(other->_klass); + return this_one->klass()->is_subtype_of(other->klass()); } return false; } diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp index 04ef4f6c0e4..62f9e27c8f8 100644 --- a/src/hotspot/share/opto/type.hpp +++ b/src/hotspot/share/opto/type.hpp @@ -1413,7 +1413,7 @@ class TypeAryPtr : public TypeOopPtr { const TypeAry *_ary; // Array we point into const bool _is_autobox_cache; - ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const; + ciKlass* compute_klass() const; // A pointer to delay allocation to Type::Initialize_shared() diff --git a/test/hotspot/jtreg/compiler/c2/TestUninitializedKlassField.java b/test/hotspot/jtreg/compiler/c2/TestUninitializedKlassField.java new file mode 100644 index 00000000000..3bad2bde7b1 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestUninitializedKlassField.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023, 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. + */ + +/* + * @test + * @bug 8321974 + * @summary Test that the TypeAryPtr::_klass field is properly initialized on use. + * @comment This test only reproduces the issue with release builds of the JVM because + * verification code in debug builds leads to eager initialization of the field. + * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,TestUninitializedKlassField::test* + * -XX:-TieredCompilation TestUninitializedKlassField + */ + +public class TestUninitializedKlassField { + static void test(long array2[]) { + long array1[] = new long[1]; + // Loop is needed to create a backedge phi that is processed only during IGVN. + for (int i = 0; i < 1; i++) { + // CmpPNode::sub will check if classes of array1 and array2 are unrelated + // and the subtype checks will crash if the _klass field is not initialized. + if (array2 != array1) { + array1 = new long[2]; + } + } + } + + public static void main(String[] args) { + for (int i = 0; i < 50_000; ++i) { + test(null); + } + } +} From 23a0b9059782a9659feb00d97963b0f8e1184110 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 5 Jan 2024 09:58:45 +0000 Subject: [PATCH 100/261] 8319548: Unexpected internal name for Filler array klass causes error in VisualVM Backport-of: 05745e3f1d56f71d7647e81fa5933c9f4ed18430 --- src/hotspot/share/memory/universe.cpp | 2 +- test/hotspot/jtreg/gc/TestFillerObjectInstantiation.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp index 58c1792633e..de479d3e9e4 100644 --- a/src/hotspot/share/memory/universe.cpp +++ b/src/hotspot/share/memory/universe.cpp @@ -335,7 +335,7 @@ void Universe::genesis(TRAPS) { // Initialization of the fillerArrayKlass must come before regular // int-TypeArrayKlass so that the int-Array mirror points to the // int-TypeArrayKlass. - _fillerArrayKlassObj = TypeArrayKlass::create_klass(T_INT, "Ljdk/internal/vm/FillerArray;", CHECK); + _fillerArrayKlassObj = TypeArrayKlass::create_klass(T_INT, "[Ljdk/internal/vm/FillerElement;", CHECK); for (int i = T_BOOLEAN; i < T_LONG+1; i++) { _typeArrayKlassObjs[i] = TypeArrayKlass::create_klass((BasicType)i, CHECK); } diff --git a/test/hotspot/jtreg/gc/TestFillerObjectInstantiation.java b/test/hotspot/jtreg/gc/TestFillerObjectInstantiation.java index bec7c4858f5..edb63f88af2 100644 --- a/test/hotspot/jtreg/gc/TestFillerObjectInstantiation.java +++ b/test/hotspot/jtreg/gc/TestFillerObjectInstantiation.java @@ -45,6 +45,6 @@ private static void testInstantiationFails(String classname) throws Exception { public static void main(String[] args) throws Exception { testInstantiationFails("jdk.internal.vm.FillerObject"); - testInstantiationFails("jdk.internal.vm.FillerArray"); + testInstantiationFails("jdk.internal.vm.FillerElement"); } } From 5f2cf881b1b941d5771328f6822693c5b9c4da0d Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 5 Jan 2024 09:59:16 +0000 Subject: [PATCH 101/261] 8322159: ThisEscapeAnalyzer crashes for erroneous code Backport-of: 7455b1b527568aff5b1c16a29fd80b05260c0fad --- .../tools/javac/comp/ThisEscapeAnalyzer.java | 8 +++- .../tools/javac/recovery/AttrRecovery.java | 39 ++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java index 0dd32fd8eca..f6ce19fac06 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java @@ -506,7 +506,7 @@ public void visitMethodDef(JCMethodDecl tree) { public void visitApply(JCMethodInvocation invoke) { // Get method symbol - MethodSymbol sym = (MethodSymbol)TreeInfo.symbolFor(invoke.meth); + Symbol sym = TreeInfo.symbolFor(invoke.meth); // Recurse on method expression scan(invoke.meth); @@ -530,7 +530,7 @@ public void visitApply(JCMethodInvocation invoke) { invoke(invoke, sym, invoke.args, receiverRefs); } - private void invoke(JCTree site, MethodSymbol sym, List args, RefSet receiverRefs) { + private void invoke(JCTree site, Symbol sym, List args, RefSet receiverRefs) { // Skip if ignoring warnings for a constructor invoked via 'this()' if (suppressed.contains(sym)) @@ -810,6 +810,10 @@ public void visitSelect(JCFieldAccess tree) { @Override public void visitReference(JCMemberReference tree) { + if (tree.type.isErroneous()) { + //error recovery - ignore erroneous member references + return ; + } // Scan target expression and extract 'this' references, if any scan(tree.expr); diff --git a/test/langtools/tools/javac/recovery/AttrRecovery.java b/test/langtools/tools/javac/recovery/AttrRecovery.java index e0dd57d23b9..5a6f92166d5 100644 --- a/test/langtools/tools/javac/recovery/AttrRecovery.java +++ b/test/langtools/tools/javac/recovery/AttrRecovery.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8301580 + * @bug 8301580 8322159 * @summary Verify error recovery w.r.t. Attr * @library /tools/lib * @modules jdk.compiler/com.sun.tools.javac.api @@ -86,4 +86,41 @@ class C { } } + @Test + public void testX() throws Exception { + String code = """ + public class C { + public C() { + Undefined.method(); + undefined1(); + Runnable r = this::undefined2; + overridable(this); //to verify ThisEscapeAnalyzer has been run + } + public void overridable(C c) {} + } + """; + Path curPath = Path.of("."); + List actual = new JavacTask(tb) + .options("-XDrawDiagnostics", "-XDdev", + "-XDshould-stop.at=FLOW", "-Xlint:this-escape") + .sources(code) + .outdir(curPath) + .run(Expect.FAIL) + .writeAll() + .getOutputLines(OutputKind.DIRECT); + + List expected = List.of( + "C.java:3:9: compiler.err.cant.resolve.location: kindname.variable, Undefined, , , (compiler.misc.location: kindname.class, C, null)", + "C.java:4:9: compiler.err.cant.resolve.location.args: kindname.method, undefined1, , , (compiler.misc.location: kindname.class, C, null)", + "C.java:5:22: compiler.err.invalid.mref: kindname.method, (compiler.misc.cant.resolve.location.args: kindname.method, undefined2, , , (compiler.misc.location: kindname.class, C, null))", + "C.java:6:20: compiler.warn.possible.this.escape", + "3 errors", + "1 warning" + ); + + if (!Objects.equals(actual, expected)) { + error("Expected: " + expected + ", but got: " + actual); + } + } + } From 579c56f0a5bea433fc2ec1d89777bca83cda5bf3 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 5 Jan 2024 09:59:30 +0000 Subject: [PATCH 102/261] 8322321: Add man page doc for -XX:+VerifySharedSpaces Backport-of: f7dc257a206d3104d6d24c2079ef1fe349368c49 --- src/java.base/share/man/java.1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/java.base/share/man/java.1 b/src/java.base/share/man/java.1 index c981746c9b8..1eeeac1889f 100644 --- a/src/java.base/share/man/java.1 +++ b/src/java.base/share/man/java.1 @@ -1565,6 +1565,15 @@ Specifies the path and name of the class data sharing (CDS) archive file See \f[B]Application Class Data Sharing\f[R]. .RE .TP +\f[V]-XX:+VerifySharedSpaces\f[R] +If this option is specified, the JVM will load a CDS archive file only +if it passes an integrity check based on CRC32 checksums. +The purpose of this flag is to check for unintentional damage to CDS +archive files in transmission or storage. +To guarantee the security and proper operation of CDS, the user must +ensure that the CDS archive files used by Java applications cannot be +modified without proper authorization. +.TP \f[V]-XX:SharedArchiveConfigFile=\f[R]\f[I]shared_config_file\f[R] Specifies additional shared data added to the archive file. .TP From 49dd575df93aee07bb512fede446f3e2d240b2bc Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 5 Jan 2024 09:59:39 +0000 Subject: [PATCH 103/261] 8320921: GHA: Parallelize hotspot_compiler test jobs Backport-of: 694136909c058370a5833322ebaf2e71a0a15164 --- .github/workflows/test.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3febb11b86b..6ccb02e39ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,7 +60,9 @@ jobs: - 'jdk/tier1 part 3' - 'langtools/tier1' - 'hs/tier1 common' - - 'hs/tier1 compiler' + - 'hs/tier1 compiler part 1' + - 'hs/tier1 compiler part 2' + - 'hs/tier1 compiler part 3' - 'hs/tier1 gc' - 'hs/tier1 runtime' - 'hs/tier1 serviceability' @@ -83,8 +85,16 @@ jobs: test-suite: 'test/hotspot/jtreg/:tier1_common' debug-suffix: -debug - - test-name: 'hs/tier1 compiler' - test-suite: 'test/hotspot/jtreg/:tier1_compiler' + - test-name: 'hs/tier1 compiler part 1' + test-suite: 'test/hotspot/jtreg/:tier1_compiler_1' + debug-suffix: -debug + + - test-name: 'hs/tier1 compiler part 2' + test-suite: 'test/hotspot/jtreg/:tier1_compiler_2 test/hotspot/jtreg/:tier1_compiler_not_xcomp' + debug-suffix: -debug + + - test-name: 'hs/tier1 compiler part 3' + test-suite: 'test/hotspot/jtreg/:tier1_compiler_3' debug-suffix: -debug - test-name: 'hs/tier1 gc' From b3344f2422a9a606dbb779d639c515c857412d3e Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Fri, 5 Jan 2024 15:32:31 +0000 Subject: [PATCH 104/261] 8315731: Open source several Swing Text related tests Backport-of: d475f61fd52b7d379260811b32d3815786858411 --- .../swing/text/CompositeView/bug4398059.java | 114 +++++++++++++++ .../swing/text/DefaultCaret/bug4197894.java | 106 ++++++++++++++ .../swing/text/DefaultCaret/bug4203175.java | 134 ++++++++++++++++++ .../text/DefaultEditorKit/bug4265242.java | 52 +++++++ .../DefaultStyledDocument/bug4472852.java | 62 ++++++++ 5 files changed, 468 insertions(+) create mode 100644 test/jdk/javax/swing/text/CompositeView/bug4398059.java create mode 100644 test/jdk/javax/swing/text/DefaultCaret/bug4197894.java create mode 100644 test/jdk/javax/swing/text/DefaultCaret/bug4203175.java create mode 100644 test/jdk/javax/swing/text/DefaultEditorKit/bug4265242.java create mode 100644 test/jdk/javax/swing/text/DefaultStyledDocument/bug4472852.java diff --git a/test/jdk/javax/swing/text/CompositeView/bug4398059.java b/test/jdk/javax/swing/text/CompositeView/bug4398059.java new file mode 100644 index 00000000000..3ce567538be --- /dev/null +++ b/test/jdk/javax/swing/text/CompositeView/bug4398059.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Robot; +import java.awt.Shape; +import javax.swing.JEditorPane; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.Element; +import javax.swing.text.Position; +import javax.swing.text.StyleConstants; +import javax.swing.text.View; +import javax.swing.text.ViewFactory; +import javax.swing.text.html.HTML; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.ParagraphView; + +/* + * @test + * @bug 4398059 + * @key headful + * @summary Tests that CompositeView doesn't throw NPE. + */ + +public class bug4398059 { + private static JFrame jFrame; + + public static void main(String[] args) throws Exception { + try { + Robot robot = new Robot(); + SwingUtilities.invokeAndWait(bug4398059::createAndShowUI); + robot.waitForIdle(); + robot.delay(1000); + } finally { + SwingUtilities.invokeAndWait(() -> { + if (jFrame != null) { + jFrame.dispose(); + } + }); + } + } + + public static void createAndShowUI() { + String text = "

    text"; + jFrame = new JFrame("CompositeView Test"); + JEditorPane jep = new JEditorPane(); + jep.setEditorKit(new MyHTMLEditorKit()); + jep.setText(text); + + Document doc = jep.getDocument(); + jep.setCaretPosition(doc.getLength() - 1); + + jFrame.getContentPane().add(jep); + jFrame.setSize(200,200); + jFrame.setVisible(true); + } + + static class MyHTMLEditorKit extends HTMLEditorKit { + private static final ViewFactory defaultFactory = new MyHTMLFactory(); + + public ViewFactory getViewFactory() { + return defaultFactory; + } + + static class MyHTMLFactory extends HTMLEditorKit.HTMLFactory { + public View create(Element elem) { + Object obj = elem.getAttributes().getAttribute(StyleConstants.NameAttribute); + if (obj instanceof HTML.Tag kind) { + if (kind == HTML.Tag.H1) { + return new MyParagraphView(elem); + } + } + return super.create(elem); + } + } + + static class MyParagraphView extends ParagraphView { + public MyParagraphView(Element elem) { + super(elem); + } + + public Shape getChildAllocation(int index, Shape a) { + return null; + } + + public Shape modelToView(int pos, Shape a, Position.Bias b) + throws BadLocationException { + return super.modelToView(pos, a, b); + } + } + } +} diff --git a/test/jdk/javax/swing/text/DefaultCaret/bug4197894.java b/test/jdk/javax/swing/text/DefaultCaret/bug4197894.java new file mode 100644 index 00000000000..11bb163860b --- /dev/null +++ b/test/jdk/javax/swing/text/DefaultCaret/bug4197894.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.JFrame; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; + +/* + * @test + * @bug 4197894 + * @key headful + * @summary Tests if shift-click adjusts selection in text areas. + */ + +public class bug4197894 { + private static JFrame jFrame; + private static JTextArea ta; + + private static volatile Point point = null; + private static volatile Rectangle bounds; + + private static volatile boolean passed = true; + + public static void main(String[] args) throws Exception { + try { + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.setAutoWaitForIdle(true); + + SwingUtilities.invokeAndWait(bug4197894::createAndShowUI); + robot.waitForIdle(); + robot.delay(1000); + + SwingUtilities.invokeAndWait(() -> { + point = ta.getLocationOnScreen(); + bounds = ta.getBounds(); + }); + robot.waitForIdle(); + robot.delay(300); + + robot.mouseMove((point.x + bounds.width / 4), + (point.y + bounds.height / 4)); + + robot.keyPress(KeyEvent.VK_SHIFT); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.keyRelease(KeyEvent.VK_SHIFT); + robot.delay(300); + + if (!passed) { + throw new RuntimeException("Test failed." + + " Shift-Click Text Selection does not work!"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (jFrame != null) { + jFrame.dispose(); + } + }); + } + } + + private static void createAndShowUI() { + jFrame = new JFrame("Shift-Click Text Selection"); + ta = new JTextArea(); + ta.addKeyListener(new KeyAdapter() { + public void keyReleased(KeyEvent e) { + String selText = ta.getSelectedText(); + passed = !(selText == null || (selText.length() == 0)); + } + }); + ta.setText("12345\n12345\n12345\n12345\n12345\n12345\n12345"); + ta.setCaretPosition(ta.getDocument().getLength()); + jFrame.getContentPane().add(ta); + jFrame.pack(); + jFrame.setLocationRelativeTo(null); + jFrame.setAlwaysOnTop(true); + jFrame.setVisible(true); + } +} diff --git a/test/jdk/javax/swing/text/DefaultCaret/bug4203175.java b/test/jdk/javax/swing/text/DefaultCaret/bug4203175.java new file mode 100644 index 00000000000..8a15644bf91 --- /dev/null +++ b/test/jdk/javax/swing/text/DefaultCaret/bug4203175.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Container; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; + +/* + * @test + * @bug 4203175 + * @key headful + * @summary Tests that double-click on disabled JTextField doesn't + * cause other text-field to select content. + */ + +public class bug4203175 { + private static JFrame jFrame; + private static JTextField tf1, tf2; + private static JButton b; + private static volatile Point point; + private static volatile boolean passed = true; + private static int clicks = 0; + + public static void main(String[] args) throws Exception { + try { + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.setAutoWaitForIdle(true); + + SwingUtilities.invokeAndWait(bug4203175::createAndShowUI); + robot.delay(1000); + + SwingUtilities.invokeAndWait(() -> point = tf1.getLocationOnScreen()); + robot.mouseMove(point.x, point.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(200); + + SwingUtilities.invokeAndWait(() -> point = b.getLocationOnScreen()); + robot.mouseMove(point.x, point.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(200); + + SwingUtilities.invokeAndWait(() -> point = tf2.getLocationOnScreen()); + robot.mouseMove(point.x, point.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(200); + + if (!passed) { + throw new RuntimeException("Test failed!! Text selection on disabled" + + " TextField does not work as expected!"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (jFrame != null) { + jFrame.dispose(); + } + }); + } + } + + private static void createAndShowUI() { + jFrame = new JFrame("JTextField Text Selection"); + Container cont = jFrame.getContentPane(); + cont.setLayout(new BoxLayout(cont, BoxLayout.Y_AXIS)); + + tf1 = new JTextField(20); + tf1.setText("sometext"); + tf1.setName("Field 1"); + tf1.setCaretPosition(tf1.getDocument().getLength()); + cont.add(tf1); + + tf2 = new JTextField(20); + tf2.setName("Field 2"); + tf2.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + clicks++; + if (clicks == 2) { + String selText = tf1.getSelectedText(); + passed = (selText == null || (selText.length() == 0)); + } + } + }); + cont.add(tf2); + + b = new JButton("Toggle Enabled"); + cont.add(b); + b.addActionListener(e -> { + if (e.getSource() == b) { + boolean b = tf1.isEnabled(); + tf1.setEnabled(!b); + tf2.setEnabled(!b); + } + }); + + jFrame.pack(); + jFrame.setLocationRelativeTo(null); + jFrame.setVisible(true); + } +} diff --git a/test/jdk/javax/swing/text/DefaultEditorKit/bug4265242.java b/test/jdk/javax/swing/text/DefaultEditorKit/bug4265242.java new file mode 100644 index 00000000000..d797b587858 --- /dev/null +++ b/test/jdk/javax/swing/text/DefaultEditorKit/bug4265242.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.event.ActionEvent; +import javax.swing.Action; +import javax.swing.JTextPane; +import javax.swing.text.DefaultEditorKit; + +/* + * @test + * @bug 4265242 + * @summary Tests endParagraphAction in JTextPane + */ + +public class bug4265242 { + public static void main(String[] args) { + JTextPane jTextPane = new JTextPane(); + jTextPane.setText("Merry sparrow"); + + Action[] actions = jTextPane.getActions(); + Action endPara = null; + for (Action action : actions) { + String name = (String) action.getValue(Action.NAME); + if (name.equals(DefaultEditorKit.endParagraphAction)) { + endPara = action; + } + } + endPara.actionPerformed(new ActionEvent(jTextPane, + ActionEvent.ACTION_PERFORMED, + DefaultEditorKit.endParagraphAction)); + } +} diff --git a/test/jdk/javax/swing/text/DefaultStyledDocument/bug4472852.java b/test/jdk/javax/swing/text/DefaultStyledDocument/bug4472852.java new file mode 100644 index 00000000000..cb9b4e654b3 --- /dev/null +++ b/test/jdk/javax/swing/text/DefaultStyledDocument/bug4472852.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Color; +import javax.swing.text.DefaultStyledDocument; +import javax.swing.text.Element; +import javax.swing.text.MutableAttributeSet; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyledDocument; + +/* + * @test + * @bug 4472852 + * @summary Tests DefaultStyledDocument.split(int, int) + */ + +public class bug4472852 { + + public static void main(String[] args) throws Exception { + // create a Document and insert some text there + StyledDocument doc = new DefaultStyledDocument(); + doc.insertString(0, "this", null); + + // add style to the last word + Element root = doc.getDefaultRootElement(); + int end = root.getEndOffset(); + MutableAttributeSet as = new SimpleAttributeSet(); + StyleConstants.setBackground(as, Color.BLUE); + doc.setCharacterAttributes(end-5, 5, as, true); + + // inspect Elements of the only Paragraph -- + // there should be no empty Elements + Element para = root.getElement(0); + for (int i = 0; i < para.getElementCount(); i++) { + Element el = para.getElement(i); + if (el.getStartOffset() == el.getEndOffset()) { + throw new RuntimeException("Failed: empty Element found"); + } + } + } +} From 4bdda4b59757a593cbceeb1ace071b489678b903 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Sat, 6 Jan 2024 12:14:33 +0000 Subject: [PATCH 105/261] 8322583: RISC-V: Enable fast class initialization checks Backport-of: 5235cc987d8c4455622acda947bed7321086a385 --- src/hotspot/cpu/riscv/vm_version_riscv.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hotspot/cpu/riscv/vm_version_riscv.hpp b/src/hotspot/cpu/riscv/vm_version_riscv.hpp index 6d9ea5c2ac3..93ebd9e4e7d 100644 --- a/src/hotspot/cpu/riscv/vm_version_riscv.hpp +++ b/src/hotspot/cpu/riscv/vm_version_riscv.hpp @@ -201,6 +201,9 @@ class VM_Version : public Abstract_VM_Version { constexpr static bool supports_stack_watermark_barrier() { return true; } static bool supports_on_spin_wait() { return UseZihintpause; } + + // RISCV64 supports fast class initialization checks + static bool supports_fast_class_init_checks() { return true; } }; #endif // CPU_RISCV_VM_VERSION_RISCV_HPP From 1f38afa6c6fa7949c5d7171b817f1d7883987cf4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 07:03:44 +0000 Subject: [PATCH 106/261] 8315097: Rename createJavaProcessBuilder 8318964: Fix build failures caused by 8315097 Reviewed-by: mdoerr Backport-of: d52a995f35de26c2cc4074297a75141e4a363e1b --- .../applications/jcstress/JcstressRunner.java | 2 +- .../applications/jcstress/TestGenerator.java | 2 +- .../jtreg/applications/scimark/Scimark.java | 2 +- .../arguments/CheckCICompilerCount.java | 4 +- .../CheckCompileThresholdScaling.java | 4 +- .../arguments/TestCodeEntryAlignment.java | 4 +- .../arguments/TestOptoLoopAlignment.java | 4 +- .../TestPrintOptoAssemblyLineNumbers.java | 4 +- .../arraycopy/stress/TestStressArrayCopy.java | 2 +- ...BlackholeExistingIntrinsicWarningTest.java | 4 +- .../BlackholeExperimentalUnlockTest.java | 4 +- .../blackhole/BlackholeIntrinsicTest.java | 2 +- .../BlackholeNonEmptyWarningTest.java | 4 +- .../BlackholeNonStaticWarningTest.java | 4 +- .../BlackholeNonVoidWarningTest.java | 4 +- .../compiler/c1/TestRangeCheckEliminated.java | 8 +- test/hotspot/jtreg/compiler/c2/TestBit.java | 4 +- .../compiler/c2/aarch64/TestFarJump.java | 2 +- .../compiler/c2/aarch64/TestSVEWithJNI.java | 48 +++++----- .../compiler/c2/aarch64/TestTrampoline.java | 2 +- .../compiler/c2/aarch64/TestVolatiles.java | 4 +- .../jtreg/compiler/ciReplay/CiReplayBase.java | 8 +- .../compiler/ciReplay/DumpReplayBase.java | 4 +- .../jtreg/compiler/ciReplay/SABase.java | 4 +- .../ciReplay/TestInvalidReplayFile.java | 2 +- .../codecache/CheckCodeCacheInfo.java | 6 +- .../compiler/codecache/CheckLargePages.java | 2 +- ...kReservedInitialCodeCacheSizeArgOrder.java | 6 +- .../codecache/CheckSegmentedCodeCache.java | 88 +++++++++--------- .../compiler/codecache/CheckUpperLimit.java | 4 +- .../codecache/CodeCacheFullCountTest.java | 2 +- .../TestConflictInlineCommands.java | 4 +- .../jtreg/compiler/cpuflags/RestoreMXCSR.java | 4 +- .../debug/TestGenerateStressSeed.java | 4 +- .../jtreg/compiler/debug/TestStressCM.java | 4 +- .../compiler/debug/TestStressIGVNAndCCP.java | 4 +- .../compiler/debug/VerifyAdapterSharing.java | 4 +- .../escapeAnalysis/TestIterativeEA.java | 4 +- .../compiler/inlining/InlineAccessors.java | 4 +- .../compiler/inlining/PrintInlining.java | 4 +- .../compiler/inlining/ResolvedClassTest.java | 8 +- .../intrinsics/chacha/TestChaCha20.java | 4 +- .../ContinuousCallSiteTargetChange.java | 2 +- .../jtreg/compiler/jsr292/MHInlineTest.java | 4 +- .../compiler/jsr292/PollutedTrapCounts.java | 4 +- .../jvmci/TestEnableJVMCIProduct.java | 2 +- .../jvmci/TestInvalidJVMCIOption.java | 4 +- .../jvmci/TestJVMCIPrintProperties.java | 4 +- .../TestUncaughtErrorInCompileMethod.java | 2 +- .../jvmci/compilerToVM/GetFlagValueTest.java | 4 +- .../hotspot/test/TestHotSpotJVMCIRuntime.java | 2 +- .../ir_framework/driver/TestVMProcess.java | 4 +- .../TestLinkageErrorInGenerateOopMap.java | 4 +- .../CheckLoopStripMiningIterShortLoop.java | 2 +- .../TestNoWarningLoopStripMiningIterSet.java | 2 +- .../compiler/onSpinWait/TestOnSpinWait.java | 4 +- .../onSpinWait/TestOnSpinWaitAArch64.java | 2 +- .../TestOnSpinWaitAArch64DefaultFlags.java | 4 +- .../compiler/onSpinWait/TestOnSpinWaitC1.java | 4 +- .../onSpinWait/TestOnSpinWaitNoneAArch64.java | 2 +- .../onSpinWait/TestOnSpinWaitRISCV64.java | 2 +- .../oracle/CheckCompileCommandOption.java | 6 +- .../compiler/oracle/TestCompileCommand.java | 4 +- .../oracle/TestInvalidCompileCommand.java | 2 +- .../TestRangeCheckHoistingScaledIV.java | 2 +- .../runtime/cr8015436/Driver8015436.java | 4 +- .../sharedstubs/SharedStubToInterpTest.java | 2 +- .../sharedstubs/SharedTrampolineTest.java | 2 +- .../startup/NumCompilerThreadsCheck.java | 4 +- .../startup/SmallCodeCacheStartup.java | 10 +- .../jtreg/compiler/startup/StartupOutput.java | 6 +- .../compiler/testlibrary/rtm/RTMTestBase.java | 6 +- .../compiler/types/correctness/OffTest.java | 4 +- .../TestBufferVectorization.java | 12 +-- .../jtreg/containers/cgroup/PlainRead.java | 4 +- test/hotspot/jtreg/gc/TestAgeOutput.java | 4 +- test/hotspot/jtreg/gc/TestAllocateHeapAt.java | 4 +- .../jtreg/gc/TestAllocateHeapAtError.java | 4 +- .../jtreg/gc/TestAllocateHeapAtMultiple.java | 4 +- .../jtreg/gc/TestCardTablePageCommits.java | 4 +- .../hotspot/jtreg/gc/TestNumWorkerOutput.java | 4 +- .../jtreg/gc/TestPLABAdaptToMinTLABSize.java | 4 +- test/hotspot/jtreg/gc/TestSmallHeap.java | 4 +- .../jtreg/gc/TestVerifyDuringStartup.java | 4 +- test/hotspot/jtreg/gc/TestVerifySilently.java | 4 +- test/hotspot/jtreg/gc/TestVerifySubSet.java | 2 +- .../jtreg/gc/arguments/GCArguments.java | 18 ++-- .../gc/arguments/TestAggressiveHeap.java | 2 +- .../TestArrayAllocatorMallocLimit.java | 4 +- .../arguments/TestCompressedClassFlags.java | 2 +- .../gc/arguments/TestDisableDefaultGC.java | 14 +-- .../TestG1ConcMarkStepDurationMillis.java | 2 +- .../TestG1ConcRefinementThreads.java | 2 +- .../gc/arguments/TestG1HeapRegionSize.java | 2 +- .../gc/arguments/TestG1PercentageOptions.java | 2 +- .../jtreg/gc/arguments/TestG1RemSetFlags.java | 2 +- .../jtreg/gc/arguments/TestHeapFreeRatio.java | 2 +- .../TestInitialTenuringThreshold.java | 4 +- .../gc/arguments/TestMaxHeapSizeTools.java | 6 +- .../TestMaxMinHeapFreeRatioFlags.java | 6 +- .../jtreg/gc/arguments/TestMaxNewSize.java | 2 +- .../jtreg/gc/arguments/TestMaxRAMFlags.java | 6 +- .../TestMinAndInitialSurvivorRatioFlags.java | 4 +- .../jtreg/gc/arguments/TestNewRatioFlag.java | 4 +- .../jtreg/gc/arguments/TestNewSizeFlags.java | 4 +- .../arguments/TestNewSizeThreadIncrease.java | 16 ++-- .../gc/arguments/TestObjectTenuringFlags.java | 4 +- .../gc/arguments/TestParallelGCThreads.java | 8 +- .../gc/arguments/TestParallelRefProc.java | 4 +- .../gc/arguments/TestSelectDefaultGC.java | 4 +- ...tSmallInitialHeapWithLargePageAndNUMA.java | 4 +- .../gc/arguments/TestSurvivorRatioFlag.java | 4 +- .../TestTargetSurvivorRatioFlag.java | 6 +- .../TestUnrecognizedVMOptionsHandling.java | 8 +- .../TestUseCompressedOopsErgoTools.java | 6 +- .../TestUseCompressedOopsFlagsWithUlimit.java | 4 +- .../gc/arguments/TestUseNUMAInterleaving.java | 4 +- .../TestVerifyBeforeAndAfterGCFlags.java | 4 +- .../TestG1ClassUnloadingHWM.java | 4 +- .../jtreg/gc/epsilon/TestDieDefault.java | 4 +- .../jtreg/gc/epsilon/TestDieWithHeapDump.java | 4 +- .../jtreg/gc/epsilon/TestDieWithOnError.java | 4 +- .../TestDynamicNumberOfGCThreads.java | 6 +- .../TestInitialGCThreadLogging.java | 4 +- test/hotspot/jtreg/gc/g1/Test2GbHeap.java | 4 +- .../g1/TestEagerReclaimHumongousRegions.java | 4 +- ...rReclaimHumongousRegionsClearMarkBits.java | 2 +- .../TestEagerReclaimHumongousRegionsLog.java | 4 +- ...tEagerReclaimHumongousRegionsWithRefs.java | 4 +- .../jtreg/gc/g1/TestEvacuationFailure.java | 20 ++-- .../jtreg/gc/g1/TestG1SkipCompaction.java | 2 +- ...stG1TraceEagerReclaimHumongousObjects.java | 18 ++-- .../jtreg/gc/g1/TestGCLogMessages.java | 92 +++++++++---------- .../g1/TestHumongousAllocConcurrentStart.java | 4 +- .../TestHumongousAllocNearlyFullRegion.java | 4 +- .../gc/g1/TestHumongousCodeCacheRoots.java | 4 +- .../g1/TestHumongousConcurrentStartUndo.java | 4 +- .../gc/g1/TestLargePageUseForAuxMemory.java | 6 +- .../jtreg/gc/g1/TestLargePageUseForHeap.java | 26 +++--- .../jtreg/gc/g1/TestMarkStackSizes.java | 4 +- .../jtreg/gc/g1/TestMixedGCLiveThreshold.java | 4 +- .../jtreg/gc/g1/TestOneEdenRegionAfterGC.java | 4 +- test/hotspot/jtreg/gc/g1/TestPLABOutput.java | 4 +- .../jtreg/gc/g1/TestPLABSizeBounds.java | 4 +- .../jtreg/gc/g1/TestPeriodicLogMessages.java | 22 ++--- .../g1/TestPrintRegionRememberedSetInfo.java | 4 +- .../jtreg/gc/g1/TestRemsetLoggingThreads.java | 14 +-- .../jtreg/gc/g1/TestRemsetLoggingTools.java | 4 +- .../gc/g1/TestSharedArchiveWithPreTouch.java | 6 +- .../jtreg/gc/g1/TestShrinkAuxiliaryData.java | 4 +- .../gc/g1/TestShrinkDefragmentedHeap.java | 4 +- .../gc/g1/TestSkipRebuildRemsetPhase.java | 22 ++--- .../hotspot/jtreg/gc/g1/TestVerifyGCType.java | 4 +- .../jtreg/gc/g1/mixedgc/TestLogging.java | 4 +- .../gc/g1/numa/TestG1NUMATouchRegions.java | 4 +- .../gc/logging/TestDeprecatedPrintFlags.java | 10 +- test/hotspot/jtreg/gc/logging/TestGCId.java | 4 +- .../jtreg/gc/logging/TestMetaSpaceLog.java | 4 +- .../jtreg/gc/logging/TestPrintReferences.java | 24 ++--- .../gc/metaspace/TestMetaspaceSizeFlags.java | 4 +- .../gc/metaspace/TestSizeTransitions.java | 4 +- .../jtreg/gc/serial/HeapChangeLogging.java | 4 +- .../jtreg/gc/shenandoah/TestEvilSyncBug.java | 2 +- .../gc/shenandoah/TestObjItrWithHeapDump.java | 2 +- .../jtreg/gc/shenandoah/TestPeriodicGC.java | 2 +- .../gc/shenandoah/oom/TestAllocLargeObj.java | 4 +- .../oom/TestAllocLargerThanHeap.java | 4 +- .../gc/shenandoah/oom/TestAllocSmallObj.java | 4 +- .../shenandoah/oom/TestClassLoaderLeak.java | 2 +- .../gc/shenandoah/oom/TestThreadFailure.java | 2 +- .../options/TestArgumentRanges.java | 14 +-- .../options/TestClassUnloadingArguments.java | 2 +- .../gc/shenandoah/options/TestExplicitGC.java | 10 +- .../options/TestExplicitGCNoConcurrent.java | 2 +- .../options/TestHeuristicsUnlock.java | 6 +- .../options/TestHumongousThresholdArgs.java | 6 +- .../options/TestLoopMiningArguments.java | 2 +- .../gc/shenandoah/options/TestModeUnlock.java | 6 +- .../options/TestRegionSizeArgs.java | 32 +++---- .../options/TestSelectiveBarrierFlags.java | 2 +- .../options/TestSoftMaxHeapSize.java | 6 +- .../shenandoah/options/TestThreadCounts.java | 2 +- .../options/TestThreadCountsOverride.java | 4 +- .../options/TestWrongBarrierDisable.java | 4 +- .../options/TestWrongBarrierEnable.java | 4 +- .../jtreg/gc/startup_warnings/TestG1.java | 2 +- .../gc/startup_warnings/TestParallelGC.java | 2 +- .../gc/startup_warnings/TestSerialGC.java | 2 +- .../gc/startup_warnings/TestShenandoah.java | 2 +- .../stress/TestReclaimStringsLeaksMemory.java | 4 +- .../gc/stress/TestStressG1Humongous.java | 4 +- .../jtreg/gc/stress/TestStressG1Uncommit.java | 4 +- .../TestStringDeduplicationTools.java | 2 +- test/hotspot/jtreg/gc/whitebox/TestWBGC.java | 4 +- .../jtreg/gc/x/TestAllocateHeapAt.java | 4 +- .../jtreg/gc/x/TestPageCacheFlush.java | 4 +- test/hotspot/jtreg/gc/x/TestSmallHeap.java | 4 +- .../jtreg/gc/z/TestAllocateHeapAt.java | 2 +- .../jtreg/gc/z/TestPageCacheFlush.java | 2 +- test/hotspot/jtreg/gc/z/TestSmallHeap.java | 2 +- ...stZForceDiscontiguousHeapReservations.java | 2 +- test/hotspot/jtreg/gc/z/TestZNMT.java | 2 +- .../jvmti/GetObjectSizeOverflow.java | 4 +- .../7162488/TestUnrecognizedVmOption.java | 4 +- .../jtreg/runtime/8176717/TestInheritFD.java | 8 +- .../BadObjectClass/BootstrapRedefine.java | 4 +- .../BootClassPathAppend.java | 4 +- .../BootstrapMethod/BSMCalledTwice.java | 4 +- .../TestLambdaExceptionInInitializer.java | 2 +- .../CDSCompressedKPtrs.java | 6 +- .../CDSCompressedKPtrs/XShareAuto.java | 6 +- .../runtime/ClassFile/FormatCheckingTest.java | 4 +- .../jtreg/runtime/ClassFile/JsrRewriting.java | 4 +- .../ClassFile/OomWhileParsingRepeatedJsr.java | 4 +- .../runtime/ClassFile/PreviewVersion.java | 8 +- .../ClassFile/TestCheckedExceptions.java | 4 +- .../UnsupportedClassFileVersion.java | 4 +- .../BooleanFlagWithInvalidValue.java | 4 +- .../CompilerConfigFileWarning.java | 4 +- .../CommandLine/ConfigFileParsing.java | 2 +- .../CommandLine/ConfigFileWarning.java | 4 +- .../DoubleFlagWithIntegerValue.java | 2 +- .../CommandLine/FlagWithInvalidValue.java | 2 +- .../IgnoreUnrecognizedVMOptions.java | 2 +- ...onBooleanFlagWithInvalidBooleanPrefix.java | 4 +- .../CommandLine/ObsoleteFlagErrorMessage.java | 4 +- .../OptionsValidation/TestJcmdOutput.java | 2 +- .../common/optionsvalidation/JVMOption.java | 4 +- .../optionsvalidation/JVMOptionsUtils.java | 4 +- .../runtime/CommandLine/TestHexArguments.java | 4 +- .../TestLongUnrecognizedVMOption.java | 2 +- .../CommandLine/TestNullTerminatedFlags.java | 2 +- .../runtime/CommandLine/TestVMOptions.java | 6 +- .../CommandLine/TraceExceptionsTest.java | 2 +- .../CommandLine/UnrecognizedVMOption.java | 2 +- .../CommandLine/VMDeprecatedOptions.java | 4 +- .../runtime/CommandLine/VMOptionWarning.java | 8 +- .../VMOptionsFile/TestVMOptionsFile.java | 2 +- .../CompressedClassPointers.java | 30 +++--- .../CompressedClassSpaceSize.java | 36 ++++---- .../CompressedKlassPointerAndOops.java | 4 +- .../CompressedOops/ObjectAlignment.java | 6 +- .../CompressedOops/UseCompressedOops.java | 4 +- .../Dictionary/CleanProtectionDomain.java | 4 +- .../Dictionary/ProtectionDomainCacheTest.java | 4 +- .../EnclosingMethodAttr/EnclMethodAttr.java | 4 +- .../BadNativeStackInErrorHandlingTest.java | 2 +- .../ErrorHandling/ClassPathEnvVar.java | 8 +- .../ErrorHandling/CreateCoredumpOnCrash.java | 4 +- .../ErrorHandling/ErrorFileOverwriteTest.java | 4 +- .../ErrorHandling/ErrorFileRedirectTest.java | 2 +- .../MachCodeFramesInErrorFile.java | 2 +- ...dThreadsListHandleInErrorHandlingTest.java | 2 +- .../ErrorHandling/ProblematicFrameTest.java | 2 +- .../ErrorHandling/ReattemptErrorTest.java | 2 +- .../ErrorHandling/ResourceMarkTest.java | 2 +- .../SafeFetchInErrorHandlingTest.java | 2 +- .../ErrorHandling/SecondaryErrorTest.java | 2 +- .../ShowRegistersOnAssertTest.java | 2 +- .../ErrorHandling/StackWalkNativeToJava.java | 4 +- .../ErrorHandling/TestAbortVmOnException.java | 4 +- .../TestCrashOnOutOfMemoryError.java | 2 +- .../runtime/ErrorHandling/TestDwarf.java | 2 +- .../TestExitOnOutOfMemoryError.java | 2 +- ...TestGZippedHeapDumpOnOutOfMemoryError.java | 2 +- .../TestHeapDumpOnOutOfMemoryError.java | 2 +- .../ErrorHandling/TestHeapDumpPath.java | 2 +- .../runtime/ErrorHandling/TestOnError.java | 2 +- .../ErrorHandling/TestOnOutOfMemoryError.java | 4 +- .../ErrorHandling/TestSigInfoInHsErrFile.java | 2 +- .../ErrorHandling/TestSymbolsInHsErrFile.java | 2 +- .../ThreadsListHandleInErrorHandlingTest.java | 2 +- .../TimeoutInErrorHandlingTest.java | 2 +- .../ErrorHandling/VeryEarlyAssertTest.java | 2 +- .../TestGenerateOopMapCrash.java | 4 +- .../InvocationTests/invocationC1Tests.java | 4 +- .../invocationOldCHATests.java | 4 +- .../InvocationTests/invokeinterfaceTests.java | 4 +- .../InvocationTests/invokespecialTests.java | 4 +- .../InvocationTests/invokevirtualTests.java | 4 +- .../runtime/LoadClass/LoadClassNegative.java | 4 +- .../jtreg/runtime/LoadClass/LongBCP.java | 14 +-- .../jtreg/runtime/LoadClass/TestResize.java | 10 +- .../runtime/LocalLong/LocalLongTest.java | 12 +-- .../runtime/LocalVariableTable/TestLVT.java | 8 +- .../runtime/MemberName/MemberNameLeak.java | 4 +- .../Metaspace/MaxMetaspaceSizeEnvVarTest.java | 8 +- .../Metaspace/MaxMetaspaceSizeTest.java | 4 +- test/hotspot/jtreg/runtime/MinimalVM/CDS.java | 8 +- .../jtreg/runtime/MinimalVM/CheckJNI.java | 4 +- .../runtime/MinimalVM/Instrumentation.java | 4 +- test/hotspot/jtreg/runtime/MinimalVM/JMX.java | 6 +- .../jtreg/runtime/MinimalVM/JVMTI.java | 4 +- test/hotspot/jtreg/runtime/MinimalVM/NMT.java | 8 +- .../Monitor/DeflationIntervalsTest.java | 2 +- .../MonitorUsedDeflationThresholdTest.java | 4 +- .../Monitor/SyncOnValueBasedClassTest.java | 8 +- .../NMT/CheckForProperDetailStackTrace.java | 2 +- .../jtreg/runtime/NMT/CommandLineDetail.java | 2 +- .../runtime/NMT/CommandLineEmptyArgument.java | 2 +- .../NMT/CommandLineInvalidArgument.java | 2 +- .../jtreg/runtime/NMT/CommandLineSummary.java | 2 +- .../runtime/NMT/CommandLineTurnOffNMT.java | 2 +- .../runtime/NMT/JcmdWithNMTDisabled.java | 4 +- .../jtreg/runtime/NMT/MallocLimitTest.java | 2 +- .../runtime/NMT/NMTInitializationTest.java | 2 +- .../jtreg/runtime/NMT/NMTJavaHeapTest.java | 2 +- .../hotspot/jtreg/runtime/NMT/NMTWithCDS.java | 4 +- .../jtreg/runtime/NMT/PrintNMTStatistics.java | 4 +- .../PrintNMTStatisticsWithNMTDisabled.java | 2 +- .../PerfMemDestroy/PerfMemDestroy.java | 4 +- .../PrintStringTableStatsTest.java | 4 +- .../ReservedStack/ReservedStackTest.java | 4 +- .../TestAbortOnVMOperationTimeout.java | 2 +- .../TestAbortVMOnSafepointTimeout.java | 4 +- .../runtime/StackTrace/LargeClassTest.java | 4 +- .../Thread/TestAlwaysPreTouchStacks.java | 4 +- .../Thread/TestBreakSignalThreadDump.java | 4 +- .../runtime/Thread/TooSmallStackSize.java | 6 +- .../runtime/Throwable/StackTraceLogging.java | 12 +-- .../Throwable/TestCatchThrowableOOM.java | 8 +- .../Throwable/TestMaxJavaStackTraceDepth.java | 12 +-- .../jtreg/runtime/Unsafe/RangeCheck.java | 4 +- .../runtime/XCheckJniJsig/XCheckJSig.java | 6 +- .../jtreg/runtime/cds/MaxMetaspaceSize.java | 4 +- .../jtreg/runtime/cds/SharedStrings.java | 6 +- .../jtreg/runtime/cds/TestCDSVMCrash.java | 2 +- .../cds/appcds/CommandLineFlagCombo.java | 2 +- .../cds/appcds/FillerObjectLoadTest.java | 4 +- .../jtreg/runtime/cds/appcds/TestCommon.java | 6 +- .../cds/appcds/TestDumpClassListSource.java | 14 +-- .../cds/appcds/VerifyWithDefaultArchive.java | 2 +- .../DynamicArchiveTestBase.java | 4 +- .../cds/appcds/jcmd/JCmdTestDynamicDump.java | 4 +- .../ResolvedReferencesNotNullTest.java | 16 ++-- .../classFileParserBug/Bad_NCDFE_Msg.java | 4 +- .../ClassFileParserBug.java | 4 +- .../TestBadPackageWithInterface.java | 4 +- .../TestEmptyBootstrapMethodsAttr.java | 6 +- .../jtreg/runtime/condy/BadBSMUseTest.java | 6 +- .../jtreg/runtime/condy/CondyLDCTest.java | 14 +-- .../condy/CondyNewInvokeSpecialTest.java | 6 +- .../condy/escapeAnalysis/TestEscapeCondy.java | 4 +- .../condy/staticInit/TestInitException.java | 4 +- .../jtreg/runtime/contended/Options.java | 24 ++--- .../duplAttributes/DuplAttributesTest.java | 4 +- .../runtime/execstack/Testexecstack.java | 8 +- .../GetPackageXbootclasspath.java | 4 +- .../runtime/getSysPackage/GetSysPkgTest.java | 4 +- .../handshake/HandshakeTimeoutTest.java | 4 +- .../handshake/HandshakeTransitionTest.java | 4 +- .../SystemMembarHandshakeTransitionTest.java | 4 +- .../TestCheckedReleaseArrayElements.java | 8 +- ...estPrimitiveArrayCriticalWithBadParam.java | 2 +- test/hotspot/jtreg/runtime/jsig/Testjsig.java | 4 +- .../logging/ClassInitializationTest.java | 18 ++-- .../runtime/logging/ClassLoadUnloadTest.java | 4 +- .../runtime/logging/ClassResolutionTest.java | 12 +-- .../runtime/logging/CompressedOopsTest.java | 20 ++-- .../jtreg/runtime/logging/CondyIndyTest.java | 22 ++--- .../runtime/logging/DefaultMethodsTest.java | 6 +- .../jtreg/runtime/logging/ExceptionsTest.java | 20 ++-- .../runtime/logging/FoldMultilinesTest.java | 8 +- .../jtreg/runtime/logging/ItablesTest.java | 6 +- .../logging/LoaderConstraintsTest.java | 4 +- .../jtreg/runtime/logging/ModulesTest.java | 4 +- .../runtime/logging/MonitorInflationTest.java | 10 +- .../runtime/logging/MonitorMismatchTest.java | 18 ++-- .../jtreg/runtime/logging/MutexRankTest.java | 4 +- .../runtime/logging/OsCpuLoggingTest.java | 8 +- .../ProtectionDomainVerificationTest.java | 26 +++--- .../runtime/logging/SafepointCleanupTest.java | 10 +- .../jtreg/runtime/logging/SafepointTest.java | 6 +- .../jtreg/runtime/logging/StackWalkTest.java | 10 +- .../runtime/logging/StartupTimeTest.java | 10 +- .../runtime/logging/ThreadLoggingTest.java | 6 +- .../runtime/logging/VMOperationTest.java | 10 +- .../runtime/logging/VerificationTest.java | 14 +-- .../jtreg/runtime/logging/VtablesTest.java | 6 +- .../loadLibraryTest/LoadLibraryTest.java | 4 +- .../LargePages/TestLargePagesFlags.java | 4 +- .../runtime/memory/ReadFromNoaccessArea.java | 4 +- .../jtreg/runtime/memory/ReserveMemory.java | 4 +- .../ClassLoaderNoUnnamedModuleTest.java | 4 +- .../modules/IgnoreModulePropertiesTest.java | 6 +- .../runtime/modules/ModuleOptionsTest.java | 6 +- .../runtime/modules/ModuleOptionsWarn.java | 24 ++--- .../ModuleStress/ExportModuleStressTest.java | 4 +- .../modules/ModuleStress/ModuleStress.java | 10 +- .../modules/ModuleStress/ModuleStressGC.java | 4 +- .../modules/PatchModule/PatchModule2Dirs.java | 4 +- .../modules/PatchModule/PatchModuleCDS.java | 10 +- .../PatchModule/PatchModuleClassList.java | 8 +- .../PatchModule/PatchModuleDupJavaBase.java | 4 +- .../PatchModule/PatchModuleDupModule.java | 4 +- .../PatchModule/PatchModuleJavaBase.java | 4 +- .../modules/PatchModule/PatchModuleTest.java | 4 +- .../PatchModule/PatchModuleTestJar.java | 4 +- .../PatchModule/PatchModuleTestJarDir.java | 16 ++-- .../PatchModule/PatchModuleTraceCL.java | 6 +- .../Visibility/PatchModuleVisibility.java | 4 +- .../Visibility/XbootcpNoVisibility.java | 4 +- .../modules/Visibility/XbootcpVisibility.java | 4 +- .../jtreg/runtime/os/AvailableProcessors.java | 6 +- .../os/THPsInThreadStackPreventionTest.java | 4 +- .../os/TestHugePageDecisionsAtVMStartup.java | 2 +- .../runtime/os/TestHugePageDetection.java | 2 +- .../jtreg/runtime/os/TestTimerSlack.java | 8 +- .../jtreg/runtime/os/TestTrimNative.java | 2 +- .../jtreg/runtime/os/TestUseCpuAllocPath.java | 10 +- .../jtreg/runtime/posixSig/TestPosixSig.java | 4 +- .../jtreg/runtime/records/RedefineRecord.java | 4 +- .../RedefinePermittedSubclass.java | 4 +- .../sealedClasses/RedefineSealedClass.java | 4 +- .../stringtable/StringTableVerifyTest.java | 4 +- .../symboltable/ShortLivedSymbolCleanup.java | 12 +-- .../jtreg/runtime/verifier/OverriderMsg.java | 4 +- .../jtreg/runtime/verifier/TestANewArray.java | 8 +- .../runtime/verifier/TestMultiANewArray.java | 4 +- .../jtreg/runtime/verifier/TraceClassRes.java | 4 +- .../whitebox/TestWBDeflateIdleMonitors.java | 4 +- .../attach/AttachSetGetFlag.java | 2 +- .../attach/AttachWithStalePidFile.java | 4 +- .../serviceability/attach/ShMemLongName.java | 2 +- .../dcmd/gc/RunFinalizationTest.java | 4 +- .../dtrace/DTraceOptionsTest.java | 2 +- .../serviceability/jdwp/DebuggeeLauncher.java | 2 +- .../CanGenerateAllClassHook.java | 4 +- .../jvmti/GetObjectSizeClass.java | 4 +- .../jvmti/RedefineClasses/RedefineLeak.java | 4 +- .../RedefinePreviousVersions.java | 4 +- .../RedefineSharedClassJFR.java | 4 +- .../RetransformClassesZeroLength.java | 4 +- .../TransformerDeadlockTest.java | 4 +- .../vthread/premain/AgentWithVThreadTest.java | 2 +- .../logging/TestBasicLogOutput.java | 4 +- .../logging/TestDefaultLogOutput.java | 4 +- .../serviceability/logging/TestFullNames.java | 8 +- .../logging/TestLogRotation.java | 4 +- .../logging/TestMultipleXlogArgs.java | 16 ++-- .../logging/TestQuotedLogOutputs.java | 14 +-- .../serviceability/sa/ClhsdbCDSCore.java | 4 +- .../serviceability/sa/TestClassDump.java | 6 +- .../sa/TestCpoolForInvokeDynamic.java | 4 +- .../serviceability/sa/TestDefaultMethods.java | 4 +- .../serviceability/sa/TestG1HeapRegion.java | 4 +- .../sa/TestInstanceKlassSize.java | 4 +- .../sa/TestInstanceKlassSizeForInterface.java | 4 +- .../jtreg/serviceability/sa/TestJmapCore.java | 4 +- .../sa/TestObjectAlignment.java | 4 +- .../sa/TestObjectMonitorIterate.java | 2 +- .../sa/TestRevPtrsForInvokeDynamic.java | 4 +- .../serviceability/sa/UniqueVtableTest.java | 2 +- .../sa/jmap-hprof/JMapHProfLargeHeapTest.java | 2 +- .../src/sun/hotspot/tools/ctw/CtwRunner.java | 2 +- .../lib/jittester/jtreg/JitTesterDriver.java | 4 +- .../jtreg/testlibrary_tests/ctw/CtwTest.java | 4 +- .../ir_framework/tests/TestDScenarios.java | 4 +- .../tests/TestDTestAndExclude.java | 4 +- .../largeheap/MemOptions/MemOptionsTest.java | 6 +- .../TestMaxMetaspaceSize.java | 6 +- .../nsk/jvmti/Allocate/alloc001/alloc001.java | 4 +- .../retransform003/TestDriver.java | 4 +- .../SetNativeMethodPrefix002/TestDriver.java | 4 +- .../vm/compiler/CodeCacheInfo/Test.java | 6 +- .../CodeCacheInfoOnCompilation/Test.java | 4 +- test/jdk/com/sun/jdi/JITDebug.java | 4 +- test/jdk/com/sun/jdi/NoLaunchOptionTest.java | 4 +- .../jdk/com/sun/jdi/PrivateTransportTest.java | 4 +- test/jdk/com/sun/jdi/ProcessAttachTest.java | 2 +- test/jdk/com/sun/jdi/RunToExit.java | 4 +- test/jdk/com/sun/jdi/cds/CDSJDITest.java | 6 +- test/jdk/com/sun/jdi/lib/jdb/Debuggee.java | 2 +- .../HotSpotDiagnosticMXBean/CheckOrigin.java | 2 +- test/jdk/com/sun/tools/attach/RunnerUtil.java | 4 +- .../java/awt/MenuBar/TestNoScreenMenuBar.java | 4 +- .../java/awt/Robot/NonEmptyErrorStream.java | 4 +- .../ScreenInsetsDPIVariation.java | 4 +- .../MainKeyWindowTest/TestMainKeyWindow.java | 4 +- .../MinimumSizeDPIVariation.java | 4 +- .../MTTransformReplacedProfile.java | 4 +- .../font/JNICheck/FreeTypeScalerJNICheck.java | 4 +- test/jdk/java/foreign/UpcallTestHelper.java | 2 +- test/jdk/java/io/Console/RedirectTest.java | 2 +- test/jdk/java/io/File/MacPath.java | 4 +- .../class/NonSerializableTest.java | 4 +- .../RenamePackage/RenamePackageTest.java | 6 +- .../lang/ClassLoader/GetSystemPackage.java | 4 +- .../Object/InvalidFinalizationOption.java | 4 +- .../lang/ProcessBuilder/InheritIOTest.java | 4 +- .../ProcessBuilder/JspawnhelperProtocol.java | 24 ++--- .../lang/ProcessBuilder/ReaderWriterTest.java | 12 +-- .../shutdown/ShutdownInterruptedMain.java | 6 +- .../modules/CustomSecurityManagerTest.java | 4 +- .../java/lang/StackWalker/CallerFromMain.java | 4 +- .../java/lang/System/FileEncodingTest.java | 4 +- .../System/MacEncoding/MacJNUEncoding.java | 4 +- test/jdk/java/lang/System/i18nEnvArg.java | 4 +- .../lang/Thread/UncaughtExceptionsTest.java | 2 +- .../lang/Thread/virtual/ShutdownHook.java | 4 +- .../java/lang/annotation/LoaderLeakTest.java | 4 +- .../TestDaemonThreadLauncher.java | 4 +- .../lang/instrument/NegativeAgentRunner.java | 4 +- .../PremainClass/PremainClassTest.java | 4 +- .../modules/AppendToClassPathModuleTest.java | 2 +- .../condy/CondyNestedResolutionTest.java | 4 +- .../channels/Selector/LotsOfUpdatesTest.java | 4 +- .../charset/Charset/DefaultCharsetTest.java | 4 +- test/jdk/java/nio/file/Path/MacPathTest.java | 6 +- .../SignedJarWithCustomClassLoader.java | 6 +- .../util/Formatter/BasicTestLauncher.java | 4 +- .../Properties/StoreReproducibilityTest.java | 16 ++-- .../util/TimeZone/CustomTzIDCheckDST.java | 4 +- .../connection/DefaultAgentFilterTest.java | 2 +- .../security/HashedPasswordFileTest.java | 4 +- .../net/ssl/TLSCommon/interop/ProcUtils.java | 6 +- .../UnninstallUIMemoryLeaks.java | 4 +- .../javax/swing/text/html/CSS/bug8234913.java | 4 +- .../jdk/incubator/vector/LoadJsvmlTest.java | 4 +- .../internal/misc/VM/RuntimeArguments.java | 2 +- .../api/consumer/streaming/Application.java | 4 +- .../streaming/TestCrossProcessStreaming.java | 4 +- .../api/consumer/streaming/TestProcess.java | 4 +- ...onConfigurationEventWithMinAndMaxSize.java | 4 +- .../os/TestInitialEnvironmentVariable.java | 4 +- .../jdk/jfr/event/runtime/TestDumpReason.java | 4 +- .../jfr/event/runtime/TestShutdownEvent.java | 2 +- test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java | 2 +- test/jdk/jdk/jfr/jvm/TestEventWriterLog.java | 2 +- .../jfr/startupargs/TestBadOptionValues.java | 4 +- .../jdk/jfr/startupargs/TestDumpOnExit.java | 4 +- .../jdk/jfr/startupargs/TestJFCWarnings.java | 4 +- .../jfr/startupargs/TestMemoryOptions.java | 24 ++--- .../TestMultipleStartupRecordings.java | 10 +- .../startupargs/TestOptionsWithLocale.java | 2 +- .../startupargs/TestPreserveRepository.java | 2 +- .../startupargs/TestRetransformUsingLog.java | 4 +- .../jfr/startupargs/TestStartDuration.java | 6 +- .../jdk/jfr/startupargs/TestStartName.java | 4 +- .../jfr/startupargs/TestStartupMessage.java | 4 +- .../JavaDotSecurity/MakeJavaSecurityTest.java | 4 +- .../MonitoredVm/MonitorVmStartTerminate.java | 2 +- .../sun/management/jdp/DynamicLauncher.java | 2 +- .../bootstrap/AbstractFilePermissionTest.java | 2 +- .../bootstrap/CustomLauncherTest.java | 2 +- .../bootstrap/JMXInterfaceBindingTest.java | 2 +- .../bootstrap/LocalManagementTest.java | 4 +- .../bootstrap/RmiRegistrySslTest.java | 2 +- .../jmxremote/startstop/JMXStartStopTest.java | 2 +- .../startstop/JMXStatusPerfCountersTest.java | 2 +- .../jmxremote/startstop/JMXStatusTest.java | 2 +- test/jdk/sun/net/spi/SystemProxyDriver.java | 2 +- .../sun/security/krb5/auto/ModuleName.java | 4 +- .../security/provider/KeyStore/DKSTest.java | 2 +- .../ssl/SSLEngineImpl/SSLEngineKeyLimit.java | 2 +- .../ResumptionUpdateBoundValues.java | 4 +- .../ssl/SSLSocketImpl/SSLSocketKeyLimit.java | 2 +- test/jdk/sun/tools/jstat/JStatInterval.java | 2 +- test/jdk/tools/jimage/JImageToolTest.java | 4 +- .../launcher/modules/basic/BasicTest.java | 4 +- .../modules/classpath/JavaClassPathTest.java | 2 +- .../lib/process/ProcessToolsLastLineTest.java | 2 +- test/lib/jdk/test/lib/cds/CDSTestUtils.java | 4 +- .../test/lib/cli/CommandLineOptionTest.java | 8 +- .../jdk/test/lib/jfr/AppExecutorHelper.java | 4 +- .../jdk/test/lib/process/ProcessTools.java | 64 ++++++++++--- 566 files changed, 1569 insertions(+), 1535 deletions(-) diff --git a/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java b/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java index e5d3df3dc0f..7505c6972d4 100644 --- a/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java +++ b/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java @@ -65,7 +65,7 @@ public static void main(String[] args) throws Throwable { } Path out = Paths.get("jcstress.out").toAbsolutePath(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(getCmd(args)) + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(getCmd(args)) .redirectErrorStream(true) .redirectOutput(out.toFile()); OutputAnalyzer oa = ProcessTools.executeProcess(pb); diff --git a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java index 2571a64df7b..d999b8a2b29 100644 --- a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java +++ b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java @@ -109,7 +109,7 @@ public static void main(String[] args) throws IOException { Path output; try { output = Files.createTempFile("jcstress", ".out"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-jar", path.toAbsolutePath().toString(), "-l"); diff --git a/test/hotspot/jtreg/applications/scimark/Scimark.java b/test/hotspot/jtreg/applications/scimark/Scimark.java index 8aab97aa2bc..ee4f6f7cef9 100644 --- a/test/hotspot/jtreg/applications/scimark/Scimark.java +++ b/test/hotspot/jtreg/applications/scimark/Scimark.java @@ -48,7 +48,7 @@ public static void main(String... args) throws Exception { System.setProperty("test.noclasspath", "true"); - OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJvm( + OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJavaProcessBuilder( "-cp", artifacts.get("gov.nist.math.scimark-2.0").toString(), "jnt.scimark2.commandline", "-large") .start()); diff --git a/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java b/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java index da007dd0da9..6f137e20261 100644 --- a/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java +++ b/test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -190,7 +190,7 @@ private static void verifyValidOption(String[] arguments, String expected_output ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); try { diff --git a/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java b/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java index fb9fe26179f..d03aced702e 100644 --- a/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java +++ b/test/hotspot/jtreg/compiler/arguments/CheckCompileThresholdScaling.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -338,7 +338,7 @@ private static void verifyValidOption(String[] arguments, String[] expected_outp ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); try { diff --git a/test/hotspot/jtreg/compiler/arguments/TestCodeEntryAlignment.java b/test/hotspot/jtreg/compiler/arguments/TestCodeEntryAlignment.java index 15a60382245..465999eac7f 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestCodeEntryAlignment.java +++ b/test/hotspot/jtreg/compiler/arguments/TestCodeEntryAlignment.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, Red Hat, Inc. All rights reserved. - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -61,7 +61,7 @@ private static List cmdline(String[] args) { } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/compiler/arguments/TestOptoLoopAlignment.java b/test/hotspot/jtreg/compiler/arguments/TestOptoLoopAlignment.java index 15f9bebc229..3993c679441 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestOptoLoopAlignment.java +++ b/test/hotspot/jtreg/compiler/arguments/TestOptoLoopAlignment.java @@ -62,14 +62,14 @@ private static List cmdline(String[] args) { } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff --git a/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java b/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java index 1d029aabc0f..1fddeeb50e8 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java +++ b/test/hotspot/jtreg/compiler/arguments/TestPrintOptoAssemblyLineNumbers.java @@ -1,6 +1,6 @@ /* * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -51,7 +51,7 @@ public static void main(String[] args) throws Throwable { CheckC2OptoAssembly.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java b/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java index 5153f85c9d7..55dfb0460a2 100644 --- a/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java +++ b/test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java @@ -173,7 +173,7 @@ public static void main(String... args) throws Exception { for (String className : classNames) { // Start a new job { - ProcessBuilder pb = ProcessTools.createTestJvm(mix(c, "-Xmx256m", className)); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(mix(c, "-Xmx256m", className)); Process p = pb.start(); OutputAnalyzer oa = new OutputAnalyzer(p); forks.add(new Fork(p, oa)); diff --git a/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java b/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java index 8d43b1e85a3..104e7661e7e 100644 --- a/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java +++ b/test/hotspot/jtreg/compiler/blackhole/BlackholeExistingIntrinsicWarningTest.java @@ -65,14 +65,14 @@ private static List cmdline(String[] args) { } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff --git a/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java b/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java index 226c28251f2..6597b2186f2 100644 --- a/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java +++ b/test/hotspot/jtreg/compiler/blackhole/BlackholeExperimentalUnlockTest.java @@ -65,14 +65,14 @@ private static List cmdline(String[] args) { } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff --git a/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java b/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java index a7a72a56ff1..8c8cbc5e88d 100644 --- a/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java +++ b/test/hotspot/jtreg/compiler/blackhole/BlackholeIntrinsicTest.java @@ -134,7 +134,7 @@ public static void check(String test, String... args) throws IOException { cmdline.add("compiler.blackhole.BlackholeIntrinsicTest"); cmdline.add(test); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.stderrShouldBeEmpty(); diff --git a/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java b/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java index 43cbdfd773b..c07754b37ea 100644 --- a/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java +++ b/test/hotspot/jtreg/compiler/blackhole/BlackholeNonEmptyWarningTest.java @@ -64,14 +64,14 @@ private static List cmdline(String[] args) { } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff --git a/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java b/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java index f9e12ba3f9d..ff84070b4e1 100644 --- a/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java +++ b/test/hotspot/jtreg/compiler/blackhole/BlackholeNonStaticWarningTest.java @@ -64,14 +64,14 @@ private static List cmdline(String[] args) { } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff --git a/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java b/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java index 555f6779124..c3a780576fe 100644 --- a/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java +++ b/test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java @@ -64,14 +64,14 @@ private static List cmdline(String[] args) { } public static void shouldFail(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain(MSG); } public static void shouldPass(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotContain(MSG); diff --git a/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java b/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java index 7d4dd350e03..9da8a5390da 100644 --- a/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java +++ b/test/hotspot/jtreg/compiler/c1/TestRangeCheckEliminated.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -54,7 +54,7 @@ public static void main(String[] args) throws Throwable { test_constant_array.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); String output = new OutputAnalyzer(pb.start()).getOutput(); // should have 2 "can be fully eliminated" System.out.println(output); @@ -74,7 +74,7 @@ public static void main(String[] args) throws Throwable { test_multi_constant_array.class.getName() }; - pb = ProcessTools.createJavaProcessBuilder(procArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); output = new OutputAnalyzer(pb.start()).getOutput(); // should have 1 "can be fully eliminated" System.out.println(output); @@ -94,7 +94,7 @@ public static void main(String[] args) throws Throwable { test_multi_new_array.class.getName() }; - pb = ProcessTools.createJavaProcessBuilder(procArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); output = new OutputAnalyzer(pb.start()).getOutput(); // should have 2 "can be fully eliminated" System.out.println(output); diff --git a/test/hotspot/jtreg/compiler/c2/TestBit.java b/test/hotspot/jtreg/compiler/c2/TestBit.java index 02596b7ee55..a3c9421a3f9 100644 --- a/test/hotspot/jtreg/compiler/c2/TestBit.java +++ b/test/hotspot/jtreg/compiler/c2/TestBit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -49,7 +49,7 @@ static void runTest(String testName) throws Exception { "-XX:CompileCommand=compileonly," + className + "::tst*", className, testName}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String expectedTestBitInstruction = diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java index f47331a6d80..d461d56d8a3 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java @@ -95,7 +95,7 @@ static void runVM(boolean bigCodeHeap) throws Exception { "-XX:+PrintAssembly", className}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); List lines = output.asLines(); diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java index eeb10e99547..81abcd27959 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java @@ -1,27 +1,27 @@ /* -* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. -* Copyright (c) 2020, 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. -* -*/ + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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. + * + */ /** * @test @@ -79,7 +79,7 @@ public static ProcessBuilder createProcessBuilder(String [] args, String mode) { Collections.addAll(vmopts, "-Dtest.jdk=" + testjdkPath); Collections.addAll(vmopts, args); Collections.addAll(vmopts, TestSVEWithJNI.class.getName(), mode); - return ProcessTools.createJavaProcessBuilder(vmopts.toArray(new String[vmopts.size()])); + return ProcessTools.createLimitedTestJavaProcessBuilder(vmopts.toArray(new String[vmopts.size()])); } public static void main(String [] args) throws Exception { diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestTrampoline.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestTrampoline.java index cf763555ebc..114f7f9bfab 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestTrampoline.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestTrampoline.java @@ -57,7 +57,7 @@ public static void main(String[] args) throws Exception { command.add("-XX:ReservedCodeCacheSize=130M"); command.add("-XX:+SegmentedCodeCache"); command.add(testClassName); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); analyzer.shouldHaveExitValue(0); System.out.println(analyzer.getOutput()); diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java index 055d54ccb4f..10bc237f2be 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -132,7 +132,7 @@ public void runtest(String classname, String testType) throws Throwable { public void runtest(String classname, String testType, boolean useCompressedOops, String[] procArgs) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.stderrShouldBeEmptyIgnoreVMWarnings(); diff --git a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java index a025962081c..6ad45edd26b 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -177,11 +177,11 @@ public boolean generateReplay(boolean needCoreDump, String... vmopts) { options.add("'" + getTestClass() + "'"); crashOut = ProcessTools.executeProcess( CoreUtils.addCoreUlimitCommand( - ProcessTools.createTestJvm(options.toArray(new String[0])))); + ProcessTools.createTestJavaProcessBuilder(options.toArray(new String[0])))); } else { options.add("-XX:CompileOnly=" + getTestClass() + "::" + getTestMethod()); options.add(getTestClass()); - crashOut = ProcessTools.executeProcess(ProcessTools.createTestJvm(options)); + crashOut = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(options)); } crashOutputString = crashOut.getOutput(); Asserts.assertNotEquals(crashOut.getExitValue(), 0, "Crash JVM exits gracefully"); @@ -288,7 +288,7 @@ public void nonTieredTests(int compLevel) { private String[] getTestJvmCommandlineWithPrefix(String prefix, String... args) { try { - String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJvm(args)); + String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJavaProcessBuilder(args)); return new String[]{"sh", "-c", prefix + (Platform.isWindows() ? cmd.replace('\\', '/').replace(";", "\\;").replace("|", "\\|") : cmd)}; } catch(Throwable t) { diff --git a/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java index 4d783993578..3597c0729a1 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -79,7 +79,7 @@ public boolean generateReplay(String... vmopts) { options.add("-XX:CompileCommand=compileonly," + getTestClass() + "::" + getTestMethod()); options.add("-Xbatch"); options.add(getTestClass()); - oa = ProcessTools.executeProcess(ProcessTools.createTestJvm(options)); + oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(options)); Asserts.assertEquals(oa.getExitValue(), 0, "Crash JVM exits gracefully"); replayFiles = Files.list(Paths.get(".")) .map(Path::toFile) diff --git a/test/hotspot/jtreg/compiler/ciReplay/SABase.java b/test/hotspot/jtreg/compiler/ciReplay/SABase.java index db576d73631..66f2eb1106f 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/SABase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/SABase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -71,7 +71,7 @@ public void testAction() { } ProcessBuilder pb; try { - pb = ProcessTools.createTestJvm("--add-modules", "jdk.hotspot.agent", + pb = ProcessTools.createTestJavaProcessBuilder("--add-modules", "jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "sun.jvm.hotspot.CLHSDB", JDKToolFinder.getTestJDKTool("java"), TEST_CORE_FILE_NAME); diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java b/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java index 8112a7a43f6..45a2e647c80 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java +++ b/test/hotspot/jtreg/compiler/ciReplay/TestInvalidReplayFile.java @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception { w.flush(); w.close(); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:+ReplayCompiles", "-XX:ReplayDataFile=./bogus-replay-file.txt"); diff --git a/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java b/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java index 53d555ee139..f6a2536515e 100644 --- a/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java +++ b/test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java @@ -66,9 +66,9 @@ public class CheckCodeCacheInfo { public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createTestJvm("-XX:+PrintCodeCache", - "-XX:+Verbose", - "-version"); + pb = ProcessTools.createTestJavaProcessBuilder("-XX:+PrintCodeCache", + "-XX:+Verbose", + "-version"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); out.stdoutShouldMatch(VERBOSE_REGEXP); diff --git a/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java b/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java index 8e2db5067d8..5e05a0fae57 100644 --- a/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java +++ b/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java @@ -50,7 +50,7 @@ public static void main(String[] args) throws Exception { final boolean largePages = WHITE_BOX.getBooleanVMFlag("UseLargePages"); final long largePageSize = WHITE_BOX.getVMLargePageSize(); if (largePages && (largePageSize == 1024 * 1024 * 1024)) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseLargePages", "-XX:+SegmentedCodeCache", "-XX:InitialCodeCacheSize=2g", diff --git a/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java b/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java index 63e7f83a303..f4a1cc3f0e7 100644 --- a/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java +++ b/test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -42,8 +42,8 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb1, pb2; OutputAnalyzer out1, out2; - pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version"); - pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version"); + pb1 = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version"); + pb2 = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version"); out1 = new OutputAnalyzer(pb1.start()); out2 = new OutputAnalyzer(pb2.start()); diff --git a/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java b/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java index ae884a1fa8c..f79d7da7695 100644 --- a/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java +++ b/test/hotspot/jtreg/compiler/codecache/CheckSegmentedCodeCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -89,80 +89,80 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; // Disabled with ReservedCodeCacheSize < 240MB - pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, false); // Disabled without TieredCompilation - pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-TieredCompilation", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, false); // Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB - pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", - "-XX:ReservedCodeCacheSize=240m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+TieredCompilation", + "-XX:ReservedCodeCacheSize=240m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); - pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", - "-XX:ReservedCodeCacheSize=400m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+TieredCompilation", + "-XX:ReservedCodeCacheSize=400m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); // Always enabled if SegmentedCodeCache is set - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:-TieredCompilation", - "-XX:ReservedCodeCacheSize=239m", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:-TieredCompilation", + "-XX:ReservedCodeCacheSize=239m", + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); // The profiled and non-profiled code heaps should not be available in // interpreter-only mode - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-Xint", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-Xint", + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED); // If we stop compilation at CompLevel_none or CompLevel_simple we // don't need a profiled code heap. - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:TieredStopAtLevel=0", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:TieredStopAtLevel=0", + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED); - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:TieredStopAtLevel=1", - "-XX:+PrintCodeCache", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:TieredStopAtLevel=1", + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED); // Fails with too small non-nmethod code heap size - pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K", + "-version"); failsWith(pb, "Invalid NonNMethodCodeHeapSize"); // Fails if code heap sizes do not add up - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:ReservedCodeCacheSize=10M", - "-XX:NonNMethodCodeHeapSize=5M", - "-XX:ProfiledCodeHeapSize=5M", - "-XX:NonProfiledCodeHeapSize=5M", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:ReservedCodeCacheSize=10M", + "-XX:NonNMethodCodeHeapSize=5M", + "-XX:ProfiledCodeHeapSize=5M", + "-XX:NonProfiledCodeHeapSize=5M", + "-version"); failsWith(pb, "Invalid code heap sizes"); // Fails if not enough space for VM internal code long minUseSpace = WHITE_BOX.getUintxVMFlag("CodeCacheMinimumUseSpace"); // minimum size: CodeCacheMinimumUseSpace DEBUG_ONLY(* 3) long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace; - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:ReservedCodeCacheSize=" + minSize, - "-XX:InitialCodeCacheSize=100K", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:ReservedCodeCacheSize=" + minSize, + "-XX:InitialCodeCacheSize=100K", + "-version"); failsWith(pb, "Not enough space in non-nmethod code heap to run VM"); } } diff --git a/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java b/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java index 9509da6cf32..7ec5e744dd6 100644 --- a/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java +++ b/test/hotspot/jtreg/compiler/codecache/CheckUpperLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +41,7 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldContain("Invalid ReservedCodeCacheSize="); out.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java index ee6866c396d..fa2cfa98ccb 100644 --- a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java +++ b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java @@ -55,7 +55,7 @@ public static void wasteCodeCache() throws Exception { } public static void runTest() throws Throwable { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "-XX:-MethodFlushing", "CodeCacheFullCountTest", "WasteCodeCache"); OutputAnalyzer oa = ProcessTools.executeProcess(pb); // Ignore adapter creation failures diff --git a/test/hotspot/jtreg/compiler/compilercontrol/TestConflictInlineCommands.java b/test/hotspot/jtreg/compiler/compilercontrol/TestConflictInlineCommands.java index 1b44d5f4331..9c12ea6b8a7 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/TestConflictInlineCommands.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/TestConflictInlineCommands.java @@ -39,7 +39,7 @@ public class TestConflictInlineCommands { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbatch", "-XX:CompileCommand=inline,*TestConflictInlineCommands::caller", "-XX:CompileCommand=dontinline,*TestConflictInlineCommands::caller", @@ -52,7 +52,7 @@ public static void main(String[] args) throws Exception { analyzer.shouldContain("disallowed by CompileCommand"); analyzer.shouldNotContain("force inline by CompileCommand"); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbatch", "-XX:CompileCommand=dontinline,*TestConflictInlineCommands::*caller", "-XX:CompileCommand=inline,*TestConflictInlineCommands::caller", diff --git a/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java b/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java index 176d23409af..fa748cb21ac 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java +++ b/test/hotspot/jtreg/compiler/cpuflags/RestoreMXCSR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +41,7 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java b/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java index 3020bf1df34..f03667a55ce 100644 --- a/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java +++ b/test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -58,7 +58,7 @@ public static void main(String[] args) throws Exception { "-Xcomp", "-XX:-TieredCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:CompileOnly=" + className + "::sum", "-XX:+" + stressOpt, "-XX:+LogCompilation", "-XX:LogFile=" + log, className, "10"}; - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(procArgs).start()) + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder(procArgs).start()) .shouldHaveExitValue(0); new OutputAnalyzer(Paths.get(log)) .shouldContain("stress_test seed"); diff --git a/test/hotspot/jtreg/compiler/debug/TestStressCM.java b/test/hotspot/jtreg/compiler/debug/TestStressCM.java index 4b3bd786595..0fb624bc16f 100644 --- a/test/hotspot/jtreg/compiler/debug/TestStressCM.java +++ b/test/hotspot/jtreg/compiler/debug/TestStressCM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ static String cmTrace(String stressOpt, int stressSeed) throws Exception { "-XX:CompileOnly=" + className + "::sum", "-XX:+TraceOptoPipelining", "-XX:+" + stressOpt, "-XX:StressSeed=" + stressSeed, className, "10"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); // Extract the trace of our method (the last one after those of all diff --git a/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java b/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java index e1f7e1fa447..0f820de47de 100644 --- a/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java +++ b/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ static String phaseTrace(String stressOption, String traceOption, "-XX:CompileOnly=" + className + "::sum", "-XX:+" + traceOption, "-XX:+" + stressOption, "-XX:StressSeed=" + stressSeed, className, "10"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); return out.getStdout(); diff --git a/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java b/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java index 00ec0291131..89da61a5763 100644 --- a/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java +++ b/test/hotspot/jtreg/compiler/debug/VerifyAdapterSharing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions", "-XX:+VerifyAdapterSharing", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java b/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java index ef4db463516..f0524368d70 100644 --- a/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java +++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ public class TestIterativeEA { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintEliminateAllocations", Launcher.class.getName()); diff --git a/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java b/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java index 0d4da50cfc5..934a13c97aa 100644 --- a/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java +++ b/test/hotspot/jtreg/compiler/inlining/InlineAccessors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -38,7 +38,7 @@ public class InlineAccessors { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", diff --git a/test/hotspot/jtreg/compiler/inlining/PrintInlining.java b/test/hotspot/jtreg/compiler/inlining/PrintInlining.java index a0975dee673..768fa90965d 100644 --- a/test/hotspot/jtreg/compiler/inlining/PrintInlining.java +++ b/test/hotspot/jtreg/compiler/inlining/PrintInlining.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -40,7 +40,7 @@ public class PrintInlining { static void test(String option) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:-UseOnStackReplacement", "-XX:CompileCommand=dontinline,*::bar", diff --git a/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java b/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java index 92263bf10cf..50711d9da6f 100644 --- a/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java +++ b/test/hotspot/jtreg/compiler/inlining/ResolvedClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -42,7 +42,7 @@ public class ResolvedClassTest { /* ======================================================================== */ static void testStatic() throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", "-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestStatic.class.getName() + "::test", @@ -78,7 +78,7 @@ public static void main(String[] args) { /* ======================================================================== */ static void testStaticInit() throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", "-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestStaticInit.class.getName() + "::test", @@ -115,7 +115,7 @@ public static void main(String[] args) { /* ======================================================================== */ static void testIndy() throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", "-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestIndy.class.getName() + "::test", diff --git a/test/hotspot/jtreg/compiler/intrinsics/chacha/TestChaCha20.java b/test/hotspot/jtreg/compiler/intrinsics/chacha/TestChaCha20.java index a3b708fab81..c2275f6563e 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/chacha/TestChaCha20.java +++ b/test/hotspot/jtreg/compiler/intrinsics/chacha/TestChaCha20.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021, Red Hat, Inc. All rights reserved. - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -127,7 +127,7 @@ public static void main(String... args) throws Exception { for (String className : classNames) { // Start a new job { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( mix(c, "-Xmx256m", className)); Process p = pb.start(); OutputAnalyzer oa = new OutputAnalyzer(p); diff --git a/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java b/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java index e8e6551e453..2b501064b76 100644 --- a/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java +++ b/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java @@ -61,7 +61,7 @@ static void runTest(Class test, String... extraArgs) throws Exception { argsList.add(test.getName()); argsList.add(Integer.toString(ITERATIONS)); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(argsList); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(argsList); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java b/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java index a2358cb6edc..a8e76f5797d 100644 --- a/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java +++ b/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -47,7 +47,7 @@ public class MHInlineTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", diff --git a/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java b/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java index 6e060c5a375..b43a6f33a1e 100644 --- a/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java +++ b/test/hotspot/jtreg/compiler/jsr292/PollutedTrapCounts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -43,7 +43,7 @@ public class PollutedTrapCounts { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-XX:-TieredCompilation", "-Xbatch", "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", diff --git a/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java b/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java index d299f4f6ac7..1c36ab78ac6 100644 --- a/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java +++ b/test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java @@ -84,7 +84,7 @@ static void test(String explicitFlag, Expectation... expectations) throws Except String[] flags = {"-XX:+EnableJVMCIProduct", "-XX:+UseGraalJIT"}; String cwd = System.getProperty("user.dir"); for (String flag : flags) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", flag, "-XX:-UnlockExperimentalVMOptions", explicitFlag, "-XX:+PrintFlagsFinal", diff --git a/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java b/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java index 0cffca55dc4..1fec1eeb278 100644 --- a/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java +++ b/test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -38,7 +38,7 @@ public class TestInvalidJVMCIOption { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+EagerJVMCI", "-XX:+UseJVMCICompiler", diff --git a/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java b/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java index 16eb6dfb8f9..4e4a013db40 100644 --- a/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java +++ b/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { } static void test(String enableFlag) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", enableFlag, "-Djvmci.Compiler=null", "-XX:+JVMCIPrintProperties"); diff --git a/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java b/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java index 1f337fca942..fcf58674f1c 100644 --- a/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java +++ b/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java @@ -80,7 +80,7 @@ private static long getTime() { } static void testSubprocess(boolean fatalError) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+UseJVMCICompiler", "-Djvmci.Compiler=ErrorCompiler", "-XX:-TieredCompilation", diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java index dba434d6d84..aa9252d4665 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetFlagValueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:+PrintFlagsFinal", diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java index 779ce9c1653..0ccc7b9b56c 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java @@ -159,7 +159,7 @@ public static void main(String[] args) { public void jniEnomemTest() throws Exception { String[] names = {"translate", "attachCurrentThread", "registerNativeMethods"}; for (String name : names) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:-UseJVMCICompiler", diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java index d8e10e76315..2c63bbe9589 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -146,7 +146,7 @@ private static String[] getVerifyFlags() { } private void start() { - ProcessBuilder process = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); try { // Calls 'main' of TestVM to run all specified tests with commands 'cmds'. // Use executeProcess instead of executeTestJvm as we have already added the JTreg VM and diff --git a/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java b/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java index d61fc44dad4..ad02dd617a7 100644 --- a/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java +++ b/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,7 +41,7 @@ public class TestLinkageErrorInGenerateOopMap { public static void main(String args[]) throws Exception { if (args.length == 0) { // Spawn new VM instance to execute test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:-BytecodeVerificationRemote", "-XX:-BytecodeVerificationLocal", diff --git a/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java index ecceaa4c4b7..80c046e7a36 100644 --- a/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java +++ b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java @@ -37,7 +37,7 @@ public class CheckLoopStripMiningIterShortLoop { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java b/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java index 6bb7ca445c5..c356e4495c2 100644 --- a/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java +++ b/test/hotspot/jtreg/compiler/loopstripmining/TestNoWarningLoopStripMiningIterSet.java @@ -94,7 +94,7 @@ public static void testWith(Consumer check, String msg, boolean System.arraycopy(args, 0, cmds, 1, args.length); cmds[args.length + 1] = "-XX:+PrintFlagsFinal"; cmds[args.length + 2] = "-version"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java index 66cf04fd62f..d5318a7bba4 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Azul Systems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -43,7 +43,7 @@ public class TestOnSpinWait { public static void main(String[] args) throws Exception { // Test C2 compiler - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java index 86f2d55e19f..76953bfb124 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java @@ -71,7 +71,7 @@ public static void main(String[] args) throws Exception { command.add("-XX:CompileCommand=compileonly," + Launcher.class.getName() + "::" + "test"); command.add(Launcher.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java index 1a6d5cb3dc7..f7ed6096080 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java @@ -87,9 +87,9 @@ public static void main(String[] args) throws Exception { final String cpuModel = cpuFeatures.get(0); if (isCPUModelNeoverseN1(cpuModel)) { - checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintFlagsFinal", "-version"), + checkFinalFlagsEqualTo(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintFlagsFinal", "-version"), "isb", "1"); - checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"), + checkFinalFlagsEqualTo(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"), "isb", "2"); } else { System.out.println("Skip because no defaults for CPU model: " + cpuModel); diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java index fde38cf858e..380a8185084 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Azul Systems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -45,7 +45,7 @@ public class TestOnSpinWaitC1 { public static void main(String[] args) throws Exception { // Test C1 compiler - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java index 7569d9d07a6..51746b4c245 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitNoneAArch64.java @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception { command.add(Launcher.class.getName()); // Test C2 compiler - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitRISCV64.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitRISCV64.java index 78189e3c0a3..ad524065f46 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitRISCV64.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitRISCV64.java @@ -64,7 +64,7 @@ public static void main(String[] args) throws Exception { command.add("-Xbatch"); command.add(Launcher.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java b/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java index d5394f73b93..81c2adc5073 100644 --- a/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java +++ b/test/hotspot/jtreg/compiler/oracle/CheckCompileCommandOption.java @@ -251,7 +251,7 @@ private static void verifyValidOption(String[] arguments, String[] expected_outp ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { @@ -266,7 +266,7 @@ private static void verifyInvalidOption(String[] arguments) throws Exception { ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); out.shouldContain("CompileCommand: An error occurred during parsing"); @@ -277,7 +277,7 @@ private static void verifyInvalidOption(String[] arguments, String[] expected_ou ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { diff --git a/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java b/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java index 0279843b590..6cb80d0a0e3 100644 --- a/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java +++ b/test/hotspot/jtreg/compiler/oracle/TestCompileCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +56,7 @@ private static void verifyValidOption(String[] arguments, String[] expected_outp ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { diff --git a/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java b/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java index 43a7e2aefd9..9d306908766 100644 --- a/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java +++ b/test/hotspot/jtreg/compiler/oracle/TestInvalidCompileCommand.java @@ -82,7 +82,7 @@ private static void verifyInvalidOption(String[] arguments, String[] expected_ou ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder(arguments); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); out = new OutputAnalyzer(pb.start()); for (String expected_output : expected_outputs) { diff --git a/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java b/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java index 5c58c6222f3..390a0dcdd3f 100644 --- a/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java +++ b/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckHoistingScaledIV.java @@ -82,7 +82,7 @@ public static void main(String[] args) { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "--enable-preview", "--add-modules", "jdk.incubator.vector", "-Xbatch", "-XX:+TraceLoopPredicate", Launcher.class.getName()); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java b/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java index 36f4266c7d5..bdf221b84c6 100644 --- a/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java +++ b/test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +30,7 @@ public class Driver8015436 { public static void main(String args[]) { OutputAnalyzer oa; try { - oa = ProcessTools.executeProcess(ProcessTools.createTestJvm( + oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder( Test8015436.class.getName())); } catch (Exception ex) { throw new Error("TESTBUG: exception while running child process: " + ex, ex); diff --git a/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java b/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java index cd8471317ff..682198672f7 100644 --- a/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java +++ b/test/hotspot/jtreg/compiler/sharedstubs/SharedStubToInterpTest.java @@ -66,7 +66,7 @@ private static void runTest(String test) throws Exception { command.add("-XX:CompileCommand=dontinline," + testClassName + "::" + "log02"); command.add(testClassName); - ProcessBuilder pb = ProcessTools.createTestJvm(command); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java b/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java index 49158fecd04..10af17de6cb 100644 --- a/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java +++ b/test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java @@ -58,7 +58,7 @@ private static void runTest(String test) throws Exception { command.add(testClassName); command.add("a"); - ProcessBuilder pb = ProcessTools.createTestJvm(command); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(command); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java b/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java index 9761002c051..679f7ff8d0b 100644 --- a/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java +++ b/test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -42,7 +42,7 @@ public class NumCompilerThreadsCheck { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CICompilerCount=-1"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); String expectedOutput = "outside the allowed range"; diff --git a/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java b/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java index b32c4d48f8a..b3b92afa0d1 100644 --- a/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java +++ b/test/hotspot/jtreg/compiler/startup/SmallCodeCacheStartup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,10 +44,10 @@ public class SmallCodeCacheStartup { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m", - "-XX:CICompilerCount=64", - "-Xcomp", - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m", + "-XX:CICompilerCount=64", + "-Xcomp", + "-version"); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); try { analyzer.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/compiler/startup/StartupOutput.java b/test/hotspot/jtreg/compiler/startup/StartupOutput.java index 0f9ab3b1f96..d97bcd0019a 100644 --- a/test/hotspot/jtreg/compiler/startup/StartupOutput.java +++ b/test/hotspot/jtreg/compiler/startup/StartupOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -43,12 +43,12 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldNotContain("no space to run compilers"); out.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version"); out = new OutputAnalyzer(pb.start()); // The VM should not crash but may return an error message because we don't have enough space for adapters int exitCode = out.getExitValue(); diff --git a/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java b/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java index 40369000036..b6535e65428 100644 --- a/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java +++ b/test/hotspot/jtreg/compiler/testlibrary/rtm/RTMTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ public class RTMTestBase { public static OutputAnalyzer executeRTMTest(CompilableTest test, String... options) throws Exception { ProcessBuilder processBuilder - = ProcessTools.createJavaProcessBuilder( + = ProcessTools.createLimitedTestJavaProcessBuilder( RTMTestBase.prepareTestOptions(test, options)); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); @@ -83,7 +83,7 @@ public static OutputAnalyzer executeRTMTest(CompilableTest test, public static OutputAnalyzer executeRTMTest(String logFileName, CompilableTest test, String... options) throws Exception { ProcessBuilder processBuilder - = ProcessTools.createJavaProcessBuilder( + = ProcessTools.createLimitedTestJavaProcessBuilder( RTMTestBase.prepareTestOptions(logFileName, test, options)); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); diff --git a/test/hotspot/jtreg/compiler/types/correctness/OffTest.java b/test/hotspot/jtreg/compiler/types/correctness/OffTest.java index 73574447eaf..6f2354cf895 100644 --- a/test/hotspot/jtreg/compiler/types/correctness/OffTest.java +++ b/test/hotspot/jtreg/compiler/types/correctness/OffTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -86,7 +86,7 @@ private static void runTest() throws Exception { OPTIONS[TYPE_PROFILE_INDEX] = typeProfileLevel; OPTIONS[USE_TYPE_SPECULATION_INDEX] = useTypeSpeculation; OPTIONS[PROFILING_TYPE_INDEX] = type.name(); - ProcessBuilder processBuilder = ProcessTools.createTestJvm(OPTIONS); + ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(OPTIONS); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); outputAnalyzer.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java b/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java index bb2bb994bc9..95970256c48 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestBufferVectorization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -224,11 +224,11 @@ static void verify_vectors(String testName) { ProcessBuilder pb; OutputAnalyzer out; try { - pb = ProcessTools.createJavaProcessBuilder("-XX:-BackgroundCompilation", - "-XX:+TraceNewVectors", - "compiler.vectorization.TestBufferVectorization", - testName, - "run"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-BackgroundCompilation", + "-XX:+TraceNewVectors", + "compiler.vectorization.TestBufferVectorization", + testName, + "run"); out = new OutputAnalyzer(pb.start()); } catch (Exception e) { throw new RuntimeException(" Exception launching Java process: " + e); diff --git a/test/hotspot/jtreg/containers/cgroup/PlainRead.java b/test/hotspot/jtreg/containers/cgroup/PlainRead.java index 5e092e663c0..21eccd79835 100644 --- a/test/hotspot/jtreg/containers/cgroup/PlainRead.java +++ b/test/hotspot/jtreg/containers/cgroup/PlainRead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,7 +67,7 @@ static public void isNotContainer(OutputAnalyzer oa) { public static void main(String[] args) throws Exception { WhiteBox wb = WhiteBox.getWhiteBox(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+container=trace", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+container=trace", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (wb.isContainerized()) { diff --git a/test/hotspot/jtreg/gc/TestAgeOutput.java b/test/hotspot/jtreg/gc/TestAgeOutput.java index 298569fa6a5..084279bcda9 100644 --- a/test/hotspot/jtreg/gc/TestAgeOutput.java +++ b/test/hotspot/jtreg/gc/TestAgeOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +66,7 @@ public static void checkPattern(String pattern, String what) throws Exception { } public static void runTest(String gcArg) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/gc/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/TestAllocateHeapAt.java index 0c80e14635d..8daf0bbcdc7 100644 --- a/test/hotspot/jtreg/gc/TestAllocateHeapAt.java +++ b/test/hotspot/jtreg/gc/TestAllocateHeapAt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -36,7 +36,7 @@ public class TestAllocateHeapAt { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:AllocateHeapAt=" + System.getProperty("test.dir", "."), "-Xlog:gc+heap=info", "-Xmx32m", diff --git a/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java b/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java index 748ddd2f1f9..372437b8898 100644 --- a/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java +++ b/test/hotspot/jtreg/gc/TestAllocateHeapAtError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ public static void main(String args[]) throws Exception { f = new File(test_dir, UUID.randomUUID().toString()); } while(f.exists()); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:AllocateHeapAt=" + f.getName(), "-Xlog:gc+heap=info", "-Xmx32m", diff --git a/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java b/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java index ddb2d9568e2..b2d2f1e429d 100644 --- a/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java +++ b/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,7 +60,7 @@ public static void main(String args[]) throws Exception { "-Xlog:gc+heap=info", "-version"}); - ProcessBuilder pb = ProcessTools.createTestJvm(flags); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("Output:\n" + output.getOutput()); diff --git a/test/hotspot/jtreg/gc/TestCardTablePageCommits.java b/test/hotspot/jtreg/gc/TestCardTablePageCommits.java index ca14cfd71be..c468a771076 100644 --- a/test/hotspot/jtreg/gc/TestCardTablePageCommits.java +++ b/test/hotspot/jtreg/gc/TestCardTablePageCommits.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -42,7 +42,7 @@ public static void main(String args[]) throws Exception { // because of 8kB pages, assume 4 KB pages for all other CPUs. String Xmx = "-Xmx4m"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( Xmx, "-XX:NativeMemoryTracking=detail", "-XX:+UseParallelGC", diff --git a/test/hotspot/jtreg/gc/TestNumWorkerOutput.java b/test/hotspot/jtreg/gc/TestNumWorkerOutput.java index d8bc4a1f6fe..81209f73929 100644 --- a/test/hotspot/jtreg/gc/TestNumWorkerOutput.java +++ b/test/hotspot/jtreg/gc/TestNumWorkerOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -58,7 +58,7 @@ public static void checkPatternOnce(String pattern, String what) throws Exceptio } public static void runTest(String gcArg) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java b/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java index 81d8529f6e9..c5c4854946d 100644 --- a/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java +++ b/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ private static void runTest(boolean shouldSucceed, String... extraArgs) throws E Collections.addAll(testArguments, extraArgs); testArguments.add("-version"); - ProcessBuilder pb = ProcessTools.createTestJvm(testArguments); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(testArguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/TestSmallHeap.java b/test/hotspot/jtreg/gc/TestSmallHeap.java index f4d44862ed6..a9b32eb81c8 100644 --- a/test/hotspot/jtreg/gc/TestSmallHeap.java +++ b/test/hotspot/jtreg/gc/TestSmallHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ public static void main(String[] args) throws Exception { private static void verifySmallHeapSize(String gc, long expectedMaxHeap) throws Exception { long minMaxHeap = 4 * 1024 * 1024; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( gc, "-Xmx" + minMaxHeap, "-XX:+PrintFlagsFinal", diff --git a/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java b/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java index e2134798722..4ad9f9675d9 100644 --- a/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java +++ b/test/hotspot/jtreg/gc/TestVerifyDuringStartup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -37,7 +37,7 @@ public class TestVerifyDuringStartup { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:-UseTLAB", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyDuringStartup", diff --git a/test/hotspot/jtreg/gc/TestVerifySilently.java b/test/hotspot/jtreg/gc/TestVerifySilently.java index c4dd4dd779b..b7b07a1eb8e 100644 --- a/test/hotspot/jtreg/gc/TestVerifySilently.java +++ b/test/hotspot/jtreg/gc/TestVerifySilently.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -57,7 +57,7 @@ private static OutputAnalyzer runTest(boolean verifySilently) throws Exception { "-XX:+VerifyAfterGC", (verifySilently ? "-Xlog:gc":"-Xlog:gc+verify=debug"), TestVerifySilentlyRunSystemGC.class.getName()}); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("Output:\n" + output.getOutput()); diff --git a/test/hotspot/jtreg/gc/TestVerifySubSet.java b/test/hotspot/jtreg/gc/TestVerifySubSet.java index b326dd7fe7f..5aa8cc3eb13 100644 --- a/test/hotspot/jtreg/gc/TestVerifySubSet.java +++ b/test/hotspot/jtreg/gc/TestVerifySubSet.java @@ -59,7 +59,7 @@ private static OutputAnalyzer runTest(String subset) throws Exception { "-Xlog:gc+verify=debug", "-XX:VerifySubSet="+subset, TestVerifySubSetRunSystemGC.class.getName()}); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("Output:\n" + output.getOutput()); diff --git a/test/hotspot/jtreg/gc/arguments/GCArguments.java b/test/hotspot/jtreg/gc/arguments/GCArguments.java index b2610da0c4e..c59a14954bf 100644 --- a/test/hotspot/jtreg/gc/arguments/GCArguments.java +++ b/test/hotspot/jtreg/gc/arguments/GCArguments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,19 @@ static private String[] withDefaults(String[] arguments) { return augmented.toArray(new String[augmented.size()]); } - static public ProcessBuilder createJavaProcessBuilder(List arguments) { - return createJavaProcessBuilder(arguments.toArray(String[]::new)); + static public ProcessBuilder createLimitedTestJavaProcessBuilder(List arguments) { + return createLimitedTestJavaProcessBuilder(arguments.toArray(String[]::new)); } - static public ProcessBuilder createJavaProcessBuilder(String... arguments) { - return ProcessTools.createJavaProcessBuilder(withDefaults(arguments)); + static public ProcessBuilder createLimitedTestJavaProcessBuilder(String... arguments) { + return ProcessTools.createLimitedTestJavaProcessBuilder(withDefaults(arguments)); } - static public ProcessBuilder createTestJvm(List arguments) { - return createTestJvm(arguments.toArray(String[]::new)); + static public ProcessBuilder createTestJavaProcessBuilder(List arguments) { + return createTestJavaProcessBuilder(arguments.toArray(String[]::new)); } - static public ProcessBuilder createTestJvm(String... arguments) { - return ProcessTools.createTestJvm(withDefaults(arguments)); + static public ProcessBuilder createTestJavaProcessBuilder(String... arguments) { + return ProcessTools.createTestJavaProcessBuilder(withDefaults(arguments)); } } diff --git a/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java b/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java index 5c4463db2b8..2ce13fbbfd4 100644 --- a/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java +++ b/test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java @@ -65,7 +65,7 @@ public static void main(String args[]) throws Exception { " *bool +UseParallelGC *= *true +\\{product\\} *\\{command line\\}"; private static void testFlag() throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( option, heapSizeOption, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java b/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java index 80f0ec4f0cc..ebea6afbc00 100644 --- a/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java +++ b/test/hotspot/jtreg/gc/arguments/TestArrayAllocatorMallocLimit.java @@ -51,7 +51,7 @@ public static void main(String [] args) throws Exception { private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *"; public static void testDefaultValue() throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -77,7 +77,7 @@ public static void testDefaultValue() throws Exception { public static void testSetValue() throws Exception { long flagValue = 2048; - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:" + flagName + "=" + flagValue, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java b/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java index f33554c46e6..0b6dce0fc0e 100644 --- a/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { } private static OutputAnalyzer runJava(String ... args) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm(args); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(args); return new OutputAnalyzer(pb.start()); } } diff --git a/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java b/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java index c282a784203..e8e4552da01 100644 --- a/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java +++ b/test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java @@ -40,13 +40,13 @@ public class TestDisableDefaultGC { public static void main(String[] args) throws Exception { // Start VM, disabling all possible default GCs - ProcessBuilder pb = GCArguments.createTestJvm("-XX:-UseSerialGC", - "-XX:-UseParallelGC", - "-XX:-UseG1GC", - "-XX:-UseZGC", - "-XX:+UnlockExperimentalVMOptions", - "-XX:-UseShenandoahGC", - "-version"); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder("-XX:-UseSerialGC", + "-XX:-UseParallelGC", + "-XX:-UseG1GC", + "-XX:-UseZGC", + "-XX:+UnlockExperimentalVMOptions", + "-XX:-UseShenandoahGC", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldMatch("Garbage collector not selected"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java b/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java index 53afba28a1a..21a4eddb410 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1ConcMarkStepDurationMillis.java @@ -78,7 +78,7 @@ private static void runG1ConcMarkStepDurationMillisTest(String expectedValue, in Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:G1ConcMarkStepDurationMillis="+expectedValue, "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createTestJvm(vmOpts); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(expectedResult == PASS ? 0 : 1); diff --git a/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java b/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java index 8a2ec1ab5f6..91be97782f5 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1ConcRefinementThreads.java @@ -69,7 +69,7 @@ private static void runG1ConcRefinementThreadsTest(String[] passedOpts, } Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createTestJvm(vmOpts); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java b/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java index ededd10f0c3..0d63dec0c26 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1HeapRegionSize.java @@ -53,7 +53,7 @@ private static void checkG1HeapRegionSize(String[] flags, int expectedValue, int flagList.add("-XX:+PrintFlagsFinal"); flagList.add("-version"); - ProcessBuilder pb = GCArguments.createTestJvm(flagList); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flagList); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(exitValue); diff --git a/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java b/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java index abf7926f966..875e995374a 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java @@ -63,7 +63,7 @@ private static final class OptionDescription { }; private static void check(String flag, boolean is_valid) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm("-XX:+UseG1GC", flag, "-version"); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder("-XX:+UseG1GC", flag, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (is_valid) { output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java b/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java index be18156df41..84483f39272 100644 --- a/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestG1RemSetFlags.java @@ -48,7 +48,7 @@ private static void checkG1RemSetFlags(String[] flags, int exitValue) throws Exc flagList.add("-XX:+PrintFlagsFinal"); flagList.add("-version"); - ProcessBuilder pb = GCArguments.createTestJvm(flagList); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flagList); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(exitValue); } diff --git a/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java b/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java index 24528c923ed..19ecb181418 100644 --- a/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java +++ b/test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java @@ -48,7 +48,7 @@ enum Validation { } private static void testMinMaxFreeRatio(String min, String max, Validation type) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( "-Xminf" + min, "-Xmaxf" + max, "-version"); diff --git a/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java b/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java index 5006dec7128..7bf78a001bf 100644 --- a/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java +++ b/test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java @@ -41,7 +41,7 @@ public class TestInitialTenuringThreshold { public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( "-XX:+UseParallelGC", "-XX:InitialTenuringThreshold=" + String.valueOf(initial), "-XX:MaxTenuringThreshold=" + String.valueOf(max), @@ -58,7 +58,7 @@ public static void runWithThresholds(int initial, int max, boolean shouldfail) t public static void main(String args[]) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( // some value below the default value of InitialTenuringThreshold of 7 "-XX:+UseParallelGC", "-XX:MaxTenuringThreshold=1", diff --git a/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java b/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java index 2480f882f00..3a5d472f9f8 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java +++ b/test/hotspot/jtreg/gc/arguments/TestMaxHeapSizeTools.java @@ -115,7 +115,7 @@ private static long align_up(long value, long alignment) { } private static void getNewOldSize(String gcflag, long[] values) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm(gcflag, + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(gcflag, "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -208,7 +208,7 @@ public static OutputAnalyzer runWhiteBoxTest(String[] vmargs, String classname, finalargs.add(classname); finalargs.addAll(Arrays.asList(arguments)); - ProcessBuilder pb = GCArguments.createTestJvm(finalargs.toArray(String[]::new)); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(finalargs.toArray(String[]::new)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -308,7 +308,7 @@ private static void shouldContainOrNot(OutputAnalyzer output, boolean contains, } private static void expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm(flags); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); shouldContainOrNot(output, hasWarning, "Warning"); shouldContainOrNot(output, hasError, "Error"); diff --git a/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java b/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java index 3cf0034f1a7..7e91fe60cfb 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestMaxMinHeapFreeRatioFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -98,7 +98,7 @@ public static void positiveTest(int minRatio, boolean useXminf, Boolean.toString(shrinkHeapInSteps) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); } @@ -123,7 +123,7 @@ public static void negativeTest(int minRatio, boolean useXminf, "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-version" ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(1); analyzer.shouldContain("Error: Could not create the Java Virtual Machine."); diff --git a/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java b/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java index 6abcc9f84fe..f2214b8b0cf 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java +++ b/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java @@ -95,7 +95,7 @@ private static String getMaxNewSize(String[] flags) throws Exception { finalargs.add("-XX:+PrintFlagsFinal"); finalargs.add("-version"); - ProcessBuilder pb = GCArguments.createTestJvm(finalargs); + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); diff --git a/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java b/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java index c2802d18a8a..4c66afd5cf5 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -61,7 +61,7 @@ private static void checkMaxRAMSize(long maxram, int maxrampercent, boolean forc args.add("-XX:+PrintFlagsFinal"); args.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(args); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); @@ -84,7 +84,7 @@ private static long getHeapBaseMinAddress() throws Exception { args.add("-XX:+PrintFlagsFinal"); args.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(args); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); diff --git a/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java b/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java index 4e18a4c60b6..83f564b98a5 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -102,7 +102,7 @@ public static void testSurvivorRatio(int survivorRatio, Boolean.toString(useAdaptiveSizePolicy) ); vmOptions.removeIf((String p) -> p.isEmpty()); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java b/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java index 49ce08e5b0e..9076005fa86 100644 --- a/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java +++ b/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -82,7 +82,7 @@ public static void testNewRatio(int ratio, LinkedList options) throws Ex Integer.toString(ratio) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); System.out.println(analyzer.getOutput()); diff --git a/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java b/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java index 70a124e6f14..3c3aff980dd 100644 --- a/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -166,7 +166,7 @@ private static OutputAnalyzer startVM(LinkedList options, Long.toString(maxHeapSize) ); vmOptions.removeIf(String::isEmpty); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); return analyzer; } diff --git a/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java b/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java index be69ff2c79b..82e98429100 100644 --- a/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java +++ b/test/hotspot/jtreg/gc/arguments/TestNewSizeThreadIncrease.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,13 +65,13 @@ public static void main(String[] args) throws Exception { } static void runNewSizeThreadIncreaseTest(String expectedValue, boolean isNewsizeChanged) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder("-XX:+UseSerialGC", - "-Xms96M", - "-Xmx128M", - "-XX:NewRatio=2", - "-Xlog:gc+heap+ergo=debug", - "-XX:NewSizeThreadIncrease="+expectedValue, - GCTest.class.getName()); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder("-XX:+UseSerialGC", + "-Xms96M", + "-Xmx128M", + "-XX:NewRatio=2", + "-Xlog:gc+heap+ergo=debug", + "-XX:NewSizeThreadIncrease="+expectedValue, + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java b/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java index 0a2c8c146da..ca45def0b2b 100644 --- a/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestObjectTenuringFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -161,7 +161,7 @@ private static void runTenuringFlagsConsistencyTest(String[] tenuringFlags, } Collections.addAll(vmOpts, "-XX:+UseParallelGC", "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldFail) { diff --git a/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java b/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java index be8c6494b54..82ee38685ec 100644 --- a/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java +++ b/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +56,7 @@ public static void main(String args[]) throws Exception { private static final String printFlagsFinalPattern = " *uint *" + flagName + " *:?= *(\\d+) *\\{product\\} *"; public static void testDefaultValue() throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -94,7 +94,7 @@ public static void testFlags() throws Exception { for (String gc : supportedGC) { // Make sure the VM does not allow ParallelGCThreads set to 0 - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+Use" + gc + "GC", "-XX:ParallelGCThreads=0", "-XX:+PrintFlagsFinal", @@ -124,7 +124,7 @@ public static void testFlags() throws Exception { } public static long getParallelGCThreadCount(String... flags) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flags); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); String stdout = output.getStdout(); diff --git a/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java b/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java index b936e87c370..d47d277e30b 100644 --- a/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java +++ b/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -77,7 +77,7 @@ private static void testFlag(String[] args, boolean expectedTrue) throws Excepti result.addAll(Arrays.asList(args)); result.add("-XX:+PrintFlagsFinal"); result.add("-version"); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(result); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(result); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java b/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java index dfa3bbfb364..a48f21c957b 100644 --- a/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java +++ b/test/hotspot/jtreg/gc/arguments/TestSelectDefaultGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -44,7 +44,7 @@ public static void assertVMOption(OutputAnalyzer output, String option, boolean public static void testDefaultGC(boolean actAsServer) throws Exception { // Start VM without specifying GC - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:" + (actAsServer ? "+" : "-") + "AlwaysActAsServerClassMachine", "-XX:" + (actAsServer ? "-" : "+") + "NeverActAsServerClassMachine", "-XX:+PrintFlagsFinal", diff --git a/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java b/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java index df678326eb9..c1c2164a4da 100644 --- a/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java +++ b/test/hotspot/jtreg/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +60,7 @@ public static void main(String[] args) throws Exception { long initHeap = heapAlignment; long maxHeap = heapAlignment * 2; - ProcessBuilder pb_enabled = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb_enabled = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UseParallelGC", "-Xms" + String.valueOf(initHeap), "-Xmx" + String.valueOf(maxHeap), diff --git a/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java b/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java index 1a2246b1581..8567615220a 100644 --- a/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java +++ b/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -87,7 +87,7 @@ public static void testSurvivorRatio(int ratio, LinkedList options) thro Integer.toString(ratio) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java b/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java index f530bf35996..8f8b4aa1087 100644 --- a/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java +++ b/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -116,7 +116,7 @@ public static void negativeTest(int ratio, LinkedList options) throws Ex vmOptions.add("-XX:TargetSurvivorRatio=" + ratio); vmOptions.add("-version"); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(1); @@ -151,7 +151,7 @@ public static void positiveTest(int ratio, LinkedList options) throws Ex Integer.toString(ratio) ); - ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions); + ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); analyzer.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java b/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java index 56bc49bd8f4..8d51a6df173 100644 --- a/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java +++ b/test/hotspot/jtreg/gc/arguments/TestUnrecognizedVMOptionsHandling.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -40,7 +40,7 @@ public class TestUnrecognizedVMOptionsHandling { public static void main(String args[]) throws Exception { // The first two JAVA processes are expected to fail, but with a correct VM option suggestion - ProcessBuilder pb = GCArguments.createJavaProcessBuilder( + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UseDynamicNumberOfGcThreads", "-version" ); @@ -50,7 +50,7 @@ public static void main(String args[]) throws Exception { throw new RuntimeException("Not expected to get exit value 0"); } - pb = GCArguments.createJavaProcessBuilder( + pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:MaxiumHeapSize=500m", "-version" ); @@ -61,7 +61,7 @@ public static void main(String args[]) throws Exception { } // The last JAVA process should run successfully for the purpose of sanity check - pb = GCArguments.createJavaProcessBuilder( + pb = GCArguments.createLimitedTestJavaProcessBuilder( "-XX:+UseDynamicNumberOfGCThreads", "-version" ); diff --git a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java index 8979b92eaf6..19ebdea3c0e 100644 --- a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java +++ b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgoTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -93,7 +93,7 @@ public static OutputAnalyzer runWhiteBoxTest(String[] vmargs, String classname, finalargs.add(classname); finalargs.addAll(Arrays.asList(arguments)); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); return output; @@ -157,7 +157,7 @@ private static boolean getFlagBoolValue(String flag, String where) { } private static String expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception { - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(flags); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(flags); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(errorcode); return output.getStdout(); diff --git a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java index ada10a210f1..07cf4126970 100644 --- a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java +++ b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -59,7 +59,7 @@ private static void checkFlag(long ulimit, long maxram, int maxrampercent, boole // Convert bytes to kbytes for ulimit -v var ulimit_prefix = "ulimit -v " + (ulimit / 1024); - String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJvm(args.toArray(String[]::new))); + String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJavaProcessBuilder(args.toArray(String[]::new))); ProcessBuilder pb = new ProcessBuilder("sh", "-c", ulimit_prefix + ";" + cmd); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java b/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java index 7f3857594b6..4a7fb7108c3 100644 --- a/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java +++ b/test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ public class TestUseNUMAInterleaving { public static void main(String[] args) throws Exception { - ProcessBuilder pb = GCArguments.createTestJvm( + ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder( "-XX:+UseNUMA", "-XX:+PrintFlagsFinal", "-version"); diff --git a/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java b/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java index 4b46d00c16d..a3d6d5a7440 100644 --- a/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -99,7 +99,7 @@ public static void testVerifyFlags(boolean verifyBeforeGC, : "-XX:-VerifyAfterGC"), GarbageProducer.class.getName(), doFullGC ? "t" : "f" }); - ProcessBuilder pb = GCArguments.createJavaProcessBuilder(vmOpts); + ProcessBuilder pb = GCArguments.createLimitedTestJavaProcessBuilder(vmOpts); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); analyzer.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java b/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java index 483fa227dbb..875da61a05f 100644 --- a/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java +++ b/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ public class TestG1ClassUnloadingHWM { private static long YoungGenSize = 32 * 1024 * 1024; private static OutputAnalyzer run(boolean enableUnloading) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff --git a/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java b/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java index a883eb9f27c..c978f149fca 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java +++ b/test/hotspot/jtreg/gc/epsilon/TestDieDefault.java @@ -37,14 +37,14 @@ public class TestDieDefault { public static void passWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("OutOfMemoryError"); out.shouldHaveExitValue(0); } public static void failWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldContain("OutOfMemoryError"); if (out.getExitValue() == 0) { diff --git a/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java b/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java index c717b493330..2e19141d286 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java +++ b/test/hotspot/jtreg/gc/epsilon/TestDieWithHeapDump.java @@ -38,14 +38,14 @@ public class TestDieWithHeapDump { public static void passWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("OutOfMemoryError"); out.shouldHaveExitValue(0); } public static void failWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); Process p = pb.start(); OutputAnalyzer out = new OutputAnalyzer(p); out.shouldContain("OutOfMemoryError"); diff --git a/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java b/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java index 2cac3843b0e..a6593fecdff 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java +++ b/test/hotspot/jtreg/gc/epsilon/TestDieWithOnError.java @@ -39,7 +39,7 @@ public class TestDieWithOnError { static String ON_ERR_MSG = "Epsilon error handler message"; public static void passWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("OutOfMemoryError"); out.stdoutShouldNotMatch("^" + ON_ERR_MSG); @@ -47,7 +47,7 @@ public static void passWith(String... args) throws Exception { } public static void failWith(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldContain("OutOfMemoryError"); if (out.getExitValue() == 0) { diff --git a/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java b/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java index 80f1828c0dd..3e7293a5a92 100644 --- a/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java +++ b/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -73,7 +73,7 @@ private static void testDynamicNumberOfGCThreads(String gcFlag) throws Exception String[] baseArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", GCTest.class.getName()}; // Base test with gc and +UseDynamicNumberOfGCThreads: - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs); + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder(baseArgs); verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); // Turn on parallel reference processing @@ -81,7 +81,7 @@ private static void testDynamicNumberOfGCThreads(String gcFlag) throws Exception String[] parRefArgs = new String[baseArgs.length + parRefProcArg.length]; System.arraycopy(parRefProcArg, 0, parRefArgs, 0, parRefProcArg.length); System.arraycopy(baseArgs, 0, parRefArgs, parRefProcArg.length, baseArgs.length); - pb_enabled = ProcessTools.createJavaProcessBuilder(parRefArgs); + pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder(parRefArgs); verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); } diff --git a/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java b/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java index a20721a9e56..dc1b83cd2c1 100644 --- a/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java +++ b/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -70,7 +70,7 @@ private static void verifyDynamicNumberOfGCThreads(OutputAnalyzer output, String private static void testInitialGCThreadLogging(String gcFlag, String threadName) throws Exception { // Base test with gc and +UseDynamicNumberOfGCThreads: - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xmx10M", diff --git a/test/hotspot/jtreg/gc/g1/Test2GbHeap.java b/test/hotspot/jtreg/gc/g1/Test2GbHeap.java index 125ea34a901..8e06ac3ee2c 100644 --- a/test/hotspot/jtreg/gc/g1/Test2GbHeap.java +++ b/test/hotspot/jtreg/gc/g1/Test2GbHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception { testArguments.add("-Xmx2g"); testArguments.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testArguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java index a459c1131ad..a334783eca6 100644 --- a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java +++ b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -80,7 +80,7 @@ public static void main(String[] args) { public class TestEagerReclaimHumongousRegions { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms128M", "-Xmx128M", diff --git a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java index 5da17f7dc61..bcb156d9074 100644 --- a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java +++ b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java @@ -119,7 +119,7 @@ public static void main(String[] args) { public class TestEagerReclaimHumongousRegionsClearMarkBits { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms128M", "-Xmx128M", diff --git a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java index 5f134e290b2..30aee3ced47 100644 --- a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java +++ b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -54,7 +54,7 @@ private static String getSumValue(String s) { } public static void runTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java index b2eaa12e6f3..585f4e867ab 100644 --- a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java +++ b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +92,7 @@ public static void main(String[] args) { public class TestEagerReclaimHumongousRegionsWithRefs { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms128M", "-Xmx128M", diff --git a/test/hotspot/jtreg/gc/g1/TestEvacuationFailure.java b/test/hotspot/jtreg/gc/g1/TestEvacuationFailure.java index 616d740cff9..6bbcddae55f 100644 --- a/test/hotspot/jtreg/gc/g1/TestEvacuationFailure.java +++ b/test/hotspot/jtreg/gc/g1/TestEvacuationFailure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -43,15 +43,15 @@ public class TestEvacuationFailure { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx32M", - "-Xmn16M", - "-XX:+G1EvacuationFailureALot", - "-XX:G1EvacuationFailureALotCount=100", - "-XX:G1EvacuationFailureALotInterval=1", - "-XX:+UnlockDiagnosticVMOptions", - "-Xlog:gc", - GCTestWithEvacuationFailure.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx32M", + "-Xmn16M", + "-XX:+G1EvacuationFailureALot", + "-XX:G1EvacuationFailureALotCount=100", + "-XX:G1EvacuationFailureALotInterval=1", + "-XX:+UnlockDiagnosticVMOptions", + "-Xlog:gc", + GCTestWithEvacuationFailure.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println(output.getStdout()); diff --git a/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java b/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java index 4f47e219039..17957cfa5fc 100644 --- a/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java +++ b/test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java @@ -54,7 +54,7 @@ public static void runTest() throws Exception { "-XX:G1HeapRegionSize=1m", GCTest.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println(output.getStdout()); diff --git a/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java b/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java index 3eafc348a4b..4dedac0a61b 100644 --- a/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java +++ b/test/hotspot/jtreg/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,14 @@ public class TestG1TraceEagerReclaimHumongousObjects { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xms128M", - "-Xmx128M", - "-Xmn16M", - "-XX:G1HeapRegionSize=1M", - "-Xlog:gc+phases=trace,gc+humongous=trace", - "-XX:+UnlockExperimentalVMOptions", - GCWithHumongousObjectTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xms128M", + "-Xmx128M", + "-Xmn16M", + "-XX:G1HeapRegionSize=1M", + "-Xlog:gc+phases=trace,gc+humongous=trace", + "-XX:+UnlockExperimentalVMOptions", + GCWithHumongousObjectTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java index 96dd4958561..f256cbc61c6 100644 --- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java +++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -217,26 +217,26 @@ public static void main(String[] args) throws Exception { private void testNormalLogs() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, allLogMessages, Level.OFF); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xlog:gc+phases=debug", - GCTest.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xlog:gc+phases=debug", + GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, allLogMessages, Level.DEBUG); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xlog:gc+phases=trace", - GCTest.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xlog:gc+phases=trace", + GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, allLogMessages, Level.TRACE); @@ -252,10 +252,10 @@ private void testNormalLogs() throws Exception { }; private void testConcurrentRefinementLogs() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xlog:gc+refine+stats=debug", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xlog:gc+refine+stats=debug", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, concRefineMessages, Level.DEBUG); } @@ -268,27 +268,27 @@ private void testConcurrentRefinementLogs() throws Exception { }; private void testWithEvacuationFailureLogs() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx32M", - "-Xmn16M", - "-XX:+G1EvacuationFailureALot", - "-XX:G1EvacuationFailureALotCount=100", - "-XX:G1EvacuationFailureALotInterval=1", - "-XX:+UnlockDiagnosticVMOptions", - "-Xlog:gc+phases=debug", - GCTestWithEvacuationFailure.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx32M", + "-Xmn16M", + "-XX:+G1EvacuationFailureALot", + "-XX:G1EvacuationFailureALotCount=100", + "-XX:G1EvacuationFailureALotInterval=1", + "-XX:+UnlockDiagnosticVMOptions", + "-Xlog:gc+phases=debug", + GCTestWithEvacuationFailure.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, exhFailureMessages, Level.DEBUG); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx32M", - "-Xmn16M", - "-Xms32M", - "-XX:+UnlockDiagnosticVMOptions", - "-Xlog:gc+phases=trace", - GCTestWithEvacuationFailure.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx32M", + "-Xmn16M", + "-Xms32M", + "-XX:+UnlockDiagnosticVMOptions", + "-Xlog:gc+phases=trace", + GCTestWithEvacuationFailure.class.getName()); output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, exhFailureMessages, Level.TRACE); @@ -301,13 +301,13 @@ private void testWithEvacuationFailureLogs() throws Exception { }; private void testWithConcurrentStart() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xbootclasspath/a:.", - "-Xlog:gc*=debug", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - GCTestWithConcurrentStart.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xbootclasspath/a:.", + "-Xlog:gc*=debug", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + GCTestWithConcurrentStart.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); checkMessagesAtLevel(output, concurrentStartMessages, Level.TRACE); @@ -315,13 +315,13 @@ private void testWithConcurrentStart() throws Exception { } private void testExpandHeap() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xmx10M", - "-Xbootclasspath/a:.", - "-Xlog:gc+ergo+heap=debug", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-Xmx10M", + "-Xbootclasspath/a:.", + "-Xlog:gc+ergo+heap=debug", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Expand the heap. requested expansion amount: "); diff --git a/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java b/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java index c399e50aabd..dc8c28a6008 100644 --- a/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java +++ b/test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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 @@ public class TestHumongousAllocConcurrentStart { private static final int initiatingHeapOccupancyPercent = 50; // % public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms" + heapSize + "m", "-Xmx" + heapSize + "m", diff --git a/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java b/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java index aae56bce361..6d141870ae3 100644 --- a/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java +++ b/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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 @@ -47,7 +47,7 @@ public class TestHumongousAllocNearlyFullRegion { private static final int heapRegionSize = 1; // MB public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseG1GC", "-Xms" + heapSize + "m", "-Xmx" + heapSize + "m", diff --git a/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java b/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java index 57b43054039..057b8310de6 100644 --- a/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java +++ b/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -106,7 +106,7 @@ public static OutputAnalyzer runWhiteBoxTest(String[] vmargs, String classname, finalargs.add(classname); finalargs.addAll(Arrays.asList(arguments)); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); return output; diff --git a/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java b/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java index b16d8d276b0..6376149fbf9 100644 --- a/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java +++ b/test/hotspot/jtreg/gc/g1/TestHumongousConcurrentStartUndo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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,7 +56,7 @@ public class TestHumongousConcurrentStartUndo { private static final int YoungSize = HeapSize / 8; public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UseG1GC", "-Xms" + HeapSize + "m", diff --git a/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java b/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java index b9c556f94cd..588411fb2e6 100644 --- a/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java +++ b/test/hotspot/jtreg/gc/g1/TestLargePageUseForAuxMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -123,7 +123,7 @@ static void testVM(String what, long heapsize, boolean cardsShouldUseLargePages, ProcessBuilder pb; // Test with large page enabled. - pb = ProcessTools.createJavaProcessBuilder(getOpts(heapsize, true)); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(getOpts(heapsize, true)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // Only expect large page size if large pages are enabled. @@ -137,7 +137,7 @@ static void testVM(String what, long heapsize, boolean cardsShouldUseLargePages, output.shouldHaveExitValue(0); // Test with large page disabled. - pb = ProcessTools.createJavaProcessBuilder(getOpts(heapsize, false)); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(getOpts(heapsize, false)); output = new OutputAnalyzer(pb.start()); checkSmallTables(output, smallPageSize); diff --git a/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java b/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java index 5255aae6e50..90f8747f3b3 100644 --- a/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java +++ b/test/hotspot/jtreg/gc/g1/TestLargePageUseForHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -87,12 +87,12 @@ static void checkHeap(OutputAnalyzer output, long expectedPageSize) throws Excep static void testVM(long regionSize) throws Exception { ProcessBuilder pb; // Test with large page enabled. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1HeapRegionSize=" + regionSize, - "-Xmx128m", - "-Xlog:gc+init,pagesize,gc+heap+coops=debug", - "-XX:+UseLargePages", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1HeapRegionSize=" + regionSize, + "-Xmx128m", + "-Xlog:gc+init,pagesize,gc+heap+coops=debug", + "-XX:+UseLargePages", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); boolean largePageEnabled = checkLargePageEnabled(output); @@ -100,12 +100,12 @@ static void testVM(long regionSize) throws Exception { output.shouldHaveExitValue(0); // Test with large page disabled. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1HeapRegionSize=" + regionSize, - "-Xmx128m", - "-Xlog:gc+init,pagesize,gc+heap+coops=debug", - "-XX:-UseLargePages", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1HeapRegionSize=" + regionSize, + "-Xmx128m", + "-Xlog:gc+init,pagesize,gc+heap+coops=debug", + "-XX:-UseLargePages", + "-version"); output = new OutputAnalyzer(pb.start()); checkHeap(output, smallPageSize); diff --git a/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java b/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java index 23f014d05cb..d056a5ef747 100644 --- a/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java +++ b/test/hotspot/jtreg/gc/g1/TestMarkStackSizes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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,7 +50,7 @@ private static void runTest(boolean shouldSucceed, String... extraArgs) throws E Collections.addAll(testArguments, extraArgs); testArguments.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testArguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java b/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java index 26ba0da396a..035a6b89679 100644 --- a/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java +++ b/test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ private static OutputAnalyzer testWithMixedGCLiveThresholdPercent(int percent) t basicOpts.add(GCTest.class.getName()); - ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(basicOpts); + ProcessBuilder procBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(basicOpts); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); return analyzer; } diff --git a/test/hotspot/jtreg/gc/g1/TestOneEdenRegionAfterGC.java b/test/hotspot/jtreg/gc/g1/TestOneEdenRegionAfterGC.java index 688d85d4ffb..f6a22c4b841 100644 --- a/test/hotspot/jtreg/gc/g1/TestOneEdenRegionAfterGC.java +++ b/test/hotspot/jtreg/gc/g1/TestOneEdenRegionAfterGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -40,7 +40,7 @@ public class TestOneEdenRegionAfterGC { private static long YoungGenSize = 32 * 1024 * 1024; private static OutputAnalyzer run() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xmn" + YoungGenSize, "-Xmx512M", diff --git a/test/hotspot/jtreg/gc/g1/TestPLABOutput.java b/test/hotspot/jtreg/gc/g1/TestPLABOutput.java index 1462b8d246b..13a496ca47e 100644 --- a/test/hotspot/jtreg/gc/g1/TestPLABOutput.java +++ b/test/hotspot/jtreg/gc/g1/TestPLABOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -59,7 +59,7 @@ public static void runTest() throws Exception { GCTest.class.getName() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java b/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java index 4ba04a38712..6c1e7f16dd3 100644 --- a/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java +++ b/test/hotspot/jtreg/gc/g1/TestPLABSizeBounds.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -62,7 +62,7 @@ public static void runTest(int regionSize, int plabSize, boolean shouldSucceed) testArguments.add("-XX:OldPLABSize=" + plabSize); testArguments.add(GCTest.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testArguments); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldSucceed) { diff --git a/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java b/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java index 5634aa143b2..c80ab7a50e8 100644 --- a/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java +++ b/test/hotspot/jtreg/gc/g1/TestPeriodicLogMessages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -40,22 +40,22 @@ public class TestPeriodicLogMessages { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1PeriodicGCInterval=0", - "-Xlog:gc+init,gc+periodic=debug", - "-Xmx10M", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1PeriodicGCInterval=0", + "-Xlog:gc+init,gc+periodic=debug", + "-Xmx10M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Periodic GC: Disabled"); output.shouldNotContain("Checking for periodic GC"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:G1PeriodicGCInterval=100", - "-Xlog:gc+init,gc+periodic=debug", - "-Xmx10M", - GCTest.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1PeriodicGCInterval=100", + "-Xlog:gc+init,gc+periodic=debug", + "-Xmx10M", + GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); output.shouldContain("Periodic GC: Enabled"); diff --git a/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java b/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java index 08afcfc9aee..bc4d59d9a3c 100644 --- a/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java +++ b/test/hotspot/jtreg/gc/g1/TestPrintRegionRememberedSetInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -69,7 +69,7 @@ public static String runTest(String arg) throws Exception { finalargs.add(RunAndWaitForMarking.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java b/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java index 8d8f77db81a..5d4b4d958f8 100644 --- a/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java +++ b/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,12 +44,12 @@ public class TestRemsetLoggingThreads { private static void runTest(int refinementThreads, int workerThreads) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:+UnlockDiagnosticVMOptions", - "-Xlog:gc+remset+exit=trace", - "-XX:G1ConcRefinementThreads=" + refinementThreads, - "-XX:ParallelGCThreads=" + workerThreads, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", + "-XX:+UnlockDiagnosticVMOptions", + "-Xlog:gc+remset+exit=trace", + "-XX:G1ConcRefinementThreads=" + refinementThreads, + "-XX:ParallelGCThreads=" + workerThreads, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java b/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java index 8a0b4ead475..69f34e07146 100644 --- a/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java +++ b/test/hotspot/jtreg/gc/g1/TestRemsetLoggingTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -77,7 +77,7 @@ public static String runTest(String[] additionalArgs, int numGCs) throws Excepti finalargs.add(VerifySummaryOutput.class.getName()); finalargs.add(String.valueOf(numGCs)); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java b/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java index 841ed393392..d894c58d737 100644 --- a/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java +++ b/test/hotspot/jtreg/gc/g1/TestSharedArchiveWithPreTouch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -59,7 +59,7 @@ public static void main(String[] args) throws Exception { } dump_args.addAll(Arrays.asList(new String[] { "-Xshare:dump", "-Xlog:cds" })); - pb = ProcessTools.createJavaProcessBuilder(dump_args); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(dump_args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); @@ -72,7 +72,7 @@ public static void main(String[] args) throws Exception { } load_args.addAll(Arrays.asList(new String[] { "-Xshare:on", "-version" })); - pb = ProcessTools.createJavaProcessBuilder(load_args.toArray(new String[0])); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(load_args.toArray(new String[0])); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java b/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java index 851115d8fee..645e545443d 100644 --- a/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java +++ b/test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -88,7 +88,7 @@ protected void test() throws Exception { } private void performTest(List opts) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm(opts); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(opts); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println(output.getStdout()); diff --git a/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java b/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java index 3f41a8f45f8..acdce6b6417 100644 --- a/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java +++ b/test/hotspot/jtreg/gc/g1/TestShrinkDefragmentedHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -61,7 +61,7 @@ public class TestShrinkDefragmentedHeap { private static final int REGION_SIZE = 1 * 1024 * 1024; public static void main(String[] args) throws Exception, Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:InitialHeapSize=" + INITIAL_HEAP_SIZE, "-Xmn" + MINIMAL_YOUNG_SIZE, "-Xmx" + MAXIMUM_HEAP_SIZE, diff --git a/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java b/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java index 8666c3c3c4a..4c7190ada02 100644 --- a/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java +++ b/test/hotspot/jtreg/gc/g1/TestSkipRebuildRemsetPhase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -40,16 +40,16 @@ public class TestSkipRebuildRemsetPhase { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:.", - "-XX:+UseG1GC", - "-XX:+UnlockExperimentalVMOptions", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - "-XX:G1MixedGCLiveThresholdPercent=20", - "-Xlog:gc+marking=debug,gc+phases=debug,gc+remset+tracking=trace", - "-Xms10M", - "-Xmx10M", - GCTest.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xbootclasspath/a:.", + "-XX:+UseG1GC", + "-XX:+UnlockExperimentalVMOptions", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "-XX:G1MixedGCLiveThresholdPercent=20", + "-Xlog:gc+marking=debug,gc+phases=debug,gc+remset+tracking=trace", + "-Xms10M", + "-Xmx10M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Skipping Remembered Set Rebuild."); output.shouldContain("No Remembered Sets to update after rebuild"); diff --git a/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java b/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java index 36c6fd6ce60..02ee74bed8b 100644 --- a/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java +++ b/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -178,7 +178,7 @@ private static OutputAnalyzer testWithVerificationType(String[] types, String... basicOpts.add(TriggerGCs.class.getName()); - ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(basicOpts); + ProcessBuilder procBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(basicOpts); OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); return analyzer; diff --git a/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java b/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java index 9cb1cdf7583..e4b4074264d 100644 --- a/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java +++ b/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +90,7 @@ private static OutputAnalyzer spawnMixedGCProvoker(String... extraFlags) Collections.addAll(testOpts, extraFlags); testOpts.add(RunMixedGC.class.getName()); System.out.println(testOpts); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testOpts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(testOpts); return new OutputAnalyzer(pb.start()); } } diff --git a/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java b/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java index c894eb051a2..4d231080a24 100644 --- a/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java +++ b/test/hotspot/jtreg/gc/g1/numa/TestG1NUMATouchRegions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -181,7 +181,7 @@ static void testMemoryTouch(String largePagesSetting, int regionSizeInMB) throws return; } - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:pagesize,gc+heap+region=trace", "-XX:+UseG1GC", diff --git a/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java b/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java index cedb42c2e2f..04607502a22 100644 --- a/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java +++ b/test/hotspot/jtreg/gc/logging/TestDeprecatedPrintFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -42,7 +42,7 @@ public class TestDeprecatedPrintFlags { public static void testPrintGC() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGC", DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintGC", DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-XX:+PrintGC is deprecated. Will use -Xlog:gc instead."); output.shouldNotContain("PrintGCDetails"); @@ -52,7 +52,7 @@ public static void testPrintGC() throws Exception { } public static void testPrintGCDetails() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintGCDetails", DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead."); output.shouldNotContain("PrintGC is deprecated"); @@ -63,7 +63,7 @@ public static void testPrintGCDetails() throws Exception { public static void testXloggc() throws Exception { String fileName = "gc-test.log"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xloggc:" + fileName, DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xloggc:" + fileName, DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead."); output.shouldNotContain("PrintGCDetails"); @@ -80,7 +80,7 @@ public static void testXloggc() throws Exception { public static void testXloggcWithPrintGCDetails() throws Exception { String fileName = "gc-test.log"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "-Xloggc:" + fileName, DoGC.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintGCDetails", "-Xloggc:" + fileName, DoGC.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead."); output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead."); diff --git a/test/hotspot/jtreg/gc/logging/TestGCId.java b/test/hotspot/jtreg/gc/logging/TestGCId.java index f720bfac7ab..dca1681e0e8 100644 --- a/test/hotspot/jtreg/gc/logging/TestGCId.java +++ b/test/hotspot/jtreg/gc/logging/TestGCId.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -74,7 +74,7 @@ private static void verifyContainsGCIDs(OutputAnalyzer output) { private static void testGCId(String gcFlag) throws Exception { ProcessBuilder pb_default = - ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); + ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); verifyContainsGCIDs(new OutputAnalyzer(pb_default.start())); } diff --git a/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java b/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java index 659f7ed9a47..260a62eb5bd 100644 --- a/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java +++ b/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, Google and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -95,7 +95,7 @@ private static void testMetaSpaceUpdate() throws Exception { String testSrc= "-Dtest.src=" + System.getProperty("test.src", "."); ProcessBuilder pb = - ProcessTools.createTestJvm( + ProcessTools.createTestJavaProcessBuilder( "-Xlog:gc*", "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/gc/logging/TestPrintReferences.java b/test/hotspot/jtreg/gc/logging/TestPrintReferences.java index 6272f08e994..99932bc68a6 100644 --- a/test/hotspot/jtreg/gc/logging/TestPrintReferences.java +++ b/test/hotspot/jtreg/gc/logging/TestPrintReferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,10 +67,10 @@ static String indent(int count) { } public static void testRefs() throws Exception { - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder("-Xlog:gc+ref+phases=debug", - "-XX:+UseG1GC", - "-Xmx32M", - GCTest.class.getName()); + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:gc+ref+phases=debug", + "-XX:+UseG1GC", + "-Xmx32M", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start()); checkRefsLogFormat(output); @@ -95,13 +95,13 @@ private static void checkRefsLogFormat(OutputAnalyzer output) { } public static void testPhases(boolean parallelRefProcEnabled) throws Exception { - ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder("-Xlog:gc+phases+ref=debug", - "-XX:+UseG1GC", - "-Xmx32M", - "-XX:" + (parallelRefProcEnabled ? "+" : "-") + "ParallelRefProcEnabled", - "-XX:-UseDynamicNumberOfGCThreads", - "-XX:ParallelGCThreads=2", - GCTest.class.getName()); + ProcessBuilder pb_enabled = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:gc+phases+ref=debug", + "-XX:+UseG1GC", + "-Xmx32M", + "-XX:" + (parallelRefProcEnabled ? "+" : "-") + "ParallelRefProcEnabled", + "-XX:-UseDynamicNumberOfGCThreads", + "-XX:ParallelGCThreads=2", + GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start()); checkLogFormat(output, parallelRefProcEnabled); diff --git a/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java b/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java index d717315b93f..eda71fa9c4b 100644 --- a/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java +++ b/test/hotspot/jtreg/gc/metaspace/TestMetaspaceSizeFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -84,7 +84,7 @@ private static MetaspaceFlags runAndGetValue(long maxMetaspaceSize, long metaspa } private static OutputAnalyzer run(long maxMetaspaceSize, long metaspaceSize) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MaxMetaspaceSize=" + maxMetaspaceSize, "-XX:MetaspaceSize=" + metaspaceSize, "-XX:-UseLargePages", // Prevent us from using 2GB large pages on solaris + sparc. diff --git a/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java b/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java index 5ecacc7be70..a87ed22e15b 100644 --- a/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java +++ b/test/hotspot/jtreg/gc/metaspace/TestSizeTransitions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, Twitter, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -119,7 +119,7 @@ public static void main(String... args) throws Exception { System.out.println(" " + a); } - final ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(jvmArgs); + final ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(jvmArgs); final OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println(output.getStdout()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java b/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java index 9d7d8961527..8480d046dfb 100644 --- a/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java +++ b/test/hotspot/jtreg/gc/serial/HeapChangeLogging.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +41,7 @@ public class HeapChangeLogging { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-Xlog:gc", HeapFiller.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-Xlog:gc", HeapFiller.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String stdout = output.getStdout(); System.out.println(stdout); diff --git a/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java b/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java index e58e8d6db5c..67690d8cad5 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java @@ -56,7 +56,7 @@ public static void main(String[] args) throws Exception { for (int c = 0; c < NUM_RUNS; c++) { Callable task = () -> { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xms128m", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xms128m", "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java b/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java index 41943d4befd..c0161b7a238 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java @@ -41,7 +41,7 @@ public static void testWith(String... args) throws Exception { String[] cmds = Arrays.copyOf(args, args.length + 2); cmds[args.length] = TestObjItrWithHeapDump.class.getName(); cmds[args.length + 1] = "test"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java b/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java index 84795fa4042..b65aa0cd0b4 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java @@ -42,7 +42,7 @@ public static void testWith(String msg, boolean periodic, String... args) throws String[] cmds = Arrays.copyOf(args, args.length + 2); cmds[args.length] = TestPeriodicGC.class.getName(); cmds[args.length + 1] = "test"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java index 3996c19a98d..1057eb4a977 100644 --- a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java +++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx16m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -68,7 +68,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff --git a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java index c996bfd714e..1567e3d05da 100644 --- a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java +++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java @@ -50,7 +50,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx16m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff --git a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java index 0820237ab94..bc32c1f0aa0 100644 --- a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java +++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx16m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -67,7 +67,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff --git a/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java b/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java index 21962b2182d..080842c37f9 100644 --- a/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java +++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java @@ -99,7 +99,7 @@ public static void testWith(boolean shouldPass, String... args) throws Exception pbArgs.add(TestClassLoaderLeak.class.getName()); pbArgs.add("test"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(pbArgs.toArray(new String[0])); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(pbArgs.toArray(new String[0])); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java b/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java index a342b416010..75cb2d5c31a 100644 --- a/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java +++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java @@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx32m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java b/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java index bcda88b553f..2cc2c2c2197 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java @@ -46,7 +46,7 @@ public static void main(String[] args) throws Exception { private static void testHeuristics() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -57,7 +57,7 @@ private static void testHeuristics() throws Exception { output.shouldHaveExitValue(0); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -68,7 +68,7 @@ private static void testHeuristics() throws Exception { output.shouldHaveExitValue(0); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -83,7 +83,7 @@ private static void testHeuristics() throws Exception { private static void testRange(String option, int min, int max) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -94,7 +94,7 @@ private static void testRange(String option, int min, int max) throws Exception output.shouldHaveExitValue(1); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -105,7 +105,7 @@ private static void testRange(String option, int min, int max) throws Exception output.shouldHaveExitValue(0); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -116,7 +116,7 @@ private static void testRange(String option, int min, int max) throws Exception output.shouldHaveExitValue(1); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java b/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java index 4ebdcc33d14..c575b51084c 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java @@ -43,7 +43,7 @@ public static void testWith(String msg, boolean cu, boolean cuConc, String... ar cmds[args.length] = "-Xmx128m"; cmds[args.length + 1] = "-XX:+PrintFlagsFinal"; cmds[args.length + 2] = "-version"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("ClassUnloading"); diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java index 4e8d699ddee..49e7c417130 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java @@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception { }; { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -77,7 +77,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -95,7 +95,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -113,7 +113,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -131,7 +131,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java index 70724658eb8..6499457b667 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java @@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception { }; for (String opt : opts) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java b/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java index f122cc55fcd..c9f1c75b4e1 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java @@ -52,7 +52,7 @@ public static void main(String[] args) throws Exception { private static void testWith(String h, Mode mode) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -73,7 +73,7 @@ private static void testWith(String h, Mode mode) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -94,7 +94,7 @@ private static void testWith(String h, Mode mode) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java b/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java index 9c7ca182210..523f434dbbd 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java @@ -38,7 +38,7 @@ public class TestHumongousThresholdArgs { public static void main(String[] args) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { int[] invalid = new int[] {-100, -1, 0, 101, 1000}; for (int v : valid) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", @@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception { } for (int v : invalid) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java b/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java index f84e576f2f0..79452b6cbc5 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java @@ -44,7 +44,7 @@ public static void testWith(String msg, boolean cls, int iters, String... args) cmds[args.length] = "-Xmx128m"; cmds[args.length + 1] = "-XX:+PrintFlagsFinal"; cmds[args.length + 2] = "-version"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("UseCountedLoopSafepoints"); diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java b/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java index 6c03281c3ca..0c8fea7f993 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestModeUnlock.java @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { private static void testWith(String h, Mode mode) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -72,7 +72,7 @@ private static void testWith(String h, Mode mode) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:-UnlockExperimentalVMOptions", @@ -93,7 +93,7 @@ private static void testWith(String h, Mode mode) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:-UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java b/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java index 17c8b1ed6e3..79d0b517e89 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception { private static void testInvalidRegionSizes() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx1g", @@ -55,7 +55,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms8m", "-Xmx1g", @@ -65,7 +65,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -77,7 +77,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -88,7 +88,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -100,7 +100,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -111,7 +111,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -122,7 +122,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -134,7 +134,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -145,7 +145,7 @@ private static void testInvalidRegionSizes() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms1g", "-Xmx1g", @@ -160,7 +160,7 @@ private static void testInvalidRegionSizes() throws Exception { private static void testMinRegionSize() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -172,7 +172,7 @@ private static void testMinRegionSize() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -184,7 +184,7 @@ private static void testMinRegionSize() throws Exception { output.shouldHaveExitValue(1); } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -196,7 +196,7 @@ private static void testMinRegionSize() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -211,7 +211,7 @@ private static void testMinRegionSize() throws Exception { private static void testMaxRegionSize() throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", @@ -223,7 +223,7 @@ private static void testMaxRegionSize() throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms100m", "-Xmx1g", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java index a6f76f867ef..1e1627d0fe5 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java @@ -90,7 +90,7 @@ public static void main(String[] args) throws Exception { pool.submit(() -> { try { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(conf.toArray(new String[0])); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(conf.toArray(new String[0])); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } catch (Exception e) { diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java b/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java index cd1e3591fe0..78bbf75189c 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSoftMaxHeapSize.java @@ -38,7 +38,7 @@ public class TestSoftMaxHeapSize { public static void main(String[] args) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx128m", @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx128m", @@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-Xms4m", "-Xmx128m", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java b/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java index 8100ff57c05..f7f9ee56b59 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCounts.java @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception { } private static void testWith(int conc, int par) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java b/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java index c8c876c23e5..5e63595e726 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestThreadCountsOverride.java @@ -38,7 +38,7 @@ public class TestThreadCountsOverride { public static void main(String[] args) throws Exception { { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { } { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java index 4c2ece2bafd..0e913375534 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java @@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception { private static void shouldFailAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -81,7 +81,7 @@ private static void shouldFailAll(String h, String[] barriers) throws Exception private static void shouldPassAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java index bf37e8db1b3..84645621eb4 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierEnable.java @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception { private static void shouldFailAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", @@ -73,7 +73,7 @@ private static void shouldFailAll(String h, String[] barriers) throws Exception private static void shouldPassAll(String h, String[] barriers) throws Exception { for (String b : barriers) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", diff --git a/test/hotspot/jtreg/gc/startup_warnings/TestG1.java b/test/hotspot/jtreg/gc/startup_warnings/TestG1.java index c0a06f41bc6..5846639d071 100644 --- a/test/hotspot/jtreg/gc/startup_warnings/TestG1.java +++ b/test/hotspot/jtreg/gc/startup_warnings/TestG1.java @@ -40,7 +40,7 @@ public class TestG1 { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff --git a/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java b/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java index 964a73eee6d..a34dac14e65 100644 --- a/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java +++ b/test/hotspot/jtreg/gc/startup_warnings/TestParallelGC.java @@ -41,7 +41,7 @@ public class TestParallelGC { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParallelGC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseParallelGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff --git a/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java b/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java index 681812a0e22..d4ae6de077a 100644 --- a/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java +++ b/test/hotspot/jtreg/gc/startup_warnings/TestSerialGC.java @@ -40,7 +40,7 @@ public class TestSerialGC { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseSerialGC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseSerialGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff --git a/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java b/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java index a9cff8e41a5..1ab02b2998a 100644 --- a/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java +++ b/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java @@ -40,7 +40,7 @@ public class TestShenandoah { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); diff --git a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java index aac4e3d02c9..3114117a1ef 100644 --- a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java +++ b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -61,7 +61,7 @@ public static void main(String[] args) throws Exception { "-XX:+PrintNMTStatistics" )); baseargs.addAll(Arrays.asList(args)); baseargs.add(GCTest.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(baseargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(baseargs); verifySymbolMemoryUsageNotTooHigh(new OutputAnalyzer(pb.start())); } diff --git a/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java b/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java index 983b9f6c33f..2a02039c60e 100644 --- a/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java +++ b/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -101,7 +101,7 @@ public static void main(String[] args) throws Exception { "-Dregionsize=" + regionSize, TestStressG1HumongousImpl.class.getName() ); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(options); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(options); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java b/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java index e256ea405c2..2f61c166cb8 100644 --- a/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java +++ b/test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -59,7 +59,7 @@ public static void main(String[] args) throws Exception { "-XX:+UseG1GC", StressUncommit.class.getName() ); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(options); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(options); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldMatch("Uncommit regions"); diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java index 6a9a197a58b..b5441b4cbcc 100644 --- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java +++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java @@ -299,7 +299,7 @@ private static OutputAnalyzer runTest(String... extraArgs) throws Exception { args.addAll(Arrays.asList(defaultArgs)); args.addAll(Arrays.asList(extraArgs)); - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.err.println(output.getStderr()); System.out.println(output.getStdout()); diff --git a/test/hotspot/jtreg/gc/whitebox/TestWBGC.java b/test/hotspot/jtreg/gc/whitebox/TestWBGC.java index c2cb35d4f9d..c2fe2633e4e 100644 --- a/test/hotspot/jtreg/gc/whitebox/TestWBGC.java +++ b/test/hotspot/jtreg/gc/whitebox/TestWBGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -43,7 +43,7 @@ public class TestWBGC { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff --git a/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java index 30cd1984c5c..de3d1f585a7 100644 --- a/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java +++ b/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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,7 +41,7 @@ public static void main(String[] args) throws Exception { final String heapBackingFile = "Heap Backing File: " + directory; final String failedToCreateFile = "Failed to create file " + directory; - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:-ZGenerational", "-Xlog:gc*", diff --git a/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java b/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java index 17b463b0cd9..5a20ee8322a 100644 --- a/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java +++ b/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -68,7 +68,7 @@ public static void main(String[] args) throws Exception { } public static void main(String[] args) throws Exception { - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:-ZGenerational", "-Xms128M", diff --git a/test/hotspot/jtreg/gc/x/TestSmallHeap.java b/test/hotspot/jtreg/gc/x/TestSmallHeap.java index 6710838c815..0fc6477b59b 100644 --- a/test/hotspot/jtreg/gc/x/TestSmallHeap.java +++ b/test/hotspot/jtreg/gc/x/TestSmallHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception { for (var maxCapacity: args) { - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:-ZGenerational", "-Xlog:gc,gc+init,gc+reloc,gc+heap", diff --git a/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java index 5a39792aade..f5a6113f6ff 100644 --- a/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java +++ b/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java @@ -41,7 +41,7 @@ public static void main(String[] args) throws Exception { final String heapBackingFile = "Heap Backing File: " + directory; final String failedToCreateFile = "Failed to create file " + directory; - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xlog:gc*", diff --git a/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java b/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java index ca39c35518e..629edccd496 100644 --- a/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java +++ b/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java @@ -68,7 +68,7 @@ public static void main(String[] args) throws Exception { } public static void main(String[] args) throws Exception { - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xms128M", diff --git a/test/hotspot/jtreg/gc/z/TestSmallHeap.java b/test/hotspot/jtreg/gc/z/TestSmallHeap.java index 1b73d5735a7..bfe1c0310ca 100644 --- a/test/hotspot/jtreg/gc/z/TestSmallHeap.java +++ b/test/hotspot/jtreg/gc/z/TestSmallHeap.java @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception { for (var maxCapacity: args) { - ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder( + ProcessTools.executeProcess(ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xlog:gc,gc+init,gc+reloc,gc+heap", diff --git a/test/hotspot/jtreg/gc/z/TestZForceDiscontiguousHeapReservations.java b/test/hotspot/jtreg/gc/z/TestZForceDiscontiguousHeapReservations.java index 18b37c21442..2993038faa5 100644 --- a/test/hotspot/jtreg/gc/z/TestZForceDiscontiguousHeapReservations.java +++ b/test/hotspot/jtreg/gc/z/TestZForceDiscontiguousHeapReservations.java @@ -45,7 +45,7 @@ private static void testValue(int n) throws Exception { */ final int XmxInM = 2000; final int XmsInM = Math.min(16 * XmxInM / (n + 1), XmxInM); - OutputAnalyzer oa = ProcessTools.executeProcess(ProcessTools.createTestJvm( + OutputAnalyzer oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xms" + XmsInM + "M", diff --git a/test/hotspot/jtreg/gc/z/TestZNMT.java b/test/hotspot/jtreg/gc/z/TestZNMT.java index 87a8643fcd5..066ebd063f6 100644 --- a/test/hotspot/jtreg/gc/z/TestZNMT.java +++ b/test/hotspot/jtreg/gc/z/TestZNMT.java @@ -68,7 +68,7 @@ private static void testValue(int zForceDiscontiguousHeapReservations) throws Ex * reservations. */ final int XmsInM = Math.min(16 * XmxInM / (zForceDiscontiguousHeapReservations + 1), XmxInM); - OutputAnalyzer oa = ProcessTools.executeProcess(ProcessTools.createTestJvm( + OutputAnalyzer oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xms" + XmsInM + "M", diff --git a/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java b/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java index b423453ce77..236d2eb9486 100644 --- a/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java +++ b/test/hotspot/jtreg/resourcehogs/serviceability/jvmti/GetObjectSizeOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +56,7 @@ public static void main(String[] args) throws Exception { var jar = new ProcessBuilder(JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", "agent.jar", "GetObjectSizeOverflowAgent.class"); new OutputAnalyzer(jar.start()).shouldHaveExitValue(0); - ProcessBuilder pt = ProcessTools.createTestJvm("-Xmx4000m", "-javaagent:agent.jar", "GetObjectSizeOverflowAgent"); + ProcessBuilder pt = ProcessTools.createTestJavaProcessBuilder("-Xmx4000m", "-javaagent:agent.jar", "GetObjectSizeOverflowAgent"); OutputAnalyzer output = new OutputAnalyzer(pt.start()); output.stdoutShouldContain("GetObjectSizeOverflow passed"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java b/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java index 7de7245d862..db7cfebfd90 100644 --- a/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java +++ b/test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -35,7 +35,7 @@ public class TestUnrecognizedVmOption { static final String OPTION="this_is_not_an_option"; public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-showversion", "-XX:" + OPTION); new OutputAnalyzer(pb.start()) .shouldNotHaveExitValue(0) diff --git a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java index c84bc7e0159..ebbae35e4e0 100644 --- a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java +++ b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,7 +28,7 @@ import static java.util.Arrays.stream; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; -import static jdk.test.lib.process.ProcessTools.createJavaProcessBuilder; +import static jdk.test.lib.process.ProcessTools.createLimitedTestJavaProcessBuilder; import static jdk.test.lib.Platform.isWindows; import jdk.test.lib.Utils; import jdk.test.lib.Platform; @@ -229,7 +229,7 @@ public static void main(String[] args) throws Exception { throw new SkippedException("Could not find lsof like command"); } - ProcessBuilder pb = createJavaProcessBuilder( + ProcessBuilder pb = createLimitedTestJavaProcessBuilder( "-Xlog:gc:\"" + logPath + "\"", "-Dtest.jdk=" + getProperty("test.jdk"), VMStartedWithLogging.class.getName(), @@ -250,7 +250,7 @@ static class VMStartedWithLogging { // second VM public static void main(String[] args) throws IOException, InterruptedException { System.out.println(SECOND_VM_PID_PREFIX + ProcessHandle.current().pid()); - ProcessBuilder pb = createJavaProcessBuilder( + ProcessBuilder pb = createLimitedTestJavaProcessBuilder( "-Dtest.jdk=" + getProperty("test.jdk"), VMShouldNotInheritFileDescriptors.class.getName(), args[0], diff --git a/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java b/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java index c4dd815cc4a..d94dd1fb927 100644 --- a/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java +++ b/test/hotspot/jtreg/runtime/BadObjectClass/BootstrapRedefine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { "--patch-module=java.base"), "mods/java.base"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.base=mods/java.base", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Incompatible definition of java.lang.Object") .shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java b/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java index 8d6f0fddacd..67c6ca493df 100644 --- a/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java +++ b/test/hotspot/jtreg/runtime/BootClassAppendProp/BootClassPathAppend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -38,7 +38,7 @@ public class BootClassPathAppend { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintCompilation", "-Xcomp", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java b/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java index a8a8aa060bf..fb00abb3d18 100644 --- a/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java +++ b/test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -107,7 +107,7 @@ public Class loadClass(String name) throws ClassNotFoundException { }; cl.loadClass(classTestCName); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", classTestCName); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", classTestCName); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String test_output = output.getOutput(); if (test_output == null) { diff --git a/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java b/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java index 77c367a0c23..008165314f4 100644 --- a/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java +++ b/test/hotspot/jtreg/runtime/BootstrapMethod/TestLambdaExceptionInInitializer.java @@ -37,7 +37,7 @@ public class TestLambdaExceptionInInitializer { public static void main(String args[]) throws Throwable { // Run Lamba class - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("TestPkg.Lambda"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("TestPkg.Lambda"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldMatch("Exception in thread \".+\" java.lang.ExceptionInInitializerError"); diff --git a/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java b/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java index be97d1cf056..51b0469ce46 100644 --- a/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java +++ b/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -42,7 +42,7 @@ public class CDSCompressedKPtrs { public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:dump", "-Xlog:cds"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -50,7 +50,7 @@ public static void main(String[] args) throws Exception { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java b/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java index 19c4128f460..e53758a671a 100644 --- a/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java +++ b/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ public class XShareAuto { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-server", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./XShareAuto.jsa", "-Xshare:dump", "-Xlog:cds"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception { }; for (String x : cases) { - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./XShareAuto.jsa", "-Xlog:cds", diff --git a/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java b/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java index 0ff1f0a65be..8ab2d2252a8 100644 --- a/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java +++ b/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -38,7 +38,7 @@ public class FormatCheckingTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("BadHelloWorld"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("BadHelloWorld"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError: Illegal class name"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java b/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java index 4d2c74360c7..8563c79b19c 100644 --- a/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java +++ b/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -70,7 +70,7 @@ public static void main(String[] args) throws Exception { // ======= execute the test // We run the test with MallocLimit set to 768m in oom mode, // in order to trigger and observe a fake os::malloc oom. This needs NMT. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", ".", "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=summary", diff --git a/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java b/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java index b82f03786ec..9ea18f5e2fc 100644 --- a/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java +++ b/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -64,7 +64,7 @@ public static void main(String[] args) throws Exception { // ======= execute the test // We run the test with MallocLimit set to 768m in oom mode, // in order to trigger and observe a fake os::malloc oom. This needs NMT. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", ".", "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=summary", diff --git a/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java b/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java index 160d0559fbe..9e3ae8de832 100644 --- a/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java +++ b/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -54,21 +54,21 @@ public static void main(String args[]) throws Throwable { // Run the test. This should fail because --enable-preview is not specified. ClassFileInstaller.writeClassToDisk("PVTest", klassbuf, System.getProperty("test.classes")); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "PVTest"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("Preview features are not enabled"); oa.shouldHaveExitValue(1); // This should be successful because --enable-preview is specified. - pb = ProcessTools.createJavaProcessBuilder("--enable-preview", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("--enable-preview", "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "PVTest"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("Hi!"); oa.shouldHaveExitValue(0); // Test -Xlog:class+preview - pb = ProcessTools.createJavaProcessBuilder("--enable-preview", "-Xlog:class+preview", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("--enable-preview", "-Xlog:class+preview", "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "PVTest"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("[info][class,preview] Loading class PVTest that depends on preview features"); diff --git a/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java b/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java index a6f64e96bb6..3c041ed2536 100644 --- a/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java +++ b/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -42,7 +42,7 @@ public class TestCheckedExceptions { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:exceptions=warning", "CheckedExceptions"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java b/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java index 3ac53335ea4..c61f46c3ecd 100644 --- a/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java +++ b/test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +41,7 @@ public class UnsupportedClassFileVersion implements Opcodes { public static void main(String... args) throws Exception { writeClassFile(); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "ClassFile"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "ClassFile"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("ClassFile has been compiled by a more recent version of the " + "Java Runtime (class file version 99.0), this version of " + diff --git a/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java b/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java index 55278a67bc2..1ca819497fa 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java @@ -37,14 +37,14 @@ public class BooleanFlagWithInvalidValue { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings=8", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Improperly specified VM option 'PrintWarnings=8'"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-PrintWarnings=8", "-version"); output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java b/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java index 6d8e2eeac61..6b40dc0a357 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java @@ -47,7 +47,7 @@ public static void main(String[] args) throws Exception { pw.println("aaa, aaa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-XX:CompileCommandFile=hs_comp.txt", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompileCommandFile=hs_comp.txt", "-version"); output = new OutputAnalyzer(pb.start()); // problems in CompileCommandFile are treated as warnings output.shouldHaveExitValue(0); @@ -61,7 +61,7 @@ public static void main(String[] args) throws Exception { pw.println("aa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("warning: .hotspot_compiler file is present but has been ignored. Run with -XX:CompileCommandFile=.hotspot_compiler to load the file."); diff --git a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java index 471c71a0046..4f31b210da1 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { pw.close(); // start VM - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-XX:Flags=.hotspotrc", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java index 62aef23b580..d9e72fa300a 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java @@ -47,7 +47,7 @@ public static void main(String[] args) throws Exception { pw.println("aaa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-XX:Flags=hs_flags.txt","-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:Flags=hs_flags.txt","-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Unrecognized VM option 'aaa'"); output.shouldHaveExitValue(1); @@ -58,7 +58,7 @@ public static void main(String[] args) throws Exception { pw.println("aa"); pw.close(); - pb = ProcessTools.createJavaProcessBuilder("-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldContain("warning: .hotspotrc file is present but has been ignored. Run with -XX:Flags=.hotspotrc to load the file."); diff --git a/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java b/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java index 52188885c41..6ed785fe0fc 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java @@ -37,7 +37,7 @@ public class DoubleFlagWithIntegerValue { public static void testDoubleFlagWithValue(String value) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:SweeperThreshold=" + value, "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:SweeperThreshold=" + value, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Improperly specified VM option"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java b/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java index 5cfc3497a94..c16a05a79a8 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java @@ -37,7 +37,7 @@ public class FlagWithInvalidValue { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MaxRAMPercentage=v", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java b/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java index 36f58fb3a97..4a5a4f7127b 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java @@ -38,7 +38,7 @@ public class IgnoreUnrecognizedVMOptions { private static void runJavaAndCheckExitValue(boolean shouldSucceed, String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldSucceed) { output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java b/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java index 0aead709245..5ea305431b0 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java +++ b/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java @@ -37,14 +37,14 @@ public class NonBooleanFlagWithInvalidBooleanPrefix { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-MaxRAMPercentage=1", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMPercentage=1'"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+MaxRAMPercentage=1", "-version"); output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java b/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java index 8de8292611b..1dc1cd9976b 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java @@ -41,7 +41,7 @@ public static void main(String[] args) throws Exception { String flag = "DummyObsoleteTestFlag"; // Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449) - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:" + flag + "PlusJunk", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception { output.shouldHaveExitValue(1); // Case 2: Newly obsolete flags should be recognized as newly obsolete (8073989) - ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb2 = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+" + flag, "-version"); OutputAnalyzer output2 = new OutputAnalyzer(pb2.start()); diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java index b56cc376788..b5b15f6d75f 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { OutputAnalyzer output; System.out.println("Verify jcmd error message and that jcmd does not write errors to the target process output"); - output = new OutputAnalyzer((ProcessTools.createJavaProcessBuilder( + output = new OutputAnalyzer((ProcessTools.createLimitedTestJavaProcessBuilder( "-Dtest.jdk=" + System.getProperty("test.jdk"), "-XX:MinHeapFreeRatio=20", "-XX:MaxHeapFreeRatio=80", runJcmd.class.getName())).start()); diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java index ed37cc65601..78a508343d6 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -417,7 +417,7 @@ private boolean runJavaWithParam(String optionValue, boolean valid) throws Excep runJava.add(optionValue); runJava.add(JVMStartup.class.getName()); - out = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(runJava).start()); + out = new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder(runJava).start()); exitCode = out.getExitValue(); String exitCodeString = null; diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java index ba0b2f7d61f..031d30bf2bd 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -469,7 +469,7 @@ private static Map getOptionsAsMap(boolean withRanges, Predic runJava.add(PRINT_FLAGS_RANGES); runJava.add("-version"); - p = ProcessTools.createJavaProcessBuilder(runJava).start(); + p = ProcessTools.createLimitedTestJavaProcessBuilder(runJava).start(); result = getJVMOptions(new InputStreamReader(p.getInputStream()), withRanges, acceptOrigin); diff --git a/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java b/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java index 3d0dab15ce1..7f646edfdcc 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java +++ b/test/hotspot/jtreg/runtime/CommandLine/TestHexArguments.java @@ -39,13 +39,13 @@ public class TestHexArguments { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:SharedBaseAddress=0x1D000000", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Could not create the Java Virtual Machine"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:SharedBaseAddress=1D000000", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java b/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java index bae2aaf5ceb..04bdd25714f 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java +++ b/test/hotspot/jtreg/runtime/CommandLine/TestLongUnrecognizedVMOption.java @@ -43,7 +43,7 @@ public class TestLongUnrecognizedVMOption { public static void main(String[] args) throws Exception { OutputAnalyzer output; - output = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder("-XX:" + VERY_LONG_OPTION, "-version").start()); + output = new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:" + VERY_LONG_OPTION, "-version").start()); output.shouldHaveExitValue(1); output.shouldContain(String.format("Unrecognized VM option '%s'", VERY_LONG_OPTION)); } diff --git a/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java b/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java index 20a6f73ad1e..e31a7e2cd17 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java +++ b/test/hotspot/jtreg/runtime/CommandLine/TestNullTerminatedFlags.java @@ -58,7 +58,7 @@ public static void main(String args[]) throws Exception{ for (String option : options) { String testOption = option + "junk"; ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder(testOption, "-version"); + ProcessTools.createLimitedTestJavaProcessBuilder(testOption, "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Unrecognized option: " + testOption) .shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java b/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java index 58a7307cafa..4ebeb9b7025 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/TestVMOptions.java @@ -38,7 +38,7 @@ public class TestVMOptions { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:bogus", "-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsInitial"); @@ -46,7 +46,7 @@ public static void main(String[] args) throws Exception { output.shouldHaveExitValue(0); output.shouldContain("bool UseSerialGC"); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-PrintVMOptions", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception { File dir = new File(System.getProperty("test.src", ".")); File file = new File(dir, "flagfile.txt"); String s = file.getAbsolutePath(); - pb = ProcessTools.createJavaProcessBuilder("-XX:Flags="+s); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:Flags="+s); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("VM option '-IgnoreUnrecognizedVMOptions'"); diff --git a/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java b/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java index 3f719849f08..09b51712c05 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java +++ b/test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java @@ -38,7 +38,7 @@ public class TraceExceptionsTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:exceptions=info", "NoClassFound"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(""); diff --git a/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java b/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java index 388b4e9fa5f..dfbb08d2f68 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java +++ b/test/hotspot/jtreg/runtime/CommandLine/UnrecognizedVMOption.java @@ -44,7 +44,7 @@ public static void main(String[] args) throws Exception { "bogus_option", }; for (String option : badOptions) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:" + option, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index 6d847088f0d..95dd88c7223 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -101,7 +101,7 @@ static void testDeprecated(String[][] optionInfo) throws Throwable { // command line by -XX:+UnlockDiagnosticVMOptions. static void testDeprecatedDiagnostic(String option, String value) throws Throwable { String XXoption = CommandLineOptionTest.prepareFlag(option, value); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS, XXoption, "-version"); OutputAnalyzer output = new OutputAnalyzer(processBuilder.start()); // check for option deprecation message: @@ -114,7 +114,7 @@ static void testDeprecatedDiagnostic(String option, String value) throws Throwa // command line by -XX:+UnlockExperimentalVMOption. static void testDeprecatedExperimental(String option, String value) throws Throwable { String XXoption = CommandLineOptionTest.prepareFlag(option, value); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, XXoption, "-version"); OutputAnalyzer output = new OutputAnalyzer(processBuilder.start()); // check for option deprecation message: diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java index 32f9bab43c6..e4740a3bcb7 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java @@ -38,7 +38,7 @@ public class VMOptionWarning { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'AlwaysSafeConstructors' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions."); @@ -48,17 +48,17 @@ public static void main(String[] args) throws Exception { return; } - pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintInlining", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintInlining", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'PrintInlining' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions."); - pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStack", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+VerifyStack", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM."); - pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+CheckCompressedOops", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM."); diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java b/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java index e9daf2575f7..675e688fa35 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java @@ -248,7 +248,7 @@ private static ProcessBuilder createProcessBuilder() throws Exception { runJava.add(PrintPropertyAndOptions.class.getName()); runJava.addAll(appParams); - pb = ProcessTools.createJavaProcessBuilder(runJava); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(runJava); VMParams.clear(); appParams.clear(); diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java index 6471abea794..ff64f605a35 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java @@ -59,7 +59,7 @@ static boolean testNarrowKlassBase() { // CDS off, small heap, ccs size default (1G) // A small heap should allow us to place the ccs within the lower 32G and thus allow zero based encoding. public static void smallHeapTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedBaseAddress=8g", "-Xmx128m", @@ -76,7 +76,7 @@ public static void smallHeapTest() throws Exception { // CDS off, small heap, ccs size explicitely set to 1G // A small heap should allow us to place the ccs within the lower 32G and thus allow zero based encoding. public static void smallHeapTestWith1G() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=1g", "-Xmx128m", @@ -94,7 +94,7 @@ public static void smallHeapTestWith1G() throws Exception { // We expect the ccs to be mapped somewhere far beyond the heap, such that it is not possible // to use zero based encoding. public static void largeHeapTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", "-Xmx30g", @@ -119,7 +119,7 @@ public static void largeHeapTest() throws Exception { // for compressed oops. // We expect a zerobased ccs. public static void largeHeapAbove32GTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockExperimentalVMOptions", "-Xmx31g", @@ -140,7 +140,7 @@ public static void largeHeapAbove32GTest() throws Exception { // Using large paged heap, metaspace uses small pages. public static void largePagesForHeapTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx128m", "-XX:+UseLargePages", @@ -154,7 +154,7 @@ public static void largePagesForHeapTest() throws Exception { } public static void heapBaseMinAddressTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:HeapBaseMinAddress=1m", "-Xlog:gc+heap+coops=debug", "-version"); @@ -165,7 +165,7 @@ public static void heapBaseMinAddressTest() throws Exception { public static void sharingTest() throws Exception { // Test small heaps - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CompressedClassPointers.jsa", "-Xmx128m", @@ -181,7 +181,7 @@ public static void sharingTest() throws Exception { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CompressedClassPointers.jsa", "-Xmx128m", @@ -200,7 +200,7 @@ public static void sharingTest() throws Exception { } public static void smallHeapTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -216,7 +216,7 @@ public static void smallHeapTestNoCoop() throws Exception { } public static void smallHeapTestWith1GNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -236,7 +236,7 @@ public static void smallHeapTestWith1GNoCoop() throws Exception { } public static void largeHeapTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -256,7 +256,7 @@ public static void largeHeapTestNoCoop() throws Exception { } public static void largePagesTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -270,7 +270,7 @@ public static void largePagesTestNoCoop() throws Exception { } public static void heapBaseMinAddressTestNoCoop() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:HeapBaseMinAddress=1m", @@ -283,7 +283,7 @@ public static void heapBaseMinAddressTestNoCoop() throws Exception { public static void sharingTestNoCoop() throws Exception { // Test small heaps - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", @@ -301,7 +301,7 @@ public static void sharingTestNoCoop() throws Exception { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java index 5eaced668f0..e0ec1271346 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -42,23 +42,23 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; OutputAnalyzer output; // Minimum size is 1MB - pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=0", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=0", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("outside the allowed range") .shouldHaveExitValue(1); // Invalid size of -1 should be handled correctly - pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=-1", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=-1", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Improperly specified VM option 'CompressedClassSpaceSize=-1'") .shouldHaveExitValue(1); // Maximum size is 3GB - pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=4g", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=4g", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("outside the allowed range") .shouldHaveExitValue(1); @@ -67,28 +67,28 @@ public static void main(String[] args) throws Exception { // Make sure the minimum size is set correctly and printed // (Note: ccs size are rounded up to the next larger root chunk boundary (16m). // Note that this is **reserved** size and does not affect rss. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", - "-XX:CompressedClassSpaceSize=1m", - "-Xlog:gc+metaspace=trace", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + "-XX:CompressedClassSpaceSize=1m", + "-Xlog:gc+metaspace=trace", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldMatch("Compressed class space.*16777216") .shouldHaveExitValue(0); // Make sure the maximum size is set correctly and printed - pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", - "-XX:CompressedClassSpaceSize=3g", - "-Xlog:gc+metaspace=trace", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + "-XX:CompressedClassSpaceSize=3g", + "-Xlog:gc+metaspace=trace", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldMatch("Compressed class space.*3221225472") .shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:-UseCompressedClassPointers", - "-XX:CompressedClassSpaceSize=1m", - "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-UseCompressedClassPointers", + "-XX:CompressedClassSpaceSize=1m", + "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used") .shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java index 28c517bbca9..403654d1cc8 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +50,7 @@ private static void runWithAlignment(int alignment) throws Exception { ProcessBuilder pb; OutputAnalyzer output; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", "-XX:ObjectAlignmentInBytes=" + alignment, diff --git a/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java b/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java index f9c6d6921aa..0cf4a72f519 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -74,8 +74,8 @@ public static void main(String[] args) throws Exception { } private static OutputAnalyzer testObjectAlignment(int alignment) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:ObjectAlignmentInBytes=" + alignment, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ObjectAlignmentInBytes=" + alignment, + "-version"); return new OutputAnalyzer(pb.start()); } } diff --git a/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java b/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java index bf4d58232a8..3d118bf73b1 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -189,7 +189,7 @@ private static OutputAnalyzer testCompressedOops(ArrayList flags1, Strin args.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); return new OutputAnalyzer(pb.start()); } } diff --git a/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java b/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java index 493f02f3036..4e4a9329f5d 100644 --- a/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java +++ b/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -43,7 +43,7 @@ public class CleanProtectionDomain { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:protectiondomain+table=debug", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java b/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java index 756bff98ffb..423fba7d221 100644 --- a/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java +++ b/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -98,7 +98,7 @@ public static void main(final String[] args) throws Exception { } public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.security.policy==" + System.getProperty("test.src") + File.separator + "test.policy", "-Dtest.classes=" + System.getProperty("test.classes", "."), "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java b/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java index db6b924078b..9b9acdce023 100644 --- a/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java +++ b/test/hotspot/jtreg/runtime/EnclosingMethodAttr/EnclMethodAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -42,7 +42,7 @@ public class EnclMethodAttr { public static void main(String args[]) throws Throwable { System.out.println("Regression test for bug 8044738"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("EnclMethTest"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("EnclMethTest"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotHaveExitValue(0); output.shouldContain("java.lang.ClassFormatError: Wrong EnclosingMethod"); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java index af4553f0022..435deeb696d 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/BadNativeStackInErrorHandlingTest.java @@ -45,7 +45,7 @@ // This test was adapted from SafeFetchInErrorHandlingTest.java. public class BadNativeStackInErrorHandlingTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:ErrorHandlerTest=14", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java b/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java index 68fbf40e441..4b4e41944de 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ClassPathEnvVar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -51,9 +51,9 @@ public static void main(String[] args) throws Exception { } private static OutputAnalyzer runCrasher() throws Exception { ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder("-XX:-CreateCoredumpOnCrash", - "-XX:ErrorHandlerTest=14", - "-XX:+ErrorFileToStdout"); + ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-CreateCoredumpOnCrash", + "-XX:ErrorHandlerTest=14", + "-XX:+ErrorFileToStdout"); // Obtain the CLASSPATH setting and expand it to more than 2000 chars. Map envMap = pb.environment(); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java b/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java index 36502046570..73efc0e5e46 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/CreateCoredumpOnCrash.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -59,7 +59,7 @@ public static void main(String[] args) throws Exception { } public static OutputAnalyzer runTest(String option) throws Exception { return new OutputAnalyzer( - ProcessTools.createJavaProcessBuilder( + ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", option, Crasher.class.getName()) .start()); } diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java index ea8e944aebb..5fcb4ec5f9e 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java @@ -97,7 +97,7 @@ public static void do_test(boolean with_percent_p) throws Exception { System.out.println("First crash..."); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=1", @@ -123,7 +123,7 @@ public static void do_test(boolean with_percent_p) throws Exception { System.out.println("Second crash..."); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=2", // << now 2 diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java index 3c32c6f8141..0e03317d640 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileRedirectTest.java @@ -48,7 +48,7 @@ public class ErrorFileRedirectTest { public static void do_test(boolean redirectStdout, boolean redirectStderr) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=14", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java index 8dced9a3a9c..5717a576e65 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java @@ -115,7 +115,7 @@ public static void main(String[] args) throws Exception { * expected to have a min number of MachCode sections. */ private static void run(boolean crashInJava) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", "-Xcomp", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java index d57a2bf29c2..b53dadfc41e 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { // Need to disable ShowRegistersOnAssert: that flag causes registers to be shown, which calls os::print_location, // which - as part of its checks - will iterate the threads list under a ThreadListHandle, changing the max nesting // counters and confusing this test. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+EnableThreadSMRStatistics", "-Xmx100M", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java index dc54b09156c..e3d9c90408d 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ProblematicFrameTest.java @@ -47,7 +47,7 @@ public static void main(String[] args) { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx64m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", Crasher.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Exception in thread"); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java index 279b07ffff7..92327d96dfb 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ReattemptErrorTest.java @@ -57,7 +57,7 @@ public static void main(String[] args) throws Exception { // * Third a step will use almost all stack space and then fault with SIGSEGV. After this the // proceeding reattempt steps will be skipped because of low stack headroom. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java index 77f8be01887..5bbc4cfac00 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java @@ -48,7 +48,7 @@ public class ResourceMarkTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java index 01c5c5e7953..a08d673115c 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java @@ -47,7 +47,7 @@ public class SafeFetchInErrorHandlingTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:ErrorHandlerTest=14", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java index 9f689380c70..012d5a5c16d 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java @@ -80,7 +80,7 @@ public static void main(String[] args) throws Exception { // We also check, optionally, that +ErrorLogSecondaryErrorDetails produces callstacks for // the secondary error. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java index f2214204f4e..b861e44532d 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ShowRegistersOnAssertTest.java @@ -55,7 +55,7 @@ private static void do_test(boolean do_assert, // true - assert, false - guarant { System.out.println("Testing " + (do_assert ? "assert" : "guarantee") + " with " + (show_registers_on_assert ? "-XX:+ShowRegistersOnAssert" : "-XX:-ShowRegistersOnAssert") + "..."); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=" + (do_assert ? "1" : "2"), (show_registers_on_assert ? "-XX:+ShowRegistersOnAssert" : "-XX:-ShowRegistersOnAssert"), diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java b/test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java index 0c9c846c8b6..7d7deffdb6e 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java @@ -65,7 +65,7 @@ public static void testStackWalkNativeToJavaNative(String... extraFlags) throws commands.addAll(Arrays.asList(extraFlags)); commands.add("StackWalkNativeToJava$TestNativeToJavaNative"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(commands); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(commands); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.RuntimeException: Reached statement after obj.wait()"); output.shouldNotContain("[error occurred during error reporting (printing native stack"); @@ -99,7 +99,7 @@ public static void testStackWalkNativeToJava(String... extraFlags) throws Except commands.addAll(Arrays.asList(extraFlags)); commands.add("StackWalkNativeToJava$TestNativeToJava"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(commands); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(commands); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.RuntimeException: Reached statement after synchronized"); output.shouldNotContain("[error occurred during error reporting (printing native stack"); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java index 232cde09043..1859589daca 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestAbortVmOnException.java @@ -59,12 +59,12 @@ public static void main(String[] args) throws Exception { private static Process runProcess(String exceptionName, boolean withMessage, String exceptionMessage) throws IOException { if (exceptionMessage == null) { - return ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + return ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:AbortVMOnException=" + exceptionName, "-Xcomp", "-XX:TieredStopAtLevel=3", "-XX:-CreateCoredumpOnCrash", "-XX:CompileCommand=compileonly,TestAbortVmOnException::*", TestAbortVmOnException.class.getName(), withMessage ? "throwExceptionWithMessage" : "throwException").start(); } else { - return ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + return ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:AbortVMOnException=" + exceptionName, "-XX:AbortVMOnExceptionMessage=" + exceptionMessage, "-Xcomp", "-XX:TieredStopAtLevel=3", "-XX:-CreateCoredumpOnCrash", "-XX:CompileCommand=compileonly,TestAbortVmOnException::*", TestAbortVmOnException.class.getName(),withMessage ? "throwExceptionWithMessage" : "throwException").start(); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java index da46cd9e811..0be39d22ebe 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception { } } // else this is the main test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", "-XX:-CreateCoredumpOnCrash", "-Xmx128m", TestCrashOnOutOfMemoryError.class.getName(),"throwOOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); int exitValue = output.getExitValue(); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java index fe0ce208d36..df7d8a5b44a 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java @@ -120,7 +120,7 @@ private static void test() throws Exception { private static void runAndCheck(Flags flags, DwarfConstraint... constraints) throws Exception { OutputAnalyzer crashOut; - crashOut = ProcessTools.executeProcess(ProcessTools.createTestJvm(flags.getFlags())); + crashOut = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(flags.getFlags())); String crashOutputString = crashOut.getOutput(); Asserts.assertNotEquals(crashOut.getExitValue(), 0, "Crash JVM should not exit gracefully"); System.out.println(crashOutputString); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java index e56ed4a1b03..145dd4aadc9 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception { } // else this is the main test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+ExitOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+ExitOnOutOfMemoryError", "-Xmx128m", TestExitOnOutOfMemoryError.class.getName(), "throwOOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java index a2a0154f0b3..5f4c1dd9b1a 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestGZippedHeapDumpOnOutOfMemoryError.java @@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception { } static void test(int level) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpGzipLevel=" + level, "-Xmx128M", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java index 9324adbb2e0..fb098bd27fe 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java @@ -75,7 +75,7 @@ public static void main(String[] args) throws Exception { static void test(String type) throws Exception { String heapdumpFilename = type + ".hprof"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=" + heapdumpFilename, // Note: When trying to provoke a metaspace OOM we may generate a lot of classes. In debug VMs this // can cause considerable wait times since: diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java index 0cc6dbc765f..167b94e1fe1 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpPath.java @@ -54,7 +54,7 @@ static void testHeapDumpPath() throws Exception { String heapdumpPath = "dumps"; File dumpDirectory = new File(heapdumpPath); dumpDirectory.mkdir(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError", "-Xmx64m", "-XX:HeapDumpPath=" + heapdumpPath, TestHeapDumpPath.class.getName(), "OOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java index 00475f8bdd7..53410c5379c 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java @@ -41,7 +41,7 @@ public class TestOnError { public static void main(String[] args) throws Exception { String msg = "Test Succeeded"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=14", // trigger potential SEGV "-XX:OnError=echo " + msg, diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java index fe3c5c34f80..f498caa2bff 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestOnOutOfMemoryError.java @@ -47,12 +47,12 @@ public static void main(String[] args) throws Exception { // else this is the main test String msg1 = "Test1 Succeeded"; String msg2 = "Test2 Succeeded"; - ProcessBuilder pb_single = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_single = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:OnOutOfMemoryError=echo " + msg1, TestOnOutOfMemoryError.class.getName(), "throwOOME"); - ProcessBuilder pb_multiple = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb_multiple = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:OnOutOfMemoryError=echo " + msg1, "-XX:OnOutOfMemoryError=echo " + msg2, TestOnOutOfMemoryError.class.getName(), diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java index c1e098b781d..7d6a18f6cdb 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java @@ -46,7 +46,7 @@ public class TestSigInfoInHsErrFile { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestSymbolsInHsErrFile.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestSymbolsInHsErrFile.java index b6a7b582611..c8ab832058c 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestSymbolsInHsErrFile.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestSymbolsInHsErrFile.java @@ -43,7 +43,7 @@ public class TestSymbolsInHsErrFile { public static void main(String[] args) throws Exception { // Start a jvm and cause a SIGSEGV / ACCESS_VIOLATION - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:-CreateCoredumpOnCrash", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java index f2930e5c5bd..0b5cc88819f 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { // Need to disable ShowRegistersOnAssert: that flag causes registers to be shown, which calls os::print_location, // which - as part of its checks - will iterate the threads list under a ThreadListHandle, changing the max nesting // counters and confusing this test. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+EnableThreadSMRStatistics", "-Xmx100M", diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java index 0ff835a8c0d..68613f8fd71 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java @@ -108,7 +108,7 @@ public static void main(String[] args) throws Exception { arguments.add("-XX:OnError=echo hi"); } arguments.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer output_detail = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java index 348ce77c4dc..2d26079fa0e 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java @@ -50,7 +50,7 @@ public class VeryEarlyAssertTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-version"); Map env = pb.environment(); env.put("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION", "1"); diff --git a/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java b/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java index b556e0d0211..559c6145cb6 100644 --- a/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java +++ b/test/hotspot/jtreg/runtime/GenerateOopMap/TestGenerateOopMapCrash.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -40,7 +40,7 @@ public class TestGenerateOopMapCrash { public static void main(String args[]) throws Exception { if (args.length == 0) { // Spawn new VM instance to execute test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:-TieredCompilation", "-XX:CompileCommand=dontinline,if_icmpleIsLastOpcode.m*", "-Xmx64m", diff --git a/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java b/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java index a5fe4b2a148..57df6306276 100644 --- a/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java +++ b/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -70,7 +70,7 @@ public class invocationC1Tests { public static void runTest(String whichTests, String classFileVersion) throws Throwable { System.out.println("\nC1 invocation tests, Tests: " + whichTests + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", "-Xcomp", "-XX:TieredStopAtLevel=1", "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", whichTests, "--classfile_version=" + classFileVersion); diff --git a/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java b/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java index 2d4c2a38b21..415cd105ee9 100644 --- a/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java +++ b/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,7 +67,7 @@ public class invocationOldCHATests { public static void runTest(String whichTests, String classFileVersion) throws Throwable { System.out.println("\nOld CHA invocation tests, Tests: " + whichTests + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", "-Xcomp", "-XX:+UnlockDiagnosticVMOptions", "-XX:-UseVtableBasedCHA", "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", whichTests, "--classfile_version=" + classFileVersion); diff --git a/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java b/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java index 9d8a164637e..9b72899d138 100644 --- a/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java +++ b/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -73,7 +73,7 @@ public class invokeinterfaceTests { public static void runTest(String classFileVersion, String option) throws Throwable { System.out.println("\ninvokeinterface invocation tests, option: " + option + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", option, "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "invokeinterface.Generator", "--classfile_version=" + classFileVersion); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java b/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java index 564f83d822e..817e5da9616 100644 --- a/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java +++ b/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -70,7 +70,7 @@ public class invokespecialTests { public static void runTest(String classFileVersion, String option) throws Throwable { System.out.println("\ninvokespecial invocation tests, option: " + option + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", option, "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "invokespecial.Generator", "--classfile_version=" + classFileVersion); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java b/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java index 9cc19b6081c..5f998a6029e 100644 --- a/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java +++ b/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -70,7 +70,7 @@ public class invokevirtualTests { public static void runTest(String classFileVersion, String option) throws Throwable { System.out.println("\ninvokevirtual invocation tests, option: " + option + ", class file version: " + classFileVersion); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx128M", option, "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED", "invokevirtual.Generator", "--classfile_version=" + classFileVersion); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java b/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java index 45360a251d6..94c2bde6e76 100644 --- a/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java +++ b/test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -42,7 +42,7 @@ public class LoadClassNegative { public static void main(String args[]) throws Exception { String bootCP = "-Xbootclasspath/a:" + System.getProperty("test.src") + File.separator + "dummy.jar"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "TestForName"); diff --git a/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java b/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java index e14cb45df87..aa4c559ff64 100644 --- a/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java +++ b/test/hotspot/jtreg/runtime/LoadClass/LongBCP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -70,7 +70,7 @@ public static void main(String args[]) throws Exception { CompilerUtils.compile(sourceDir, destDir); String bootCP = "-Xbootclasspath/a:" + destDir.toString(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -82,7 +82,7 @@ public static void main(String args[]) throws Exception { CompilerUtils.compile(sourceDir, destDir); bootCP = "-Xbootclasspath/a:" + destDir.toString(); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); @@ -97,7 +97,7 @@ public static void main(String args[]) throws Exception { // run with long bootclasspath to hello.jar bootCP = "-Xbootclasspath/a:" + helloJar; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); @@ -122,7 +122,7 @@ public static void main(String args[]) throws Exception { CompilerUtils.compile(sourceDir, destDir); bootCP = "-Xbootclasspath/a:" + destDir.toString(); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); @@ -139,7 +139,7 @@ public static void main(String args[]) throws Exception { Path jarPath = jarDir.resolve("hello.jar"); Files.copy(Paths.get(helloJar), jarPath); bootCP = "-Xbootclasspath/a:" + jarPath.toString(); - pb = ProcessTools.createJavaProcessBuilder(bootCP, "Hello"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Hello World") @@ -151,7 +151,7 @@ public static void main(String args[]) throws Exception { CompilerUtils.compile(sourceDir, destDir); bootCP = "-Xbootclasspath/a:" + destDir.toString(); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( bootCP, "Hello"); output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/LoadClass/TestResize.java b/test/hotspot/jtreg/runtime/LoadClass/TestResize.java index 56ae7e9b78d..9177ede52da 100644 --- a/test/hotspot/jtreg/runtime/LoadClass/TestResize.java +++ b/test/hotspot/jtreg/runtime/LoadClass/TestResize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -131,10 +131,10 @@ public static void main(String[] args) throws Exception { // that will allow us to calculate the table's load factor. // -Xlog:safepoint+cleanup will print out cleanup details at safepoint // that will allow us to detect if the system dictionary resized. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintClassLoaderDataGraphAtExit", - "-Xlog:safepoint+cleanup,class+loader+data", - "TriggerResize", - String.valueOf(CLASSES_TO_LOAD)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintClassLoaderDataGraphAtExit", + "-Xlog:safepoint+cleanup,class+loader+data", + "TriggerResize", + String.valueOf(CLASSES_TO_LOAD)); analyzeOutputOn(pb); } } diff --git a/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java b/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java index 6a9adec6c0c..f48eddc5180 100644 --- a/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java +++ b/test/hotspot/jtreg/runtime/LocalLong/LocalLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -37,11 +37,11 @@ public class LocalLongTest { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xint", - "--add-opens", "java.base/java.lang=ALL-UNNAMED", - "--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED", - "--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED", - "LocalLongHelper"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", + "--add-opens", "java.base/java.lang=ALL-UNNAMED", + "--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED", + "--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED", + "LocalLongHelper"); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); }; diff --git a/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java b/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java index b1ed991b931..c84fef5c126 100644 --- a/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java +++ b/test/hotspot/jtreg/runtime/LocalVariableTable/TestLVT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,17 +41,17 @@ public class TestLVT { public static void main(String[] args) throws Exception { test(); // Test good LVT in this test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("DuplicateLVT"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("DuplicateLVT"); new OutputAnalyzer(pb.start()) .shouldContain("Duplicated LocalVariableTable attribute entry for 'by' in class file DuplicateLVT") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("DuplicateLVTT"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("DuplicateLVTT"); new OutputAnalyzer(pb.start()) .shouldContain("Duplicated LocalVariableTypeTable attribute entry for 'list' in class file DuplicateLVTT") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("NotFoundLVTT"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("NotFoundLVTT"); new OutputAnalyzer(pb.start()) .shouldContain("LVTT entry for 'list' in class file NotFoundLVTT does not match any LVT entry") .shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java b/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java index ee1b10903a9..d2d000f7c7d 100644 --- a/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java +++ b/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -126,7 +126,7 @@ public static void test(GC gc, boolean doConcurrent) throws Throwable { Path gcLogPath = createGcLogPath("gc." + gc + "." + doConcurrent); System.err.println("test(" + gc + ", " + doConcurrent + ")" + " " + dateFormat.format(new Date())); // Run this Leak class with logging - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:membername+table=trace,gc+verify=debug,gc:" + gcLogPath + ":time,utctime,uptime,pid,level,tags", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", diff --git a/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java b/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java index eb8698295f9..867257cba12 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java +++ b/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -81,7 +81,7 @@ public static void main(String... args) throws Exception { test++; report("Test " + test + ": normal command-line flag"); - pb = ProcessTools.createJavaProcessBuilder(flag, main, max); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(flag, main, max); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); @@ -96,7 +96,7 @@ public static void main(String... args) throws Exception { for (String envVar : envVars) { report("Test " + test + ": " + envVar + " env-var"); - pb = ProcessTools.createJavaProcessBuilder(main, max); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(main, max); pb.environment().put(envVar, flag); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -112,7 +112,7 @@ public static void main(String... args) throws Exception { PrintWriter pw = new PrintWriter(rcFile); pw.println(flagRaw); pw.close(); - pb = ProcessTools.createJavaProcessBuilder(rcFileFlag, main, max); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(rcFileFlag, main, max); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java b/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java index 32aaa34db50..76c24eb1d25 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java +++ b/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -35,7 +35,7 @@ public class MaxMetaspaceSizeTest { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx1g", "-XX:MaxMetaspaceSize=4K", "-XX:+UseCompressedClassPointers", diff --git a/test/hotspot/jtreg/runtime/MinimalVM/CDS.java b/test/hotspot/jtreg/runtime/MinimalVM/CDS.java index a86504c451a..84e0f47e9b8 100644 --- a/test/hotspot/jtreg/runtime/MinimalVM/CDS.java +++ b/test/hotspot/jtreg/runtime/MinimalVM/CDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -38,17 +38,17 @@ public class CDS { public static void main(String args[]) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:dump"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xshare:dump"); new OutputAnalyzer(pb.start()) .shouldContain("Shared spaces are not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:on"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xshare:on"); new OutputAnalyzer(pb.start()) .shouldContain("Shared spaces are not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:auto", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xshare:auto", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Shared spaces are not supported in this VM") .shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java b/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java index 01c436c7086..5a1ee499c60 100644 --- a/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java +++ b/test/hotspot/jtreg/runtime/MinimalVM/CheckJNI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -36,7 +36,7 @@ public class CheckJNI { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xcheck:jni", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Xcheck:jni", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Minimal VM warning: JNI CHECKING is not supported in this VM") .shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java b/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java index 29fa15e607b..c2b30fdd6a2 100644 --- a/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java +++ b/test/hotspot/jtreg/runtime/MinimalVM/Instrumentation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -37,7 +37,7 @@ public class Instrumentation { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-minimal", "-javaagent:redefineagent.jar", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Instrumentation agents are not supported in this VM") diff --git a/test/hotspot/jtreg/runtime/MinimalVM/JMX.java b/test/hotspot/jtreg/runtime/MinimalVM/JMX.java index b7afcb6a81d..53ef41902ed 100644 --- a/test/hotspot/jtreg/runtime/MinimalVM/JMX.java +++ b/test/hotspot/jtreg/runtime/MinimalVM/JMX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -38,12 +38,12 @@ public class JMX { public static void main(String args[]) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:+ManagementServer", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:+ManagementServer", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("ManagementServer is not supported in this VM.") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Dcom.sun.management ", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-Dcom.sun.management ", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("-Dcom.sun.management is not supported in this VM.") .shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java b/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java index 9a96e1bc481..1914aafcfd6 100644 --- a/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java +++ b/test/hotspot/jtreg/runtime/MinimalVM/JVMTI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -36,7 +36,7 @@ public class JVMTI { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-minimal", "-agentlib:jdwp=server=y,transport=dt_socket,address=5000,suspend=n", "-version"); diff --git a/test/hotspot/jtreg/runtime/MinimalVM/NMT.java b/test/hotspot/jtreg/runtime/MinimalVM/NMT.java index 740912be231..958ccc1758d 100644 --- a/test/hotspot/jtreg/runtime/MinimalVM/NMT.java +++ b/test/hotspot/jtreg/runtime/MinimalVM/NMT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -38,17 +38,17 @@ public class NMT { public static void main(String args[]) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=detail", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=detail", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Native Memory Tracking is not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=summary", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=summary", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Native Memory Tracking is not supported in this VM") .shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=off", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=off", "-version"); new OutputAnalyzer(pb.start()) .shouldContain("Native Memory Tracking is not supported in this VM") .shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java b/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java index 8663989fd9e..eb394235196 100644 --- a/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java +++ b/test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java @@ -272,7 +272,7 @@ public static void test(Disabled disabled, Guaranteed guaranteed, Threshold thre opts.addAll(Arrays.asList(args)); opts.add("DeflationIntervalsTest$Test"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(opts); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(opts); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java b/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java index 5dd01e4262b..41b86e0e19e 100644 --- a/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java +++ b/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -73,7 +73,7 @@ public static void usage() { public static void main(String[] args) throws Exception { if (args.length == 0) { // Without args we invoke the test in a java sub-process: - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( // Test doesn't need much Java heap: "-Xmx100M", // AvgMonitorsPerThreadEstimate == 1 means we'll start with diff --git a/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java b/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java index 28bfd0f2bd4..3de4e89e3a0 100644 --- a/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java +++ b/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java @@ -84,14 +84,14 @@ private static void generateTests() { public static void main(String[] args) throws Exception { generateTests(); for (int i = 0; i < fatalTests.length; i++) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(fatalTests[i]); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(fatalTests[i]); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldContain("fatal error: Synchronizing on object"); output.shouldNotContain("synchronization on value based class did not fail"); output.shouldNotHaveExitValue(0); } for (int i = 0; i < logTests.length; i++) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(logTests[i]); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(logTests[i]); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); checkOutput(output); @@ -171,7 +171,7 @@ private static void virtualThreadTests() throws Exception { "", "SyncOnValueBasedClassTest$VTTest" }; // Fatal test vtTest[2] = "-XX:DiagnoseSyncOnValueBasedClasses=1"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vtTest); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vtTest); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldContain("fatal error: Synchronizing on object"); output.shouldNotContain("synchronization on value based class did not fail"); @@ -179,7 +179,7 @@ private static void virtualThreadTests() throws Exception { // Log test vtTest[2] = "-XX:DiagnoseSyncOnValueBasedClasses=2"; - pb = ProcessTools.createJavaProcessBuilder(vtTest); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(vtTest); output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); output.shouldContain("Synchronizing on object"); diff --git a/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java b/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java index 71fdfd8aea5..411676b1b63 100644 --- a/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java +++ b/test/hotspot/jtreg/runtime/NMT/CheckForProperDetailStackTrace.java @@ -91,7 +91,7 @@ public static void main(String args[]) throws Exception { // If modules in the system image have been archived in CDS, they will not be // created again at run time. Explicitly use an external module to make sure // we have a runtime-defined ModuleEntry - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:+PrintNMTStatistics", diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java b/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java index 074a9b194eb..57f2302db30 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java @@ -37,7 +37,7 @@ public class CommandLineDetail { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:NativeMemoryTracking=detail", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java b/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java index 3d2ac8baf29..2a0620b7bad 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java @@ -37,7 +37,7 @@ public class CommandLineEmptyArgument { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:NativeMemoryTracking="); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:NativeMemoryTracking="); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java b/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java index d82df08b8cc..655fa140d35 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java @@ -37,7 +37,7 @@ public class CommandLineInvalidArgument { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:NativeMemoryTracking=apa"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:NativeMemoryTracking=apa"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java b/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java index c44be999d5f..02b37a40ef4 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java @@ -37,7 +37,7 @@ public class CommandLineSummary { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:NativeMemoryTracking=summary", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java b/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java index 710902a53cb..199a2957f61 100644 --- a/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java +++ b/test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java @@ -37,7 +37,7 @@ public class CommandLineTurnOffNMT { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:NativeMemoryTracking=off", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java b/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java index 079d8d99052..3b61a0be383 100644 --- a/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java +++ b/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java @@ -51,13 +51,13 @@ public static void main(String args[]) throws Exception { // First run without enabling NMT (not in debug, where NMT is by default on) if (!Platform.isDebugBuild()) { - pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "JcmdWithNMTDisabled"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "JcmdWithNMTDisabled"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } // Then run with explicitly disabling NMT, should not be any difference - pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:NativeMemoryTracking=off", "JcmdWithNMTDisabled"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:NativeMemoryTracking=off", "JcmdWithNMTDisabled"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java b/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java index ba53d4d06a1..a58ff861a29 100644 --- a/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java +++ b/test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java @@ -98,7 +98,7 @@ private static ProcessBuilder processBuilderWithSetting(String... extraSettings) args.add("-XX:NativeMemoryTracking=summary"); args.addAll(Arrays.asList(extraSettings)); args.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); return pb; } diff --git a/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java b/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java index ef1e5cd8346..8cbacfb5701 100644 --- a/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java +++ b/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java @@ -156,7 +156,7 @@ public static void main(String args[]) throws Exception { } vmArgs.add("-version"); - ProcessBuilder pb = ProcessTools.createTestJvm(vmArgs); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(vmArgs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (debug) { output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/NMT/NMTJavaHeapTest.java b/test/hotspot/jtreg/runtime/NMT/NMTJavaHeapTest.java index 603760379de..f2abd3ac0ad 100644 --- a/test/hotspot/jtreg/runtime/NMT/NMTJavaHeapTest.java +++ b/test/hotspot/jtreg/runtime/NMT/NMTJavaHeapTest.java @@ -37,7 +37,7 @@ public class NMTJavaHeapTest { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=summary", diff --git a/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java b/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java index 994705e1e77..226626acb34 100644 --- a/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java +++ b/test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java @@ -38,14 +38,14 @@ public class NMTWithCDS { public static void main(String[] args) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createTestJvm( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:dump", "-Xlog:cds"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); - pb = ProcessTools.createTestJvm( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); diff --git a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java index 3263cc40233..389e6a25de5 100644 --- a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java +++ b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java @@ -37,7 +37,7 @@ public class PrintNMTStatistics { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=detail", @@ -55,7 +55,7 @@ public static void main(String args[]) throws Exception { // Make sure memory reserved for Module processing is recorded. output_detail.shouldContain(" Module (reserved="); - ProcessBuilder pb1 = ProcessTools.createTestJvm( + ProcessBuilder pb1 = ProcessTools.createTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=summary", diff --git a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java index 70222701b06..897893c47ea 100644 --- a/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java +++ b/test/hotspot/jtreg/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java @@ -37,7 +37,7 @@ public class PrintNMTStatisticsWithNMTDisabled { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics", "-XX:NativeMemoryTracking=off", "-version"); diff --git a/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java b/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java index 2040c755576..1ee2f604df6 100644 --- a/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java +++ b/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ public class PerfMemDestroy { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PerfAllowAtExitRegistration", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PerfAllowAtExitRegistration", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java b/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java index 1425e3e6eb1..4dfde2f1d0b 100644 --- a/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java +++ b/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ public class PrintStringTableStatsTest { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintStringTableStatistics", "--version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java b/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java index 36f74d01b54..e75e6643809 100644 --- a/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java +++ b/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +254,7 @@ private static void initIsSupportedPlatform() throws Exception { // In order to dynamicaly determine if the platform supports the reserved // stack area, run with -XX:StackReservedPages=1 and see if we get the // expected warning message for platforms that don't support it. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:StackReservedPages=1", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:StackReservedPages=1", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); System.out.println("StackReservedPages=1 log: [" + output.getOutput() + "]"); if (output.getExitValue() != 0) { diff --git a/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java b/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java index 33de13f6c45..a2c3f944db8 100644 --- a/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java +++ b/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java @@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception { } public static void testWith(int delay, boolean shouldPass) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+AbortVMOnVMOperationTimeout", "-XX:AbortVMOnVMOperationTimeoutDelay=" + delay, diff --git a/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java b/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java index e7e3cfca781..e54f40e0893 100644 --- a/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java +++ b/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -40,7 +40,7 @@ public class TestAbortVMOnSafepointTimeout { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff --git a/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java b/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java index 5ef84f9ca95..d82b4b1f195 100644 --- a/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java +++ b/test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ public class LargeClassTest implements Opcodes { public static void main(String... args) throws Exception { writeClassFile(); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "Large"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "Large"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java index b4e5e6b514b..a10f4193234 100644 --- a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java +++ b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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,7 +90,7 @@ public static void main(String[] args) throws Exception { } else { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", "-XX:+AlwaysPreTouchStacks", diff --git a/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java b/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java index 1ad74dbec0f..aecf3fdb5a6 100644 --- a/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java +++ b/test/hotspot/jtreg/runtime/Thread/TestBreakSignalThreadDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2022, Google and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -67,7 +67,7 @@ public static void main(String[] argv) throws Exception { public static void main(String[] argv) throws Exception { String main = "TestBreakSignalThreadDump$TestProcess"; - ProcessBuilder pb = ProcessTools.createTestJvm("-Djava.library.path=" + Utils.TEST_NATIVE_PATH, main); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-Djava.library.path=" + Utils.TEST_NATIVE_PATH, main); if (argv.length > 0 && argv[0].equals("load_libjsig")) { prepend_jsig_lib(pb.environment()); diff --git a/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java b/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java index 88099b44ab2..09db906b151 100644 --- a/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java +++ b/test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -94,14 +94,14 @@ static String getMinStackAllowed(String testOutput) { static ProcessBuilder createProcessWithOptions(String stackOption, String stackSize) throws Exception { if (testShadowSize == null) { - return ProcessTools.createJavaProcessBuilder( + return ProcessTools.createLimitedTestJavaProcessBuilder( stackOption + stackSize, // Uncomment the following to get log output // that shows actual thread creation sizes. // "-Xlog:os+thread", "-version"); } else { - return ProcessTools.createJavaProcessBuilder( + return ProcessTools.createLimitedTestJavaProcessBuilder( stackOption + stackSize, // Uncomment the following to get log output // that shows actual thread creation sizes. diff --git a/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java b/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java index 1482037b28f..ef63dc942f1 100644 --- a/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java +++ b/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,11 +51,11 @@ static void analyzeOutputOn(ProcessBuilder pb) throws Exception { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:stacktrace=info", - "-XX:MaxJavaStackTraceDepth=1024", - "--add-opens", - "java.base/java.lang=ALL-UNNAMED", - "TestThrowable"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stacktrace=info", + "-XX:MaxJavaStackTraceDepth=1024", + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "TestThrowable"); analyzeOutputOn(pb); } } diff --git a/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java b/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java index 36fedc0bd2d..b7c261afbd0 100644 --- a/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java +++ b/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -43,10 +43,10 @@ public class TestCatchThrowableOOM { }; public static void main(String[] args) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx64m", - "-Xlog:exceptions=trace", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xmx64m", + "-Xlog:exceptions=trace", - "TestCatchThrowableOOM$OOM"); + "TestCatchThrowableOOM$OOM"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); for (String msg : expected) { diff --git a/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java b/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java index 92e57718608..95f29ee2eb6 100644 --- a/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java +++ b/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -79,11 +79,11 @@ public static void main(String args[]) throws Exception { int[] depths = {0, 20, 1024}; for (int d : depths) { System.out.println("running test with -XX:MaxJavaStackTraceDepth=" + d); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:stacktrace=info", - "-XX:MaxJavaStackTraceDepth=" + d, - "--add-opens", - "java.base/java.lang=ALL-UNNAMED", - "TestMaxJavaStackTraceDepth"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stacktrace=info", + "-XX:MaxJavaStackTraceDepth=" + d, + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "TestMaxJavaStackTraceDepth"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (d == 0) { // Should get all the elements in stack trace diff --git a/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java b/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java index 2f9ae3fddff..788b96fb22e 100644 --- a/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java +++ b/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -40,7 +40,7 @@ public class RangeCheck { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xmx128m", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", diff --git a/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java b/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java index 03d5d885e45..aae401df963 100644 --- a/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java +++ b/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -61,14 +61,14 @@ public static void main(String args[]) throws Throwable { throw new RuntimeException("File libjsig not found, path: " + libjsig); } - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcheck:jni", "-version"); Map env = pb.environment(); env.put(env_var, libjsig); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("libjsig is activated"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-verbose:jni", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcheck:jni", "-verbose:jni", "-version"); env = pb.environment(); env.put(env_var, libjsig); output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java b/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java index b1aab5d3371..08665415764 100644 --- a/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java +++ b/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ public static void main(String[] args) throws Exception { } String msg = "OutOfMemoryError: ((Metaspace)|(Compressed class space))"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(processArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(processArgs); CDSTestUtils.executeAndLog(pb, "dump").shouldMatch(msg).shouldHaveExitValue(1); } } diff --git a/test/hotspot/jtreg/runtime/cds/SharedStrings.java b/test/hotspot/jtreg/runtime/cds/SharedStrings.java index bda830401f0..33a041bb298 100644 --- a/test/hotspot/jtreg/runtime/cds/SharedStrings.java +++ b/test/hotspot/jtreg/runtime/cds/SharedStrings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -44,7 +44,7 @@ public static void main(String[] args) throws Exception { // This also serves as a reference on how to use this feature, // hence the command lines are spelled out instead of using the // test utils methods. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedStrings.jsa", "-Xlog:cds,cds+hashtables", @@ -56,7 +56,7 @@ public static void main(String[] args) throws Exception { CDSTestUtils.checkDump(out, "Shared string table stats"); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedStrings.jsa", // needed for access to white box test API diff --git a/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java b/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java index 1a13e30f33a..183b1c3afcf 100644 --- a/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java +++ b/test/hotspot/jtreg/runtime/cds/TestCDSVMCrash.java @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception { } } // else this is the main test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError", "-XX:-CreateCoredumpOnCrash", "-Xmx128m", "-Xshare:on", TestCDSVMCrash.class.getName(),"throwOOME"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // executeAndLog should throw an exception in the VM crashed diff --git a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java index baf59d02fed..e1708925e9e 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java @@ -160,7 +160,7 @@ private static void testExtraCase(String jarFile, String[] classList) throws Exc } String[] args = new String[] { "-cp", jarFile, "-XX:ArchiveClassesAtExit=" + dynName, "-XX:DumpLoadedClassList=" + dumpedListName, "Hello"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = TestCommon.executeAndLog(pb, "combo"); output.shouldHaveExitValue(0) .shouldContain(HELLO_WORLD); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/FillerObjectLoadTest.java b/test/hotspot/jtreg/runtime/cds/appcds/FillerObjectLoadTest.java index 97511db815f..d53120fc1b1 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/FillerObjectLoadTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/FillerObjectLoadTest.java @@ -35,14 +35,14 @@ public class FillerObjectLoadTest { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-XX:-UseCompressedClassPointers", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseEpsilonGC", "-Xshare:dump", "-XX:SharedArchiveFile=" + TestCommon.getNewArchiveName()); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); analyzer.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-XX:-UseCompressedClassPointers", "-XX:TLABSize=2048", "-Xshare:dump", "-XX:SharedArchiveFile=" + TestCommon.getNewArchiveName()); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java b/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java index 317d6767046..007d9fb4c2c 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -300,7 +300,7 @@ public static OutputAnalyzer createArchive(CDSOptions opts) } } - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); if (opts.appJarDir != null) { pb.directory(new File(opts.appJarDir)); } @@ -447,7 +447,7 @@ public static OutputAnalyzer runWithArchive(CDSOptions opts) } } - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); if (opts.appJarDir != null) { pb.directory(new File(opts.appJarDir)); } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java b/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java index 647e44bc455..17634e9a31e 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -112,7 +112,7 @@ public static void main(String[] args) throws Exception { "-cp", jarFile, mainInvokeClass}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(launchArgs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); OutputAnalyzer output = TestCommon.executeAndLog(pb, "invoke-class"); checkFileExistence("Archive", fileArchive); @@ -137,7 +137,7 @@ public static void main(String[] args) throws Exception { jarFile, mainCutomClass, "1"}; - pb = ProcessTools.createJavaProcessBuilder(launchArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); output = TestCommon.executeAndLog(pb, "custom-nosource"); checkFileExistence("Archive", fileArchive); @@ -163,7 +163,7 @@ public static void main(String[] args) throws Exception { jarFile, mainCutomClass, "2"}; - pb = ProcessTools.createJavaProcessBuilder(launchArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); output = TestCommon.executeAndLog(pb, "custom-nosource"); checkFileExistence("Archive", fileArchive); @@ -184,7 +184,7 @@ public static void main(String[] args) throws Exception { jarFile, mainCutomClass, "3"}; - pb = ProcessTools.createJavaProcessBuilder(launchArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); output = TestCommon.executeAndLog(pb, "custom-dump-classlist"); checkFileExistence("ClassList", fileList); @@ -205,7 +205,7 @@ public static void main(String[] args) throws Exception { jarFile, mainCutomClass, "3"}; - pb = ProcessTools.createJavaProcessBuilder(launchArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); output = TestCommon.executeAndLog(pb, "custom-dump"); checkFileExistence("Archive", archiveFile); @@ -225,7 +225,7 @@ public static void main(String[] args) throws Exception { jarFile, mainCutomClass, "3"}; - pb = ProcessTools.createJavaProcessBuilder(launchArgs); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); output = TestCommon.executeAndLog(pb, "custom-share"); checkFileExistence("ClassList", newFile); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java b/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java index aa65bb38b1c..6835adf33f3 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java @@ -37,7 +37,7 @@ public class VerifyWithDefaultArchive { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:cds", "-XX:+VerifySharedSpaces", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:cds", "-XX:+VerifySharedSpaces", "-version"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotContain("relocation bitmap CRC error"); out.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java index f35ffbf5d00..108002246db 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -261,7 +261,7 @@ private static Result execProcess(String mode, String jarDir, String[] cmdLine) if (!executedIn_run) { throw new Exception("Test error: dynamic archive tests must be executed via DynamicArchiveTestBase.run()"); } - ProcessBuilder pb = ProcessTools.createTestJvm(cmdLine); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmdLine); if (jarDir != null) { pb.directory(new File(jarDir)); } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java b/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java index 65e8b090dda..228948f3ebd 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -133,7 +133,7 @@ static void test() throws Exception { private static void dumpStaticArchive(String archiveFile) throws Exception { String javapath = JDKToolFinder.getJDKTool("java"); String cmd[] = {javapath, "-Xshare:dump", "-XX:SharedArchiveFile=" + archiveFile}; - // Do not use ProcessTools.createTestJvm(cmd) here, it copies jtreg env. + // Do not use ProcessTools.createTestJavaProcessBuilder(cmd) here, it copies jtreg env. ProcessBuilder pb = new ProcessBuilder(cmd); CDSTestUtils.executeAndLog(pb, "dump") .shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java index 005a1f78e0b..bdd5ad9ec7e 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ResolvedReferencesNotNullTest.java @@ -42,14 +42,14 @@ public static void main(String[] args) throws Exception { String appJar = TestCommon.getTestJar(SharedStringsUtils.TEST_JAR_NAME_FULL); String whiteboxParam = SharedStringsUtils.getWbParam(); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-cp", - appJar, - whiteboxParam, - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - "ResolvedReferencesWb", - "false" // ResolvedReferencesTestApp is not archived - ); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-cp", + appJar, + whiteboxParam, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "ResolvedReferencesWb", + "false" // ResolvedReferencesTestApp is not archived + ); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java b/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java index 215887f7bb3..1baf5bdc8a8 100644 --- a/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java +++ b/test/hotspot/jtreg/runtime/classFileParserBug/Bad_NCDFE_Msg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ public class Bad_NCDFE_Msg { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", System.getProperty("test.classes") + File.separator + "pkg", "C"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.NoClassDefFoundError: C (wrong name: pkg/C"); diff --git a/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java b/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java index 31dde4d3adf..bac36378d2e 100644 --- a/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java +++ b/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +41,7 @@ public class ClassFileParserBug { public static void main(String args[]) throws Throwable { System.out.println("Regression test for bug 8040018"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("LambdaMath"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("LambdaMath"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError: Bad length on BootstrapMethods"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java b/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java index f7028990b05..35abee5ce3e 100644 --- a/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java +++ b/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -38,7 +38,7 @@ public class TestBadPackageWithInterface { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", System.getProperty("test.classes"), "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyBeforeExit", MyLoader.class.getName()); diff --git a/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java b/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java index ea91f54da83..53c85d53c44 100644 --- a/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java +++ b/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +50,7 @@ public static void main(String args[]) throws Throwable { // ======= execute test case #1 // Expect a lack of main method, this implies that the class loaded correctly // with an empty bootstrap_methods and did not generate a ClassFormatError. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Duser.language=en", "-Duser.country=US", className); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.ClassFormatError"); @@ -65,7 +65,7 @@ public static void main(String args[]) throws Throwable { // ======= execute test case #2 // Expect a lack of main method, this implies that the class loaded correctly // with an empty bootstrap_methods and did not generate ClassFormatError. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Duser.language=en", "-Duser.country=US", className); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.ClassFormatError"); diff --git a/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java b/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java index 4ae0eaa0df3..a07c98caa66 100644 --- a/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java +++ b/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -42,7 +42,7 @@ public class BadBSMUseTest { public static void main(String args[]) throws Throwable { // 1. Test a CONSTANT_Dynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_InvokeDynamic_info - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("CondyUsesIndyBSM"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("CondyUsesIndyBSM"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In Indybsm target CallSite method foo"); oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception"); @@ -50,7 +50,7 @@ public static void main(String args[]) throws Throwable { // 2. Test a CONSTANT_InvokeDynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_Dynamic_info - pb = ProcessTools.createJavaProcessBuilder("IndyUsesCondyBSM"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("IndyUsesCondyBSM"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In Condybsm"); oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception"); diff --git a/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java b/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java index ef26a6bf674..22cfb727eb8 100644 --- a/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java +++ b/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -42,16 +42,16 @@ public class CondyLDCTest { public static void main(String args[]) throws Throwable { // 1. Test a ldc_w instruction can be used with condy's which generate // loadable constants of the following types: byte, char, short, float, integer, boolean. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyUseLDC_W"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyUseLDC_W"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldNotContain("VerifyError"); oa.shouldHaveExitValue(0); // 2. Test ldc2_w of a condy which returns a dynamically generated // float constant, generates a VerifyError. - pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyBadLDC2_W"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyBadLDC2_W"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("java.lang.VerifyError: Illegal type at constant pool entry"); oa.shouldContain("CondyBadLDC2_W.F()F @0: ldc2_w"); @@ -59,8 +59,8 @@ public static void main(String args[]) throws Throwable { // 3. Test a ldc of a condy which returns a dynamically generated // double constant, generates a VerifyError. - pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyBadLDC"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyBadLDC"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("java.lang.VerifyError: Illegal type at constant pool entry"); oa.shouldContain("CondyBadLDC.D()D @0: ldc"); diff --git a/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java b/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java index 2de9e728666..6e810d0d3b8 100644 --- a/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java +++ b/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -38,8 +38,8 @@ public class CondyNewInvokeSpecialTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xverify:all", - "CondyNewInvokeSpecial"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + "CondyNewInvokeSpecial"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In CondyNewInvokeSpecial method"); oa.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java index cb4b6960cf9..877a805c445 100644 --- a/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java +++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -43,7 +43,7 @@ public class TestEscapeCondy { public static void main(String args[]) throws Throwable { // 1. Test escape analysis of a method that contains // a ldc instruction of a condy whose return type is an array of boolean - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:CompileCommand=dontinline,runtime.condy.TestEscapeThroughInvokeWithCondy::create", "runtime.condy.TestEscapeThroughInvokeWithCondy"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java b/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java index c8b8aeba22e..2b572edb66f 100644 --- a/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java +++ b/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -38,7 +38,7 @@ public class TestInitException { public static void main(java.lang.String[] unused) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("Example"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("Example"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); // First call stack trace // shouldMatch is used to workaround CODETOOLS-7902686 diff --git a/test/hotspot/jtreg/runtime/contended/Options.java b/test/hotspot/jtreg/runtime/contended/Options.java index ea7261c229a..f646b152921 100644 --- a/test/hotspot/jtreg/runtime/contended/Options.java +++ b/test/hotspot/jtreg/runtime/contended/Options.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -40,59 +40,59 @@ public static void main(String[] args) throws Exception { ProcessBuilder pb; OutputAnalyzer output; - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-128", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=-128", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-8", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=-8", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-1", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=-1", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=0", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=0", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=1", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=1", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("must be a multiple of 8"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8184", "-version"); // 8192-8 = 8184 + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8184", "-version"); // 8192-8 = 8184 output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8191", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8191", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("must be a multiple of 8"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8192", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8192", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8193", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8193", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); output.shouldHaveExitValue(1); - pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8200", "-version"); // 8192+8 = 8200 + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ContendedPaddingWidth=8200", "-version"); // 8192+8 = 8200 output = new OutputAnalyzer(pb.start()); output.shouldContain("ContendedPaddingWidth"); output.shouldContain("outside the allowed range"); diff --git a/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java b/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java index aebc9d0a899..4116c91705f 100644 --- a/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java +++ b/test/hotspot/jtreg/runtime/duplAttributes/DuplAttributesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,7 +41,7 @@ public class DuplAttributesTest { static final String testsrc = System.getProperty("test.src"); public static void runTest(String test, String result) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(test); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(test); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError: Multiple " + result); output.shouldNotHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/execstack/Testexecstack.java b/test/hotspot/jtreg/runtime/execstack/Testexecstack.java index 7af23d7a41e..3c690d54a23 100644 --- a/test/hotspot/jtreg/runtime/execstack/Testexecstack.java +++ b/test/hotspot/jtreg/runtime/execstack/Testexecstack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -47,7 +47,7 @@ public static void main(String[] args) throws Throwable { // Create a new java process for the Test Java/JNI test without // an executeable stack - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "Test", "test-rw"); // Start the process and check the output @@ -56,7 +56,7 @@ public static void main(String[] args) throws Throwable { // Create a new java process for the Test Java/JNI test with an // executable stack - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "Test", "test-rwx"); // Start the process and check the output @@ -65,7 +65,7 @@ public static void main(String[] args) throws Throwable { // Create a new java process for the TestMT Java/JNI test with an // executable stack - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "TestMT", "test-rwx"); // Start the process and check the output diff --git a/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java b/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java index db4d26f801b..ae1f86cc7c1 100644 --- a/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java +++ b/test/hotspot/jtreg/runtime/getSysPackage/GetPackageXbootclasspath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -54,7 +54,7 @@ public static void main(String args[]) throws Exception { ClassFileInstaller.writeClassToDisk("P/Test", InMemoryJavaCompiler.compile("P.Test", Test_src), test_classes); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:" + test_classes, "P.Test") .start()).shouldContain("Test Passed") .shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java b/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java index a6e5d40db3d..0cd3e371d8b 100644 --- a/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java +++ b/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -101,7 +101,7 @@ public static void main(String args[]) throws Throwable { InMemoryJavaCompiler.compile("GetSysPkg_package.GetSysClass", source); ClassFileInstaller.writeClassToDisk("GetSysPkg_package/GetSysClass", klassbuf); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:bl_dir", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xbootclasspath/a:bl_dir", "--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED", "-cp", "." + File.pathSeparator + System.getProperty("test.classes"), "GetSysPkgTest", "do_tests"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java b/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java index b92ff56da9a..a1a5ff68c31 100644 --- a/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java +++ b/test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -42,7 +42,7 @@ public class HandshakeTimeoutTest { public static void main(String[] args) throws Exception { ProcessBuilder pb = - ProcessTools.createTestJvm( + ProcessTools.createTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff --git a/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java b/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java index b8e03763e2b..5480b495a2d 100644 --- a/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java +++ b/test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ public static void main(String[] args) throws Exception { commands.add("-XX:CICompilerCount=2"); commands.addAll(Arrays.asList(args)); commands.add("HandshakeTransitionTest$Test"); - ProcessBuilder pb = ProcessTools.createTestJvm(commands); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(commands); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/handshake/SystemMembarHandshakeTransitionTest.java b/test/hotspot/jtreg/runtime/handshake/SystemMembarHandshakeTransitionTest.java index 0c02c40eae5..0f0e5b90e85 100644 --- a/test/hotspot/jtreg/runtime/handshake/SystemMembarHandshakeTransitionTest.java +++ b/test/hotspot/jtreg/runtime/handshake/SystemMembarHandshakeTransitionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception { commands.add("-XX:+UseSystemMemoryBarrier"); commands.addAll(Arrays.asList(args)); commands.add("HandshakeTransitionTest$Test"); - ProcessBuilder pb = ProcessTools.createTestJvm(commands); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(commands); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java index 038136b74be..6395e3b9f0b 100644 --- a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java +++ b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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,9 +48,9 @@ public static void main(String[] args) throws Throwable { // Uses executeProcess() instead of executeTestJvm() to avoid passing options // that might generate output on stderr (which should be empty for this test). ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder("-Xcheck:jni", - "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "TestCheckedReleaseArrayElements"); + ProcessTools.createLimitedTestJavaProcessBuilder("-Xcheck:jni", + "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "TestCheckedReleaseArrayElements"); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); output.stderrShouldBeEmpty(); diff --git a/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java b/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java index ed5d6b052b2..53cba9d9e47 100644 --- a/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java +++ b/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java @@ -65,7 +65,7 @@ private static void runTest(boolean useVThread) { pbArgs.add(TestPrimitiveArrayCriticalWithBadParam.class.getName()); pbArgs.add(useVThread ? "vtest" : "test"); try { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(pbArgs.toArray(new String[0])); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(pbArgs.toArray(new String[0])); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); // -Xcheck:jni should warn the bad parameter diff --git a/test/hotspot/jtreg/runtime/jsig/Testjsig.java b/test/hotspot/jtreg/runtime/jsig/Testjsig.java index 315ec3d1500..6e287a6cdc1 100644 --- a/test/hotspot/jtreg/runtime/jsig/Testjsig.java +++ b/test/hotspot/jtreg/runtime/jsig/Testjsig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +46,7 @@ public static void main(String[] args) throws Throwable { String libpath = System.getProperty("java.library.path"); // Create a new java process for the TestJNI Java/JNI test - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.library.path=" + libpath + ":.", "TestJNI", "100"); diff --git a/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java b/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java index a2e1f0c94f5..34249e5fec8 100644 --- a/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java +++ b/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,10 +41,10 @@ public class ClassInitializationTest { public static void main(String... args) throws Exception { // (1) - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=info", - "-Xverify:all", - "-Xmx128m", - "BadMap50"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+init=info", + "-Xverify:all", + "-Xmx128m", + "BadMap50"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldNotHaveExitValue(0); out.shouldContain("Start class verification for:"); @@ -54,10 +54,10 @@ public static void main(String... args) throws Exception { out.shouldContain("Fail over class verification to old verifier for: BadMap50"); // (2) class+init should turn off. - pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=off", - "-Xverify:all", - "-Xmx128m", - "BadMap50"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+init=off", + "-Xverify:all", + "-Xmx128m", + "BadMap50"); out = new OutputAnalyzer(pb.start()); out.shouldNotHaveExitValue(0); out.shouldNotContain("[class,init]"); diff --git a/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java b/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java index f4cc137db99..133d5e65112 100644 --- a/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java +++ b/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -84,7 +84,7 @@ static ProcessBuilder exec(String... args) throws Exception { Collections.addAll(argsList, "-XX:+WhiteBoxAPI"); Collections.addAll(argsList, "-XX:+ClassUnloading"); Collections.addAll(argsList, ClassUnloadTestMain.class.getName()); - return ProcessTools.createJavaProcessBuilder(argsList); + return ProcessTools.createLimitedTestJavaProcessBuilder(argsList); } public static void main(String... args) throws Exception { diff --git a/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java b/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java index 05155e5108f..129d34bd2db 100644 --- a/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java +++ b/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,17 +60,17 @@ public static void main(String... args) throws Exception { public static void main(String... args) throws Exception { // (1) class+resolve should turn on. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug", - ClassResolutionTestMain.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+resolve=debug", + ClassResolutionTestMain.class.getName()); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[class,resolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); o.shouldContain("[class,resolve] resolve JVM_CONSTANT_MethodHandle"); // (2) class+resolve should turn off. - pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug", - "-Xlog:class+resolve=off", - ClassResolutionTestMain.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:class+resolve=debug", + "-Xlog:class+resolve=off", + ClassResolutionTestMain.class.getName()); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[class,resolve]"); diff --git a/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java b/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java index ee1a4997900..79167f581e7 100644 --- a/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java +++ b/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,20 +51,20 @@ static void analyzeOutputOff(ProcessBuilder pb) throws Exception { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseCompressedOops", - "-Xlog:gc+heap+coops=debug", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseCompressedOops", + "-Xlog:gc+heap+coops=debug", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseCompressedOops", - "-Xlog:gc+heap+coops", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseCompressedOops", + "-Xlog:gc+heap+coops", + InnerClass.class.getName()); // No coops logging on info level. analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:+UseCompressedOops", - "-Xlog:gc+heap+coops=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseCompressedOops", + "-Xlog:gc+heap+coops=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff --git a/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java b/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java index f94f5e5cb20..c62402c918b 100644 --- a/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java +++ b/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -40,8 +40,8 @@ public class CondyIndyTest { public static void main(String... args) throws Exception { // (1) methodhandles should turn on, no indy, no condy - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles", - "CondyIndy"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles", + "CondyIndy"); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[info][methodhandles"); @@ -49,8 +49,8 @@ public static void main(String... args) throws Exception { o.shouldNotContain("[debug][methodhandles,condy"); // (2) methodhandles+condy=debug only - pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+condy=debug", - "CondyIndy"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles+condy=debug", + "CondyIndy"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[info ][methodhandles"); @@ -58,8 +58,8 @@ public static void main(String... args) throws Exception { o.shouldContain("[debug][methodhandles,condy"); // (3) methodhandles+indy=debug only - pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+indy=debug", - "CondyIndy"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles+indy=debug", + "CondyIndy"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[info ][methodhandles"); @@ -67,10 +67,10 @@ public static void main(String... args) throws Exception { o.shouldNotContain("[debug][methodhandles,condy"); // (4) methodhandles, condy, indy all on - pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles=info", - "-Xlog:methodhandles+condy=debug", - "-Xlog:methodhandles+indy=debug", - "CondyIndy"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:methodhandles=info", + "-Xlog:methodhandles+condy=debug", + "-Xlog:methodhandles+indy=debug", + "CondyIndy"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[info ][methodhandles"); diff --git a/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java b/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java index 2ea7e6bb07a..d41d6685c23 100644 --- a/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java +++ b/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -37,8 +37,8 @@ public class DefaultMethodsTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:defaultmethods=debug", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:defaultmethods=debug", + InnerClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Slots that need filling:"); output.shouldContain("requires default method processing"); diff --git a/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java b/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java index 976478253ee..327b1cc0f24 100644 --- a/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java +++ b/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -57,25 +57,25 @@ static void analyzeOutputOff(ProcessBuilder pb) throws Exception { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:exceptions=info", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:exceptions=info", + InternalClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:exceptions=off", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:exceptions=off", + InternalClass.class.getName()); analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(InternalClass.class.getName()); updateEnvironment(pb, "_JAVA_OPTIONS", "-Xlog:exceptions=info"); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(InternalClass.class.getName()); updateEnvironment(pb, "JAVA_TOOL_OPTIONS", "-Xlog:exceptions=info -Xlog:exceptions=off"); analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:VMOptionsFile=" + System.getProperty("test.src", ".") - + File.separator + "ExceptionsTest_options_file", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:VMOptionsFile=" + System.getProperty("test.src", ".") + + File.separator + "ExceptionsTest_options_file", + InternalClass.class.getName()); analyzeOutputOn(pb); } diff --git a/test/hotspot/jtreg/runtime/logging/FoldMultilinesTest.java b/test/hotspot/jtreg/runtime/logging/FoldMultilinesTest.java index 1ae9f2c21d0..8df835245c8 100644 --- a/test/hotspot/jtreg/runtime/logging/FoldMultilinesTest.java +++ b/test/hotspot/jtreg/runtime/logging/FoldMultilinesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021 NTT DATA. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -79,15 +79,15 @@ private static void test(String out) throws Exception { ProcessBuilder pb; Xlog = XLOG_BASE + out + "::foldmultilines=true"; - pb = ProcessTools.createJavaProcessBuilder(Xlog, InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(Xlog, InternalClass.class.getName()); analyzeFoldMultilinesOn(pb, out); Xlog = XLOG_BASE + out + "::foldmultilines=false"; - pb = ProcessTools.createJavaProcessBuilder(Xlog, InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(Xlog, InternalClass.class.getName()); analyzeFoldMultilinesOff(pb, out); Xlog = XLOG_BASE + out + "::foldmultilines=invalid"; - pb = ProcessTools.createJavaProcessBuilder(Xlog, InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(Xlog, InternalClass.class.getName()); analyzeFoldMultilinesInvalid(pb); } diff --git a/test/hotspot/jtreg/runtime/logging/ItablesTest.java b/test/hotspot/jtreg/runtime/logging/ItablesTest.java index 009986285a4..6869e5b2917 100644 --- a/test/hotspot/jtreg/runtime/logging/ItablesTest.java +++ b/test/hotspot/jtreg/runtime/logging/ItablesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +41,7 @@ public class ItablesTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:itables=trace", "ClassB"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:itables=trace", "ClassB"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(": Initializing itables for ClassB"); output.shouldContain(": Initializing itable indices for interface "); @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { output.shouldContain("invokeinterface selected method: receiver-class"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:itables=trace", "ItablesVtableTest"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:itables=trace", "ItablesVtableTest"); output = new OutputAnalyzer(pb.start()); output.shouldContain("vtable index "); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java b/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java index 0661ae81446..39ad3b872a2 100644 --- a/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java +++ b/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +66,7 @@ static ProcessBuilder exec(String... args) throws Exception { Collections.addAll(argsList, "-XX:+UnlockDiagnosticVMOptions"); Collections.addAll(argsList, "-XX:+WhiteBoxAPI"); Collections.addAll(argsList, ClassUnloadTestMain.class.getName()); - return ProcessTools.createJavaProcessBuilder(argsList); + return ProcessTools.createLimitedTestJavaProcessBuilder(argsList); } public static void main(String... args) throws Exception { diff --git a/test/hotspot/jtreg/runtime/logging/ModulesTest.java b/test/hotspot/jtreg/runtime/logging/ModulesTest.java index 5d30fa3a6a4..96292b1d5d2 100644 --- a/test/hotspot/jtreg/runtime/logging/ModulesTest.java +++ b/test/hotspot/jtreg/runtime/logging/ModulesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,7 +75,7 @@ static void testModuleUnload(String... args) throws Exception { } static OutputAnalyzer run(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); return new OutputAnalyzer(pb.start()); } } diff --git a/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java b/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java index 85f025469b4..737c64621e8 100644 --- a/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java +++ b/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -51,12 +51,12 @@ static void analyzeOutputOff(ProcessBuilder pb) throws Exception { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=trace", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:monitorinflation=trace", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:monitorinflation=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff --git a/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java b/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java index ac54ab8c2ca..c3b9198b398 100644 --- a/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java +++ b/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -40,19 +40,19 @@ public class MonitorMismatchTest { public static void main(String... args) throws Exception { // monitormismatch should turn on. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcomp", - "-XX:+TieredCompilation", - "-Xlog:monitormismatch=info", - "MonitorMismatchHelper"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcomp", + "-XX:+TieredCompilation", + "-Xlog:monitormismatch=info", + "MonitorMismatchHelper"); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldContain("[monitormismatch] Monitor mismatch in method"); // monitormismatch should turn off. - pb = ProcessTools.createJavaProcessBuilder("-Xcomp", - "-XX:+TieredCompilation", - "-Xlog:monitormismatch=off", - "MonitorMismatchHelper"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcomp", + "-XX:+TieredCompilation", + "-Xlog:monitormismatch=off", + "MonitorMismatchHelper"); o = new OutputAnalyzer(pb.start()); o.shouldHaveExitValue(0); o.shouldNotContain("[monitormismatch]"); diff --git a/test/hotspot/jtreg/runtime/logging/MutexRankTest.java b/test/hotspot/jtreg/runtime/logging/MutexRankTest.java index d1d459ac002..9bf2459a651 100644 --- a/test/hotspot/jtreg/runtime/logging/MutexRankTest.java +++ b/test/hotspot/jtreg/runtime/logging/MutexRankTest.java @@ -36,8 +36,8 @@ public class MutexRankTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:vmmutex", - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:vmmutex", + "-version"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("VM Mutex/Monitor ranks:"); if (Platform.isDebugBuild()) { diff --git a/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java b/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java index bf6e3faed59..a1141964f38 100644 --- a/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java +++ b/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,14 +52,14 @@ static void analyzeOutputForOsCpuLog(OutputAnalyzer output) throws Exception { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+cpu", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+cpu", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); analyzeOutputForOsCpuLog(output); // PPC64 only uses polling pages when UseSIGTRAP is off. pb = (Platform.isPPC() && Platform.is64bit()) - ? ProcessTools.createJavaProcessBuilder("-Xlog:os", "-XX:-UseSIGTRAP", "-version") - : ProcessTools.createJavaProcessBuilder("-Xlog:os", "-version"); + ? ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os", "-XX:-UseSIGTRAP", "-version") + : ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os", "-version"); output = new OutputAnalyzer(pb.start()); analyzeOutputForOsLog(output); } diff --git a/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java b/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java index 9d89de8b67b..c99429519e0 100644 --- a/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java +++ b/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,30 +39,30 @@ public class ProtectionDomainVerificationTest { public static void main(String... args) throws Exception { // -Xlog:protectiondomain=trace - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=trace", - "-Xmx128m", - "-Djava.security.manager=allow", - Hello.class.getName(), "security_manager"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:protectiondomain=trace", + "-Xmx128m", + "-Djava.security.manager=allow", + Hello.class.getName(), "security_manager"); new OutputAnalyzer(pb.start()) .shouldHaveExitValue(0) .shouldContain("[protectiondomain] Checking package access") .shouldContain("[protectiondomain] adding protection domain for class"); // -Xlog:protectiondomain=debug - pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=debug", - "-Xmx128m", - "-Djava.security.manager=allow", - Hello.class.getName(), "security_manager"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:protectiondomain=debug", + "-Xmx128m", + "-Djava.security.manager=allow", + Hello.class.getName(), "security_manager"); new OutputAnalyzer(pb.start()) .shouldHaveExitValue(0) .shouldContain("[protectiondomain] Checking package access") .shouldNotContain("[protectiondomain] adding protection domain for class"); // -Xlog:protectiondomain=debug - pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=trace", - "-Xmx128m", - "-Djava.security.manager=disallow", - Hello.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:protectiondomain=trace", + "-Xmx128m", + "-Djava.security.manager=disallow", + Hello.class.getName()); new OutputAnalyzer(pb.start()) .shouldHaveExitValue(0) .shouldNotContain("[protectiondomain] Checking package access") diff --git a/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java b/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java index 82859b38f15..d4ec877f19b 100644 --- a/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java +++ b/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,12 +51,12 @@ static void analyzeOutputOff(ProcessBuilder pb) throws Exception { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint+cleanup=info", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:safepoint+cleanup=info", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint+cleanup=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:safepoint+cleanup=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff --git a/test/hotspot/jtreg/runtime/logging/SafepointTest.java b/test/hotspot/jtreg/runtime/logging/SafepointTest.java index b79a46ca686..58d02b64660 100644 --- a/test/hotspot/jtreg/runtime/logging/SafepointTest.java +++ b/test/hotspot/jtreg/runtime/logging/SafepointTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -38,8 +38,8 @@ public class SafepointTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint=trace", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:safepoint=trace", + InnerClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Safepoint synchronization initiated"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/logging/StackWalkTest.java b/test/hotspot/jtreg/runtime/logging/StackWalkTest.java index b72358842d9..226dac6f466 100644 --- a/test/hotspot/jtreg/runtime/logging/StackWalkTest.java +++ b/test/hotspot/jtreg/runtime/logging/StackWalkTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -49,12 +49,12 @@ static void analyzeOutputOff(ProcessBuilder pb) throws Exception { } public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:stackwalk=debug", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stackwalk=debug", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:stackwalk=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:stackwalk=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff --git a/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java b/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java index 2066331cb77..88ec76efd12 100644 --- a/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java +++ b/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,12 +52,12 @@ static void analyzeOutputOff(ProcessBuilder pb) throws Exception { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime", - InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:startuptime", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime=off", - InnerClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:startuptime=off", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff --git a/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java b/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java index d98fc455319..2e62240aeb1 100644 --- a/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java +++ b/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -61,11 +61,11 @@ static void analyzeOutputForDebugLevel(OutputAnalyzer output) throws Exception { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); analyzeOutputForInfoLevel(output); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread=debug", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread=debug", "-version"); output = new OutputAnalyzer(pb.start()); analyzeOutputForDebugLevel(output); output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/logging/VMOperationTest.java b/test/hotspot/jtreg/runtime/logging/VMOperationTest.java index 873ed6e6792..014db904235 100644 --- a/test/hotspot/jtreg/runtime/logging/VMOperationTest.java +++ b/test/hotspot/jtreg/runtime/logging/VMOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -38,10 +38,10 @@ public class VMOperationTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:vmoperation=debug", - "-Xmx128m", - "-Xms128m", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:vmoperation=debug", + "-Xmx128m", + "-Xms128m", + InternalClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("VM_Operation ("); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/logging/VerificationTest.java b/test/hotspot/jtreg/runtime/logging/VerificationTest.java index 0a7f01f86b7..a6a0ee66acc 100644 --- a/test/hotspot/jtreg/runtime/logging/VerificationTest.java +++ b/test/hotspot/jtreg/runtime/logging/VerificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,17 +63,17 @@ static void analyzeOutputOff(ProcessBuilder pb) throws Exception { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:verification=info", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:verification=info", + InternalClass.class.getName()); analyzeOutputOn(pb, true); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:verification=off", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:verification=off", + InternalClass.class.getName()); analyzeOutputOff(pb); // logging level 'debug' should output stackmaps and bytecode data. - pb = ProcessTools.createJavaProcessBuilder("-Xlog:verification=debug", - InternalClass.class.getName()); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:verification=debug", + InternalClass.class.getName()); analyzeOutputOn(pb, false); } diff --git a/test/hotspot/jtreg/runtime/logging/VtablesTest.java b/test/hotspot/jtreg/runtime/logging/VtablesTest.java index bc525cf2534..a07fe895173 100644 --- a/test/hotspot/jtreg/runtime/logging/VtablesTest.java +++ b/test/hotspot/jtreg/runtime/logging/VtablesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -44,7 +44,7 @@ public class VtablesTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "ClassB"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:vtables=trace", "ClassB"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("copy vtable from ClassA to ClassB"); output.shouldContain("Initializing: ClassB"); @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception { output.shouldContain("NOT overriding with p2.D.nooverride()V"); output.shouldHaveExitValue(0); - pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "p1/C"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:vtables=trace", "p1/C"); output = new OutputAnalyzer(pb.start()); output.shouldContain("transitive overriding superclass "); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java b/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java index 29dd7b2fbc0..f43f3cf760e 100644 --- a/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java +++ b/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -118,7 +118,7 @@ static class LoadLibraryClass { public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xmn8m", "-Xlog:library=info", "-Djava.library.path=" + System.getProperty("java.library.path"), diff --git a/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java b/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java index d0d9b4d2213..a2b80db74e4 100644 --- a/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java +++ b/test/hotspot/jtreg/runtime/memory/LargePages/TestLargePagesFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -328,7 +328,7 @@ private static OutputAnalyzer executeNewJVM(Flag... flags) throws Exception { args.add("-XX:+PrintFlagsFinal"); args.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java b/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java index 889e35577f0..ede62416633 100644 --- a/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java +++ b/test/hotspot/jtreg/runtime/memory/ReadFromNoaccessArea.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,7 +44,7 @@ public class ReadFromNoaccessArea { public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff --git a/test/hotspot/jtreg/runtime/memory/ReserveMemory.java b/test/hotspot/jtreg/runtime/memory/ReserveMemory.java index 7cd0e1a0e78..6341a031c13 100644 --- a/test/hotspot/jtreg/runtime/memory/ReserveMemory.java +++ b/test/hotspot/jtreg/runtime/memory/ReserveMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 static void main(String args[]) throws Exception { // expected to crash WhiteBox.getWhiteBox().readReservedMemory(); } else { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff --git a/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java b/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java index 91017b30702..765f9dcee7d 100644 --- a/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java +++ b/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -37,7 +37,7 @@ public class ClassLoaderNoUnnamedModuleTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=java.base", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", diff --git a/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java b/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java index a3c9c8ac6ee..6bd2b299a55 100644 --- a/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java +++ b/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -43,7 +43,7 @@ public class IgnoreModulePropertiesTest { // bogus for that property. But, since the property is ignored no exception is // thrown. public static void testProperty(String prop, String value) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-D" + prop + "=" + value, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(" version "); @@ -62,7 +62,7 @@ public static void testProperty(String prop, String value) throws Exception { public static void testOption(boolean shouldVMFail, String option, String value, String prop, String result) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( option + "=" + value, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (shouldVMFail) { diff --git a/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java b/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java index 140b9103910..137e482ffb2 100644 --- a/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java +++ b/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { // Test that multiple --add-modules options are cumulative, not last one wins. // An exception should be thrown because module i_dont_exist doesn't exist. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=i_dont_exist", "--add-modules=java.base", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("FindException"); @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { // Test that the last --limit-modules is the only one recognized. No exception // should be thrown. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--limit-modules=i_dont_exist", "--limit-modules=java.base", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java b/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java index 5e6b526b5a3..73870e029ad 100644 --- a/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java +++ b/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,77 +41,77 @@ public class ModuleOptionsWarn { public static void main(String[] args) throws Exception { // Test that a warning is not issued for extraneous jdk.module properties. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.ignored", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.addmods", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in '.'. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.limitmods.", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in '='. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.addexports=", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in ".stuff" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.addreads.stuff", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in "=stuff" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.path=stuff", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in ".=" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.upgrade.path.=xx", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for a reserved jdk.module property ending in "." - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.patch.3=xx", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning can be suppressed for module related properties that get ignored. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djdk.module.addmods", "-XX:-PrintWarnings", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is not issued for properties of the form "jdk.module.main" - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+PrintWarnings", "-Djdk.module.main.ignored", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Ignoring system property option"); output.shouldHaveExitValue(0); // Test that a warning is issued for module related properties specified using _JAVA_OPTIONS. - pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintWarnings", "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintWarnings", "-version"); Map env = pb.environment(); env.put("_JAVA_OPTIONS", "-Djdk.module.addreads"); output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java b/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java index ce9246e83c6..1de5f4ae0f8 100644 --- a/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java +++ b/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -71,7 +71,7 @@ public static void main(String[] args) throws Exception { // Sanity check that the test, jdk.test/test/Main.java // runs without error. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-p", MODS_DIR.toString(), "-m", "jdk.test/test.Main"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java b/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java index bc23a0383ab..7232e213410 100644 --- a/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java +++ b/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +50,7 @@ public static void main(String[] args) throws Exception { // loaders (boot, application, platform). Thus there is // not a need to walk those lists at a GC safepoint since // those loaders never die. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:module=trace", "-version"); @@ -85,7 +85,7 @@ public static void main(String[] args) throws Exception { // m1x's module readability list and package p2's exportability should // not be walked at a GC safepoint since both modules are defined to // the same loader and thus have the exact same life cycle. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:module=trace", "ModuleSameCLMain"); @@ -99,7 +99,7 @@ public static void main(String[] args) throws Exception { // m1x's module readability list and package p2's exportability list must // be walked at a GC safepoint since both modules are defined to non-builtin // class loaders which could die and thus be unloaded. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-Xlog:module=trace", "ModuleNonBuiltinCLMain"); @@ -116,7 +116,7 @@ public static void main(String[] args) throws Exception { // m3x is defined to the system class loader, m2x's module readability // list does not have to be walked at a GC safepoint, but package p2's // exportability list does. - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Djava.system.class.loader=CustomSystemClassLoader", "-Xbootclasspath/a:.", "-Xlog:module=trace", diff --git a/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java b/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java index 05b9cf7c2ef..44bbe4ed5c2 100644 --- a/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java +++ b/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -72,7 +72,7 @@ public static void main(String[] args) throws Exception { // Check that jdk.test/test.MainGC walks module jdk.test's // reads list and walks the exports list for package test, // defined in module jdk.test, during a GC. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmx128m", "-Xlog:module=trace", "-p", MODS_DIR.toString(), diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java index b582314411d..cd0670cfb72 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +60,7 @@ public static void main(String[] args) throws Exception { InMemoryJavaCompiler.compile("java.beans.Encoder", source2, "--patch-module=java.desktop"), "mods2/java.desktop"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=java.naming=mods/java.naming", "--patch-module=java.desktop=mods2/java.desktop", "PatchModule2DirsMain", "javax.naming.spi.NamingManager", "java.beans.Encoder"); diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java index 109f6cf2616..e7bf5dabf21 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -44,7 +44,7 @@ public static void main(String args[]) throws Throwable { // Case 1: Test that --patch-module and -Xshare:dump are compatible String filename = "patch_module.jsa"; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", @@ -69,7 +69,7 @@ public static void main(String args[]) throws Throwable { InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"), System.getProperty("test.classes")); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", @@ -84,7 +84,7 @@ public static void main(String args[]) throws Throwable { // Case 3a: Test CDS dumping with jar file in --patch-module BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager"); String moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", @@ -98,7 +98,7 @@ public static void main(String args[]) throws Throwable { .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module"); // Case 3b: Test CDS run with jar file in --patch-module - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:auto", diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java index a4a03935f03..35ec86f841d 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -64,7 +64,7 @@ public static void main(String args[]) throws Throwable { String moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); String classList = "javanaming.list"; - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:DumpLoadedClassList=" + classList, "--patch-module=java.naming=" + moduleJar, "PatchModuleMain", BOOT_CLASS.replace('/', '.')); @@ -98,7 +98,7 @@ public static void main(String args[]) throws Throwable { moduleJar = BasicJarBuilder.getTestJar("javasql.jar"); classList = "javasql.list"; - pb = ProcessTools.createTestJvm( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:DumpLoadedClassList=" + classList, "--patch-module=java.sql=" + moduleJar, "PatchModuleMain", PLATFORM_CLASS.replace('/', '.')); @@ -130,7 +130,7 @@ public static void main(String args[]) throws Throwable { moduleJar = BasicJarBuilder.getTestJar("hello.jar"); classList = "hello.list"; - pb = ProcessTools.createTestJvm( + pb = ProcessTools.createTestJavaProcessBuilder( "-XX:DumpLoadedClassList=" + classList, "-Xbootclasspath/a:" + moduleJar, "Hello"); diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java index a256a1f6c85..d9d00a1573e 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -37,7 +37,7 @@ public class PatchModuleDupJavaBase { // The VM should exit initialization if java.base is specified // more than once to --patch-module. public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=java.base=javabase_dir", "--patch-module=java.base=javabase_dir", "-version"); diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java index a454dcb1527..464a15f78bd 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ public class PatchModuleDupModule { // if --patch-module is specified with the same module more than once. public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=module_one=module_one_dir", "--patch-module=module_one=module_one_dir", "-version"); diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java index 58aef0fb877..75fcf26f633 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { InMemoryJavaCompiler.compile("java.lang.NewClass", source, "--patch-module=java.base"), "mods/java.base"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.base=mods/java.base", "PatchModuleMain", "java.lang.NewClass"); new OutputAnalyzer(pb.start()) diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java index 045f156c9d8..ed9f9019033 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"), "mods/java.naming"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", "PatchModuleMain", "javax.naming.spi.NamingManager"); new OutputAnalyzer(pb.start()) diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java index ed9e2b0ea8b..617d144d186 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +76,7 @@ public static void main(String[] args) throws Exception { System.getProperty("test.classes")); // Supply --patch-module with the name of the jar file for the module java.naming. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=" + moduleJar, + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=" + moduleJar, "PatchModuleMain", "javax.naming.spi.NamingManager"); new OutputAnalyzer(pb.start()) diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java index 2b2952b1e23..1be1f2f0e22 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,13 +92,13 @@ public static void main(String[] args) throws Exception { // Supply --patch-module with the name of the jar file for the module java.naming. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=" + - moduleJar + - File.pathSeparator + - System.getProperty("test.classes") + "/mods/java.naming", - "PatchModule2DirsMain", - "javax.naming.spi.NamingManager1", - "javax.naming.spi.NamingManager2"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=" + + moduleJar + + File.pathSeparator + + System.getProperty("test.classes") + "/mods/java.naming", + "PatchModule2DirsMain", + "javax.naming.spi.NamingManager1", + "javax.naming.spi.NamingManager2"); new OutputAnalyzer(pb.start()) .shouldContain("I pass one!") diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java index f98f85cce9a..dd8b33402ac 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"), "mods/java.naming"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("--patch-module=java.naming=mods/java.naming", "-Xlog:class+load=info", "PatchModuleMain", "javax.naming.spi.NamingManager"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -77,7 +77,7 @@ public static void main(String[] args) throws Exception { InMemoryJavaCompiler.compile("PatchModuleTraceCL_pkg.ItIsI", source), "xbcp"); - pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:xbcp", + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xbootclasspath/a:xbcp", "-Xlog:class+load=info", "PatchModuleMain", "PatchModuleTraceCL_pkg.ItIsI"); output = new OutputAnalyzer(pb.start()); // -Xbootclasspath/a case. diff --git a/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java b/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java index f11d52b46f0..96982593dbb 100644 --- a/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java +++ b/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -86,7 +86,7 @@ public static void main(String[] args) throws Throwable { Files.delete(Paths.get(System.getProperty("test.classes") + File.separator + "p2" + File.separator + "Vis2_B.class")); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "--patch-module=java.base=mods2/java.base", "--add-exports=java.base/p2=ALL-UNNAMED", "Vis2_A") diff --git a/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java b/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java index 9d10fe6488c..90df4c10f27 100644 --- a/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java +++ b/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -73,7 +73,7 @@ public static void main(String args[]) throws Exception { ClassFileInstaller.writeClassToDisk("Vis3_A", InMemoryJavaCompiler.compile("Vis3_A", Vis3_A_src), System.getProperty("test.classes")); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:.", "Vis3_A") .start()) diff --git a/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java b/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java index df20c356c92..5d1605b74fe 100644 --- a/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java +++ b/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -104,7 +104,7 @@ public static void main(String[] args) throws Throwable { Files.delete(Paths.get(System.getProperty("test.classes") + File.separator + "p2" + File.separator + "Vis1_C.class")); - new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:nonexistent.jar", "-Xbootclasspath/a:mods1", "Vis1_A") diff --git a/test/hotspot/jtreg/runtime/os/AvailableProcessors.java b/test/hotspot/jtreg/runtime/os/AvailableProcessors.java index 97491d241b9..18201d99127 100644 --- a/test/hotspot/jtreg/runtime/os/AvailableProcessors.java +++ b/test/hotspot/jtreg/runtime/os/AvailableProcessors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -69,8 +69,8 @@ public static void main(String[] args) throws Exception { // Get the java command we want to execute // Enable logging for easier failure diagnosis ProcessBuilder master = - ProcessTools.createJavaProcessBuilder("-Xlog:os=trace", - "AvailableProcessors"); + ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os=trace", + "AvailableProcessors"); int[] expected = new int[] { 1, available/2, available-1, available }; diff --git a/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java b/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java index f5ec01e43a6..fd9fea9e5a5 100644 --- a/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java +++ b/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java @@ -177,7 +177,7 @@ public static void main(String[] args) throws Exception { switch (args[0]) { case "PATCH-ENABLED": { finalargs.add(TestMain.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); @@ -214,7 +214,7 @@ public static void main(String[] args) throws Exception { finalargs.add("-XX:-THPStackMitigation"); finalargs.add(TestMain.class.getName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(finalargs); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java b/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java index e93309c0b00..340c1370738 100644 --- a/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java +++ b/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java @@ -146,7 +146,7 @@ public static void main(String[] extraOptions) throws Exception { boolean useTHP = allOptions.contains("-XX:+UseTransparentHugePages"); System.out.println("useLP: " + useLP + " useTHP: " + useTHP); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(allOptions.toArray(new String[0])); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(allOptions.toArray(new String[0])); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.reportDiagnosticSummary(); HugePageConfiguration configuration = HugePageConfiguration.readFromOS(); diff --git a/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java b/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java index 2dac98000f5..ba318da0a0b 100644 --- a/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java +++ b/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java @@ -47,7 +47,7 @@ public static void main(String[] args) throws Exception { finalargs.addAll(Arrays.asList(defaultArgs)); finalargs.add("-version"); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( new String[] {"-Xlog:pagesize", "-Xmx64M", "-version"}); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/os/TestTimerSlack.java b/test/hotspot/jtreg/runtime/os/TestTimerSlack.java index 86aece992b5..b703625dfd0 100644 --- a/test/hotspot/jtreg/runtime/os/TestTimerSlack.java +++ b/test/hotspot/jtreg/runtime/os/TestTimerSlack.java @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { // Check the timer slack value is not printed by default { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "TestTimerSlack$TestMain"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -52,7 +52,7 @@ public static void main(String[] args) throws Exception { // Check the timer slack value is not printed when explicitly disabled { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-XX:+UnlockExperimentalVMOptions", "-XX:TimerSlack=-1", "TestTimerSlack$TestMain"); @@ -64,7 +64,7 @@ public static void main(String[] args) throws Exception { // Check the timer slack value is good when system-wide default is requested { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-XX:+UnlockExperimentalVMOptions", "-XX:TimerSlack=0", "TestTimerSlack$TestMain"); @@ -82,7 +82,7 @@ public static void main(String[] args) throws Exception { // Check the timer slack value is accepted by all threads for (int slack : new int[] {1, 10, 100, 1000, 10000, 100000, 1000000}) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+thread", "-XX:+UnlockExperimentalVMOptions", "-XX:TimerSlack=" + slack, "TestTimerSlack$TestMain"); diff --git a/test/hotspot/jtreg/runtime/os/TestTrimNative.java b/test/hotspot/jtreg/runtime/os/TestTrimNative.java index f1aed48b88e..6bca3132b3d 100644 --- a/test/hotspot/jtreg/runtime/os/TestTrimNative.java +++ b/test/hotspot/jtreg/runtime/os/TestTrimNative.java @@ -159,7 +159,7 @@ private static String[] prepareOptions(String[] extraVMOptions, String[] program } private static OutputAnalyzer runTestWithOptions(String[] extraOptions, String[] programOptions) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(prepareOptions(extraOptions, programOptions)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(prepareOptions(extraOptions, programOptions)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); return output; diff --git a/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java b/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java index 0146256f7dd..6b98f8fd2d9 100644 --- a/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java +++ b/test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,10 @@ public class TestUseCpuAllocPath { public static void main(String[] args) throws Exception { ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder("-Xlog:os=trace", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+UseCpuAllocPath", - "-version"); + ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os=trace", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+UseCpuAllocPath", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java b/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java index 354273d1516..33707126935 100644 --- a/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java +++ b/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ public static void main(String[] args) throws Throwable { // modification, the JVM may crash or hang in an endless loop, where the // illegal instruction will be continously executed, raising SIGILL, and // the signal handler will return to the illegal instruction again... - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+CheckJNICalls", "-Xint", "-Djava.library.path=" + libpath + ":.", diff --git a/test/hotspot/jtreg/runtime/records/RedefineRecord.java b/test/hotspot/jtreg/runtime/records/RedefineRecord.java index bad4542885e..1019a4c3e7b 100644 --- a/test/hotspot/jtreg/runtime/records/RedefineRecord.java +++ b/test/hotspot/jtreg/runtime/records/RedefineRecord.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -102,7 +102,7 @@ public static void main(String argv[]) throws Exception { return; } if (argv.length == 1 && argv[0].equals("runtest")) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", diff --git a/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java b/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java index 1832d295cc5..29ce452cc2c 100644 --- a/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java +++ b/test/hotspot/jtreg/runtime/sealedClasses/RedefinePermittedSubclass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -126,7 +126,7 @@ public static void main(String argv[]) throws Exception { if (argv.length == 1 && argv[0].equals("runtest")) { String[] javaArgs1 = { "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", "RedefinePermittedSubclass"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(javaArgs1); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(javaArgs1); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("processing of -javaagent failed"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java b/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java index 515dfa9f5e0..84a1b6bfac7 100644 --- a/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java +++ b/test/hotspot/jtreg/runtime/sealedClasses/RedefineSealedClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -108,7 +108,7 @@ public static void main(String argv[]) throws Exception { if (argv.length == 1 && argv[0].equals("runtest")) { String[] javaArgs1 = { "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", "RedefineSealedClass"}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(javaArgs1); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(javaArgs1); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("processing of -javaagent failed"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java b/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java index 6f6b0a6ef73..f0513de13a4 100644 --- a/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java +++ b/test/hotspot/jtreg/runtime/stringtable/StringTableVerifyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -36,7 +36,7 @@ public class StringTableVerifyTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyStringTableAtExit", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyStringTableAtExit", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java b/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java index 6e5db46bd5c..ee7fa8f40d7 100644 --- a/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java +++ b/test/hotspot/jtreg/runtime/symboltable/ShortLivedSymbolCleanup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -89,13 +89,13 @@ static void analyzeOutputOn(int size, ProcessBuilder pb) throws Exception { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:symboltable=trace", - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:symboltable=trace", + "-version"); int size = getSymbolTableSize(pb); - pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintSymbolTableSizeHistogram", - LotsOfTempSymbols.class.getName(), - Integer.toString(size)); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+PrintSymbolTableSizeHistogram", + LotsOfTempSymbols.class.getName(), + Integer.toString(size)); analyzeOutputOn(size, pb); } diff --git a/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java b/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java index 38a8595d25d..5b24caacd3e 100644 --- a/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java +++ b/test/hotspot/jtreg/runtime/verifier/OverriderMsg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -125,7 +125,7 @@ public static void dump_Overrider () throws Exception { public static void main(String... args) throws Exception { dump_HasFinal(); dump_Overrider(); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "Overrider"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "Overrider"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain( "java.lang.IncompatibleClassChangeError: class Overrider overrides final method HasFinal.m(Ljava/lang/String;)V"); diff --git a/test/hotspot/jtreg/runtime/verifier/TestANewArray.java b/test/hotspot/jtreg/runtime/verifier/TestANewArray.java index 99333da56dd..011749133da 100644 --- a/test/hotspot/jtreg/runtime/verifier/TestANewArray.java +++ b/test/hotspot/jtreg/runtime/verifier/TestANewArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -69,7 +69,7 @@ public static void main(String... args) throws Exception { byte[] classFile_254 = dumpClassFile(cfv, test_Dimension_254, array_Dimension_254); writeClassFileFromByteArray(classFile_254); System.err.println("Running with cfv: " + cfv + ", test_Dimension_254"); - ProcessBuilder pb = ProcessTools.createTestJvm("-verify", "-cp", ".", classCName); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-verify", "-cp", ".", classCName); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.VerifyError"); output.shouldHaveExitValue(0); @@ -78,7 +78,7 @@ public static void main(String... args) throws Exception { byte[] classFile_255 = dumpClassFile(cfv, test_Dimension_255, array_Dimension_255); writeClassFileFromByteArray(classFile_255); System.err.println("Running with cfv: " + cfv + ", test_Dimension_255"); - pb = ProcessTools.createTestJvm("-verify", "-cp", ".", classCName); + pb = ProcessTools.createTestJavaProcessBuilder("-verify", "-cp", ".", classCName); output = new OutputAnalyzer(pb.start()); // If anewarray has an operand with 255 array dimensions then VerifyError should // be thrown because the resulting array would have 256 dimensions. @@ -95,7 +95,7 @@ public static void main(String... args) throws Exception { byte[] classFile_264 = dumpClassFile(cfv, test_Dimension_264, array_Dimension_264); writeClassFileFromByteArray(classFile_264); System.err.println("Running with cfv: " + cfv + ", test_Dimension_264"); - pb = ProcessTools.createTestJvm("-verify", "-cp", ".", classCName); + pb = ProcessTools.createTestJavaProcessBuilder("-verify", "-cp", ".", classCName); output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ClassFormatError"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java b/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java index 07f2f33110d..6f04278c4cd 100644 --- a/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java +++ b/test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 static void main(String... args) throws Exception { int cfv = Integer.parseInt(args[0]); writeClassFile(cfv); System.err.println("Running with cfv: " + cfv); - ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "ClassFile"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-cp", ".", "ClassFile"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("VerifyError"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java b/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java index c4e420a1613..ddb5e68e1d3 100644 --- a/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java +++ b/test/hotspot/jtreg/runtime/verifier/TraceClassRes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -38,7 +38,7 @@ public class TraceClassRes { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xlog:class+resolve=debug", "-verify", "-Xshare:off", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java b/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java index e5e22e58239..e88bc025e8c 100644 --- a/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java +++ b/test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -44,7 +44,7 @@ public class TestWBDeflateIdleMonitors { static final int N_TRIES = 5; // number of times to try deflation public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", diff --git a/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java b/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java index 939cc872a11..e38cc940d37 100644 --- a/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java +++ b/test/hotspot/jtreg/serviceability/attach/AttachSetGetFlag.java @@ -67,7 +67,7 @@ public static void main(String... args) throws Exception { } public static ProcessBuilder runTarget(String flagName, String flagValue) throws Exception { - return ProcessTools.createJavaProcessBuilder( + return ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", "-XX:" + flagName + "=" + flagValue, "AttachSetGetFlag$Target"); diff --git a/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java b/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java index f5905396782..aceaa82d668 100644 --- a/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java +++ b/test/hotspot/jtreg/serviceability/attach/AttachWithStalePidFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -59,7 +59,7 @@ public static void main(String... args) throws Exception { } public static boolean runTest() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:+PauseAtStartup", "AttachWithStalePidFileTarget"); Process target = pb.start(); Path pidFile = null; diff --git a/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java b/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java index bf90dd9a08c..3618a4cfa09 100644 --- a/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java +++ b/test/hotspot/jtreg/serviceability/attach/ShMemLongName.java @@ -94,7 +94,7 @@ private static void log(String s) { // creates target process builder for the specified shmem transport name private static ProcessBuilder getTarget(String shmemName) throws IOException { log("starting target with shmem name: '" + shmemName + "'..."); - return ProcessTools.createJavaProcessBuilder( + return ProcessTools.createLimitedTestJavaProcessBuilder( "-Xrunjdwp:transport=" + transport + ",server=y,suspend=n,address=" + shmemName, "ShMemLongName$Target"); } diff --git a/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java b/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java index bf8605ee320..da47616d6e4 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/gc/RunFinalizationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -47,7 +47,7 @@ public static void main(String ... args) throws Exception { javaArgs.add("-cp"); javaArgs.add(System.getProperty("test.class.path")); javaArgs.add(TEST_APP_NAME); - ProcessBuilder testAppPb = ProcessTools.createJavaProcessBuilder(javaArgs); + ProcessBuilder testAppPb = ProcessTools.createLimitedTestJavaProcessBuilder(javaArgs); final AtomicBoolean failed = new AtomicBoolean(); final AtomicBoolean passed = new AtomicBoolean(); diff --git a/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java b/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java index f0bd1e1fdfb..66476712514 100644 --- a/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java +++ b/test/hotspot/jtreg/serviceability/dtrace/DTraceOptionsTest.java @@ -62,7 +62,7 @@ public static void main(String[] args) throws Throwable { }; for (String opt : options) { - var pb = ProcessTools.createJavaProcessBuilder("-XX:+" + opt, "-version"); + var pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+" + opt, "-version"); var oa = new OutputAnalyzer(pb.start()); if (dtraceEnabled) { oa.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java b/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java index 2d03d2f418f..f7467affdf8 100644 --- a/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java +++ b/test/hotspot/jtreg/serviceability/jdwp/DebuggeeLauncher.java @@ -69,7 +69,7 @@ public DebuggeeLauncher(Listener listener) { */ public void launchDebuggee() throws Throwable { - ProcessBuilder pb = ProcessTools.createTestJvm(JDWP_OPT, DEBUGGEE); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(JDWP_OPT, DEBUGGEE); p = pb.start(); StreamHandler inputHandler = new StreamHandler(p.getInputStream(), this); StreamHandler errorHandler = new StreamHandler(p.getErrorStream(), l -> System.out.println("[stderr]: " + l)); diff --git a/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java b/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java index 759967c5c96..b3c8ed66a0b 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java +++ b/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -125,7 +125,7 @@ private static void log(String msg) { } private static OutputAnalyzer execJava(String... args) throws IOException { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java b/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java index 126f3333cae..b5ab4eeb997 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java +++ b/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception { pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", "agent.jar", "GetObjectSizeClassAgent.class"}); pb.start().waitFor(); - ProcessBuilder pt = ProcessTools.createTestJvm("-javaagent:agent.jar", "GetObjectSizeClassAgent"); + ProcessBuilder pt = ProcessTools.createTestJavaProcessBuilder("-javaagent:agent.jar", "GetObjectSizeClassAgent"); OutputAnalyzer output = new OutputAnalyzer(pt.start()); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java index bd14f8ec3c7..b369f4abb85 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ public static void main(String argv[]) throws Exception { } if (argv.length == 1 && argv[0].equals("runtest")) { // run outside of jtreg to not OOM on jtreg classes that are loaded after metaspace is full - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:MetaspaceSize=12m", "-XX:MaxMetaspaceSize=12m", "-javaagent:redefineagent.jar", diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java index 80933a7beb0..9fe9f43b8a9 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefinePreviousVersions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -84,7 +84,7 @@ public static void main(String[] args) throws Exception { if (args.length > 0) { // java -javaagent:redefineagent.jar -Xlog:stuff RedefinePreviousVersions - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-javaagent:redefineagent.jar", + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:redefineagent.jar", "-Xlog:redefine+class+iklass+add=trace,redefine+class+iklass+purge=trace", "RedefinePreviousVersions"); new OutputAnalyzer(pb.start()) diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java index 6ee54be7831..bf6216ae85a 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.java @@ -75,7 +75,7 @@ public static void main(String[] args) throws Exception { List offCommand = new ArrayList<>(); offCommand.add("-Xshare:off"); offCommand.addAll(baseCommand); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(offCommand); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(offCommand); new OutputAnalyzer(pb.start()) // We can't expect any of the transformed classes to be in use // so the only thing we can verify is that no scratch classes @@ -89,7 +89,7 @@ public static void main(String[] args) throws Exception { List onCommand = new ArrayList<>(); onCommand.add("-Xshare:on"); onCommand.addAll(baseCommand); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(onCommand); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(onCommand); new OutputAnalyzer(pb.start()) .shouldContain(SHOULD_CLEAN_FALSE) .shouldNotContain(SHOULD_CLEAN_TRUE) diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java index 13ac65a2eb7..7f7ec792941 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RetransformClassesZeroLength.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,7 +56,7 @@ public class RetransformClassesZeroLength { public static void main(String args[]) throws Throwable { String agentJar = buildAgent(); ProcessTools.executeProcess( - ProcessTools.createJavaProcessBuilder( + ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:" + agentJar, "-version") ).shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java index f51ff4c58a5..99c7a49263c 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TransformerDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -57,7 +57,7 @@ public class TransformerDeadlockTest { public static void main(String args[]) throws Throwable { String agentJar = buildAgent(); ProcessTools.executeProcess( - ProcessTools.createJavaProcessBuilder( + ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:" + agentJar, TransformerDeadlockTest.Agent.class.getName()) ).shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/premain/AgentWithVThreadTest.java b/test/hotspot/jtreg/serviceability/jvmti/vthread/premain/AgentWithVThreadTest.java index 4e0db40d1b9..ab04520f4ae 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/vthread/premain/AgentWithVThreadTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/premain/AgentWithVThreadTest.java @@ -37,7 +37,7 @@ public class AgentWithVThreadTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm("-javaagent:agent.jar", "-version"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-javaagent:agent.jar", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.stdoutShouldContain("passed"); } diff --git a/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java b/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java index 07aafabf995..895e5504feb 100644 --- a/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java +++ b/test/hotspot/jtreg/serviceability/logging/TestBasicLogOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -36,7 +36,7 @@ public class TestBasicLogOutput { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:all=trace", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:all=trace", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldMatch("\\[logging *\\]"); // expected tag(s) output.shouldContain("Log configuration fully initialized."); // expected message diff --git a/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java b/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java index 3a7fde88894..a1f70fdeb13 100644 --- a/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java +++ b/test/hotspot/jtreg/serviceability/logging/TestDefaultLogOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -36,7 +36,7 @@ public class TestDefaultLogOutput { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:badTag"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:badTag"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.stdoutShouldMatch("\\[error *\\]\\[logging *\\]"); output.shouldHaveExitValue(1); diff --git a/test/hotspot/jtreg/serviceability/logging/TestFullNames.java b/test/hotspot/jtreg/serviceability/logging/TestFullNames.java index dceb2e32f63..0a3bc855d8f 100644 --- a/test/hotspot/jtreg/serviceability/logging/TestFullNames.java +++ b/test/hotspot/jtreg/serviceability/logging/TestFullNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,9 +63,9 @@ public static void main(String[] args) throws Exception { for (String logOutput : validOutputs) { Asserts.assertFalse(file.exists()); // Run with logging=trace on stdout so that we can verify the log configuration afterwards. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", - "-Xlog:all=trace:" + logOutput, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); Asserts.assertTrue(file.exists()); diff --git a/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java b/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java index 608c656c580..585e8bda47d 100644 --- a/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java +++ b/test/hotspot/jtreg/serviceability/logging/TestLogRotation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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 @@ -71,7 +71,7 @@ public static void cleanLogs() { } public static void runTest(int numberOfFiles) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-cp", System.getProperty("java.class.path"), "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k" diff --git a/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java b/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java index 8570eec7360..13560eeb68a 100644 --- a/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java +++ b/test/hotspot/jtreg/serviceability/logging/TestMultipleXlogArgs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -36,13 +36,13 @@ public class TestMultipleXlogArgs { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=debug", - "-Xlog:logging=trace", - "-Xlog:defaultmethods=trace", - "-Xlog:defaultmethods=warning", - "-Xlog:safepoint=info", - "-Xlog:safepoint=info", - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=debug", + "-Xlog:logging=trace", + "-Xlog:defaultmethods=trace", + "-Xlog:defaultmethods=warning", + "-Xlog:safepoint=info", + "-Xlog:safepoint=info", + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // -Xlog:logging=trace means that the log configuration will be printed. String stdoutConfigLine = "\\[logging *\\] #0: stdout .*"; diff --git a/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java b/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java index dff973f61da..dea656130ab 100644 --- a/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java +++ b/test/hotspot/jtreg/serviceability/logging/TestQuotedLogOutputs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -73,9 +73,9 @@ public static void main(String[] args) throws Exception { }; for (String logOutput : validOutputs) { // Run with logging=trace on stdout so that we can verify the log configuration afterwards. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", - "-Xlog:all=trace:" + logOutput, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); Asserts.assertTrue(file.exists()); @@ -98,9 +98,9 @@ public static void main(String[] args) throws Exception { "A" + quote + quote + "B" }; for (String logOutput : invalidOutputs) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", - "-Xlog:all=trace:" + logOutput, - "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(1); // Ensure error message was logged diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java index 3655a8c8847..53370fc09d6 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,7 +90,7 @@ public static void main(String[] args) throws Exception { try { List options = new ArrayList<>(); options.addAll(Arrays.asList(jArgs)); - ProcessBuilder pb = ProcessTools.createTestJvm(options); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(options); // Add "ulimit -c unlimited" if we can since we are generating a core file. pb = CoreUtils.addCoreUlimitCommand(pb); crashOutput = ProcessTools.executeProcess(pb); diff --git a/test/hotspot/jtreg/serviceability/sa/TestClassDump.java b/test/hotspot/jtreg/serviceability/sa/TestClassDump.java index 18f3c47e5d1..04d225287b8 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestClassDump.java +++ b/test/hotspot/jtreg/serviceability/sa/TestClassDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -49,7 +49,7 @@ private static void dumpClass(long lingeredAppPid) ProcessBuilder pb; OutputAnalyzer output; - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.jvm.hotspot.tools.jcore.outputDir=jtreg_classes", "-m", "jdk.hotspot.agent/sun.jvm.hotspot.tools.jcore.ClassDump", String.valueOf(lingeredAppPid)); SATestUtils.addPrivilegesIfNeeded(pb); @@ -68,7 +68,7 @@ private static void dumpClass(long lingeredAppPid) throw new RuntimeException("jtreg_classes/sun/net/util/URLUtil.class not found"); } - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.jvm.hotspot.tools.jcore.outputDir=jtreg_classes2", "-Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=jdk,sun", "-m", "jdk.hotspot.agent/sun.jvm.hotspot.tools.jcore.ClassDump", String.valueOf(lingeredAppPid)); diff --git a/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java b/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java index 4753c924f1e..ca5c99d00b8 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java +++ b/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -91,7 +91,7 @@ private static void createAnotherToAttach( String[] instanceKlassNames, long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java b/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java index f674008e2f8..094c7525048 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java +++ b/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -98,7 +98,7 @@ private static void createAnotherToAttach( String[] instanceKlassNames, long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java b/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java index 70b9f066257..5c344b408dc 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java +++ b/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -72,7 +72,7 @@ private static void checkHeapRegion(String pid) throws Exception { private static void createAnotherToAttach(long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.gc.g1=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java b/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java index a2190d48487..ebe55b75061 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java +++ b/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -82,7 +82,7 @@ private static void startMeWithArgs() throws Exception { } try { // Run this app with the LingeredApp PID to get SA output from the LingeredApp - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java b/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java index f2310dfe561..e0f7cbecd2f 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java +++ b/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -103,7 +103,7 @@ private static void createAnotherToAttach( String[] instanceKlassNames, int lingeredAppPid) throws Exception { // Start a new process to attach to the LingeredApp process to get SA info - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java index 36772043668..9119ac45cc3 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java +++ b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -71,7 +71,7 @@ public static void main(String[] args) throws Throwable { } static void test(String type) throws Throwable { - ProcessBuilder pb = ProcessTools.createTestJvm("-XX:+CreateCoredumpOnCrash", + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-XX:+CreateCoredumpOnCrash", "-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError", // The test loads lots of small classes to exhaust Metaspace, skip method // dependency verification to improve performance in debug builds. diff --git a/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java b/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java index 236dee6c39d..84744c70cdf 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java +++ b/test/hotspot/jtreg/serviceability/sa/TestObjectAlignment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -64,7 +64,7 @@ private static void checkAlignment(String pid, int expectedAlign) throws Excepti private static void createAnotherToAttach(long lingeredAppPid, int expectedAlign) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java b/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java index e2d79b1ce9d..15201a9c92b 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java +++ b/test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java @@ -73,7 +73,7 @@ private static void test(String pid) { private static void createAnotherToAttach(long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java b/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java index da7334503db..315c931d49e 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java +++ b/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,7 +66,7 @@ private static void computeReversePointers(String pid) throws Exception { private static void createAnotherToAttach(long lingeredAppPid) throws Exception { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/UniqueVtableTest.java b/test/hotspot/jtreg/serviceability/sa/UniqueVtableTest.java index 533ef82b4f3..932974d2dce 100644 --- a/test/hotspot/jtreg/serviceability/sa/UniqueVtableTest.java +++ b/test/hotspot/jtreg/serviceability/sa/UniqueVtableTest.java @@ -146,7 +146,7 @@ private static void runTest(HotSpotAgent agent) throws Throwable { private static void createAnotherToAttach(long lingeredAppPid) throws Throwable { // Start a new process to attach to the lingered app - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.debugger=ALL-UNNAMED", diff --git a/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java index ef31f325481..9d923f7b710 100644 --- a/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java +++ b/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java @@ -77,7 +77,7 @@ public static void main(String[] args) throws Exception { private static void testHProfFileFormat(String vmArgs, long heapSize, String expectedFormat) throws Exception, IOException, InterruptedException, FileNotFoundException { - ProcessBuilder procBuilder = ProcessTools.createTestJvm( + ProcessBuilder procBuilder = ProcessTools.createTestJavaProcessBuilder( "--add-exports=java.management/sun.management=ALL-UNNAMED", vmArgs, "JMapHProfLargeHeapProc", String.valueOf(heapSize)); procBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); Process largeHeapProc = procBuilder.start(); diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java index c23561b6d52..478b74c2741 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java @@ -183,7 +183,7 @@ private void startCtwforAllClasses() { while (!done) { String[] cmd = cmd(classStart, classStop); try { - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); String commandLine = pb.command() .stream() .collect(Collectors.joining(" ")); diff --git a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java index e350d5cf121..1f824c5109f 100644 --- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java +++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -47,7 +47,7 @@ public static void main(String[] args) { } OutputAnalyzer oa; try { - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); oa = new OutputAnalyzer(pb.start()); } catch (Exception e) { throw new Error("Unexpected exception on test jvm start :" + e, e); diff --git a/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java b/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java index ec22510bf8d..2aa2e2a207b 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java +++ b/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -103,7 +103,7 @@ protected void compile(String[] args) throws Exception { } } } - ProcessBuilder pb = ProcessTools.createTestJvm(cmd); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmd); OutputAnalyzer output = new OutputAnalyzer(pb.start()); dump(output, "compile"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java index 10a49f9a3c7..e5476afc1f6 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDScenarios.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -73,7 +73,7 @@ public static void main(String[] args) throws Exception { } else { // Test invalid -DScenario flag. OutputAnalyzer oa; - ProcessBuilder process = ProcessTools.createJavaProcessBuilder( + ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dtest.jdk=" + Utils.TEST_JDK, "-DScenarios=a,1,b,10", "ir_framework.tests.TestDScenarios", " test3"); oa = ProcessTools.executeProcess(process); diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java index b74012fd54a..22d52f692a3 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDTestAndExclude.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -97,7 +97,7 @@ public static void main(String[] args) throws Exception { protected static void run(String dTest, String dExclude, String arg) throws Exception { System.out.println("Run -DTest=" + dTest + " -DExclude=" + dExclude + " arg=" + arg); OutputAnalyzer oa; - ProcessBuilder process = ProcessTools.createJavaProcessBuilder( + ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dtest.class.path=" + Utils.TEST_CLASS_PATH, "-Dtest.jdk=" + Utils.TEST_JDK, "-Dtest.vm.opts=-DTest=" + dTest + " -DExclude=" + dExclude, "ir_framework.tests.TestDTestAndExclude", arg); diff --git a/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java b/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java index 8eea44148ed..67e629fddcd 100644 --- a/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java +++ b/test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -93,7 +93,7 @@ private void positive(String name, String... opts) throws IOException { var cmd = new ArrayList(); Collections.addAll(cmd, opts); cmd.add(MemStat.class.getName()); - var pb = ProcessTools.createTestJvm(cmd); + var pb = ProcessTools.createTestJavaProcessBuilder(cmd); var output = new OutputAnalyzer(pb.start()); if (output.getExitValue() != 0) { output.reportDiagnosticSummary(); @@ -106,7 +106,7 @@ private void negative(String name, String... opts) throws IOException { var cmd = new ArrayList(); Collections.addAll(cmd, opts); cmd.add(MemStat.class.getName()); - var pb = ProcessTools.createTestJvm(cmd); + var pb = ProcessTools.createTestJavaProcessBuilder(cmd); var output = new OutputAnalyzer(pb.start()); if (output.getExitValue() == 0) { output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java b/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java index 5df4b8aea8f..728c6baed6e 100644 --- a/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java +++ b/test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -40,8 +40,8 @@ public class TestMaxMetaspaceSize { public static void main(String[] args) throws Exception { ProcessBuilder pb = - ProcessTools.createTestJvm("-XX:MaxMetaspaceSize=100m", - maxMetaspaceSize.class.getName()); + ProcessTools.createTestJavaProcessBuilder("-XX:MaxMetaspaceSize=100m", + maxMetaspaceSize.class.getName()); OutputAnalyzer out = new OutputAnalyzer(pb.start()); if (out.getExitValue() == 0) { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java index 25ceeeecfbc..f81acedbaec 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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 @@ -80,7 +80,7 @@ public class alloc001 { private static final int STATUS_NO_OOM = 3 + STATUS_BASE; public static void main(String[] args) throws Throwable { - String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJvm( + String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJavaProcessBuilder( "-XX:MaxHeapSize=" + (Platform.is32bit() ? "256m" : "512m"), "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, "-agentpath:" + Utils.TEST_NATIVE_PATH + File.separator + System.mapLibraryName("alloc001"), diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java index 57afb3a0e46..be48854648f 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -68,7 +68,7 @@ public class TestDriver { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-agentlib:retransform003-01=id=1 can_retransform_classes=1", "-agentlib:retransform003-02=id=2 can_retransform_classes=0", "-agentlib:retransform003-03=id=3 can_retransform_classes=1", diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java index b1057f9893e..898e7671332 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -57,7 +57,7 @@ public class TestDriver { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-agentlib:SetNativeMethodPrefix001=trace=all", "-agentlib:SetNativeMethodPrefix002-01=trace=all prefix=wa_", "-agentlib:SetNativeMethodPrefix002-02=trace=all prefix=wb_", diff --git a/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java b/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java index 118d6c8f821..f63eb21a893 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java +++ b/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -69,7 +69,7 @@ public class Test { public static void main(String[] args) throws Exception { { System.out.println("SegmentedCodeCache is enabled"); - var pb = ProcessTools.createTestJvm( + var pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+SegmentedCodeCache", "-XX:+PrintCodeCache", "-version"); @@ -79,7 +79,7 @@ public static void main(String[] args) throws Exception { } { System.out.println("SegmentedCodeCache is disabled"); - var pb = ProcessTools.createTestJvm( + var pb = ProcessTools.createTestJavaProcessBuilder( "-XX:-SegmentedCodeCache", "-XX:+PrintCodeCache", "-version"); diff --git a/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java b/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java index 4580e7f0ec8..145072487ec 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java +++ b/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,7 +46,7 @@ public class Test { private static String REGEXP = "^(CodeCache|(CodeHeap.*)): size=\\d+Kb used=\\d+Kb max_used=\\d+Kb free=\\d+Kb"; public static void main(String[] args) throws Exception { - var pb = ProcessTools.createTestJvm( + var pb = ProcessTools.createTestJavaProcessBuilder( "-XX:-PrintCodeCache", "-XX:+PrintCodeCacheOnCompilation", "-XX:-Inline", diff --git a/test/jdk/com/sun/jdi/JITDebug.java b/test/jdk/com/sun/jdi/JITDebug.java index e7a5647fdd4..45ec0f2ea79 100644 --- a/test/jdk/com/sun/jdi/JITDebug.java +++ b/test/jdk/com/sun/jdi/JITDebug.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, 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 @@ -104,7 +104,7 @@ boolean parseArgs(String[] args) { } void testLaunch() { - ProcessBuilder pb = ProcessTools.createTestJvm(); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(); List largs = pb.command(); largs.add("-classpath"); largs.add(Utils.TEST_CLASSES); diff --git a/test/jdk/com/sun/jdi/NoLaunchOptionTest.java b/test/jdk/com/sun/jdi/NoLaunchOptionTest.java index 275b130bf96..fca9d59196f 100644 --- a/test/jdk/com/sun/jdi/NoLaunchOptionTest.java +++ b/test/jdk/com/sun/jdi/NoLaunchOptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, 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 @@ public static void main(String[] args) throws Exception { "onthrow=java.lang.ClassNotFoundException,suspend=n", "NotAClass" }); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmd); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmd); OutputAnalyzer output = ProcessTools.executeProcess(pb); System.out.println(output.getOutput()); diff --git a/test/jdk/com/sun/jdi/PrivateTransportTest.java b/test/jdk/com/sun/jdi/PrivateTransportTest.java index c12db8b90be..a023b8a752c 100644 --- a/test/jdk/com/sun/jdi/PrivateTransportTest.java +++ b/test/jdk/com/sun/jdi/PrivateTransportTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -82,7 +82,7 @@ private void test() throws Throwable { String libName = transportLib.getFileName().toString().replace("dt_socket", "private_dt_socket"); Files.copy(transportLib, Paths.get(Utils.TEST_CLASSES).resolve(libName)); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-agentlib:jdwp=transport=private_dt_socket,server=y,suspend=n", "-classpath", Utils.TEST_CLASSES, "HelloWorld"); diff --git a/test/jdk/com/sun/jdi/ProcessAttachTest.java b/test/jdk/com/sun/jdi/ProcessAttachTest.java index 04cc8320570..746b5d047fe 100644 --- a/test/jdk/com/sun/jdi/ProcessAttachTest.java +++ b/test/jdk/com/sun/jdi/ProcessAttachTest.java @@ -69,7 +69,7 @@ public static void main(String[] args) throws Exception { } private static void runTest(String jdwpArg) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( jdwpArg, "ProcessAttachTestTarg"); Process p = null; diff --git a/test/jdk/com/sun/jdi/RunToExit.java b/test/jdk/com/sun/jdi/RunToExit.java index d5fd5d2b6f7..a7c7058b7aa 100644 --- a/test/jdk/com/sun/jdi/RunToExit.java +++ b/test/jdk/com/sun/jdi/RunToExit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -79,7 +79,7 @@ private static Process launch(String class_name) throws Exception { }; args = VMConnection.insertDebuggeeVMOptions(args); - ProcessBuilder launcher = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder launcher = ProcessTools.createLimitedTestJavaProcessBuilder(args); System.out.println(launcher.command().stream().collect(Collectors.joining(" ", "Starting: ", ""))); diff --git a/test/jdk/com/sun/jdi/cds/CDSJDITest.java b/test/jdk/com/sun/jdi/cds/CDSJDITest.java index 22abd30163f..0ec201d7035 100644 --- a/test/jdk/com/sun/jdi/cds/CDSJDITest.java +++ b/test/jdk/com/sun/jdi/cds/CDSJDITest.java @@ -39,7 +39,7 @@ public static void runTest(String testname, String[] jarClasses) throws Exceptio File jarClasslistFile = makeClassList(jarClasses); String appJar = buildJar(testname, jarClasses); - // These are the arguments passed to createJavaProcessBuilder() to launch + // These are the arguments passed to createLimitedTestJavaProcessBuilder() to launch // the JDI test. String[] testArgs = { // JVM Args: @@ -67,7 +67,7 @@ public static void runTest(String testname, String[] jarClasses) throws Exceptio }; // Dump the archive - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xbootclasspath/a:" + appJar, "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-XX:ExtraSharedClassListFile=" + jarClasslistFile.getPath(), @@ -80,7 +80,7 @@ public static void runTest(String testname, String[] jarClasses) throws Exceptio outputDump.shouldHaveExitValue(0); // Run the test specified JDI test - pb = ProcessTools.createTestJvm(testArgs); + pb = ProcessTools.createTestJavaProcessBuilder(testArgs); OutputAnalyzer outputRun = executeAndLog(pb, "exec"); try { outputRun.shouldContain("sharing"); diff --git a/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java b/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java index 55956ca5811..35b116d2c51 100644 --- a/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java +++ b/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java @@ -122,7 +122,7 @@ public ProcessBuilder prepare() { + onthrowArgs); debuggeeArgs.addAll(options); debuggeeArgs.add(mainClass); - return ProcessTools.createTestJvm(debuggeeArgs); + return ProcessTools.createTestJavaProcessBuilder(debuggeeArgs); } public Debuggee launch(String name) { diff --git a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index 133ca19be74..d0557e630f0 100644 --- a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -60,7 +60,7 @@ public static void main(String... args) throws Exception { } ProcessBuilder pb = ProcessTools. - createJavaProcessBuilder( + createLimitedTestJavaProcessBuilder( "--add-exports", "jdk.attach/sun.tools.attach=ALL-UNNAMED", "-XX:+UseG1GC", // this will cause MaxNewSize to be FLAG_SET_ERGO "-XX:+UseCodeCacheFlushing", diff --git a/test/jdk/com/sun/tools/attach/RunnerUtil.java b/test/jdk/com/sun/tools/attach/RunnerUtil.java index 92f1a951d07..120736de21b 100644 --- a/test/jdk/com/sun/tools/attach/RunnerUtil.java +++ b/test/jdk/com/sun/tools/attach/RunnerUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -53,7 +53,7 @@ public static ProcessThread startApplication(String... additionalOpts) throws Th "-Dattach.test=true", "-classpath", classpath, "Application" }); String[] args = Utils.addTestJavaOpts(myArgs); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); ProcessThread pt = new ProcessThread("runApplication", (line) -> line.equals(Application.READY_MSG), pb); pt.start(); return pt; diff --git a/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java b/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java index fb545ca8480..a903b31c5c4 100644 --- a/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java +++ b/test/jdk/java/awt/MenuBar/TestNoScreenMenuBar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -148,7 +148,7 @@ private void closeOtherApplication() { private Process execute() { try { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( TestNoScreenMenuBar.class.getSimpleName(), "mark"); return ProcessTools.startProcess("Other frame", pb); } catch (IOException ex) { diff --git a/test/jdk/java/awt/Robot/NonEmptyErrorStream.java b/test/jdk/java/awt/Robot/NonEmptyErrorStream.java index 87137ac74ed..5bdada8aa5f 100644 --- a/test/jdk/java/awt/Robot/NonEmptyErrorStream.java +++ b/test/jdk/java/awt/Robot/NonEmptyErrorStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -42,7 +42,7 @@ public final class NonEmptyErrorStream { public static void main(String[] args) throws Exception { if (args.length == 0) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( NonEmptyErrorStream.class.getSimpleName(),"run"); Process p = pb.start(); OutputAnalyzer output = new OutputAnalyzer(p); diff --git a/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java b/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java index e089ef26ca9..244f8bb6bd7 100644 --- a/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java +++ b/test/jdk/java/awt/Toolkit/ScreenInsetsDPIVariation/ScreenInsetsDPIVariation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -102,7 +102,7 @@ public static int clipRound(double coordinate) { private static void runProcess(String dpi, int screen, Insets insets) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.java2d.uiScale=" + dpi, ScreenInsetsDPIVariation.class.getSimpleName(), String.valueOf(screen), String.valueOf(insets.left), diff --git a/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java b/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java index 1b052f953a9..51ce7721ef7 100644 --- a/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java +++ b/test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -149,7 +149,7 @@ private void performTest(Object windowIdentification, boolean selectColorPanel) private Process execute() { try { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( TestMainKeyWindow.class.getSimpleName(), "mark"); return ProcessTools.startProcess("Other frame", pb); } catch (IOException ex) { diff --git a/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java b/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java index f00564ff934..534f25c4cbb 100644 --- a/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java +++ b/test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -110,7 +110,7 @@ private static void checkAllDPI(String comp, int w, int h) private static void runProcess(String dpi, String comp, int w, int h) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.java2d.uiScale=" + dpi, MinimumSizeDPIVariation.class.getSimpleName(), comp, String.valueOf(w), String.valueOf(h), dpi); diff --git a/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java b/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java index 9694554ed4f..9a82c3c85c9 100644 --- a/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java +++ b/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java @@ -1,6 +1,6 @@ /* * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -49,7 +49,7 @@ public final class MTTransformReplacedProfile { public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equals("checkJNI")) { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xcheck:jni", MTTransformReplacedProfile.class.getName()); OutputAnalyzer oa = ProcessTools.executeProcess(pb); oa.stderrShouldBeEmpty(); diff --git a/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java b/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java index a71918c2297..73c2770fba5 100644 --- a/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java +++ b/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, JetBrains s.r.o.. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -43,7 +43,7 @@ public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equals("runtest")) { runTest(); } else { - ProcessBuilder pb = ProcessTools.createTestJvm("-Xcheck:jni", FreeTypeScalerJNICheck.class.getName(), "runtest"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-Xcheck:jni", FreeTypeScalerJNICheck.class.getName(), "runtest"); OutputAnalyzer oa = ProcessTools.executeProcess(pb); oa.shouldContain("Done").shouldNotContain("WARNING").shouldHaveExitValue(0); } diff --git a/test/jdk/java/foreign/UpcallTestHelper.java b/test/jdk/java/foreign/UpcallTestHelper.java index bbfa44aa346..3f1d9302b9c 100644 --- a/test/jdk/java/foreign/UpcallTestHelper.java +++ b/test/jdk/java/foreign/UpcallTestHelper.java @@ -64,7 +64,7 @@ public Output runInNewProcess(Class target, boolean useSpec, String... progra )); command.addAll(Arrays.asList(programArgs)); - Process process = ProcessTools.createTestJvm(command).start(); + Process process = ProcessTools.createTestJavaProcessBuilder(command).start(); int result = process.waitFor(); assertNotEquals(result, 0); diff --git a/test/jdk/java/io/Console/RedirectTest.java b/test/jdk/java/io/Console/RedirectTest.java index d7aa6c64468..644ece9c3a2 100644 --- a/test/jdk/java/io/Console/RedirectTest.java +++ b/test/jdk/java/io/Console/RedirectTest.java @@ -40,7 +40,7 @@ public class RedirectTest { public static void main(String... args) throws Throwable { if (args.length == 0) { // no arg will launch the child process that actually perform tests - var pb = ProcessTools.createTestJvm( + var pb = ProcessTools.createTestJavaProcessBuilder( "-D" + SYSPROP + "=" + System.getProperty(SYSPROP, ""), "RedirectTest", "dummy"); var input = new File(System.getProperty("test.src", "."), "input.txt"); diff --git a/test/jdk/java/io/File/MacPath.java b/test/jdk/java/io/File/MacPath.java index a9d91018783..751113b7fd8 100644 --- a/test/jdk/java/io/File/MacPath.java +++ b/test/jdk/java/io/File/MacPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -38,7 +38,7 @@ public class MacPath { public static void main(String args[]) throws Exception { final ProcessBuilder pb = - ProcessTools.createTestJvm(MacPathTest.class.getName()); + ProcessTools.createTestJavaProcessBuilder(MacPathTest.class.getName()); final Map env = pb.environment(); env.put("LC_ALL", "en_US.UTF-8"); Process p = ProcessTools.startProcess("Mac Path Test", pb); diff --git a/test/jdk/java/io/Serializable/class/NonSerializableTest.java b/test/jdk/java/io/Serializable/class/NonSerializableTest.java index b2ac4e933cb..fa81b3e3ce7 100644 --- a/test/jdk/java/io/Serializable/class/NonSerializableTest.java +++ b/test/jdk/java/io/Serializable/class/NonSerializableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -102,7 +102,7 @@ public void test(String[] args) throws Exception { Paths.get(System.getProperty("user.dir"))); assertTrue(b, "Compilation failed"); String params[] = Arrays.copyOfRange(args, 1, args.length); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(params); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(params); Process p = ProcessTools.startProcess("Serializable Test", pb); int exitValue = p.waitFor(); assertEquals(exitValue, 0, "Test failed"); diff --git a/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java b/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java index faccc09bb4b..bf51dc66c54 100644 --- a/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java +++ b/test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -81,7 +81,7 @@ private static void setup() throws Exception { } private static void runTestSerialDriver() throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-classpath", SHARE.toString() + File.pathSeparator @@ -93,7 +93,7 @@ private static void runTestSerialDriver() throws Exception { } private static void runInstallSerialDriver() throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-classpath", SHARE.toString() + File.pathSeparator diff --git a/test/jdk/java/lang/ClassLoader/GetSystemPackage.java b/test/jdk/java/lang/ClassLoader/GetSystemPackage.java index 25967bca620..2af81f3c416 100644 --- a/test/jdk/java/lang/ClassLoader/GetSystemPackage.java +++ b/test/jdk/java/lang/ClassLoader/GetSystemPackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -118,7 +118,7 @@ private static void buildJar(String name, Manifest man) throws Exception { private static void runSubProcess(String messageOnError, String ... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); int res = pb.directory(tmpFolder).inheritIO().start().waitFor(); if (res != 0) { throw new RuntimeException(messageOnError); diff --git a/test/jdk/java/lang/Object/InvalidFinalizationOption.java b/test/jdk/java/lang/Object/InvalidFinalizationOption.java index c5cca549ead..f87ecfe9045 100644 --- a/test/jdk/java/lang/Object/InvalidFinalizationOption.java +++ b/test/jdk/java/lang/Object/InvalidFinalizationOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -43,7 +43,7 @@ record TestData(String arg, String expected) { } }; for (var data : testData) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(data.arg); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(data.arg); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(data.expected); output.shouldHaveExitValue(1); diff --git a/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java b/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java index 340507cb37b..f1c1940f538 100644 --- a/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java +++ b/test/jdk/java/lang/ProcessBuilder/InheritIOTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -54,7 +54,7 @@ public Object[][] testCases() { @Test(dataProvider = "testCases") public void testInheritWithoutRedirect(List arguments) throws Throwable { - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(arguments); + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(arguments); OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder); outputAnalyzer.shouldHaveExitValue(0); assertEquals(outputAnalyzer.getStdout(), EXPECTED_RESULT_STDOUT); diff --git a/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java b/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java index d82a317148e..00543b09947 100644 --- a/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java +++ b/test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java @@ -78,9 +78,9 @@ private static void parentCode(String arg) throws IOException, InterruptedExcept private static void normalExec() throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "normalExec"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "normalExec"); pb.inheritIO(); Process p = pb.start(); if (!p.waitFor(TIMEOUT, TimeUnit.SECONDS)) { @@ -93,9 +93,9 @@ private static void normalExec() throws Exception { private static void simulateCrashInChild(int stage) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "simulateCrashInChild" + stage); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "simulateCrashInChild" + stage); pb.environment().put(ENV_KEY, Integer.toString(stage)); Process p = pb.start(); @@ -126,9 +126,9 @@ private static void simulateCrashInChild(int stage) throws Exception { private static void simulateCrashInParent(int stage) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "simulateCrashInParent" + stage); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "simulateCrashInParent" + stage); pb.environment().put(ENV_KEY, Integer.toString(stage)); Process p = pb.start(); @@ -172,9 +172,9 @@ private static void simulateCrashInParent(int stage) throws Exception { private static void simulateTruncatedWriteInParent(int stage) throws Exception { ProcessBuilder pb; - pb = ProcessTools.createJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", - "JspawnhelperProtocol", - "simulateTruncatedWriteInParent" + stage); + pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Djdk.lang.Process.launchMechanism=posix_spawn", + "JspawnhelperProtocol", + "simulateTruncatedWriteInParent" + stage); pb.environment().put(ENV_KEY, Integer.toString(stage)); Process p = pb.start(); diff --git a/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java b/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java index efe4f842c7f..3768b34ea53 100644 --- a/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java +++ b/test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -82,7 +82,7 @@ void testCaseNativeEncoding() throws IOException { Charset cs = Charset.forName(nativeEncoding); System.out.println("Native.encoding Charset: " + cs); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); Process p = pb.start(); writeTestChars(p.outputWriter()); checkReader(p.inputReader(), cs, "Out"); @@ -121,7 +121,7 @@ void testRedirects() throws IOException { // 2: redirectErrorStream(true); no redirect of errorOutput // 3: redirectErrorStream(true); redirect of errorOutput to a file - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("ReaderWriterTest$ChildWithCharset"); pb.redirectInput(inPath.toFile()); pb.redirectOutput(outPath.toFile()); if (errType == 1 || errType == 3) { @@ -191,7 +191,7 @@ void testCase(String encoding) throws IOException { } String cleanCSName = cleanCharsetName(cs); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dsun.stdout.encoding=" + cleanCSName, // Encode in the child using the charset "-Dsun.stderr.encoding=" + cleanCSName, "ReaderWriterTest$ChildWithCharset"); @@ -217,7 +217,7 @@ void testCase(String encoding) throws IOException { @Test void testNullCharsets() throws IOException { // Launch a child; its behavior is not interesting and is ignored - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "ReaderWriterTest$ChildWithCharset"); Process p = pb.start(); @@ -263,7 +263,7 @@ void testIllegalArgCharsets() throws IOException { : StandardCharsets.UTF_8; // Launch a child; its behavior is not interesting and is ignored - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "ReaderWriterTest$ChildWithCharset"); Process p = pb.start(); diff --git a/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java b/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java index e141fc35212..85040e9548e 100644 --- a/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java +++ b/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,14 +31,14 @@ */ import jdk.test.lib.process.OutputAnalyzer; -import static jdk.test.lib.process.ProcessTools.createTestJvm; +import static jdk.test.lib.process.ProcessTools.createTestJavaProcessBuilder; import static jdk.test.lib.process.ProcessTools.executeProcess; public class ShutdownInterruptedMain { public static void main(String[] args) throws Exception { if (args.length > 0) { - ProcessBuilder pb = createTestJvm("ShutdownInterruptedMain"); + ProcessBuilder pb = createTestJavaProcessBuilder("ShutdownInterruptedMain"); OutputAnalyzer output = executeProcess(pb); output.shouldContain("Shutdown Hook"); output.shouldHaveExitValue(0); diff --git a/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java b/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java index bb346f04b2a..92b9e44f892 100644 --- a/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java +++ b/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -64,7 +64,7 @@ public Object[][] testCases() { @Test(dataProvider = "testCases") public void testProvider(List args) throws Throwable { - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(args); OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder); outputAnalyzer.shouldHaveExitValue(0); } diff --git a/test/jdk/java/lang/StackWalker/CallerFromMain.java b/test/jdk/java/lang/StackWalker/CallerFromMain.java index 3cb599c6859..86e7cfb7043 100644 --- a/test/jdk/java/lang/StackWalker/CallerFromMain.java +++ b/test/jdk/java/lang/StackWalker/CallerFromMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -37,7 +37,7 @@ public class CallerFromMain { private static final StackWalker sw = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); public static void main(String[] args) throws Exception { if (args.length > 0) { - ProcessBuilder pb = ProcessTools.createTestJvm("CallerFromMain"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("CallerFromMain"); OutputAnalyzer output = ProcessTools.executeProcess(pb); System.out.println(output.getOutput()); output.shouldHaveExitValue(0); diff --git a/test/jdk/java/lang/System/FileEncodingTest.java b/test/jdk/java/lang/System/FileEncodingTest.java index 6bff90ccb8b..1e41194a29b 100644 --- a/test/jdk/java/lang/System/FileEncodingTest.java +++ b/test/jdk/java/lang/System/FileEncodingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -73,7 +73,7 @@ public void testFileEncodingToDefault(String fileEncoding, String expected) thro var cmds = fileEncoding.isEmpty() ? List.of(FileEncodingTest.class.getName(), expected) : List.of("-Dfile.encoding=" + fileEncoding, FileEncodingTest.class.getName(), expected); - var pb = ProcessTools.createTestJvm(cmds); + var pb = ProcessTools.createTestJavaProcessBuilder(cmds); var env = pb.environment(); env.put("LANG", "C"); env.put("LC_ALL", "C"); diff --git a/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java b/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java index a962bbb7002..a58686871d5 100644 --- a/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java +++ b/test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception { var cmds = (args.length == 4) ? List.of("-Dfile.encoding=" + args[3], ExpectedEncoding.class.getName(), args[0], args[1]) : List.of(ExpectedEncoding.class.getName(), args[0], args[1]); - ProcessBuilder pb = ProcessTools.createTestJvm(cmds); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmds); Map env = pb.environment(); env.put("LANG", locale); env.put("LC_ALL", locale); diff --git a/test/jdk/java/lang/System/i18nEnvArg.java b/test/jdk/java/lang/System/i18nEnvArg.java index 776ea19f653..ba9d31cb373 100644 --- a/test/jdk/java/lang/System/i18nEnvArg.java +++ b/test/jdk/java/lang/System/i18nEnvArg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -80,7 +80,7 @@ public static void main(String[] args) throws Exception { "i18nEnvArg$Verify", EUC_JP_TEXT)); } - pb = ProcessTools.createTestJvm(cmds); + pb = ProcessTools.createTestJavaProcessBuilder(cmds); Map environ = pb.environment(); environ.clear(); environ.put("LANG", "ja_JP.eucjp"); diff --git a/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java b/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java index e53c370e7f7..42d85593088 100644 --- a/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java +++ b/test/jdk/java/lang/Thread/UncaughtExceptionsTest.java @@ -85,7 +85,7 @@ private static Stream testCases() { @MethodSource("testCases") void test(String className, int exitValue, String stdOutMatch, String stdErrMatch) throws Throwable { String cmd = "UncaughtExitSimulator$" + className; - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(cmd); + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(cmd); OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder); outputAnalyzer.shouldHaveExitValue(exitValue); outputAnalyzer.stderrShouldMatch(stdErrMatch); diff --git a/test/jdk/java/lang/Thread/virtual/ShutdownHook.java b/test/jdk/java/lang/Thread/virtual/ShutdownHook.java index 84c59dcc82f..a30d3d295dd 100644 --- a/test/jdk/java/lang/Thread/virtual/ShutdownHook.java +++ b/test/jdk/java/lang/Thread/virtual/ShutdownHook.java @@ -29,14 +29,14 @@ */ import jdk.test.lib.process.OutputAnalyzer; -import static jdk.test.lib.process.ProcessTools.createTestJvm; +import static jdk.test.lib.process.ProcessTools.createTestJavaProcessBuilder; import static jdk.test.lib.process.ProcessTools.executeProcess; public class ShutdownHook { public static void main(String[] args) throws Exception { if (args.length > 0) { - ProcessBuilder pb = createTestJvm("ShutdownHook"); + ProcessBuilder pb = createTestJavaProcessBuilder("ShutdownHook"); OutputAnalyzer output = executeProcess(pb); output.shouldContain("Shutdown Hook"); output.shouldHaveExitValue(0); diff --git a/test/jdk/java/lang/annotation/LoaderLeakTest.java b/test/jdk/java/lang/annotation/LoaderLeakTest.java index e5e0a8d61c4..ed230d8df0e 100644 --- a/test/jdk/java/lang/annotation/LoaderLeakTest.java +++ b/test/jdk/java/lang/annotation/LoaderLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, 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 @@ -55,7 +55,7 @@ public void testWithReadingAnnotations() throws Throwable { } private void runJavaProcessExpectSuccessExitCode(String ... command) throws Throwable { - var processBuilder = ProcessTools.createJavaProcessBuilder(command) + var processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(command) .directory(Paths.get(Utils.TEST_CLASSES).toFile()); ProcessTools.executeCommand(processBuilder).shouldHaveExitValue(0); } diff --git a/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java b/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java index 728fc5d17ab..697ca7366a0 100644 --- a/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java +++ b/test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java @@ -1,6 +1,6 @@ /* * Copyright 2014 Goldman Sachs. - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -29,7 +29,7 @@ public class TestDaemonThreadLauncher { public static void main(String args[]) throws Exception { for(int i=0; i<50; i++) { - ProcessBuilder pb = ProcessTools.createTestJvm("-javaagent:DummyAgent.jar", "TestDaemonThread", "."); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-javaagent:DummyAgent.jar", "TestDaemonThread", "."); OutputAnalyzer analyzer = ProcessTools.executeProcess(pb); analyzer.shouldNotContain("ASSERTION FAILED"); analyzer.shouldHaveExitValue(0); diff --git a/test/jdk/java/lang/instrument/NegativeAgentRunner.java b/test/jdk/java/lang/instrument/NegativeAgentRunner.java index 1b7ff2f7335..9689c323114 100644 --- a/test/jdk/java/lang/instrument/NegativeAgentRunner.java +++ b/test/jdk/java/lang/instrument/NegativeAgentRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -35,7 +35,7 @@ public static void main(String argv[]) throws Exception { } String agentClassName = argv[0]; String excepClassName = argv[1]; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-javaagent:" + agentClassName + ".jar", "-Xmx128m", "-XX:-CreateCoredumpOnCrash", agentClassName); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java b/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java index b59b69d3c75..ecd284fe6e0 100644 --- a/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java +++ b/test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,7 +44,7 @@ public static void main(String[] a) throws Exception { System.getProperty("test.src"), System.getProperty("test.classes", ".")); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( Utils.addTestJavaOpts(testArgs.split("\\s+"))); System.out.println("testjvm.cmd:" + Utils.getCommandLine(pb)); diff --git a/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java b/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java index 9eb3cff391b..1b0e1f50dd2 100644 --- a/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java +++ b/test/jdk/java/lang/instrument/modules/AppendToClassPathModuleTest.java @@ -46,7 +46,7 @@ public class AppendToClassPathModuleTest { public static void main(String... args) throws Throwable { String modulepath = System.getProperty("test.module.path"); - // can't use ProcessTools.createJavaProcessBuilder as it always adds -cp + // can't use ProcessTools.createLimitedTestJavaProcessBuilder as it always adds -cp ProcessBuilder pb = new ProcessBuilder( JDKToolFinder.getTestJDKTool("java"), "-javaagent:Agent.jar", diff --git a/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java b/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java index b5dd8befa48..914e90650da 100644 --- a/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java +++ b/test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -44,7 +44,7 @@ */ public class CondyNestedResolutionTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("CondyNestedResolution"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("CondyNestedResolution"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("StackOverflowError"); oa.shouldContain("bsm1arg"); diff --git a/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java b/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java index ef2c389ef39..86c3c828f70 100644 --- a/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java +++ b/test/jdk/java/nio/channels/Selector/LotsOfUpdatesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,7 +46,7 @@ public class LotsOfUpdatesTest { private static final String ULIMIT_SET_CMD = "ulimit -n 2048"; private static final String JAVA_CMD = ProcessTools.getCommandLine( - ProcessTools.createJavaProcessBuilder(LotsOfUpdates.class.getName())); + ProcessTools.createLimitedTestJavaProcessBuilder(LotsOfUpdates.class.getName())); public static void main(String[] args) throws Throwable { ProcessTools.executeCommand("sh", "-c", ULIMIT_SET_CMD + " && " + JAVA_CMD) diff --git a/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java b/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java index 9ea2902fb0d..be33ecb70f2 100644 --- a/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java +++ b/test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -54,7 +54,7 @@ public class DefaultCharsetTest { private static final ProcessBuilder pb - = ProcessTools.createTestJvm(Default.class.getName()); + = ProcessTools.createTestJavaProcessBuilder(Default.class.getName()); private static final Map env = pb.environment(); private static String UNSUPPORTED = null; diff --git a/test/jdk/java/nio/file/Path/MacPathTest.java b/test/jdk/java/nio/file/Path/MacPathTest.java index d3b37aa978d..7563e30338c 100644 --- a/test/jdk/java/nio/file/Path/MacPathTest.java +++ b/test/jdk/java/nio/file/Path/MacPathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -49,9 +49,9 @@ public static void main(String args[]) throws Exception { ProcessBuilder pb; if (NORMALIZE_FILE_PATHS) { String option = "-D" + PROPERTY_NORMALIZE_FILE_PATHS + "=true"; - pb = ProcessTools.createTestJvm(option, MacPath.class.getName()); + pb = ProcessTools.createTestJavaProcessBuilder(option, MacPath.class.getName()); } else { - pb = ProcessTools.createTestJvm(MacPath.class.getName()); + pb = ProcessTools.createTestJavaProcessBuilder(MacPath.class.getName()); } pb.environment().put("LC_ALL", "en_US.UTF-8"); ProcessTools.executeProcess(pb) diff --git a/test/jdk/java/security/SignedJar/SignedJarWithCustomClassLoader.java b/test/jdk/java/security/SignedJar/SignedJarWithCustomClassLoader.java index 1f335c87f14..540990bc82a 100644 --- a/test/jdk/java/security/SignedJar/SignedJarWithCustomClassLoader.java +++ b/test/jdk/java/security/SignedJar/SignedJarWithCustomClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -72,7 +72,7 @@ public static void main(String[] args) {} .shouldHaveExitValue(0); // run app with system class loader set to custom classloader - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", "signed.jar", "-Djava.system.class.loader=CustomClassLoader", "Main"); ProcessTools.executeProcess(pb) @@ -85,7 +85,7 @@ public static void main(String[] args) {} .shouldHaveExitValue(0); // run app again, should still succeed even though SHA-1 is disabled - pb = ProcessTools.createJavaProcessBuilder( + pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-cp", "signed.jar", "-Djava.system.class.loader=CustomClassLoader", "Main"); ProcessTools.executeProcess(pb) diff --git a/test/jdk/java/util/Formatter/BasicTestLauncher.java b/test/jdk/java/util/Formatter/BasicTestLauncher.java index 0b37acfd944..4dfc0e36743 100644 --- a/test/jdk/java/util/Formatter/BasicTestLauncher.java +++ b/test/jdk/java/util/Formatter/BasicTestLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -82,7 +82,7 @@ void testTimeZone(String timeZone) throws IOException{ */ private static OutputAnalyzer RunTest(String timeZone) throws IOException{ // Build and run Basic class with correct configuration - ProcessBuilder pb = ProcessTools.createTestJvm(JAVA_OPTS, TEST_CLASS); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(JAVA_OPTS, TEST_CLASS); pb.environment().put("TZ", timeZone); Process process = pb.start(); return new OutputAnalyzer(process); diff --git a/test/jdk/java/util/Properties/StoreReproducibilityTest.java b/test/jdk/java/util/Properties/StoreReproducibilityTest.java index c19657923be..b77f3262a4a 100644 --- a/test/jdk/java/util/Properties/StoreReproducibilityTest.java +++ b/test/jdk/java/util/Properties/StoreReproducibilityTest.java @@ -92,7 +92,7 @@ private static void testWithoutSecurityManager() throws Exception { for (int i = 0; i < 5; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); storedFiles.add(tmpFile); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=" + sysPropVal, StoreTest.class.getName(), tmpFile.toString(), @@ -134,7 +134,7 @@ private static void testWithSecMgrExplicitPermission() throws Exception { for (int i = 0; i < 5; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); storedFiles.add(tmpFile); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=" + sysPropVal, "-Djava.security.manager", "-Djava.security.policy=" + policyFile, @@ -178,7 +178,7 @@ private static void testWithSecMgrNoSpecificPermission() throws Exception { for (int i = 0; i < 5; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); storedFiles.add(tmpFile); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=" + sysPropVal, "-Djava.security.manager", "-Djava.security.policy=" + policyFile, @@ -208,7 +208,7 @@ private static void testBlankSysPropValue() throws Exception { for (int i = 0; i < 2; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); storedFiles.add(tmpFile); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=" + sysPropVal, StoreTest.class.getName(), tmpFile.toString(), @@ -240,7 +240,7 @@ private static void testBlankSysPropValue() throws Exception { private static void testEmptySysPropValue() throws Exception { for (int i = 0; i < 2; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=", "-Duser.timezone=UTC", StoreTest.class.getName(), @@ -272,7 +272,7 @@ private static void testNonDateSysPropValue() throws Exception { for (int i = 0; i < 2; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); storedFiles.add(tmpFile); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=" + sysPropVal, StoreTest.class.getName(), tmpFile.toString(), @@ -301,7 +301,7 @@ private static void testMultiLineSysPropValue() throws Exception { for (int i = 0; i < 2; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); storedFiles.add(tmpFile); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=" + sysPropVal, StoreTest.class.getName(), tmpFile.toString(), @@ -343,7 +343,7 @@ private static void testBackSlashInSysPropValue() throws Exception { for (int i = 0; i < 2; i++) { final Path tmpFile = Files.createTempFile("8231640", ".props"); storedFiles.add(tmpFile); - final ProcessBuilder processBuilder = ProcessTools.createTestJvm( + final ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder( "-D" + SYS_PROP_JAVA_PROPERTIES_DATE + "=" + sysPropVal, StoreTest.class.getName(), tmpFile.toString(), diff --git a/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java b/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java index 28afa8f49e1..ece90a9d7cd 100644 --- a/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java +++ b/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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,7 +46,7 @@ public class CustomTzIDCheckDST { private static String CUSTOM_TZ2 = "MEZ-1MESZ,M10.5.0,M3.5.0/3"; public static void main(String args[]) throws Throwable { if (args.length == 0) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(List.of("CustomTzIDCheckDST", "runTZTest")); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(List.of("CustomTzIDCheckDST", "runTZTest")); pb.environment().put("TZ", CUSTOM_TZ); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); diff --git a/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java b/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java index 603e2890a0e..8645e6ff86a 100644 --- a/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java +++ b/test/jdk/javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java @@ -280,7 +280,7 @@ private static void testDefaultAgent(String propertyFile, String additionalArgum } pbArgs.add(TEST_APP_NAME); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( pbArgs.toArray(new String[pbArgs.size()]) ); diff --git a/test/jdk/javax/management/security/HashedPasswordFileTest.java b/test/jdk/javax/management/security/HashedPasswordFileTest.java index e2d5bd7deb6..7a3f02bc7c8 100644 --- a/test/jdk/javax/management/security/HashedPasswordFileTest.java +++ b/test/jdk/javax/management/security/HashedPasswordFileTest.java @@ -439,7 +439,7 @@ public void testDefaultAgent() throws Exception { pbArgs.add("jdk.management.agent/jdk.internal.agent=ALL-UNNAMED"); pbArgs.add(TestApp.class.getSimpleName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( pbArgs.toArray(new String[0])); Process process = ProcessTools.startProcess( TestApp.class.getSimpleName(), @@ -481,7 +481,7 @@ public void testDefaultAgentNoHash() throws Exception { pbArgs.add("jdk.management.agent/jdk.internal.agent=ALL-UNNAMED"); pbArgs.add(TestApp.class.getSimpleName()); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( pbArgs.toArray(new String[0])); Process process = ProcessTools.startProcess( TestApp.class.getSimpleName(), diff --git a/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java b/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java index 10cb3d68856..de27f538f70 100644 --- a/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java +++ b/test/jdk/javax/net/ssl/TLSCommon/interop/ProcUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -42,7 +42,7 @@ public class ProcUtils { */ public static OutputAnalyzer java(Path javaPath, Class clazz, Map props) { - ProcessBuilder pb = createJavaProcessBuilder(javaPath, clazz, props); + ProcessBuilder pb = createLimitedTestJavaProcessBuilder(javaPath, clazz, props); try { return ProcessTools.executeCommand(pb); } catch (Throwable e) { @@ -50,7 +50,7 @@ public static OutputAnalyzer java(Path javaPath, Class clazz, } } - private static ProcessBuilder createJavaProcessBuilder(Path javaPath, + private static ProcessBuilder createLimitedTestJavaProcessBuilder(Path javaPath, Class clazz, Map props) { List cmds = new ArrayList<>(); cmds.add(javaPath.toString()); diff --git a/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java b/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java index c2d413cff25..c3bb610bb87 100644 --- a/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java +++ b/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -224,7 +224,7 @@ private static void test(Object[] listeners) { } private static Process runProcess(LookAndFeelInfo laf) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Dswing.defaultlaf=" + laf.getClassName(), "-mx9m", "-XX:+HeapDumpOnOutOfMemoryError", UnninstallUIMemoryLeaks.class.getSimpleName(), "mark"); diff --git a/test/jdk/javax/swing/text/html/CSS/bug8234913.java b/test/jdk/javax/swing/text/html/CSS/bug8234913.java index cf4c43d7531..bd74fbaeb93 100644 --- a/test/jdk/javax/swing/text/html/CSS/bug8234913.java +++ b/test/jdk/javax/swing/text/html/CSS/bug8234913.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -52,7 +52,7 @@ static ProcessBuilder exec(String... args) throws Exception { Collections.addAll(argsList, "-Xmn8m"); Collections.addAll(argsList, "-Dtest.class.path=" + System.getProperty("test.class.path", ".")); Collections.addAll(argsList, FontSizePercentTest.class.getName()); - return ProcessTools.createJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); + return ProcessTools.createLimitedTestJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); } static void checkFor(String... outputStrings) throws Exception { diff --git a/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java b/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java index 355201bfbf3..e6e613bbc90 100644 --- a/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java +++ b/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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,7 +60,7 @@ public static void main(String[] args) throws Exception { } public static void main(String... args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-Xmn8m", "-Xlog:library=info", "--add-modules=jdk.incubator.vector", VectorTest.class.getName()); diff --git a/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java b/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java index 90d3be1f7df..c48de900ec3 100644 --- a/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java +++ b/test/jdk/jdk/internal/misc/VM/RuntimeArguments.java @@ -117,7 +117,7 @@ public void test(List args, List expected) throws Exception { Stream options = Stream.concat(args.stream(), Stream.of("-classpath", TEST_CLASSES, "RuntimeArguments")); - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( // The runtime image may be created with jlink --add-options // The initial VM options will be included in the result // returned by VM.getRuntimeArguments() diff --git a/test/jdk/jdk/jfr/api/consumer/streaming/Application.java b/test/jdk/jdk/jfr/api/consumer/streaming/Application.java index 6cc7876a7cb..fea8347ceaf 100644 --- a/test/jdk/jdk/jfr/api/consumer/streaming/Application.java +++ b/test/jdk/jdk/jfr/api/consumer/streaming/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -102,7 +102,7 @@ public void start() throws IOException { args[2] = Application.class.getName(); args[3] = lockFile.toString(); args[4] = message; - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); touch(lockFile); process = pb.start(); // For debugging diff --git a/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java b/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java index 75885d50876..313b5f026e1 100644 --- a/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java +++ b/test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -127,7 +127,7 @@ static class EventProducer { static Process start() throws Exception { String[] args = {"-XX:StartFlightRecording", EventProducer.class.getName()}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); return ProcessTools.startProcess("Event-Producer", pb, line -> line.contains(MAIN_STARTED), 0, TimeUnit.SECONDS); diff --git a/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java b/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java index 8643ec35bc2..dbbdbe9c67d 100644 --- a/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java +++ b/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,7 +66,7 @@ public TestProcess(String name, boolean createCore) throws IOException { "-XX:" + (createCore ? "+" : "-") + "CreateCoredumpOnCrash", TestProcess.class.getName(), path.toString() }; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args); process = ProcessTools.startProcess(name, pb); } diff --git a/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java b/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java index 67962399569..d347378b606 100644 --- a/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java +++ b/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +46,7 @@ public static void main(String[] args) throws Exception { "-Xms32m", "-Xmx64m", Tester.class.getName()}; - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(jvm_args); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(jvm_args); OutputAnalyzer analyzer = ProcessTools.executeProcess(pb); analyzer.shouldHaveExitValue(0); } diff --git a/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java b/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java index aa8cdbbf662..d8fd9a6e673 100644 --- a/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java +++ b/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 class TestInitialEnvironmentVariable { private final static String EVENT_NAME = EventNames.InitialEnvironmentVariable; public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(Test.class.getName()); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(Test.class.getName()); setEnv(pb.environment()); (new OutputAnalyzer(pb.start())).shouldHaveExitValue(0); } diff --git a/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java b/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java index 4282c1afffb..83af0de239d 100644 --- a/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java +++ b/test/jdk/jdk/jfr/event/runtime/TestDumpReason.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, 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 @@ -89,7 +89,7 @@ private static void test(Class crasher, String reason) throws Exception { private static long runProcess(Class crasher) throws Exception { System.out.println("Test case for " + crasher.getName()); - Process p = ProcessTools.createTestJvm( + Process p = ProcessTools.createTestJavaProcessBuilder( "-Xmx64m", "-XX:-CreateCoredumpOnCrash", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", diff --git a/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java b/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java index 71b617ecd79..5eedbd24354 100644 --- a/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java +++ b/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java @@ -89,7 +89,7 @@ public static void main(String[] args) throws Throwable { } private static void runSubtest(int subTestIndex) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Xlog:jfr=debug", "-XX:-CreateCoredumpOnCrash", "-XX:-TieredCompilation", diff --git a/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java b/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java index f318961b57a..f9892fa94f0 100644 --- a/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java +++ b/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java @@ -131,7 +131,7 @@ private static long runProcess(Class crasher, String signal, boolean disk, St } options.add(crasher.getName()); options.add(signal); - Process p = ProcessTools.createTestJvm(options).start(); + Process p = ProcessTools.createTestJavaProcessBuilder(options).start(); OutputAnalyzer output = new OutputAnalyzer(p); System.out.println("========== Crasher process output:"); diff --git a/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java b/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java index a242eede559..f1fcf3e68c7 100644 --- a/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java +++ b/test/jdk/jdk/jfr/jvm/TestEventWriterLog.java @@ -35,7 +35,7 @@ public class TestEventWriterLog { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:jfr+system+bytecode=trace", "-XX:StartFlightRecording", "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:jfr+system+bytecode=trace", "-XX:StartFlightRecording", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("extends jdk/jfr/events/AbstractJDKEvent"); } diff --git a/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java b/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java index 9156ffb6b66..50514e02024 100644 --- a/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java +++ b/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -54,7 +54,7 @@ private static void test(String prepend, String expectedOutput, String... option Asserts.assertGreaterThan(options.length, 0); for (String option : options) { - pb = ProcessTools.createJavaProcessBuilder(prepend + option, "-version"); + pb = ProcessTools.createLimitedTestJavaProcessBuilder(prepend + option, "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain(expectedOutput); } diff --git a/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java b/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java index 454bbb631ad..eaf325a779d 100644 --- a/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java +++ b/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,7 +92,7 @@ private static Path findJFRFileInCurrentDirectory() { } private static void testDumponExit(Supplier p,String... args) throws Exception, IOException { - ProcessBuilder pb = ProcessTools.createTestJvm(args); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args); OutputAnalyzer output = ProcessTools.executeProcess(pb); System.out.println(output.getOutput()); output.shouldHaveExitValue(0); diff --git a/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java b/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java index 139ab8385d7..cf0cb021216 100644 --- a/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java +++ b/test/jdk/jdk/jfr/startupargs/TestJFCWarnings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -70,7 +70,7 @@ private static void testUnknownOption() throws Exception { } private static void launch(String commandLine, String expectedOutput) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(commandLine, "-version"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(commandLine, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(expectedOutput); } diff --git a/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java b/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java index baa56bbddc9..9c90d04691a 100644 --- a/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java +++ b/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -483,19 +483,19 @@ private static void launchTestVM(TestCase tc) throws Exception { final String flightRecorderOptions = tc.getTestString(); ProcessBuilder pb; if (flightRecorderOptions != null) { - pb = ProcessTools.createTestJvm("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", - "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", - flightRecorderOptions, - "-XX:StartFlightRecording", - SUT.class.getName(), - tc.getTestName()); + pb = ProcessTools.createTestJavaProcessBuilder("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", + "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", + flightRecorderOptions, + "-XX:StartFlightRecording", + SUT.class.getName(), + tc.getTestName()); } else { // default, no FlightRecorderOptions passed - pb = ProcessTools.createTestJvm("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", - "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", - "-XX:StartFlightRecording", - SUT.class.getName(), - tc.getTestName()); + pb = ProcessTools.createTestJavaProcessBuilder("--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED", + "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", + "-XX:StartFlightRecording", + SUT.class.getName(), + tc.getTestName()); } System.out.println("Driver launching SUT with string: " + flightRecorderOptions != null ? flightRecorderOptions : "default"); diff --git a/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java b/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java index e8cbff2dfd3..24be874a87f 100644 --- a/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java +++ b/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -55,14 +55,14 @@ private static void test(ProcessBuilder pb, String... expectedOutputs) throws Ex private static void launchUnary(String options) throws Exception { String recording1 = START_FLIGHT_RECORDING + (options != null ? options : ""); - ProcessBuilder pb = ProcessTools.createTestJvm(recording1, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(recording1, MainClass.class.getName()); test(pb, "Started recording 1"); } private static void launchBinary(String options1, String options2) throws Exception { String recording1 = START_FLIGHT_RECORDING + (options1 != null ? options1 : ""); String recording2 = START_FLIGHT_RECORDING + (options2 != null ? options2 : ""); - ProcessBuilder pb = ProcessTools.createTestJvm(recording1, recording2, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(recording1, recording2, MainClass.class.getName()); test(pb, "Started recording 1", "Started recording 2"); } @@ -70,7 +70,7 @@ private static void launchTernary(String options1, String options2, String optio String recording1 = START_FLIGHT_RECORDING + (options1 != null ? options1 : ""); String recording2 = START_FLIGHT_RECORDING + (options2 != null ? options2 : ""); String recording3 = START_FLIGHT_RECORDING + (options3 != null ? options3 : ""); - ProcessBuilder pb = ProcessTools.createTestJvm(recording1, recording2, recording3, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(recording1, recording2, recording3, MainClass.class.getName()); test(pb, "Started recording 1", "Started recording 2", "Started recording 3"); } @@ -94,7 +94,7 @@ private static void testWithFlightRecorderOptions() throws Exception { String flightRecorderOptions = FLIGHT_RECORDER_OPTIONS + "=maxchunksize=8m"; String recording1 = START_FLIGHT_RECORDING + "=filename=recording1.jfr"; String recording2 = START_FLIGHT_RECORDING + "=name=myrecording,filename=recording2.jfr"; - ProcessBuilder pb = ProcessTools.createTestJvm(flightRecorderOptions, recording1, recording2, MainClass.class.getName()); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(flightRecorderOptions, recording1, recording2, MainClass.class.getName()); test(pb, "Started recording 1", "Started recording 2"); } diff --git a/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java b/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java index 1942b3d3f63..3a4d3f20732 100644 --- a/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java +++ b/test/jdk/jdk/jfr/startupargs/TestOptionsWithLocale.java @@ -36,7 +36,7 @@ public static void main(String... args) throws IOException { return; } - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-Duser.country=DE", "-Duser.language=de", "-XX:FlightRecorderOptions:stackdepth=128", diff --git a/test/jdk/jdk/jfr/startupargs/TestPreserveRepository.java b/test/jdk/jdk/jfr/startupargs/TestPreserveRepository.java index 335681bfc0c..4f4ee195e1f 100644 --- a/test/jdk/jdk/jfr/startupargs/TestPreserveRepository.java +++ b/test/jdk/jdk/jfr/startupargs/TestPreserveRepository.java @@ -46,7 +46,7 @@ public static void main(String... args) throws Exception { "-XX:FlightRecorderOptions:repository=" + path + ",preserve-repository=true", "-version" }; - ProcessBuilder pb = ProcessTools.createTestJvm(arguments); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(arguments); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); Optional p = Files.find(path, 99, (a,b) -> a.getFileName().toString().endsWith(".jfr")).findAny(); diff --git a/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java b/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java index a427cfc1af4..8c8703dc9e6 100644 --- a/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java +++ b/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -104,7 +104,7 @@ private static void startApp(boolean recording, boolean retransform, Consumer cmd = ProcessTools.createJavaProcessBuilder().command(); + List cmd = ProcessTools.createLimitedTestJavaProcessBuilder().command(); Stream.of(jdk.internal.misc.VM.getRuntimeArguments()) .filter(arg -> arg.startsWith("--add-exports=") || arg.startsWith("--add-opens=")) diff --git a/test/jdk/sun/security/provider/KeyStore/DKSTest.java b/test/jdk/sun/security/provider/KeyStore/DKSTest.java index 76c66f492d1..1d1943ec729 100644 --- a/test/jdk/sun/security/provider/KeyStore/DKSTest.java +++ b/test/jdk/sun/security/provider/KeyStore/DKSTest.java @@ -80,7 +80,7 @@ public class DKSTest { public static void main(String[] args) throws Exception { if (args.length == 0) { // Environment variable and system properties referred in domains.cfg used by this Test. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(List.of( + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(List.of( "-Dtest.src=" + TEST_SRC , "-Duser.dir=" + USER_DIR, "DKSTest", "run")); pb.environment().putAll(System.getenv()); pb.environment().put("KEYSTORE_PWD", "test12"); diff --git a/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java b/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java index c0d3bbfda31..d6ec20c93d2 100644 --- a/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java +++ b/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java @@ -118,7 +118,7 @@ public static void main(String args[]) throws Exception { System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( Utils.addTestJavaOpts("SSLEngineKeyLimit", "p", args[1], args[2])); diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java index f7796e1a49d..4778cc217ba 100644 --- a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -188,7 +188,7 @@ public static void main(String[] args) throws Exception { System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( Utils.addTestJavaOpts("ResumptionUpdateBoundValues", "p")); OutputAnalyzer output = ProcessTools.executeProcess(pb); diff --git a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java index 8b19d39af7e..f0519a94249 100644 --- a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java +++ b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java @@ -134,7 +134,7 @@ public static void main(String args[]) throws Exception { System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( Utils.addTestJavaOpts("SSLSocketKeyLimit", "p", args[1], args[2])); diff --git a/test/jdk/sun/tools/jstat/JStatInterval.java b/test/jdk/sun/tools/jstat/JStatInterval.java index 1dfa1f9187b..0719e1d11b6 100644 --- a/test/jdk/sun/tools/jstat/JStatInterval.java +++ b/test/jdk/sun/tools/jstat/JStatInterval.java @@ -61,7 +61,7 @@ public static void main(String[] args) { } } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createTestJvm( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:+UsePerfData", Application.class.getName() ); diff --git a/test/jdk/tools/jimage/JImageToolTest.java b/test/jdk/tools/jimage/JImageToolTest.java index fce9a0ac347..feb6a56a968 100644 --- a/test/jdk/tools/jimage/JImageToolTest.java +++ b/test/jdk/tools/jimage/JImageToolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,7 +46,7 @@ private static void jimage(String... jimageArgs) throws Exception { args.add("jdk.tools.jimage.Main"); args.addAll(Arrays.asList(jimageArgs)); - ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[args.size()])); + ProcessBuilder builder = ProcessTools.createLimitedTestJavaProcessBuilder(args.toArray(new String[args.size()])); int res = builder.inheritIO().start().waitFor(); if (res != 0) { diff --git a/test/jdk/tools/launcher/modules/basic/BasicTest.java b/test/jdk/tools/launcher/modules/basic/BasicTest.java index 6a91cdc6d7c..ac831119988 100644 --- a/test/jdk/tools/launcher/modules/basic/BasicTest.java +++ b/test/jdk/tools/launcher/modules/basic/BasicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -270,7 +270,7 @@ public void testTryRunWithMainClassInWrongModule() throws Exception { * while setting the _JAVA_LAUNCHER_DEBUG environment variable. */ private ProcessBuilder createProcessWithLauncherDebugging(String... cmds) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(Utils.addTestJavaOpts(cmds)); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(Utils.addTestJavaOpts(cmds)); pb.environment().put("_JAVA_LAUNCHER_DEBUG", "true"); return pb; diff --git a/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java b/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java index 0526c881d8a..5854021c4a3 100644 --- a/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java +++ b/test/jdk/tools/launcher/modules/classpath/JavaClassPathTest.java @@ -200,7 +200,7 @@ public void testClassPathAttribute() throws Throwable { } private OutputAnalyzer execute(List options) throws Throwable { - // can't use ProcessTools.createJavaProcessBuilder as it always adds -cp + // can't use ProcessTools.createLimitedTestJavaProcessBuilder as it always adds -cp ProcessBuilder pb = new ProcessBuilder( Stream.concat(Stream.of(JDKToolFinder.getTestJDKTool("java")), options.stream() diff --git a/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java b/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java index 696f76f0f1e..54b5a3bc220 100644 --- a/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java +++ b/test/lib-test/jdk/test/lib/process/ProcessToolsLastLineTest.java @@ -37,7 +37,7 @@ public class ProcessToolsLastLineTest { static void test(String output) throws Exception { final StringBuffer sb = new StringBuffer(); Process p = ProcessTools.startProcess("process", - ProcessTools.createJavaProcessBuilder(ProcessToolsLastLineTest.class.getName(), output), + ProcessTools.createLimitedTestJavaProcessBuilder(ProcessToolsLastLineTest.class.getName(), output), line -> { sb.append(line);}); p.waitFor(); String expectedOutput = output.replace("\n", ""); diff --git a/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java index 629cf682384..7115912380a 100644 --- a/test/lib/jdk/test/lib/cds/CDSTestUtils.java +++ b/test/lib/jdk/test/lib/cds/CDSTestUtils.java @@ -266,7 +266,7 @@ public static OutputAnalyzer createArchive(CDSOptions opts) for (String s : opts.suffix) cmd.add(s); String[] cmdLine = cmd.toArray(new String[cmd.size()]); - ProcessBuilder pb = ProcessTools.createTestJvm(cmdLine); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmdLine); return executeAndLog(pb, "dump"); } @@ -444,7 +444,7 @@ public static OutputAnalyzer runWithArchive(CDSOptions opts) for (String s : opts.suffix) cmd.add(s); String[] cmdLine = cmd.toArray(new String[cmd.size()]); - ProcessBuilder pb = ProcessTools.createTestJvm(cmdLine); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(cmdLine); return executeAndLog(pb, "exec"); } diff --git a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java index b3b1b8a7e2c..31cff4b8c25 100644 --- a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java +++ b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -113,7 +113,7 @@ public static void verifyJVMStartup(String expectedMessages[], finalOptions.add("-version"); ProcessBuilder processBuilder - = ProcessTools.createJavaProcessBuilder(finalOptions.toArray( + = ProcessTools.createLimitedTestJavaProcessBuilder(finalOptions.toArray( new String[finalOptions.size()])); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start()); @@ -263,7 +263,7 @@ public static void verifyOptionValue(String optionName, Collections.addAll(vmOpts, additionalVMOpts); Collections.addAll(vmOpts, "-XX:+PrintFlagsFinal", "-version"); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( vmOpts.toArray(new String[vmOpts.size()])); OutputAnalyzer outputAnalyzer @@ -333,7 +333,7 @@ public static OutputAnalyzer startVMWithOptions(String[] optionNames, Collections.addAll(vmOpts, additionalVMOpts); Collections.addAll(vmOpts, "-version"); - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder( vmOpts.toArray(new String[vmOpts.size()])); return new OutputAnalyzer(processBuilder.start()); diff --git a/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java b/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java index 6768f4ed8f9..5268e05b688 100644 --- a/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java +++ b/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -74,7 +74,7 @@ public static OutputAnalyzer executeAndRecord(String settings, String jfrFilenam Collections.addAll(arguments, classArguments); } - ProcessBuilder pb = ProcessTools.createTestJvm(arguments); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(arguments); return ProcessTools.executeProcess(pb); } } diff --git a/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java index e49b17febf6..e7cf434d615 100644 --- a/test/lib/jdk/test/lib/process/ProcessTools.java +++ b/test/lib/jdk/test/lib/process/ProcessTools.java @@ -377,16 +377,6 @@ public static long getProcessId() throws Exception { return ProcessHandle.current().pid(); } - /** - * Create ProcessBuilder using the java launcher from the jdk to be tested. - * - * @param command Arguments to pass to the java command. - * @return The ProcessBuilder instance representing the java command. - */ - public static ProcessBuilder createJavaProcessBuilder(List command) { - return createJavaProcessBuilder(command.toArray(String[]::new)); - } - /* Convert arguments for tests running with virtual threads main wrapper When test is executed with process wrapper the line is changed from @@ -458,7 +448,7 @@ private static List addMainWrapperArgs(String mainWrapper, List * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createJavaProcessBuilder(String... command) { + private static ProcessBuilder createJavaProcessBuilder(String... command) { String javapath = JDKToolFinder.getJDKTool("java"); ArrayList args = new ArrayList<>(); @@ -513,8 +503,8 @@ private static void printStack(Thread t, StackTraceElement[] stack) { * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createTestJvm(List command) { - return createTestJvm(command.toArray(String[]::new)); + public static ProcessBuilder createTestJavaProcessBuilder(List command) { + return createTestJavaProcessBuilder(command.toArray(String[]::new)); } /** @@ -528,10 +518,54 @@ public static ProcessBuilder createTestJvm(List command) { * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createTestJvm(String... command) { + public static ProcessBuilder createTestJavaProcessBuilder(String... command) { return createJavaProcessBuilder(Utils.prependTestJavaOpts(command)); } + /** + * Create ProcessBuilder using the java launcher from the jdk to + * be tested. + * + *

    Please observe that you likely should use + * createTestJavaProcessBuilder() instead of this method because + * createTestJavaProcessBuilder() will add JVM options from + * "test.vm.opts" and "test.java.opts" and this method will + * not do that. + * + *

    If you still chose to use + * createLimitedTestJavaProcessBuilder() you should probably use + * it in combination with @requires vm.flagless JTREG + * anotation as to not waste energy and test resources. + * + * @param command Arguments to pass to the java command. + * @return The ProcessBuilder instance representing the java command. + */ + public static ProcessBuilder createLimitedTestJavaProcessBuilder(List command) { + return createLimitedTestJavaProcessBuilder(command.toArray(String[]::new)); + } + + /** + * Create ProcessBuilder using the java launcher from the jdk to + * be tested. + * + *

    Please observe that you likely should use + * createTestJavaProcessBuilder() instead of this method because + * createTestJavaProcessBuilder() will add JVM options from + * "test.vm.opts" and "test.java.opts" and this method will + * not do that. + * + *

    If you still chose to use + * createLimitedTestJavaProcessBuilder() you should probably use + * it in combination with @requires vm.flagless JTREG + * anotation as to not waste energy and test resources. + * + * @param command Arguments to pass to the java command. + * @return The ProcessBuilder instance representing the java command. + */ + public static ProcessBuilder createLimitedTestJavaProcessBuilder(String... command) { + return createJavaProcessBuilder(command); + } + /** * Executes a test jvm process, waits for it to finish and returns the process output. * The default jvm options from jtreg, test.vm.opts and test.java.opts, are added. @@ -563,7 +597,7 @@ public static OutputAnalyzer executeTestJvm(List cmds) throws Exception * @return The output from the process. */ public static OutputAnalyzer executeTestJvm(String... cmds) throws Exception { - ProcessBuilder pb = createTestJvm(cmds); + ProcessBuilder pb = createTestJavaProcessBuilder(cmds); return executeProcess(pb); } From 854c3191c31e4e33b66fb4c236e44014c8cce7a4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 07:15:16 +0000 Subject: [PATCH 107/261] 8319569: Several java/util tests should be updated to accept VM flags Backport-of: 2bb4b9398d65e3f37f34e45476c969ff0afb1540 --- .../SupplementalJapaneseEraTestRun.java | 36 +++++----- test/jdk/java/util/Currency/PropertiesTest.sh | 12 ++-- .../java/util/Locale/LocaleProvidersRun.java | 31 ++++----- .../Control/MissingResourceCauseTestRun.java | 18 +++-- .../modules/ModuleTestUtil.java | 66 +++++++++---------- .../modules/layer/LayerTest.java | 19 +++--- .../modules/unnamed/UnNamedTest.java | 53 +++++++-------- .../modules/visibility/VisibilityTest.java | 17 ++--- .../util/TimeZone/CustomTzIDCheckDST.java | 6 +- .../TimeZoneDatePermissionCheckRun.java | 22 +++---- .../java/util/logging/LoggingDeadlock2.java | 21 +++--- test/jdk/java/util/zip/EntryCount64k.java | 7 +- 12 files changed, 143 insertions(+), 165 deletions(-) diff --git a/test/jdk/java/util/Calendar/SupplementalJapaneseEraTestRun.java b/test/jdk/java/util/Calendar/SupplementalJapaneseEraTestRun.java index 34363bf711d..5383d0d1240 100644 --- a/test/jdk/java/util/Calendar/SupplementalJapaneseEraTestRun.java +++ b/test/jdk/java/util/Calendar/SupplementalJapaneseEraTestRun.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,10 +34,15 @@ import java.util.List; import java.util.Locale; import java.util.TimeZone; -import static java.util.Calendar.*; +import java.util.stream.Stream; + +import static java.util.Calendar.DAY_OF_YEAR; +import static java.util.Calendar.ERA; +import static java.util.Calendar.FEBRUARY; +import static java.util.Calendar.LONG; +import static java.util.Calendar.YEAR; import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.Utils; import org.testng.annotations.DataProvider; @@ -91,19 +96,18 @@ public void InvalidPropertyValuesTest(String prop) } private static void testRun(String property, List javaParam) - throws Throwable{ - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(Utils.TEST_CLASS_PATH) - .addToolArg("-Djdk.calendar.japanese.supplemental.era=" + property) - .addToolArg("SupplementalJapaneseEraTest"); - for (String para: javaParam) { - launcher.addToolArg(para); - } - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + throws Throwable { + List params = List.of( + "-ea", "-esa", + "-cp", Utils.TEST_CLASS_PATH, + "-Djdk.calendar.japanese.supplemental.era=" + property, + "SupplementalJapaneseEraTest"); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + Stream.concat(params.stream(), javaParam.stream()).toList()); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); + System.out.println(property + ":pass"); if (exitCode != 0) { System.out.println(property + ":fail"); diff --git a/test/jdk/java/util/Currency/PropertiesTest.sh b/test/jdk/java/util/Currency/PropertiesTest.sh index 6e8bbc23970..f7825640480 100644 --- a/test/jdk/java/util/Currency/PropertiesTest.sh +++ b/test/jdk/java/util/Currency/PropertiesTest.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2023, 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,7 +76,7 @@ failures=0 run() { echo '' - ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} $* 2>&1 + ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} $* 2>&1 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi } @@ -110,23 +110,23 @@ echo "Properties location: ${PROPLOCATION}" # run echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} PropertiesTest -d dump3 +${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest -d dump3 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi if [ ! -f dump3 ]; then echo "file dump3 not created. Test cannot execute. Failed."; exit 1; fi # run bug7102969 test echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} PropertiesTest bug7102969 +${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest bug7102969 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi # run bug8157138 test echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} PropertiesTest bug8157138 +${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest bug8157138 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi # run bug8190904 test echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} PropertiesTest bug8190904 +${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest bug8190904 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi # Cleanup diff --git a/test/jdk/java/util/Locale/LocaleProvidersRun.java b/test/jdk/java/util/Locale/LocaleProvidersRun.java index beeb1444e93..aae8ff03c11 100644 --- a/test/jdk/java/util/Locale/LocaleProvidersRun.java +++ b/test/jdk/java/util/Locale/LocaleProvidersRun.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, 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,6 @@ import java.util.Locale; -import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; @@ -178,22 +177,18 @@ public static void main(String[] args) throws Throwable { } private static void testRun(String prefList, String methodName, - String param1, String param2, String param3) throws Throwable{ - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(Utils.TEST_CLASS_PATH) - .addToolArg("-Djava.util.logging.config.class=LocaleProviders$LogConfig") - .addToolArg("-Djava.locale.providers=" + prefList) - .addToolArg("--add-exports=java.base/sun.util.locale.provider=ALL-UNNAMED") - .addToolArg("LocaleProviders") - .addToolArg(methodName) - .addToolArg(param1) - .addToolArg(param2) - .addToolArg(param3); - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + String param1, String param2, String param3) throws Throwable { + + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-ea", "-esa", + "-cp", Utils.TEST_CLASS_PATH, + "-Djava.util.logging.config.class=LocaleProviders$LogConfig", + "-Djava.locale.providers=" + prefList, + "--add-exports=java.base/sun.util.locale.provider=ALL-UNNAMED", + "LocaleProviders", methodName, param1, param2, param3); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); if (exitCode != 0) { throw new RuntimeException("Unexpected exit code: " + exitCode); } diff --git a/test/jdk/java/util/ResourceBundle/Control/MissingResourceCauseTestRun.java b/test/jdk/java/util/ResourceBundle/Control/MissingResourceCauseTestRun.java index 0ed86582846..30cd81757df 100644 --- a/test/jdk/java/util/ResourceBundle/Control/MissingResourceCauseTestRun.java +++ b/test/jdk/java/util/ResourceBundle/Control/MissingResourceCauseTestRun.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -84,15 +84,13 @@ private static void runCmd() throws Throwable { // UnreadableRB.properties is in current directory String cp = Utils.TEST_CLASSES + File.pathSeparator + Utils.TEST_SRC + File.pathSeparator + "."; - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(cp) - .addToolArg("MissingResourceCauseTest"); - - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-ea", "-esa", + "-cp", cp, + "MissingResourceCauseTest"); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); if (exitCode != 0) { throw new RuntimeException("Execution of the test failed. " + "Unexpected exit code: " + exitCode); diff --git a/test/jdk/java/util/ResourceBundle/modules/ModuleTestUtil.java b/test/jdk/java/util/ResourceBundle/modules/ModuleTestUtil.java index 1d8bdbb89db..24c6e181ccc 100644 --- a/test/jdk/java/util/ResourceBundle/modules/ModuleTestUtil.java +++ b/test/jdk/java/util/ResourceBundle/modules/ModuleTestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -29,6 +29,7 @@ import java.util.stream.Stream; import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Utils; import jdk.test.lib.compiler.CompilerUtils; import jdk.test.lib.process.ProcessTools; @@ -133,17 +134,15 @@ public static void copyResFiles(Path src, Path dest, String mn, */ public static void runModule(String mp, String mn, List localeList) throws Throwable { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-p") - .addToolArg(mp) - .addToolArg("-m") - .addToolArg(mn); - localeList.forEach(launcher::addToolArg); - - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + List args = List.of( + "-ea", "-esa", + "-p", mp, + "-m", mn); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + Stream.concat(args.stream(), localeList.stream()).toList()); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); if (exitCode != 0) { throw new RuntimeException("Execution of the test failed. " + "Unexpected exit code: " + exitCode); @@ -161,19 +160,17 @@ public static void runModule(String mp, String mn, List localeList) */ public static void runModuleWithCp(String cp, String mp, String mn, List localeList, boolean expected) throws Throwable { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(cp) - .addToolArg("-p") - .addToolArg(mp) - .addToolArg("-m") - .addToolArg(mn); - localeList.forEach(launcher::addToolArg); + List args = List.of( + "-ea", "-esa", + "-cp", cp, + "-p", mp, + "-m", mn); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + Stream.concat(args.stream(), localeList.stream()).toList()); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); if (expected) { if (exitCode != 0) { throw new RuntimeException("Execution of the test loads bundles " @@ -198,18 +195,17 @@ public static void runModuleWithCp(String cp, String mp, String mn, */ public static void runModuleWithLegacyCode(String mp, String mn, List localeList) throws Throwable { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-Djava.locale.useOldISOCodes=true") - .addToolArg("-p") - .addToolArg(mp) - .addToolArg("-m") - .addToolArg(mn); - localeList.forEach(launcher::addToolArg); + List args = List.of( + "-ea", "-esa", + "-Djava.locale.useOldISOCodes=true", + "-p", mp, + "-m", mn); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + Stream.concat(args.stream(), localeList.stream()).toList()); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); if (exitCode != 0) { throw new RuntimeException("Execution of the test failed. " + "Unexpected exit code: " + exitCode); diff --git a/test/jdk/java/util/ResourceBundle/modules/layer/LayerTest.java b/test/jdk/java/util/ResourceBundle/modules/layer/LayerTest.java index b1c79c0367f..85e8e531a31 100644 --- a/test/jdk/java/util/ResourceBundle/modules/layer/LayerTest.java +++ b/test/jdk/java/util/ResourceBundle/modules/layer/LayerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -71,16 +71,13 @@ private static void compileCmd() throws Throwable { } private static void runCmd() throws Throwable { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(Utils.TEST_CLASSES) - .addToolArg("Main") - .addToolArg(Utils.TEST_CLASSES); - - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-ea", "-esa", + "-cp", Utils.TEST_CLASSES, + "Main", Utils.TEST_CLASSES); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); if (exitCode != 0) { throw new RuntimeException("Execution of the test failed. " + "Unexpected exit code: " + exitCode); diff --git a/test/jdk/java/util/ResourceBundle/modules/unnamed/UnNamedTest.java b/test/jdk/java/util/ResourceBundle/modules/unnamed/UnNamedTest.java index 4540d5a378b..e9567fcdaad 100644 --- a/test/jdk/java/util/ResourceBundle/modules/unnamed/UnNamedTest.java +++ b/test/jdk/java/util/ResourceBundle/modules/unnamed/UnNamedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,6 +39,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import java.util.stream.Stream; import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.Utils; @@ -73,42 +74,34 @@ private static void compileCmd() throws Throwable { private static void runCmd() throws Throwable { // access resource bundles that are exported private unconditionally. - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(Utils.TEST_CLASSES) - .addToolArg("--module-path") - .addToolArg(MODS_DIR.toString()) - .addToolArg("--add-modules") - .addToolArg("bundles") - .addToolArg("Main"); - LOCALE_LIST.forEach(launcher::addToolArg); - - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + List args = List.of( + "-ea", "-esa", + "-cp", Utils.TEST_CLASSES, + "--module-path", MODS_DIR.toString(), + "--add-modules", "bundles", + "Main"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + Stream.concat(args.stream(), LOCALE_LIST.stream()).toList()); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); if (exitCode != 0) { throw new RuntimeException("Execution of the test1 failed. " + "Unexpected exit code: " + exitCode); } // --add-exports can't open resources - launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(Utils.TEST_CLASSES) - .addToolArg("--module-path") - .addToolArg(MODS_DIR.toString()) - .addToolArg("--add-modules") - .addToolArg("bundles") - .addToolArg("--add-opens") - .addToolArg("bundles/jdk.test.internal.resources=ALL-UNNAMED") - .addToolArg("Main"); - LOCALE_LIST.forEach(launcher::addToolArg); + List argsWithOpens = List.of( + "-ea", "-esa", + "-cp", Utils.TEST_CLASSES, + "--module-path", MODS_DIR.toString(), + "--add-modules", "bundles", + "--add-opens", "bundles/jdk.test.internal.resources=ALL-UNNAMED", + "Main"); + pb = ProcessTools.createTestJavaProcessBuilder( + Stream.concat(argsWithOpens.stream(), LOCALE_LIST.stream()).toList()); - exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + // Evaluate process status + exitCode = ProcessTools.executeCommand(pb).getExitValue(); if (exitCode != 0) { throw new RuntimeException("Execution of the test2 failed. " + "Unexpected exit code: " + exitCode); diff --git a/test/jdk/java/util/ResourceBundle/modules/visibility/VisibilityTest.java b/test/jdk/java/util/ResourceBundle/modules/visibility/VisibilityTest.java index 7f940586337..b81c69a4269 100644 --- a/test/jdk/java/util/ResourceBundle/modules/visibility/VisibilityTest.java +++ b/test/jdk/java/util/ResourceBundle/modules/visibility/VisibilityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,10 +39,12 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import java.util.stream.Stream; import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.Utils; import jdk.test.lib.process.ProcessTools; + import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -328,11 +330,10 @@ public void RunWithPkgRes(List argsList) throws Throwable { } private int runCmd(List argsList) throws Throwable { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-ea") - .addToolArg("-esa"); - argsList.forEach(launcher::addToolArg); - - return ProcessTools.executeCommand(launcher.getCommand()).getExitValue(); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + Stream.concat(Stream.of("-ea", "-esa"), argsList.stream()).toList()); + // Evaluate process status + return ProcessTools.executeCommand(pb).getExitValue(); } -} \ No newline at end of file +} diff --git a/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java b/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java index ece90a9d7cd..5fd48efadcc 100644 --- a/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java +++ b/test/jdk/java/util/TimeZone/CustomTzIDCheckDST.java @@ -29,16 +29,18 @@ * @requires os.family != "windows" * @run main/othervm CustomTzIDCheckDST */ + import java.util.Calendar; import java.util.Date; -import java.util.List; import java.util.SimpleTimeZone; import java.util.TimeZone; import java.time.DayOfWeek; import java.time.ZonedDateTime; import java.time.temporal.TemporalAdjusters; + import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; + public class CustomTzIDCheckDST { // Northern Hemisphere private static String CUSTOM_TZ = "MEZ-1MESZ,M3.5.0,M10.5.0/3"; @@ -46,7 +48,7 @@ public class CustomTzIDCheckDST { private static String CUSTOM_TZ2 = "MEZ-1MESZ,M10.5.0,M3.5.0/3"; public static void main(String args[]) throws Throwable { if (args.length == 0) { - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(List.of("CustomTzIDCheckDST", "runTZTest")); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("CustomTzIDCheckDST", "runTZTest"); pb.environment().put("TZ", CUSTOM_TZ); OutputAnalyzer output = ProcessTools.executeProcess(pb); output.shouldHaveExitValue(0); diff --git a/test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheckRun.java b/test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheckRun.java index c510c39cd16..f5d80cd6069 100644 --- a/test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheckRun.java +++ b/test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheckRun.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2023, 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,17 +66,15 @@ public static void main(String[] args) throws Throwable { //run it with the security manager on, plus accesscontroller debugging //will go into infinite recursion trying to get enough permissions for //printing Date of failing certificate unless fix is applied. - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); - launcher.addToolArg("-Djava.security.manager") - .addToolArg("-Djava.security.debug=access,failure,policy") - .addToolArg("-ea") - .addToolArg("-esa") - .addToolArg("-cp") - .addToolArg(jarPath) - .addToolArg("TimeZoneDatePermissionCheck"); - - int exitCode = ProcessTools.executeCommand(launcher.getCommand()) - .getExitValue(); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-Djava.security.manager", + "-Djava.security.debug=access,failure,policy", + "-ea", "-esa", + "-cp", jarPath, + "TimeZoneDatePermissionCheck"); + // Evaluate process status + int exitCode = ProcessTools.executeCommand(pb).getExitValue(); if (exitCode != 0) { throw new RuntimeException("Unexpected exit code: " + exitCode); } diff --git a/test/jdk/java/util/logging/LoggingDeadlock2.java b/test/jdk/java/util/logging/LoggingDeadlock2.java index 4aa3121abc1..e8a0bb49d87 100644 --- a/test/jdk/java/util/logging/LoggingDeadlock2.java +++ b/test/jdk/java/util/logging/LoggingDeadlock2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2023, 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,11 +25,12 @@ * @test * @bug 6467152 6716076 6829503 8132550 * @summary deadlock occurs in LogManager initialization and JVM termination + * @key randomness + * @library /test/lib * @author Serguei Spitsyn / Hitachi / Martin Buchholz * * @build LoggingDeadlock2 * @run main LoggingDeadlock2 - * @key randomness */ /* @@ -50,7 +51,6 @@ * This is a regression test for this bug. */ -import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.concurrent.CyclicBarrier; @@ -63,6 +63,8 @@ import java.io.Reader; import java.util.concurrent.TimeUnit; +import jdk.test.lib.process.ProcessTools; + public class LoggingDeadlock2 { // ask child process to dumpstack after 60secs @@ -74,7 +76,9 @@ public class LoggingDeadlock2 { public static void realMain(String arg[]) throws Throwable { try { System.out.println(javaChildArgs); - ProcessBuilder pb = new ProcessBuilder(javaChildArgs); + // Build process (with VM flags) + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + javaChildArgs); ProcessResults r = run(pb.start()); equal(r.exitValue(), 99); @@ -151,9 +155,6 @@ public void run() { //---------------------------------------------------------------- // The rest of this test is copied from ProcessBuilder/Basic.java //---------------------------------------------------------------- - private static final String javaExe = - System.getProperty("java.home") + - File.separator + "bin" + File.separator + "java"; private static final String jstackExe = System.getProperty("java.home") + File.separator + "bin" + File.separator + "jstack"; @@ -161,10 +162,8 @@ public void run() { private static final String classpath = System.getProperty("java.class.path"); - private static final List javaChildArgs = - Arrays.asList(new String[] - { javaExe, "-classpath", classpath, - "LoggingDeadlock2$JavaChild"}); + private static final List javaChildArgs = List.of( + "-classpath", classpath, "LoggingDeadlock2$JavaChild"); private static class ProcessResults { private final String out; diff --git a/test/jdk/java/util/zip/EntryCount64k.java b/test/jdk/java/util/zip/EntryCount64k.java index 68b86e50ece..08d896a124a 100644 --- a/test/jdk/java/util/zip/EntryCount64k.java +++ b/test/jdk/java/util/zip/EntryCount64k.java @@ -37,7 +37,6 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.RandomAccessFile; -import java.nio.file.Paths; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -161,11 +160,7 @@ static void checkCanRead(File zipFile, int entryCount) throws Throwable { } // Check java -jar - String javaHome = System.getProperty("java.home"); - String java = Paths.get(javaHome, "bin", "java").toString(); - String[] cmd = { java, "-jar", zipFile.getName() }; - ProcessBuilder pb = new ProcessBuilder(cmd); - OutputAnalyzer a = ProcessTools.executeProcess(pb); + OutputAnalyzer a = ProcessTools.executeTestJvm("-jar", zipFile.getName()); a.shouldHaveExitValue(0); a.stdoutShouldMatch("\\AMain\\Z"); a.stderrShouldMatch("\\A\\Z"); From e8aa37dbe6a69889256d886a8faa75dfaa8849a7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 09:07:11 +0000 Subject: [PATCH 108/261] 8310238: [test bug] javax/swing/JTableHeader/6889007/bug6889007.java fails Backport-of: 2cf5c2f4b6cdb52a3560ab03d272f19f47b22b17 --- .../JTableHeader/6889007/bug6889007.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java b/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java index 7b120024186..d5526645930 100644 --- a/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java +++ b/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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 @@ import java.awt.Cursor; import java.awt.Dimension; +import java.awt.MouseInfo; import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; @@ -47,12 +48,15 @@ public class bug6889007 { static JFrame frame; static Robot robot; static volatile Point point; + static volatile Point mouseLoc; static volatile int width; static volatile int height; + static volatile boolean ignoreFirst = false; public static void main(String[] args) throws Exception { try { robot = new Robot(); + robot.mouseMove(100, 100); SwingUtilities.invokeAndWait(() -> { frame = new JFrame(); @@ -74,14 +78,21 @@ public static void main(String[] args) throws Exception { robot.waitForIdle(); robot.delay(1000); SwingUtilities.invokeAndWait(() -> { + mouseLoc = MouseInfo.getPointerInfo().getLocation(); point = frame.getLocationOnScreen(); width = frame.getWidth(); height = frame.getHeight(); }); + if ((mouseLoc.x >= point.x) && (mouseLoc.x < point.x + width) && + (mouseLoc.y >= point.y) && (mouseLoc.y < point.y + height)) { + System.out.println("pointer is within window"); + ignoreFirst = true; + MyTableHeaderUI.testValue = 0; + } int shift = 10; int x = point.x; int y = point.y + height/2; - for(int i = -shift; i < width + 2*shift; i++) { + for (int i = -shift; i < width + 2*shift; i++) { robot.mouseMove(x++, y); robot.delay(100); } @@ -102,15 +113,21 @@ public static void main(String[] args) throws Exception { } static class MyTableHeaderUI extends BasicTableHeaderUI { - private static int testValue; + private static volatile int testValue; protected void rolloverColumnUpdated(int oldColumn, int newColumn) { increaseTestValue(newColumn); Cursor cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR); + System.out.println("oldColumn " + oldColumn + " newColumn " + newColumn + + " header.getCursor " + header.getCursor() + " cursor " + cursor); + if (ignoreFirst) { + ignoreFirst = false; + if (newColumn == 0) { + return; + } + } if (oldColumn != -1 && newColumn != -1 && header.getCursor() != cursor) { - System.out.println("oldColumn " + oldColumn + " newColumn " + newColumn + - "header.getCursor " + header.getCursor() + " cursor " + cursor); try { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); From c8caefa5c3ab4206eff90ea0684a3bb4e14362a4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 09:08:51 +0000 Subject: [PATCH 109/261] 8311279: TestStressIGVNAndCCP.java failed with different IGVN traces for the same seed Backport-of: edb2be10fb897834ed78ab4493d3a4f73dc2e140 --- test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java b/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java index 0f820de47de..3ec49daa0ea 100644 --- a/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java +++ b/test/hotspot/jtreg/compiler/debug/TestStressIGVNAndCCP.java @@ -44,7 +44,7 @@ static String phaseTrace(String stressOption, String traceOption, int stressSeed) throws Exception { String className = TestStressIGVNAndCCP.class.getName(); String[] procArgs = { - "-Xcomp", "-XX:-TieredCompilation", "-XX:-Inline", + "-Xcomp", "-XX:-TieredCompilation", "-XX:-Inline", "-XX:+CICountNative", "-XX:CompileOnly=" + className + "::sum", "-XX:+" + traceOption, "-XX:+" + stressOption, "-XX:StressSeed=" + stressSeed, className, "10"}; From db1fa92d7420dc94f82af0c781a04a6e0ca511eb Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 09:13:52 +0000 Subject: [PATCH 110/261] 8316594: C2 SuperWord: wrong result with hand unrolled loops Reviewed-by: roland, shade Backport-of: 3630af26e6f05237195e53b98603adf404e90a1a --- src/hotspot/share/opto/superword.cpp | 11 +-- src/hotspot/share/opto/superword.hpp | 14 +++ .../superword/TestMovingLoadBeforeStore.java | 90 ++++++++++++++++++- 3 files changed, 107 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index b952a0759f7..6a641a44b32 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -2705,15 +2705,12 @@ bool SuperWord::output() { // Set the memory dependency of the LoadVector as early as possible. // Walk up the memory chain, and ignore any StoreVector that provably // does not have any memory dependency. - SWPointer p1(n->as_Mem(), this, nullptr, false); while (mem->is_StoreVector()) { - SWPointer p2(mem->as_Mem(), this, nullptr, false); - if (p1.not_equal(p2)) { - // Either Less or Greater -> provably no overlap between the two memory regions. - mem = mem->in(MemNode::Memory); - } else { - // No proof that there is no overlap. Stop here. + SWPointer p_store(mem->as_Mem(), this, nullptr, false); + if (p_store.overlap_possible_with_any_in(p)) { break; + } else { + mem = mem->in(MemNode::Memory); } } Node* adr = first->in(MemNode::Address); diff --git a/src/hotspot/share/opto/superword.hpp b/src/hotspot/share/opto/superword.hpp index 6e2689b19ad..eca3836845a 100644 --- a/src/hotspot/share/opto/superword.hpp +++ b/src/hotspot/share/opto/superword.hpp @@ -722,6 +722,20 @@ class SWPointer : public ArenaObj { } } + bool overlap_possible_with_any_in(Node_List* p) { + for (uint k = 0; k < p->size(); k++) { + MemNode* mem = p->at(k)->as_Mem(); + SWPointer p_mem(mem, _slp, nullptr, false); + // Only if we know that we have Less or Greater can we + // be sure that there can never be an overlap between + // the two memory regions. + if (!not_equal(p_mem)) { + return true; + } + } + return false; + } + bool not_equal(SWPointer& q) { return not_equal(cmp(q)); } bool equal(SWPointer& q) { return equal(cmp(q)); } bool comparable(SWPointer& q) { return comparable(cmp(q)); } diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestMovingLoadBeforeStore.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestMovingLoadBeforeStore.java index 71d9050160f..80922aeffe9 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestMovingLoadBeforeStore.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestMovingLoadBeforeStore.java @@ -25,27 +25,35 @@ /** * @test * @requires vm.compiler2.enabled - * @bug 8316679 + * @requires vm.cpu.features ~= ".*avx2.*" + * @bug 8316679 8316594 * @summary In SuperWord::output, LoadVector can be moved before StoreVector, but only if it is proven to be safe. * @key randomness + * @modules java.base/jdk.internal.misc * @library /test/lib * @run main/othervm -XX:CompileCommand=compileonly,compiler.loopopts.superword.TestMovingLoadBeforeStore::test* * -Xbatch -XX:LoopUnrollLimit=100 * -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM + * --add-modules java.base --add-exports java.base/jdk.internal.misc=ALL-UNNAMED * compiler.loopopts.superword.TestMovingLoadBeforeStore */ package compiler.loopopts.superword; import java.util.Random; import jdk.test.lib.Utils; +import jdk.internal.misc.Unsafe; public class TestMovingLoadBeforeStore { static int RANGE = 1024*64; + static int NINE = 9; + private static final Random random = Utils.getRandomInstance(); + static Unsafe UNSAFE = Unsafe.getUnsafe(); public static void main(String[] strArr) { byte a[] = new byte[RANGE]; + byte b[] = new byte[RANGE]; for (int i = 0; i < 100; i++) { for (int j = 0; j < a.length; j++) { a[j] = (byte)random.nextInt(); @@ -56,6 +64,30 @@ public static void main(String[] strArr) { test1(a_res, a_res, i % 2); verify("a in test1", a_ref, a_res, a); } + for (int i = 0; i < 100; i++) { + for (int j = 0; j < a.length; j++) { + a[j] = (byte)random.nextInt(); + b[j] = (byte)random.nextInt(); + } + byte[] a_ref = a.clone(); + byte[] b_ref = b.clone(); + byte[] a_res = a.clone(); + byte[] b_res = b.clone(); + ref2(a_ref, b_ref); + test2(a_res, b_res); + verify("a in test2", a_ref, a_res, a); + verify("b in test2", b_ref, b_res, b); + } + for (int i = 0; i < 100; i++) { + for (int j = 0; j < a.length; j++) { + a[j] = (byte)random.nextInt(); + } + byte[] a_ref = a.clone(); + byte[] a_res = a.clone(); + ref3(a_ref); + test3(a_res); + verify("a in test3", a_ref, a_res, a); + } } static void verify(String name, byte[] ref, byte[] res, byte[] orig) { @@ -96,4 +128,60 @@ static void ref1(byte[] a, byte[] b, int inv) { b[inv + i + 3]++; } } + + static void test2(byte[] a, byte[] b) { + for (int i = 46; i < 6000; i++) { + a[47 + i + 0]++; + a[47 + i + 1]++; + a[47 + i + 2]++; + a[47 + i + 3]++; + b[NINE + i + 0]++; + b[NINE + i + 1]++; + b[NINE + i + 2]++; + b[NINE + i + 3]++; + } + } + + static void ref2(byte[] a, byte[] b) { + for (int i = 46; i < 6000; i++) { + a[47 + i + 0]++; + a[47 + i + 1]++; + a[47 + i + 2]++; + a[47 + i + 3]++; + b[NINE + i + 0]++; + b[NINE + i + 1]++; + b[NINE + i + 2]++; + b[NINE + i + 3]++; + } + } + + static void test3(byte[] a) { + for (int i = 51; i < 6000; i++) { + int adr = UNSAFE.ARRAY_BYTE_BASE_OFFSET + 42 + i; + UNSAFE.putIntUnaligned(a, adr + 0*4, UNSAFE.getIntUnaligned(a, adr + 0*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 1*4, UNSAFE.getIntUnaligned(a, adr + 1*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 2*4, UNSAFE.getIntUnaligned(a, adr + 2*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 3*4, UNSAFE.getIntUnaligned(a, adr + 3*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 4*4, UNSAFE.getIntUnaligned(a, adr + 4*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 5*4, UNSAFE.getIntUnaligned(a, adr + 5*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 6*4, UNSAFE.getIntUnaligned(a, adr + 6*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 7*4, UNSAFE.getIntUnaligned(a, adr + 7*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 8*4, UNSAFE.getIntUnaligned(a, adr + 8*4) + 1); + } + } + + static void ref3(byte[] a) { + for (int i = 51; i < 6000; i++) { + int adr = UNSAFE.ARRAY_BYTE_BASE_OFFSET + 42 + i; + UNSAFE.putIntUnaligned(a, adr + 0*4, UNSAFE.getIntUnaligned(a, adr + 0*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 1*4, UNSAFE.getIntUnaligned(a, adr + 1*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 2*4, UNSAFE.getIntUnaligned(a, adr + 2*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 3*4, UNSAFE.getIntUnaligned(a, adr + 3*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 4*4, UNSAFE.getIntUnaligned(a, adr + 4*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 5*4, UNSAFE.getIntUnaligned(a, adr + 5*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 6*4, UNSAFE.getIntUnaligned(a, adr + 6*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 7*4, UNSAFE.getIntUnaligned(a, adr + 7*4) + 1); + UNSAFE.putIntUnaligned(a, adr + 8*4, UNSAFE.getIntUnaligned(a, adr + 8*4) + 1); + } + } } From 307569f2c332fcbaeff360ed90d2038fec8c3b5b Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 09:20:22 +0000 Subject: [PATCH 111/261] 8319938: TestFileChooserSingleDirectorySelection.java fails with "getSelectedFiles returned empty array" Backport-of: 4ef24e2596340c5375f2ab07883c26a6458efe0e --- ...stFileChooserSingleDirectorySelection.java | 185 +++++++++--------- 1 file changed, 95 insertions(+), 90 deletions(-) diff --git a/test/jdk/com/sun/java/swing/plaf/gtk/TestFileChooserSingleDirectorySelection.java b/test/jdk/com/sun/java/swing/plaf/gtk/TestFileChooserSingleDirectorySelection.java index 0f74b09f7fa..05681550eb2 100644 --- a/test/jdk/com/sun/java/swing/plaf/gtk/TestFileChooserSingleDirectorySelection.java +++ b/test/jdk/com/sun/java/swing/plaf/gtk/TestFileChooserSingleDirectorySelection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -33,12 +33,9 @@ import java.io.File; import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.awt.Point; import java.awt.Robot; -import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.SwingUtilities; @@ -48,130 +45,128 @@ public class TestFileChooserSingleDirectorySelection { private static JFrame frame; private static JFileChooser fileChooser; - private static JButton getSelectedFilesButton; private static Robot robot; - private static boolean passed; - private static File[] testDir; - private static File[] tempFile; + private static volatile Point clickLocation; public static void main(String[] args) throws Exception { System.setProperty("sun.java2d.uiScale", "1.0"); robot = new Robot(); robot.setAutoDelay(100); - - try { - // create test directory - String tmpDir = System.getProperty("user.home"); - testDir = new File[1]; - testDir[0] = new File(tmpDir, "testDir"); - if (!testDir[0].exists()) - testDir[0].mkdir(); - testDir[0].deleteOnExit(); - - // create temporary files inside testDir - tempFile = new File[5]; - for (int i = 0; i < 5; ++i) { - tempFile[i] = File.createTempFile("temp", ".txt", - new File(testDir[0].getAbsolutePath())); - tempFile[i].deleteOnExit(); - } - } catch (Exception e) { - e.printStackTrace(); - } + File testDirDirs = createFoldersOnlyDir(); + File testDirFiles = createFilesOnlyDir(); + populateDirs(testDirDirs); + populateFiles(testDirFiles); for (UIManager.LookAndFeelInfo laf : - UIManager.getInstalledLookAndFeels()) { + UIManager.getInstalledLookAndFeels()) { System.out.println("Testing LAF: " + laf.getClassName()); SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); - checkFileOnlyTest(laf); - checkDirectoriesOnlyTest(laf); - checkFilesAndDirectoriesTest(laf); + checkFileOnlyTest(laf, testDirFiles); + checkDirectoriesOnlyTest(laf, testDirDirs); + checkFilesAndDirectoriesTest(laf, testDirDirs); System.out.println("Passed"); } } - private static void checkFileOnlyTest(UIManager.LookAndFeelInfo laf) - throws Exception { + private static File createFoldersOnlyDir() { + String tmpDir = System.getProperty("java.io.tmpdir"); + File dirsDir = new File(tmpDir, "dirsDir"); + if (!dirsDir.exists()) { + dirsDir.mkdir(); + } + dirsDir.deleteOnExit(); + return dirsDir; + } + + private static void populateDirs(File parent) { + for (int i = 0; i < 10; ++i) { + File subDir = new File(parent, "subDir_" + (i+1)); + subDir.mkdir(); + subDir.deleteOnExit(); + } + } + + private static File createFilesOnlyDir() { + String tmpDir = System.getProperty("java.io.tmpdir"); + File filesDir = new File(tmpDir, "filesDir"); + if (!filesDir.exists()) { + filesDir.mkdir(); + } + filesDir.deleteOnExit(); + return filesDir; + } + + private static void populateFiles(File parent) throws Exception { + for (int i = 0; i < 10; ++i) { + File subFile = new File(parent, "subFiles_" + (i+1)); + subFile.createNewFile(); + subFile.deleteOnExit(); + } + } + + private static void checkFileOnlyTest(UIManager.LookAndFeelInfo laf, + File dir) throws Exception { System.out.println("Testing File Only mode"); try { SwingUtilities.invokeAndWait(() -> { createAndShowUI(); - fileChooser.setCurrentDirectory(testDir[0]); + fileChooser.setCurrentDirectory(dir); + fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); }); robot.waitForIdle(); robot.delay(1000); - fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - doTesting(laf, 230); + if (laf.getClassName().contains("Motif") + || laf.getClassName().contains("GTK")) { + doTesting(laf, 230); + } else { + doTesting(laf, 50); + } } finally { - SwingUtilities.invokeAndWait(() -> { - if (frame != null) { - frame.dispose(); - } - }); + disposeFrame(); } } - private static void checkDirectoriesOnlyTest(UIManager.LookAndFeelInfo laf) - throws Exception { + private static void checkDirectoriesOnlyTest(UIManager.LookAndFeelInfo laf, + File dir) throws Exception { System.out.println("Testing Directories Only mode"); try { SwingUtilities.invokeAndWait(() -> { createAndShowUI(); + fileChooser.setCurrentDirectory(dir); + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); }); robot.waitForIdle(); robot.delay(1000); - fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); doTesting(laf, 50); } finally { - SwingUtilities.invokeAndWait(() -> { - if (frame != null) { - frame.dispose(); - } - }); + disposeFrame(); } } - private static void checkFilesAndDirectoriesTest(UIManager.LookAndFeelInfo laf) - throws Exception { + private static void checkFilesAndDirectoriesTest(UIManager.LookAndFeelInfo laf, + File dir) throws Exception { System.out.println("Testing Files and Directories mode"); try { SwingUtilities.invokeAndWait(() -> { createAndShowUI(); + fileChooser.setCurrentDirectory(dir); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); }); robot.waitForIdle(); robot.delay(1000); - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); doTesting(laf, 50); } finally { - SwingUtilities.invokeAndWait(() -> { - if (frame != null) { - frame.dispose(); - } - }); + disposeFrame(); } } private static void createAndShowUI() { frame = new JFrame("Test File Chooser Single Directory Selection"); frame.getContentPane().setLayout(new BorderLayout()); - fileChooser = new JFileChooser("user.home"); + fileChooser = new JFileChooser(); fileChooser.setMultiSelectionEnabled(true); fileChooser.setControlButtonsAreShown(false); - - getSelectedFilesButton = new JButton(); - getSelectedFilesButton.setText("Print selected Files"); - getSelectedFilesButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - passed = false; - File files[] = fileChooser.getSelectedFiles(); - if (files.length != 0) { - passed = true; - } - } - }); - frame.getContentPane().add(fileChooser, BorderLayout.CENTER); - frame.getContentPane().add(getSelectedFilesButton, BorderLayout.SOUTH); frame.pack(); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -189,30 +184,40 @@ private static void setLookAndFeel(UIManager.LookAndFeelInfo laf) { } } - private static void doTesting(UIManager.LookAndFeelInfo laf, int xOffset) { - Point frameLocation = fileChooser.getLocationOnScreen(); - int frameWidth = frame.getWidth(); - int frameHeight = frame.getHeight(); - - Point btnLocation = getSelectedFilesButton.getLocationOnScreen(); - int btnWidth = getSelectedFilesButton.getWidth(); - int btnHeight = getSelectedFilesButton.getHeight(); - clickMouse(frameLocation, 0, frameHeight, xOffset); - clickMouse(btnLocation, btnWidth, btnHeight, 0); + private static void doTesting(UIManager.LookAndFeelInfo laf, int xOffset) + throws Exception { + SwingUtilities.invokeAndWait(() -> { + Point fileChooserLocation = fileChooser.getLocationOnScreen(); + fileChooserLocation.y += frame.getHeight() / 3; + clickLocation = new Point(fileChooserLocation); + }); + clickMouse(clickLocation, xOffset); checkResult(laf); } - private static void clickMouse(Point point, int width, int height, - int xOffset) { - robot.mouseMove(point.x + width/2 + xOffset , point.y + height/3); + private static void clickMouse(Point point, int xOffset) { + robot.mouseMove(point.x + xOffset , point.y); robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.delay(100); + robot.waitForIdle(); + } + + private static void checkResult(UIManager.LookAndFeelInfo laf) throws Exception { + SwingUtilities.invokeAndWait(() -> { + File[] files = fileChooser.getSelectedFiles(); + if (files.length == 0) { + throw new RuntimeException("getSelectedFiles returned " + + "empty array for LAF: " + laf.getClassName()); + } + }); } - private static void checkResult(UIManager.LookAndFeelInfo laf) { - if (!passed) - throw new RuntimeException("getSelectedFiles returned " + - "empty array for LAF: "+laf.getClassName()); + private static void disposeFrame() throws Exception { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); } } From dfc93243a870ccd5fa2a3e39346e04713077380a Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 09:20:45 +0000 Subject: [PATCH 112/261] 8319879: Stress mode to randomize incremental inlining decision Backport-of: 303757b3a0d73329c954b28f08058fb60e5c9729 --- src/hotspot/share/compiler/compilerDefinitions.cpp | 1 + src/hotspot/share/opto/c2_globals.hpp | 3 +++ src/hotspot/share/opto/callGenerator.cpp | 9 +++++---- src/hotspot/share/opto/compile.cpp | 4 ++-- src/hotspot/share/opto/compile.hpp | 1 + src/hotspot/share/opto/doCall.cpp | 8 ++++---- .../jtreg/compiler/ciReplay/TestIncrementalInlining.java | 1 + .../intrinsics/klass/CastNullCheckDroppingsTest.java | 2 +- test/hotspot/jtreg/compiler/uncommontrap/Decompile.java | 2 +- 9 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp index 221fc00d1a4..54bd1cbc7fc 100644 --- a/src/hotspot/share/compiler/compilerDefinitions.cpp +++ b/src/hotspot/share/compiler/compilerDefinitions.cpp @@ -619,6 +619,7 @@ void CompilerConfig::ergo_initialize() { IncrementalInline = false; IncrementalInlineMH = false; IncrementalInlineVirtual = false; + StressIncrementalInlining = false; } #ifndef PRODUCT if (!IncrementalInline) { diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index 10b8ac2028a..29dd95322a0 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -53,6 +53,9 @@ product(bool, StressCCP, false, DIAGNOSTIC, \ "Randomize worklist traversal in CCP") \ \ + product(bool, StressIncrementalInlining, false, DIAGNOSTIC, \ + "Randomize the incremental inlining decision") \ + \ product(uint, StressSeed, 0, DIAGNOSTIC, \ "Seed for randomized stress testing (if unset, a random one is " \ "generated). The seed is recorded in the compilation log, if " \ diff --git a/src/hotspot/share/opto/callGenerator.cpp b/src/hotspot/share/opto/callGenerator.cpp index d60195dca6f..c88d5db5488 100644 --- a/src/hotspot/share/opto/callGenerator.cpp +++ b/src/hotspot/share/opto/callGenerator.cpp @@ -432,7 +432,7 @@ bool LateInlineMHCallGenerator::do_late_inline_check(Compile* C, JVMState* jvms) assert(!input_not_const, "sanity"); // shouldn't have been scheduled for inlining in the first place if (cg != nullptr) { - assert(!cg->is_late_inline() || cg->is_mh_late_inline() || AlwaysIncrementalInline, "we're doing late inlining"); + assert(!cg->is_late_inline() || cg->is_mh_late_inline() || AlwaysIncrementalInline || StressIncrementalInlining, "we're doing late inlining"); _inline_cg = cg; C->dec_number_of_mh_late_inlines(); return true; @@ -554,7 +554,7 @@ bool LateInlineVirtualCallGenerator::do_late_inline_check(Compile* C, JVMState* true /*allow_intrinsics*/); if (cg != nullptr) { - assert(!cg->is_late_inline() || cg->is_mh_late_inline() || AlwaysIncrementalInline, "we're doing late inlining"); + assert(!cg->is_late_inline() || cg->is_mh_late_inline() || AlwaysIncrementalInline || StressIncrementalInlining, "we're doing late inlining"); _inline_cg = cg; return true; } else { @@ -989,8 +989,9 @@ CallGenerator* CallGenerator::for_method_handle_call(JVMState* jvms, ciMethod* c bool input_not_const; CallGenerator* cg = CallGenerator::for_method_handle_inline(jvms, caller, callee, allow_inline, input_not_const); Compile* C = Compile::current(); + bool should_delay = C->should_delay_inlining(); if (cg != nullptr) { - if (AlwaysIncrementalInline) { + if (should_delay) { return CallGenerator::for_late_inline(callee, cg); } else { return cg; @@ -1001,7 +1002,7 @@ CallGenerator* CallGenerator::for_method_handle_call(JVMState* jvms, ciMethod* c int call_site_count = caller->scale_count(profile.count()); if (IncrementalInlineMH && call_site_count > 0 && - (input_not_const || !C->inlining_incrementally() || C->over_inlining_cutoff())) { + (should_delay || input_not_const || !C->inlining_incrementally() || C->over_inlining_cutoff())) { return CallGenerator::for_mh_late_inline(caller, callee, input_not_const); } else { // Out-of-line call. diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 35f37b0b945..e6f81ccb67a 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -826,7 +826,7 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci, // If any phase is randomized for stress testing, seed random number // generation and log the seed for repeatability. - if (StressLCM || StressGCM || StressIGVN || StressCCP) { + if (StressLCM || StressGCM || StressIGVN || StressCCP || StressIncrementalInlining) { if (FLAG_IS_DEFAULT(StressSeed) || (FLAG_IS_ERGO(StressSeed) && directive->RepeatCompilationOption)) { _stress_seed = static_cast(Ticks::now().nanoseconds()); FLAG_SET_ERGO(StressSeed, _stress_seed); @@ -2244,7 +2244,7 @@ void Compile::Optimize() { if (failing()) return; - if (AlwaysIncrementalInline) { + if (AlwaysIncrementalInline || StressIncrementalInlining) { inline_incrementally(igvn); } diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index 52d1ba7e08b..adf4feabc80 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -1032,6 +1032,7 @@ class Compile : public Phase { bool inline_incrementally_one(); void inline_incrementally_cleanup(PhaseIterGVN& igvn); void inline_incrementally(PhaseIterGVN& igvn); + bool should_delay_inlining() { return AlwaysIncrementalInline || (StressIncrementalInlining && (random() % 2) == 0); } void inline_string_calls(bool parse_time); void inline_boxing_calls(PhaseIterGVN& igvn); bool optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode); diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp index ebf7af12ed5..f7fa5e9d8cc 100644 --- a/src/hotspot/share/opto/doCall.cpp +++ b/src/hotspot/share/opto/doCall.cpp @@ -172,7 +172,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool // Try inlining a bytecoded method: if (!call_does_dispatch) { InlineTree* ilt = InlineTree::find_subtree_from_root(this->ilt(), jvms->caller(), jvms->method()); - bool should_delay = AlwaysIncrementalInline; + bool should_delay = C->should_delay_inlining(); if (ilt->ok_to_inline(callee, jvms, profile, should_delay)) { CallGenerator* cg = CallGenerator::for_inline(callee, expected_uses); // For optimized virtual calls assert at runtime that receiver object @@ -191,14 +191,14 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool // Delay the inlining of this method to give us the // opportunity to perform some high level optimizations // first. - if (should_delay_string_inlining(callee, jvms)) { + if (should_delay) { + return CallGenerator::for_late_inline(callee, cg); + } else if (should_delay_string_inlining(callee, jvms)) { return CallGenerator::for_string_late_inline(callee, cg); } else if (should_delay_boxing_inlining(callee, jvms)) { return CallGenerator::for_boxing_late_inline(callee, cg); } else if (should_delay_vector_reboxing_inlining(callee, jvms)) { return CallGenerator::for_vector_reboxing_late_inline(callee, cg); - } else if (should_delay) { - return CallGenerator::for_late_inline(callee, cg); } else { return cg; } diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java b/test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java index 8bac1ea283c..43daab7a9b0 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java +++ b/test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java @@ -68,6 +68,7 @@ public static void main(String[] args) { commandLineNormal.add("-XX:+WhiteBoxAPI"); commandLineNormal.add("-XX:MaxInlineLevel=2"); commandLineNormal.add("-XX:-AlwaysIncrementalInline"); + commandLineNormal.add("-XX:-StressIncrementalInlining"); runTest(); } diff --git a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java index 79433ef355d..2d2bf14d76f 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java @@ -37,7 +37,7 @@ * -Xmixed -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:CompileThreshold=1000 * -XX:+UnlockExperimentalVMOptions -XX:PerMethodTrapLimit=100 -XX:-StressReflectiveCode * -XX:+UncommonNullCast -XX:-StressMethodHandleLinkerInlining -XX:TypeProfileLevel=0 - * -XX:-AlwaysIncrementalInline + * -XX:-AlwaysIncrementalInline -XX:-StressIncrementalInlining * -XX:CompileCommand=exclude,compiler.intrinsics.klass.CastNullCheckDroppingsTest::runTest * compiler.intrinsics.klass.CastNullCheckDroppingsTest */ diff --git a/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java b/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java index 827eae7168b..678b2883b16 100644 --- a/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java +++ b/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java @@ -36,7 +36,7 @@ * -Xbatch -XX:-UseOnStackReplacement -XX:-TieredCompilation * -XX:+UnlockExperimentalVMOptions -XX:PerMethodTrapLimit=100 -XX:PerBytecodeTrapLimit=4 * -XX:TypeProfileLevel=0 - * -XX:+IgnoreUnrecognizedVMOptions -XX:-AlwaysIncrementalInline + * -XX:+IgnoreUnrecognizedVMOptions -XX:-AlwaysIncrementalInline -XX:-StressIncrementalInlining * -XX:CompileCommand=compileonly,compiler.uncommontrap.Decompile::uncommonTrap * -XX:CompileCommand=inline,compiler.uncommontrap.Decompile*::foo * compiler.uncommontrap.Decompile From d4797b711e7666ebd7d0ef77ebfb2d94cd183c8d Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 8 Jan 2024 09:22:39 +0000 Subject: [PATCH 113/261] 8316693: Simplify at-requires checkDockerSupport() Backport-of: 16fd43c5eb0fb18e93f00b5817d368df5afad969 --- test/jtreg-ext/requires/VMProps.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index e119c1bd6d4..16b078410f0 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -571,9 +571,10 @@ private void printLogfileContent(Map logFileNames) { private boolean checkDockerSupport() throws IOException, InterruptedException { log("checkDockerSupport(): entering"); - ProcessBuilder pb = new ProcessBuilder(Container.ENGINE_COMMAND, "ps"); - Map logFileNames = redirectOutputToLogFile("checkDockerSupport(): ps", - pb, "container-ps"); + ProcessBuilder pb = new ProcessBuilder("which", Container.ENGINE_COMMAND); + Map logFileNames = + redirectOutputToLogFile("checkDockerSupport(): which ", + pb, "which-container"); Process p = pb.start(); p.waitFor(10, TimeUnit.SECONDS); int exitValue = p.exitValue(); From 1e6648867b9b04f079332ce8baf59ae4b471571e Mon Sep 17 00:00:00 2001 From: Oli Gillespie Date: Mon, 8 Jan 2024 10:33:59 +0000 Subject: [PATCH 114/261] 8321599: Data loss in AVX3 Base64 decoding Backport-of: 13c11487f7126a370d9ce8e62f661ea83eedefe6 --- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 6 +- .../intrinsics/base64/TestBase64.java | 121 +++++++++++++++++- 2 files changed, 124 insertions(+), 3 deletions(-) diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 014737322d8..2a52fa200c9 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -2324,7 +2324,7 @@ address StubGenerator::generate_base64_decodeBlock() { const Register isURL = c_rarg5;// Base64 or URL character set __ movl(isMIME, Address(rbp, 2 * wordSize)); #else - const Address dp_mem(rbp, 6 * wordSize); // length is on stack on Win64 + const Address dp_mem(rbp, 6 * wordSize); // length is on stack on Win64 const Address isURL_mem(rbp, 7 * wordSize); const Register isURL = r10; // pick the volatile windows register const Register dp = r12; @@ -2546,10 +2546,12 @@ address StubGenerator::generate_base64_decodeBlock() { // output_size in r13 // Strip pad characters, if any, and adjust length and mask + __ addq(length, start_offset); __ cmpb(Address(source, length, Address::times_1, -1), '='); __ jcc(Assembler::equal, L_padding); __ BIND(L_donePadding); + __ subq(length, start_offset); // Output size is (64 - output_size), output mask is (all 1s >> output_size). __ kmovql(input_mask, rax); diff --git a/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java b/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java index 5d2651c3285..0d3c9569c33 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java +++ b/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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,10 +46,13 @@ import java.util.Base64; import java.util.Base64.Decoder; import java.util.Base64.Encoder; +import java.util.HexFormat; import java.util.Objects; import java.util.Random; import java.util.Arrays; +import static java.lang.String.format; + import compiler.whitebox.CompilerWhiteBoxTest; import jdk.test.whitebox.code.Compiler; import jtreg.SkippedException; @@ -69,6 +72,8 @@ public static void main(String[] args) throws Exception { warmup(); + length_checks(); + test0(FileType.ASCII, Base64Type.BASIC, Base64.getEncoder(), Base64.getDecoder(),"plain.txt", "baseEncode.txt", iters); test0(FileType.ASCII, Base64Type.URLSAFE, Base64.getUrlEncoder(), Base64.getUrlDecoder(),"plain.txt", "urlEncode.txt", iters); test0(FileType.ASCII, Base64Type.MIME, Base64.getMimeEncoder(), Base64.getMimeDecoder(),"plain.txt", "mimeEncode.txt", iters); @@ -302,4 +307,118 @@ private static final byte getBadBase64Char(Base64Type b64Type) { throw new InternalError("Internal test error: getBadBase64Char called with unknown Base64Type value"); } } + + static final int POSITIONS = 30_000; + static final int BASE_LENGTH = 256; + static final HexFormat HEX_FORMAT = HexFormat.of().withUpperCase().withDelimiter(" "); + + static int[] plainOffsets = new int[POSITIONS + 1]; + static byte[] plainBytes; + static int[] base64Offsets = new int[POSITIONS + 1]; + static byte[] base64Bytes; + + static { + // Set up ByteBuffer with characters to be encoded + int plainLength = 0; + for (int i = 0; i < plainOffsets.length; i++) { + plainOffsets[i] = plainLength; + int positionLength = (BASE_LENGTH + i) % 2048; + plainLength += positionLength; + } + // Put one of each possible byte value into ByteBuffer + plainBytes = new byte[plainLength]; + for (int i = 0; i < plainBytes.length; i++) { + plainBytes[i] = (byte) i; + } + + // Grab various slices of the ByteBuffer and encode them + ByteBuffer plainBuffer = ByteBuffer.wrap(plainBytes); + int base64Length = 0; + for (int i = 0; i < POSITIONS; i++) { + base64Offsets[i] = base64Length; + int offset = plainOffsets[i]; + int length = plainOffsets[i + 1] - offset; + ByteBuffer plainSlice = plainBuffer.slice(offset, length); + base64Length += Base64.getEncoder().encode(plainSlice).remaining(); + } + + // Decode the slices created above and ensure lengths match + base64Offsets[base64Offsets.length - 1] = base64Length; + base64Bytes = new byte[base64Length]; + for (int i = 0; i < POSITIONS; i++) { + int plainOffset = plainOffsets[i]; + ByteBuffer plainSlice = plainBuffer.slice(plainOffset, plainOffsets[i + 1] - plainOffset); + ByteBuffer encodedBytes = Base64.getEncoder().encode(plainSlice); + int base64Offset = base64Offsets[i]; + int expectedLength = base64Offsets[i + 1] - base64Offset; + if (expectedLength != encodedBytes.remaining()) { + throw new IllegalStateException(format("Unexpected length: %s <> %s", encodedBytes.remaining(), expectedLength)); + } + encodedBytes.get(base64Bytes, base64Offset, expectedLength); + } + } + + public static void length_checks() { + decodeAndCheck(); + encodeDecode(); + System.out.println("Test complete, no invalid decodes detected"); + } + + // Use ByteBuffer to cause decode() to use the base + offset form of decode + // Checks for bug reported in JDK-8321599 where padding characters appear + // within the beginning of the ByteBuffer *before* the offset. This caused + // the decoded string length to be off by 1 or 2 bytes. + static void decodeAndCheck() { + for (int i = 0; i < POSITIONS; i++) { + ByteBuffer encodedBytes = base64BytesAtPosition(i); + ByteBuffer decodedBytes = Base64.getDecoder().decode(encodedBytes); + + if (!decodedBytes.equals(plainBytesAtPosition(i))) { + String base64String = base64StringAtPosition(i); + String plainHexString = plainHexStringAtPosition(i); + String decodedHexString = HEX_FORMAT.formatHex(decodedBytes.array(), decodedBytes.arrayOffset() + decodedBytes.position(), decodedBytes.arrayOffset() + decodedBytes.limit()); + throw new IllegalStateException(format("Mismatch for %s\n\nExpected:\n%s\n\nActual:\n%s", base64String, plainHexString, decodedHexString)); + } + } + } + + // Encode strings of lengths 1-1K, decode, and ensure length and contents correct. + // This checks that padding characters are properly handled by decode. + static void encodeDecode() { + String allAs = "A(=)".repeat(128); + for (int i = 1; i <= 512; i++) { + String encStr = Base64.getEncoder().encodeToString(allAs.substring(0, i).getBytes()); + String decStr = new String(Base64.getDecoder().decode(encStr)); + + if ((decStr.length() != allAs.substring(0, i).length()) || + (!Objects.equals(decStr, allAs.substring(0, i))) + ) { + throw new IllegalStateException(format("Mismatch: Expected: %s\n Actual: %s\n", allAs.substring(0, i), decStr)); + } + } + } + + static ByteBuffer plainBytesAtPosition(int position) { + int offset = plainOffsets[position]; + int length = plainOffsets[position + 1] - offset; + return ByteBuffer.wrap(plainBytes, offset, length); + } + + static String plainHexStringAtPosition(int position) { + int offset = plainOffsets[position]; + int length = plainOffsets[position + 1] - offset; + return HEX_FORMAT.formatHex(plainBytes, offset, offset + length); + } + + static String base64StringAtPosition(int position) { + int offset = base64Offsets[position]; + int length = base64Offsets[position + 1] - offset; + return new String(base64Bytes, offset, length, StandardCharsets.UTF_8); + } + + static ByteBuffer base64BytesAtPosition(int position) { + int offset = base64Offsets[position]; + int length = base64Offsets[position + 1] - offset; + return ByteBuffer.wrap(base64Bytes, offset, length); + } } From a85f3f8300245d97daee8f35f4ebdeb442fe1fdb Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 8 Jan 2024 12:08:42 +0000 Subject: [PATCH 115/261] 8320145: Compiler should accept final variable in Record Pattern Backport-of: 4ba94ef69ef2ee576c50bb6003a795746dcdf30d --- .../sun/tools/javac/parser/JavacParser.java | 2 + .../tools/javac/patterns/T8317300.out | 6 +-- .../tools/javac/patterns/T8320145.java | 42 +++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 test/langtools/tools/javac/patterns/T8320145.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java index e26d157937d..48d33dc51d3 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -3362,6 +3362,8 @@ PatternResult analyzePattern(int lookahead) { case RPAREN: parenDepth--; break; case ARROW: return parenDepth > 0 ? PatternResult.EXPRESSION : pendingResult; + case FINAL: + if (parenDepth > 0) return PatternResult.PATTERN; default: return pendingResult; } lookahead++; diff --git a/test/langtools/tools/javac/patterns/T8317300.out b/test/langtools/tools/javac/patterns/T8317300.out index f28fd7467d8..6889c873db5 100644 --- a/test/langtools/tools/javac/patterns/T8317300.out +++ b/test/langtools/tools/javac/patterns/T8317300.out @@ -1,5 +1,3 @@ T8317300.java:13:18: compiler.err.mod.not.allowed.here: final -T8317300.java:20:22: compiler.err.illegal.start.of.expr -T8317300.java:20:31: compiler.err.expected: token.identifier -T8317300.java:20:37: compiler.err.expected: ';' -4 errors +T8317300.java:20:22: compiler.err.mod.not.allowed.here: final +2 errors diff --git a/test/langtools/tools/javac/patterns/T8320145.java b/test/langtools/tools/javac/patterns/T8320145.java new file mode 100644 index 00000000000..67c851a82aa --- /dev/null +++ b/test/langtools/tools/javac/patterns/T8320145.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 8320145 + * @summary Compiler should accept final variable in Record Pattern + * @compile T8320145.java + */ +public class T8320145 { + record ARecord(String aComponent) {} + record BRecord(ARecord aComponent) {} + record CRecord(ARecord aComponent1, ARecord aComponent2) {} + + public String match(Object o) { + return switch(o) { + case ARecord(final String s) -> s; + case BRecord(ARecord(final String s)) -> s; + case CRecord(ARecord(String s), ARecord(final String s2)) -> s; + default -> "No match"; + }; + } +} From b745bb515f19d47e5246773ddfc48a23deda1345 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 8 Jan 2024 16:36:50 +0000 Subject: [PATCH 116/261] 8319883: Zero: Use atomic built-ins for 64-bit accesses Backport-of: 25f9af99be1c906fc85b8192df8fa50cced3474f --- .../os_cpu/bsd_zero/atomic_bsd_zero.hpp | 28 +++-------- .../os_cpu/linux_zero/atomic_linux_zero.hpp | 50 +++---------------- 2 files changed, 15 insertions(+), 63 deletions(-) diff --git a/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp b/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp index b39f03fd0d2..4d5d97fddcd 100644 --- a/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp +++ b/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp @@ -286,31 +286,19 @@ inline T Atomic::PlatformCmpxchg<8>::operator()(T volatile* dest, } // Atomically copy 64 bits of data -static void atomic_copy64(const volatile void *src, volatile void *dst) { -#if defined(PPC32) - double tmp; - asm volatile ("lfd %0, 0(%1)\n" - "stfd %0, 0(%2)\n" - : "=f"(tmp) - : "b"(src), "b"(dst)); -#elif defined(S390) && !defined(_LP64) - double tmp; - asm volatile ("ld %0, 0(%1)\n" - "std %0, 0(%2)\n" - : "=r"(tmp) - : "a"(src), "a"(dst)); -#else - *(jlong *) dst = *(const jlong *) src; -#endif +inline void atomic_copy64(const volatile void *src, volatile void *dst) { + int64_t tmp; + __atomic_load(reinterpret_cast(src), &tmp, __ATOMIC_RELAXED); + __atomic_store(reinterpret_cast(dst), &tmp, __ATOMIC_RELAXED); } template<> template inline T Atomic::PlatformLoad<8>::operator()(T const volatile* src) const { STATIC_ASSERT(8 == sizeof(T)); - volatile int64_t dest; - atomic_copy64(reinterpret_cast(src), reinterpret_cast(&dest)); - return PrimitiveConversions::cast(dest); + T dest; + __atomic_load(const_cast(src), &dest, __ATOMIC_RELAXED); + return dest; } template<> @@ -318,7 +306,7 @@ template inline void Atomic::PlatformStore<8>::operator()(T volatile* dest, T store_value) const { STATIC_ASSERT(8 == sizeof(T)); - atomic_copy64(reinterpret_cast(&store_value), reinterpret_cast(dest)); + __atomic_store(dest, &store_value, __ATOMIC_RELAXED); } #endif // OS_CPU_BSD_ZERO_ATOMIC_BSD_ZERO_HPP diff --git a/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp b/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp index eefa8d5d062..7b7beba6565 100644 --- a/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp +++ b/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp @@ -134,54 +134,18 @@ inline T Atomic::PlatformCmpxchg<8>::operator()(T volatile* dest, // Atomically copy 64 bits of data inline void atomic_copy64(const volatile void *src, volatile void *dst) { -#if defined(PPC32) && !defined(__SPE__) - double tmp; - asm volatile ("lfd %0, %2\n" - "stfd %0, %1\n" - : "=&f"(tmp), "=Q"(*(volatile double*)dst) - : "Q"(*(volatile double*)src)); -#elif defined(PPC32) && defined(__SPE__) - long tmp; - asm volatile ("evldd %0, %2\n" - "evstdd %0, %1\n" - : "=&r"(tmp), "=Q"(*(volatile long*)dst) - : "Q"(*(volatile long*)src)); -#elif defined(S390) && !defined(_LP64) - double tmp; - asm volatile ("ld %0, %2\n" - "std %0, %1\n" - : "=&f"(tmp), "=Q"(*(volatile double*)dst) - : "Q"(*(volatile double*)src)); -#elif defined(__ARM_ARCH_7A__) - // The only way to perform the atomic 64-bit load/store - // is to use ldrexd/strexd for both reads and writes. - // For store, we need to have the matching (fake) load first. - // Put clrex between exclusive ops on src and dst for clarity. - uint64_t tmp_r, tmp_w; - uint32_t flag_w; - asm volatile ("ldrexd %[tmp_r], [%[src]]\n" - "clrex\n" - "1:\n" - "ldrexd %[tmp_w], [%[dst]]\n" - "strexd %[flag_w], %[tmp_r], [%[dst]]\n" - "cmp %[flag_w], 0\n" - "bne 1b\n" - : [tmp_r] "=&r" (tmp_r), [tmp_w] "=&r" (tmp_w), - [flag_w] "=&r" (flag_w) - : [src] "r" (src), [dst] "r" (dst) - : "cc", "memory"); -#else - *(jlong *) dst = *(const jlong *) src; -#endif + int64_t tmp; + __atomic_load(reinterpret_cast(src), &tmp, __ATOMIC_RELAXED); + __atomic_store(reinterpret_cast(dst), &tmp, __ATOMIC_RELAXED); } template<> template inline T Atomic::PlatformLoad<8>::operator()(T const volatile* src) const { STATIC_ASSERT(8 == sizeof(T)); - volatile int64_t dest; - atomic_copy64(reinterpret_cast(src), reinterpret_cast(&dest)); - return PrimitiveConversions::cast(dest); + T dest; + __atomic_load(const_cast(src), &dest, __ATOMIC_RELAXED); + return dest; } template<> @@ -189,7 +153,7 @@ template inline void Atomic::PlatformStore<8>::operator()(T volatile* dest, T store_value) const { STATIC_ASSERT(8 == sizeof(T)); - atomic_copy64(reinterpret_cast(&store_value), reinterpret_cast(dest)); + __atomic_store(dest, &store_value, __ATOMIC_RELAXED); } #endif // OS_CPU_LINUX_ZERO_ATOMIC_LINUX_ZERO_HPP From 1a9c7ec2af95d53ca16519bcab8b79afe6d0c615 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 9 Jan 2024 08:48:29 +0000 Subject: [PATCH 117/261] 8318082: ConcurrentModificationException from IndexWriter Reviewed-by: prappo, simonis Backport-of: fc29a2e152310ed81bd1bb23e6f17d02f055a454 --- .../html/AbstractOverviewIndexWriter.java | 7 +- .../doclets/formats/html/ClassWriterImpl.java | 5 + .../formats/html/DocFilesHandlerImpl.java | 7 +- .../formats/html/HtmlDocletWriter.java | 17 +- .../formats/html/ModuleWriterImpl.java | 5 + .../formats/html/PackageWriterImpl.java | 5 + .../formats/html/TagletWriterImpl.java | 3 +- .../doclet/testIndex/TestSelfIndexing.java | 164 ++++++++++++++++++ .../javadoc/doclet/testSearch/TestSearch.java | 34 +--- 9 files changed, 212 insertions(+), 35 deletions(-) create mode 100644 test/langtools/jdk/javadoc/doclet/testIndex/TestSelfIndexing.java diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java index 343eac6914b..bda2db655e7 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -110,6 +110,11 @@ protected void buildOverviewIndexFile(String title, String description) description, body); } + @Override + public boolean isIndexable() { + return true; + } + /** * Adds the index to the documentation. * diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java index 640102dfabf..bb3f5aafcca 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java @@ -461,4 +461,9 @@ public Content getMemberDetails(Content content) { } return section; } + + @Override + public boolean isIndexable() { + return true; + } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java index 6567f6e13fb..40cfd5cbd24 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -299,5 +299,10 @@ protected Navigation getNavBar(PageMode pageMode, Element element) { .setNavLinkModule(mdleLinkContent) .setNavLinkPackage(pkgLinkContent); } + + @Override + public boolean isIndexable() { + return true; + } } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index 79cfae7ef47..cf382def3f5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -399,6 +399,20 @@ public TagletWriterImpl getTagletWriterInstance(TagletWriterImpl.Context context return new TagletWriterImpl(this, context); } + /** + * {@return true if the page written by this writer should be indexed, + * false otherwise} + * + * Some pages merely aggregate filtered information available on other pages + * and, thus, have no indexing value. In fact, if indexed, they would + * clutter the index and mislead the reader. + * + * @implSpec The default implementation returns {@code false}. + */ + public boolean isIndexable() { + return false; + } + /** * Generates the HTML document tree and prints it out. * @@ -1401,7 +1415,8 @@ public Boolean visitLiteral(LiteralTree node, Content content) { @Override public Boolean visitStartElement(StartElementTree node, Content content) { Content attrs = new ContentBuilder(); - if (node.getName().toString().matches("(?i)h[1-6]")) { + if (node.getName().toString().matches("(?i)h[1-6]") + && isIndexable()) { createSectionIdAndIndex(node, trees, attrs, element, context); } for (DocTree dt : node.getAttributes()) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java index 2c8e684a017..3a5b8de520e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java @@ -845,4 +845,9 @@ public void addPackageDeprecationInfo(Content li, PackageElement pkg) { li.add(deprDiv); } } + + @Override + public boolean isIndexable() { + return true; + } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java index fadcc7451f4..6ef967e9c5e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java @@ -375,4 +375,9 @@ private List filterPackages(Predicate fi .filter(p -> p != packageElement && filter.test(p)) .collect(Collectors.toList()); } + + @Override + public boolean isIndexable() { + return true; + } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index fa466e723b9..d225e07f9c8 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -902,7 +902,8 @@ private Content createAnchorAndSearchIndex(Element element, String tagText, Stri @SuppressWarnings("preview") private Content createAnchorAndSearchIndex(Element element, String tagText, Content tagContent, String desc, DocTree tree) { Content result = null; - if (context.isFirstSentence && context.inSummary || context.inTags.contains(DocTree.Kind.INDEX)) { + if (context.isFirstSentence && context.inSummary || context.inTags.contains(DocTree.Kind.INDEX) + || !htmlWriter.isIndexable()) { result = tagContent; } else { HtmlId id = HtmlIds.forText(tagText, htmlWriter.indexAnchorTable); diff --git a/test/langtools/jdk/javadoc/doclet/testIndex/TestSelfIndexing.java b/test/langtools/jdk/javadoc/doclet/testIndex/TestSelfIndexing.java new file mode 100644 index 00000000000..9d1d146d54d --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testIndex/TestSelfIndexing.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.Spliterator; +import java.util.Spliterators; +import java.util.regex.Pattern; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +import javadoc.tester.JavadocTester; +import toolbox.ToolBox; + +/* + * @test + * @bug 8318082 + * @library /tools/lib ../../lib + * @modules jdk.javadoc/jdk.javadoc.internal.tool + * @build toolbox.ToolBox javadoc.tester.* + * @run main TestSelfIndexing + */ +public class TestSelfIndexing extends JavadocTester { + + public static void main(String... args) throws Exception { + new TestSelfIndexing().runTests(); + } + + private final ToolBox tb = new ToolBox(); + + /* + * Pages derived from other pages must not be indexed and may not + * cross-reference each other except for navigation ergonomics. + * + * For example, it's okay for all-index.html to reference deprecated-list.html; + * but it is not okay, for all-index.html to reference an anchor, such as + * deprecated-list.html#java.lang.Object.finalize() + */ + @Test + public void test(Path base) throws Exception { + Path src = base.resolve("src"); + int i = 0; + // try to start a search tag (i) with the same letter, H, + // as the class, Hello, and (ii) with some other letter, P + for (var l : List.of("H", "P")) { + // try all markup constructs that cause indexing + for (var t : List.of("

    %s

    ", "{@index %s}", "{@systemProperty %s}")) { + tb.writeJavaFiles(src, """ + package pkg; + + /** @deprecated %s */ + public class Hello { } + """.formatted(t.formatted(l))); + + Path out = base.resolve("out-" + i); + checking(t.formatted(l) + "; results in: " + out); + setAutomaticCheckNoStacktrace(true); // no exceptions + javadoc("-d", out.toString(), + "--source-path", src.toString(), + "pkg"); + // check that index pages do not refer to derived pages + try (var s = findIndexFiles(out)) { + record PathAndString(Path path, String str) { } + Optional r = s.map(p -> { + try { + return new PathAndString(p, Files.readString(p)); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }) + .flatMap(pac -> findLinksToDerivedPages(pac.str) + .map(link -> new PathAndString(pac.path, link))) + .findAny(); + r.ifPresentOrElse(p -> failed(p.toString()), () -> passed(t.formatted(l))); + } + i++; + } + } + } + + // ----------- support and infrastructure ----------- + + private static Stream findIndexFiles(Path start) throws IOException { + return Files.find(start, Integer.MAX_VALUE, (path, attr) -> { + if (attr.isDirectory()) + return false; + var fileName = path.getFileName().toString(); + if (!fileName.endsWith(".html") && !fileName.endsWith(".js")) + return false; + if (!fileName.contains("-index") && !fileName.contains("index-")) + return false; + var underDocFiles = StreamSupport.stream(Spliterators.spliterator(path.iterator(), + Integer.MAX_VALUE, Spliterator.ORDERED), false) + .anyMatch(p -> p.equals(DOC_FILES)); + return !underDocFiles; + }); + } + + private static final Path DOC_FILES = Path.of("doc-files"); + + // good enough to capture relevant parts of URLs that javadoc uses, + // from html and js files alike + private static final Pattern URL = Pattern.compile( + "(?([a-zA-Z.%0-9-]+/)*+)(?[a-zA-Z.%0-9-]+\\.html)#[a-zA-Z.%0-9-]+"); + + static { + assert findLinksToDerivedPages("module-summary.html#a").findAny().isEmpty(); + assert findLinksToDerivedPages("package-summary.html#a").findAny().isEmpty(); + assert findLinksToDerivedPages("Exception.html#a").findAny().isEmpty(); + assert findLinksToDerivedPages("util/doc-files/coll-index.html#a").findAny().isEmpty(); + assert findLinksToDerivedPages("util/doc-files/index-all.html#a").findAny().isEmpty(); // tricky + + + assert findLinksToDerivedPages("index-all.html#a").findAny().isPresent(); + assert findLinksToDerivedPages("index-17.html#a").findAny().isPresent(); + } + + // NOTE: this will not find self-links that are allowed on some index pages. + // For example, the quick-jump first-character links, such as #I:A, + // #I:B, etc., on the top and at the bottom of index-all.html + private static Stream findLinksToDerivedPages(String content) { + return URL.matcher(content).results() + .filter(r -> { + String f = r.group("file"); + if (!f.contains("-")) + return false; + return switch (f) { + case "package-summary.html", + "module-summary.html", + "overview-summary.html", + "help-doc.html" -> false; + default -> { + String p = r.group("path"); + yield !p.contains("/doc-files/") && !p.startsWith("doc-files/"); + } + }; + }) + .map(r -> r.group(0)); + } +} diff --git a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java index 39788956f29..d2d22e7090a 100644 --- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java +++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java @@ -26,7 +26,7 @@ * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881 * 8181622 8182263 8074407 8187521 8198522 8182765 8199278 8196201 8196202 * 8184205 8214468 8222548 8223378 8234746 8241219 8254627 8247994 8263528 - * 8266808 8248863 8305710 + * 8266808 8248863 8305710 8318082 * @summary Test the search feature of javadoc. * @library ../../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool @@ -505,14 +505,6 @@ constant in enum class pkg2.
    TWO - Enum con\ stant in enum class pkg2.TestEnum"""); - checkOutput("index-all.html", true, - """ -
    class_test1 passes. Search tag SearchTagDeprecatedClass""", - """ -
    error_test3 passes. Search tag for - method SearchTagDeprecatedMethod
    """); } void checkSplitIndex() { @@ -623,13 +615,7 @@ ion interface pkg2.TestAnnotationType""", k">SearchTagDeprecatedClass - Search tag in class pkg2.TestClass""", """
    Single\ - Word - Search tag in package pkg
    """, - """ -
    class_test1 passes. Search tag SearchTagDeprecatedClass
    """, - """ -
    error_test3 passes. Search tag for - method SearchTagDeprecatedMethod
    """); + Word - Search tag in package pkg"""); checkOutput("index-all.html", true, """
    \ @@ -667,13 +653,7 @@ ion interface pkg2.TestAnnotationType
    """, search phrase deprecated - Search tag in pkg2.TestEnum.ONE""", """
    SearchTagDeprecatedMethod - Search tag in pkg2.TestError.TestError()
    """, - """ -
    class_test1 passes. Search tag SearchTagDeprecatedClass
    """, - """ -
    error_test3 passes. Search tag for - method SearchTagDeprecatedMethod
    """); + nk">SearchTagDeprecatedMethod - Search tag in pkg2.TestError.TestError()"""); } void checkJavaFXOutput() { @@ -841,20 +821,12 @@ void checkSearchTagIndex() { {"l":"r","h":"package pkg","u":"pkg/package-summary.html#r"}""", """ {"l":"search phrase","h":"class pkg1.RegClass","d":"with description","u":"pkg1/RegClass.html#searchphrase"}""", - """ - {"l":"search phrase deprecated","h":"pkg2.TestEnum.ONE","u":"deprecated-list.html#searchphrasedeprecated"}""", """ {"l":"search phrase deprecated","h":"pkg2.TestEnum.ONE","u":"pkg2/TestEnum.html#searchphrasedeprecated"}""", - """ - {"l":"search phrase with desc deprecated","h":"annotation interface pkg2.TestAnnotationType","d":"description for phrase deprecated","u":"deprecated-list.html#searchphrasewithdescdeprecated"}""", """ {"l":"search phrase with desc deprecated","h":"annotation interface pkg2.TestAnnotationType","d":"description for phrase deprecated","u":"pkg2/TestAnnotationType.html#searchphrasewithdescdeprecated"}""", - """ - {"l":"SearchTagDeprecatedClass","h":"class pkg2.TestClass","u":"deprecated-list.html#SearchTagDeprecatedClass"}""", """ {"l":"SearchTagDeprecatedClass","h":"class pkg2.TestClass","u":"pkg2/TestClass.html#SearchTagDeprecatedClass"}""", - """ - {"l":"SearchTagDeprecatedMethod","h":"pkg2.TestError.TestError()","d":"with description","u":"deprecated-list.html#SearchTagDeprecatedMethod"}""", """ {"l":"SearchTagDeprecatedMethod","h":"pkg2.TestError.TestError()","d":"with description","u":"pkg2/TestError.html#SearchTagDeprecatedMethod"}""", """ From e652bb72d05b8058032e9f525f3f225da82bc05c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 9 Jan 2024 09:05:49 +0000 Subject: [PATCH 118/261] 8310844: [AArch64] C1 compilation fails because monitor offset in OSR buffer is too large for immediate Reviewed-by: aph Backport-of: ade21a965f8a5fc889cd48bba76fad507bdeddf5 --- .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 5 +- .../compiler/c1/TestLargeMonitorOffset.java | 146 ++++++++++++++++++ 2 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c1/TestLargeMonitorOffset.java diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 94df2fbffe6..656dbdf7ae8 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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. * @@ -282,7 +282,8 @@ void LIR_Assembler::osr_entry() { __ bind(L); } #endif - __ ldp(r19, r20, Address(OSR_buf, slot_offset)); + __ ldr(r19, Address(OSR_buf, slot_offset)); + __ ldr(r20, Address(OSR_buf, slot_offset + BytesPerWord)); __ str(r19, frame_map()->address_for_monitor_lock(i)); __ str(r20, frame_map()->address_for_monitor_object(i)); } diff --git a/test/hotspot/jtreg/compiler/c1/TestLargeMonitorOffset.java b/test/hotspot/jtreg/compiler/c1/TestLargeMonitorOffset.java new file mode 100644 index 00000000000..d5cdb6bee52 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c1/TestLargeMonitorOffset.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8310844 + * @summary Verify that monitors with large offset in the OSR buffer are handled properly. + * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,TestLargeMonitorOffset::* TestLargeMonitorOffset + */ + +public class TestLargeMonitorOffset { + + public static void test() { + long l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, + l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, + l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, + l31, l32, l33, l34, l35, l36, l37, l38, l39, l40, + l41, l42, l43, l44, l45, l46, l47, l48, l49, l50, + l51, l52, l53, l54, l55, l56, l57, l58, l59, l60, + l61, l62, l63, l64, l65, l66, l67, l68, l69, l70, + l71, l72, l73, l74, l75, l76, l77, l78, l79, l80, + l81, l82, l83, l84, l85, l86, l87, l88, l89, l90, + l91, l92, l93, l94, l95, l96, l97, l98, l99, l100, + l101, l102, l103, l104, l105, l106, l107, l108, l109, l110, + l111, l112, l113, l114, l115, l116, l117, l118, l119, l120, + l121, l122, l123, l124, l125, l126, l127, l128, l129, l130, + l131, l132, l133, l134, l135, l136, l137, l138, l139, l140, + l141, l142, l143, l144, l145, l146, l147, l148, l149, l150, + l151, l152, l153, l154, l155, l156, l157, l158, l159, l160, + l161, l162, l163, l164, l165, l166, l167, l168, l169, l170, + l171, l172, l173, l174, l175, l176, l177, l178, l179, l180, + l181, l182, l183, l184, l185, l186, l187, l188, l189, l190, + l191, l192, l193, l194, l195, l196, l197, l198, l199, l200, + l201, l202, l203, l204, l205, l206, l207, l208, l209, l210, + l211, l212, l213, l214, l215, l216, l217, l218, l219, l220, + l221, l222, l223, l224, l225, l226, l227, l228, l229, l230, + l231, l232, l233, l234, l235, l236, l237, l238, l239, l240, + l241, l242, l243, l244, l245, l246, l247, l248, l249, l250, + l251, l252, l253, l254, l255, l256, l257, l258, l259, l260, + l261, l262, l263, l264, l265, l266, l267, l268, l269, l270, + l271, l272, l273, l274, l275, l276, l277, l278, l279, l280, + l281, l282, l283, l284, l285, l286, l287, l288, l289, l290, + l291, l292, l293, l294, l295, l296, l297, l298, l299, l300, + l301, l302, l303, l304, l305, l306, l307, l308, l309, l310, + l311, l312, l313, l314, l315, l316, l317, l318, l319, l320, + l321, l322, l323, l324, l325, l326, l327, l328, l329, l330, + l331, l332, l333, l334, l335, l336, l337, l338, l339, l340, + l341, l342, l343, l344, l345, l346, l347, l348, l349, l350, + l351, l352, l353, l354, l355, l356, l357, l358, l359, l360, + l361, l362, l363, l364, l365, l366, l367, l368, l369, l370, + l371, l372, l373, l374, l375, l376, l377, l378, l379, l380, + l381, l382, l383, l384, l385, l386, l387, l388, l389, l390, + l391, l392, l393, l394, l395, l396, l397, l398, l399, l400, + l401, l402, l403, l404, l405, l406, l407, l408, l409, l410, + l411, l412, l413, l414, l415, l416, l417, l418, l419, l420, + l421, l422, l423, l424, l425, l426, l427, l428, l429, l430, + l431, l432, l433, l434, l435, l436, l437, l438, l439, l440, + l441, l442, l443, l444, l445, l446, l447, l448, l449, l450, + l451, l452, l453, l454, l455, l456, l457, l458, l459, l460, + l461, l462, l463, l464, l465, l466, l467, l468, l469, l470, + l471, l472, l473, l474, l475, l476, l477, l478, l479, l480, + l481, l482, l483, l484, l485, l486, l487, l488, l489, l490, + l491, l492, l493, l494, l495, l496, l497, l498, l499, l500, + l501, l502, l503, l504, l505, l506, l507, l508, l509, l510, + l511, l512, l513, l514, l515, l516, l517, l518, l519, l520, + l521, l522, l523, l524, l525, l526, l527, l528, l529, l530, + l531, l532, l533, l534, l535, l536, l537, l538, l539, l540, + l541, l542, l543, l544, l545, l546, l547, l548, l549, l550, + l551, l552, l553, l554, l555, l556, l557, l558, l559, l560, + l561, l562, l563, l564, l565, l566, l567, l568, l569, l570, + l571, l572, l573, l574, l575, l576, l577, l578, l579, l580, + l581, l582, l583, l584, l585, l586, l587, l588, l589, l590, + l591, l592, l593, l594, l595, l596, l597, l598, l599, l600, + l601, l602, l603, l604, l605, l606, l607, l608, l609, l610, + l611, l612, l613, l614, l615, l616, l617, l618, l619, l620, + l621, l622, l623, l624, l625, l626, l627, l628, l629, l630, + l631, l632, l633, l634, l635, l636, l637, l638, l639, l640, + l641, l642, l643, l644, l645, l646, l647, l648, l649, l650, + l651, l652, l653, l654, l655, l656, l657, l658, l659, l660, + l661, l662, l663, l664, l665, l666, l667, l668, l669, l670, + l671, l672, l673, l674, l675, l676, l677, l678, l679, l680, + l681, l682, l683, l684, l685, l686, l687, l688, l689, l690, + l691, l692, l693, l694, l695, l696, l697, l698, l699, l700, + l701, l702, l703, l704, l705, l706, l707, l708, l709, l710, + l711, l712, l713, l714, l715, l716, l717, l718, l719, l720, + l721, l722, l723, l724, l725, l726, l727, l728, l729, l730, + l731, l732, l733, l734, l735, l736, l737, l738, l739, l740, + l741, l742, l743, l744, l745, l746, l747, l748, l749, l750, + l751, l752, l753, l754, l755, l756, l757, l758, l759, l760, + l761, l762, l763, l764, l765, l766, l767, l768, l769, l770, + l771, l772, l773, l774, l775, l776, l777, l778, l779, l780, + l781, l782, l783, l784, l785, l786, l787, l788, l789, l790, + l791, l792, l793, l794, l795, l796, l797, l798, l799, l800, + l801, l802, l803, l804, l805, l806, l807, l808, l809, l810, + l811, l812, l813, l814, l815, l816, l817, l818, l819, l820, + l821, l822, l823, l824, l825, l826, l827, l828, l829, l830, + l831, l832, l833, l834, l835, l836, l837, l838, l839, l840, + l841, l842, l843, l844, l845, l846, l847, l848, l849, l850, + l851, l852, l853, l854, l855, l856, l857, l858, l859, l860, + l861, l862, l863, l864, l865, l866, l867, l868, l869, l870, + l871, l872, l873, l874, l875, l876, l877, l878, l879, l880, + l881, l882, l883, l884, l885, l886, l887, l888, l889, l890, + l891, l892, l893, l894, l895, l896, l897, l898, l899, l900, + l901, l902, l903, l904, l905, l906, l907, l908, l909, l910, + l911, l912, l913, l914, l915, l916, l917, l918, l919, l920, + l921, l922, l923, l924, l925, l926, l927, l928, l929, l930, + l931, l932, l933, l934, l935, l936, l937, l938, l939, l940, + l941, l942, l943, l944, l945, l946, l947, l948, l949, l950, + l951, l952, l953, l954, l955, l956, l957, l958, l959, l960, + l961, l962, l963, l964, l965, l966, l967, l968, l969, l970, + l971, l972, l973, l974, l975, l976, l977, l978, l979, l980, + l981, l982, l983, l984, l985, l986, l987, l988, l989, l990, + l991, l992, l993, l994, l995, l996, l997, l998, l999, l1000; + + synchronized (TestLargeMonitorOffset.class) { + // Trigger OSR compilation with monitor in the OSR buffer + for (int i = 0; i < 1_000_000; ++i) { + + } + } + } + + public static void main(String[] args) { + test(); + } +} From d44b5dc7a634b08f27f9a3e71112607a12023f8b Mon Sep 17 00:00:00 2001 From: William Kemper Date: Tue, 9 Jan 2024 09:09:35 +0000 Subject: [PATCH 119/261] 8323021: Shenandoah: Encountered reference count always attributed to first worker thread Backport-of: f0e2e4311b8cab160dc9e35f43e9ae5a145c5e23 --- .../share/gc/shenandoah/shenandoahReferenceProcessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp index caa5416cd22..3630514f5d9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp @@ -362,7 +362,7 @@ bool ShenandoahReferenceProcessor::discover_reference(oop reference, ReferenceTy log_trace(gc, ref)("Encountered Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type)); uint worker_id = WorkerThread::worker_id(); - _ref_proc_thread_locals->inc_encountered(type); + _ref_proc_thread_locals[worker_id].inc_encountered(type); if (UseCompressedOops) { return discover(reference, type, worker_id); From c21a12d44165a907b1875e02f1676aa7076f062b Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 9 Jan 2024 15:17:46 +0000 Subject: [PATCH 120/261] 8296631: NSS tests failing on OL9 linux-aarch64 hosts Reviewed-by: aph Backport-of: 6e1aacdfba5a32f7b071eea8039888d275827e83 --- .../pkcs11/KeyStore/ClientAuthData/cert9.db | Bin 0 -> 36864 bytes .../pkcs11/KeyStore/ClientAuthData/key4.db | Bin 0 -> 53248 bytes test/jdk/sun/security/pkcs11/PKCS11Test.java | 30 +++++++++++------- .../pkcs11/Provider/MultipleLogins.sh | 6 ++++ test/jdk/sun/security/pkcs11/Secmod/cert9.db | Bin 9216 -> 28672 bytes test/jdk/sun/security/pkcs11/Secmod/key4.db | Bin 11264 -> 36864 bytes .../jdk/sun/security/pkcs11/Secmod/pkcs11.txt | 9 ++++-- test/jdk/sun/security/pkcs11/SecmodTest.java | 2 +- .../sun/security/pkcs11/tls/tls12/cert9.db | Bin 0 -> 28672 bytes .../jdk/sun/security/pkcs11/tls/tls12/key4.db | Bin 0 -> 36864 bytes .../sun/security/pkcs11/tls/tls12/pkcs11.txt | 9 ++++++ 11 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 test/jdk/sun/security/pkcs11/KeyStore/ClientAuthData/cert9.db create mode 100644 test/jdk/sun/security/pkcs11/KeyStore/ClientAuthData/key4.db create mode 100644 test/jdk/sun/security/pkcs11/tls/tls12/cert9.db create mode 100644 test/jdk/sun/security/pkcs11/tls/tls12/key4.db create mode 100644 test/jdk/sun/security/pkcs11/tls/tls12/pkcs11.txt diff --git a/test/jdk/sun/security/pkcs11/KeyStore/ClientAuthData/cert9.db b/test/jdk/sun/security/pkcs11/KeyStore/ClientAuthData/cert9.db new file mode 100644 index 0000000000000000000000000000000000000000..f701c4fc2d42210759727d0cb29fb7b7dedc9a06 GIT binary patch literal 36864 zcmeI52UrwG8-RDO7r2!orx@YX5TwcOH4aoF>KRZ35mB1r0S970qJRdC1r#JiiCChE z4UH{I1b@Ze6&v;%QBkafpdk?yev@C$ZCQtNFo+q=NWKHR^?mCK;J9u(w4MDVqcwMAEz9|QmuXzO~so87NcjFS6^RkOAc|-vLQo#273(+kqy#@$b$TQ z0)n)#hJOBj1AKk@4U>8G^&dLSS*9bwN`X}lRt1#l2pB`bC=J}zz+DZ!3$tjHFi^oj z4FfkAXkg$D104(^LEuiSA`Ky}k%T%Z(ohf7LXl7nMM6Ck2^CQ!)I^a`6-7c_6bY44 zWE2dU<{8>YYnB^iTC<$iET=WgY0Yw4vz*o}r!~uI%?i4#f-b9|%PQ!y3c9SCPF2&X zYC2U-r>YI9v}QG}*^SOgQ=({0a@t-w3Cqf9d*yVS6?D9Uj#tp}N;*bK$0(T?Sc{T` zwJ2#aN}7z4)~}@XE9v8)qRXo2vMRc)ilz#5lBAr1l`|r2y#~gTbml0%N}*J!Ukqum}0J>Xv zQI8W1P!tjk!eQJyTmh#Yy8}KN8v`TX)RLAWn#{43NX*+Rv@};rB$xz5OF*i5nhDk> z3rIAiw=Ma{_e~415|EpPV{5TcSPX3H$7LT_w&bJpF2b}$oty@(divQdA-MMe?tXwo z@L66$#E1v^)jJ&Q<1)WotPhAQcG!BQ$Bcr_U82WLS||Qhf6TriA0PAm$)oatYWu=- zt5dF?6uII%x<3i;eW=DAhc{9%e5OkHhwPs9mh3*&)^4}RFH3Sib@skK$Cb6=+0ywA zJ~wBywEK&x4eBq#swF=yc-XPm&F@D)td$BM+^)FA=^S6lcMWoR7I^!=Cls5iC(gt^ zy)irVRQ7h?%>jwCZnGX_Jzqbic=d&Krd>TvSL1aRss6tVzjtV%t98+=tnATylDA#u zj$ArFHEZ9x!uQ5}8$7&{clX)0vcB_GqjMHoU4HPa?w#{rxbfMQcFBXnLms<_;QFO% zx6P+6R@K~oI@H_Sbn$^@U#%5>6z+r1STVidT)B8&>32^9Yx&k|L|HMrLb|05{b}x& z3ZlPnC~v^1P5Q)jt{G`PFC~6f-9K3I-P{G(C%^cPJuE%rJUY0bsPw(iiYK#1Tc>=y zsc@rb=bFL}oX7DY=@|+sbKKHW1b^tby{-Owvh8u(G-%)8C!0c3CtTk0O~c0J)4LU( zAJOu-6*_U9RHlyOBl992-E&?2l*bJZ$lp8g$`13J$G?-GOH5iE<1+94^3)Xq>8P(y zcboj9ZT>j*vN-ASuEClWQM+2& zogbVLR++mx-K~&UX%##FQIyhpbH@p*^A2~Pt{=RAx-eovm)*yo2IX zu1iMwOdGzt-YGIuYgX2!(e5B#YLkB=twAgP%mUrlpIa=!0!v7g&KPh{$Ik}#3#45S z*^ZKsCOmc!hi$=4NzzY{v$)vK0drh&m<6ms%r+1Usn;#?>e0)2Z` z>8#~sI-ZfoX5lQxD$$n=Mrnm*>fK4ecK<&>#=peXwsQI{=2*QQ}RzTZKMU+_F|51 z`emzx$>Z*Z^LE?c`tjZk6Romb$gQ4uNtHK!&XzrR$qlw5px?$L8os?2!IEKa4ae_X>i^d@|$H{6>P^? z_Lsd@D*K0Z{GlR#TiBVfY2NnsJ1#9u4a)G4u3xAd!#b$%yGi9*BdrK)xTx^?_5Puy z&mRpdSX5t{Tw?O|$|u?nu}-UEw7;IXbz;nbyu!eJQ@RaZRl0TiIs0WAmnq|Y2afGx zB8cifV&OH(J7c@`vma1hJ$b}rkJCGo&P#3_>eOehe;yf7aG>fxc4j<}pXS*e=$&VK z9do|uK4*ZaWb+5v3pV!UsDo?HXY`J(&WzX?9qn30Ic1e4@ZA5Plu>?fsvLVT-GT-EA7Ry}uvin*6W!=(kY4dh{Rcw1`5I_H2CriJ(g76hVSj}43q}=NG z%41PgnF96{=vJ+;EGx{iHH-g?|2YbXG5&`F{s$-1Dxozkdp`%boj1d&rLQ90RdVR7 zG^D#+11>P(?n`}(BEws@1bV7L80pRO!v5;l`AcIQSV@oZO$%zKF1EY8?)JHvDZ=n5 zZcb;x^KI#|H689c?Xi;h-SEhczjrgxroyvsKvJ)=QDnk4BEDPdV~Ik^kVc-=}UgODMIyGvDK& zMNCY1WNhWr%k}PK)?FAAR-yY`^Wx6I6Ft%bSNA+0d{TO2w!bK_mRIL@Br*R-znnXL zJU3WvPY`eH^mzV@#VhvOPYXPGf7B|ok|OF#cIFFLi<8&z#b);>AF>;`^7|!ww*>7; zvW-h}!%vSgf44zv=oQieSj}e`jvb7Tszj*9{-RZ~yQ+$5CNDV_YWh`}tvinH4uNt9M%N_{t6lA%6G}4jFzvHg*-0SJtxwACvY?|n<-K7uxJ4O8x(C|5D z$=*{%wy`;>6TZ#WPEDI}rl|K1tKKc1)MJFv5$c6qb@*wk{l;DC zzg9o_v&`9!!ZvY+-~Y2PqJlULe)E4!Tp)^w4MZNXgqTNUz12g2lp_L&03v`0AOeU0 zB7g`W0*C-2fCwN0|2hJEwmJNhh?v=mn5~f63YaY)-lKTc%?OyrF?yqdV#BmoU;nSe zi2s5+09T2hi95tu;ux`?*iLLF*8S@a12Py9Km-s0L;w*$1P}p401-e05CKF05%?Pk zFjxPty*t3<;|bYTI6dVOmx%fJ;9K@G7N-X90L@b0K)(z!b0)fvNr_o~C0(5orE@ zFqDI9-}t@?H2*(z@?abq^L}Xle>j;hn*SfZ4°>Vdg{(ft2t{(m(8 zKNk9i{+WvA|Nmp}NkH@eqxt{Q{Qrilb2R_|KYjlHQ22)fc>Rw{yfN@W3nG9BAOeU0 zB7g`W0*C-2fCwN0hyWt+S^_gw;^udrw#?n;{qAq;J?E!Eovq&QZtQpQmcJYQ+g}3A Hy!ZNlT;&TO literal 0 HcmV?d00001 diff --git a/test/jdk/sun/security/pkcs11/KeyStore/ClientAuthData/key4.db b/test/jdk/sun/security/pkcs11/KeyStore/ClientAuthData/key4.db new file mode 100644 index 0000000000000000000000000000000000000000..3c489989b0a7dbd518219864414651a692a6d327 GIT binary patch literal 53248 zcmeI52UHW?+O`uy@4fd(7YH2$se<(0QF@gwARr)yUIeLDP?{i8Z1mogA|gmpr1##X z3Ft?nyn5b~1Dy4p|6k`@D-$yFWS+h6xpPfsPiFRH(9u$L@U&sHb-n6r;mIffAOrw` z0BJ@>004k}_{2MW9u4S+0qW6l~g zl+%`%(UoV^m627IXFQtA$nIdxsHv@_CZlb{s3LE~sHd)^r6`i1KlSYXdPTn3#aEuJBd%Ti|zu@=NOHYWqF^G%HR< zRzq9&ETaYF@Oil2Ecg$f0o}q;d2Dx za|D0Qfh|Q40$Yk8oQxoxj38WJ5Uwu>Uk^g?xqpnwppz^@Qi;8zG+`mYdX;a3QIx4%NzTmBWoi2e#;Sbv6aKEJ}>)!?Ll z&HY_X_>XF^Rr0fd$ZroKM;?TK`#lVg{2qo!We>wY${sEFaPE=c!|-UqhvCtJ55uDc zABM1x8qC9C2>ZPK3Sl3*U!nEy(B^k&`&S76(EKcG`P+^q%#O8?1;pAC0^txqL8rLL z^sgGm-&?R5-|rZ7xJSW+?N!hYpFn~=Scvy?0t=A?k^qvxKNE<-06~GMr1<#6f6tK; z3*rL~ANcqH06sBs2rhs)#4X7G=y6p1Fb^yCzZvkJ13nzq2LXXk0LCz(!-_?)W0u6r0Pf8CYV7Mz)F<&$ z7l%YdnOAxi^`TvUnBW^xo&AEy z(UO=E(B`4ANMYN@#jhh9+KP&JcWYA~Ji&6iqy)VAC{QkjA1Ch1=M9}r4C*ZG2-|Wa zFjRXj=H)EG1yy5o1=Bnm*KFQUsCc()^y&pefzL6C0RMf}D-9Iy&zc)PFaE-6Ji8oX zPVMEB_u`o(-PaeCs7p>pL7@T^KmZUD1muCRqvLRfDTZz10ddiQAP5yIDIXv}(eHJ3 z*I*}sd3{OM+1e)%6%-&4H3$gMk~C_#D_(wuWDrO2$^*75nvWUVIltkLHC`AcsS6Nl z7Z>Xd?G;JFKwYra`mg~iuE}0W^`@enSGHyS@JzzOQ!`l9HJtj@mFeBgjll%3VZQ*G z_u})_5jVy-^xQg=QK4gA&X-~f2#tsU*ES56^S`I|NsGoqs!gR0l+8K5px=+`-ugll zRXRzcmDIM3^EKzuwIIHwl5^1Llv`FksLKdLCKM ziFSO~w{~}jblBd=$v&$3@U}WmNmgS)l+x8P@bF8rOq%2#~YF~-ydbz=hFLmw4Lw;`%%NogD zPwA=orB{y=@KIko`)UyT4vAlCNu?!E&DZtF4{d$gQu09B z;HU3 z;gn(Cj9p(o+jRb13gp~QzcBfhAYWdn-k#M$?swLC&hyKk7=SnWhfR#|Qlg<6S1E6Z zwaG4pk2j7I1408yN@JzU^b-a~)$BIDY@$~)~#2az=40?t3$Im)LhqMG9tbp!RLM@#2C{8$kCZgwGy+k}#( zU_wo2ndw?sMpe9{fBL>q37uH&jCjk6-oI|OV><0#I=xX!w0@8gsk#jivbLmL*j3h2 z7JNggZtO!DufoCBAbCJnx-cFsAZSt`Q$nUA=tuBCNp8mwE&h_I5xN)eGD`f+K5xL- zj>t@aH;@JS(;&&jj(tH&HxIA2TdvwzAEL7|q(Qr5}B|T;fo~zNNgp zL|*Fchm6UA-M6cCyN6y+`Tg`=FPGAyl~S%3-DQ}^#r};J|MtGq!t1_*)`{8jpb+xB zGXioOEOv4evWsdik#yieNt2>Qib%C+-AiJdC1+$*4AZhCgj$n$s;p7HISW2At7&bp zyDyeJaQ^6czrFqTT!1c1;>#B3^_e8U#fJk2VehLtAKs_3l&Em={Jya!m2K~}IF}tS z(SF#f1A$>oD5u*KK@aytP#>u1(c@^>^Pkxhb^Lu#l&4ayww!0|d$s3f?%uQ1K=6xB zgFp8~FSyXSgzz}sEz`_qCU`S8(9tewT%bWJ5FlM_Yo$AX=Xe4 z`U?Jgx3g@+w02|j-;;1_@n9{vCxT|F5N(8c=HdR!-7{+kB;=gsA*>BVu+^scg!z8n zUJwO4YIYt_gTEB|cwHnXY`~W2_H?f^-EAP= z0s($6v|O%E?=$n=Xpyi6h%SPq@{X$S^v|GsEU2jjuW+{ni-^f)!aATZrCIB$AyFjsxD=CbSm&ST(L3$CCz7nraqg=AK&YzgN@>Kv z_t8_CI7t9RSYEt36&MOv9hKG|H(Ye1C6X!OmXJ7rXv~}9H8Xf~s)H5c;(Pn(1gh9h(1?#3KSI?gjUKLeohrRBzo=^dPlGYwxY{|mDn2*smHRzz_mz1G zuo!%^Xa!8~VR~*3P55bD;*NCQM78uwDbn z;y}^NY$*E3s{GGwB;PR9WIjG4NaO|jJh@%MjFljDA=TB4vNPBXq zn2t1Q*e6!Fst9A3E;~;QH(y6LSuYi#m3_y!=U7%@rWank82j@~4L*m;l0ix*I)tk9 zBvYl{qf3nx?w4X~>uG6~e8B5)Rj;Dlp)`ijrFjnsR~7Wv_L^qxUN26mv@Tn#bJI20 zW_=4PFh=+6yHFSA9+zF6RKJid+k;Sb_+0j*Plx=m8My5UdbP z6AT@O$N@T7Lf#y1ds%f1ds%f1ds%f1ds%f z1ds%f1ds%f1P~HH1p$C)un{V31cHrFKp+6t&*T4o0KqQ78o?aF7(qY6>d2W$0!RW# z0!RW#0!RW#0!RW#0!RW#0!RW#0!RY?jRY`2#IPR-qy3tq{+fb*O;ON6#8`)UlU?7Jr67K?C_t6$Jj6Y% zr-EA$4VKt-iKmQc2&49>PL}B@o^78w5)rx&X-$@+)s|zR;av2@#*L}Lt@FAKI+21d5AwsB( zImW{+`l6eJX}ZLM4XFkI0Tb)cpxD@cDzbowE7&WRC@5@%C_qLCHag}{85FEPV^l`Q zT)Im-#`d5o+o+rpa;@apr?W|}Lv7Fn*UOCJxqfe;U$BE;C!F zVpE3~$%!*GW&dxhGI?G;(Q+44)mr?@}8Ryv{`CIPc1KPm1wft6N^%2Q= z41+wMzKYqQDL}!b$Ga3fh0DU|ybGn*Uy`?Jk}Ahc9^TX3>Y&Tp>UC4M`>U|Kmt4b6 zbP0L1Z;`<9)RDtJ&Z$+0elPqW5%#Gut;m!TsT zZ=Y%kCT`=)qGR~Zcb3B1jn3!^%z_0r)_R%IPj)G} zmrG5{MZpv9gJzecLIZWjnnpm=*G#btf+8M3*@4W7DWn z9sQkuyygqdvmjvpElXqajRJ8-R*oRnBaJqqNi|~S!9|K*Bo5dhg~=G5O26o zL}L6J1I?^FV3tHwF;W zjTzI?G%jSs6}l+-47%K}MeSuUr*?*d@s4+SnwIF9y1xG%xd93a+~C)jy!gaZd3IJ& zmZ@AiFWOIfJR7Ju(Pfd{Wu*g>sfoba@fu5#%vlB?fb;rKw|- zW5>({(*~%m__|uN`7Y}Nks&A;=UA7gYKhSO2P1AbJi7F;5|@qPJ2?hON}pX_5>ZSg~nc@#fyG<^z7kg@mByLB{tJJudh8 zM%0tA3$1h|pIoe z61d_Q{T3pWQ0;`9{Cq45mpA%Vn;oR{v zB`a99;KU`h;C!o~v=0n1wWKl|9A6w{(ZKl(1*0D8@>DI+&7wB}<`WHJjXvdgrccM@ zwZ?xCYk`urV*0ZolO1EhC%ViC9g2%v{?Yd=xEezwh2q=Bo|s)u?9iG?ejU!^l`ET2 zFz9%fr)h~QRJg{^Yj!J%Pbl#; zrX@n3UIXtzpk7bW%PpRI`3}>y(6!F#5kLjzwiyEN+^jj#W#|_oE`Sw=Iaq77wRsBa zBc}MSv-aWQnz!PE!=rL+O4#-PoH!T&91MbSf<}TYf=~imf{O&~1X%d<`0w!Z@ni5^ z@HOxu_(XW?c-?qKc*%Iz@C@)o@u+aW;SS(d;ilr=z%|2_#%0Du#hJ!w!Fh&r3&#aV z6Nev%^pC@SWQZhyB!DDpy3$Z2zjua$FX220_;5ue#vlvJhqjS?j;* zG98zNFw%o$;H>`a%d`5cGQ+WH2tA^-o5v48us!elj8bXaI{Z}s}Kh?2m z2qmKQ@7_U*W780FMCsrCVPwaq1xb%f3qwebOAA>NADgxyIyNmvcx+mf08#q)>2>^L z(}H-%rG+85$EAfVagI$}U>}~n z9FPQ%1ds&&{}M3cM57agVjgwR$ToeA`VzMejGIVURP7;_$*(TWg-Afy(Q$tLWC#}x z2!c?dl5V;(CeJdzp?RSbPl9QiQA;|OFNXpIq7qh2E;!LTXKIiPEA9=yyoS8`X!D5|YN4M!2Ylk- zi~4E%`KXkOe$+W;K@U(q^D5!BtC-#V_V1v~?8lls%`ZQ2p|Wh>UHjQVUjcXQ&$4hm z?T<<;B8xHuwpLcm-5Z%b(d38$$7Aigz#j7SN6As^AByhe^+2By(|dsmXU?;H_)G_7 zW9F8Dr?FY@gSh#z{!^|CkAq2)V#g^ZBCl&M^2J` z=R0Uv$;&wIBaKOABX6+Dm_3AoX^(e#8kRW}J9<8qlr0}^+cmdCAC0JR-F?mcW-@Vdh`o%e zW2NUrm%ScumK6d=-+cW3ELi(f4gixx1k#;)$x|=BKYm)qE)fc*LFn@LRTZaT$!%}+ z3Me_g0uqM88rm7YgP+8@=2G)dZv%xejb=M!F z%TLoLtjR8;w-G#sf~k*pc^a1Dvs%In57#tsrOpU|^&}E5{REqEUF#M&S@d6XWrQ++qJw^U;fxd6mq& zFFp~~9CeIc40ikv0`UNF2eHZyC&&Rw07>9q5{SV7L4l~G`1r(sFG5Nzhz~e?;Nt@T z_{78^xB%i1w;=zc$5HXaJgnINX25$6_;6Ss1cd#2517#51kt@ffUp6UJp8*8uqS-S zWEFocahghEaL#;slLBjMWOfLZ&S@TlSC4y3XXIOpK;G)LU_j(RxN%!liE5#iYsd)7 zRK#|U-R3ybR#Ztgptt{zQEeFLiN9M3i}@XHg&8<%bEr5!Kl*SnUf8_2<#Y zw~B^k6NJoTlgN9fwsvSc?}%W4=2<*dE*UL}83An`3X2rBeO&xHvZ1Z0hc180sV>{Ax)XEG{u%***wYyqJW5#ZW}!E*lh)IMp^cu2LWw1KiY z#~1YbQQcc#Xrf9dNwkvMmT|u3Ji69|+WgWK*F&hKJF53{07@z-I!yCC*sj1yaF`@R zjZM(3S})DiEVaw9CY<%kY*KK3MsxZdF`D*5PSUw}@ePK1ip=b!{vyK}1EIMQ#Sirp zw@P@=Y0CObJ8E+>&Q_bUNzz%A$0f!Uu6i(~L!iY7fbmEqPeqPz-Yk=xlj$ZQFnqxL z(HaH}8bQw^%Q?}G@A}s6?vM`K8#&oWRUh6~$0^BbEQpdiZc-0Jx;f*lyi951UX8?D zdo}lvuvx&-SAM2cp>N>uUK!oxcy+l;Tt#0L+0W~Qs@!v|u<@iUTheM@iRgN{!HO?+ z?Z!iXZxG8G$z4zBsrjW>j}!7nblTKQ$0{XiNqNee^g`+wRoVM$5c>{^UusFEB~Q)Q z^~euxecDp;K-%D^?|XS@7dxx>z?s7CP2H zdgzd+JgaA^u`}V6Vcv{gUq0J({#**=+)lqR`IaDGUZ~!l)k5xf)_KnJ%bys4H~NQ7 zjPO#Tp&C~yZ-}+YE`^UbjuHbx14&9_rONePqx+~aRsPwwBK&;AW;*4%$Q(n^3%7PWk9OlUSoByFsv#g0*UFM~{}3+|}Jds;Lk zpB;9faWk`;s4N>$*GsXcx_Z;w?sKZXE5U!bsb^v-2Y3+QG^@?MnxdG~oiyKiWCUrz)bF;}&%T^`=Kl=REva z5c_U+A&c9DlBHlmO=p?uT3AL^yrX~mzEBCBSnZ5>%ZlE=Zna}N?Or;)QA)IakP)f6 z4G^-nq+Hll)>0OHL#b};Lm98a!PX#oKv%jj9xWhfQXo@8rX%P_@IXm!#}F<4lBf~7 z7wN`&4?Jy+ODM^ zeY#xYP{h8ayu3tS>g|V&$${Ost984FUQhY`^j$BP(xR18t{2^9n8(HbjTZm*zSF|% zzJk_?+47(e^1L$wavLmmauc$PYA%s<;6X`~qD6{GwP@W-Vw)vrWK;~(vLu9BlX$AE zQN1|}J~FFmZLqs9mOOC&=y<=q{q|gdE=%Ie7U=bvB)`Rn0|#O6t2!Uvr?Ql&aPj=U zu_l#m@3lCW9WT*-*s248VN58e+Y><#_e4-1sOZt-XxHo zo!)2WyU`+H4G>)fOXVF^-|3%0_gGL<30~oD2^JBP&4w+Nz4T=dQxASVE`2@$S9-;E zq~=~hJTV}+B6Ao$P~fbKpDXR|{;e(mH$v6h>TOmktxt_iud0V`EYeapH8eNCRf)xu zgo|PZP1IYvT1vClRYRgk=y53~->}X<&!czRcTXf)o#Wh9{ee(b*Ok(Uf$yWIGI5ds zh_JkPbt*6vt~x5MJ#M(@MoT19!Yv_j0MVE?#cO8p=2QnO#Krga(Ft5@yygnR9zdvC zFH*m=?JdsyL79URq+ahvy_rn`SAEStn)=Y2E1=I_iSemrW%_J|f~Zelk@_{YrTI!v zY%1JXp`Z~THGYJuQ5rp5@j6v{VSZ87{GSG6z;U&6a8-P6)+_gW-0my$5@0d-X3+|m z-oy0V9GdXcy2KsnyoqY*m&h%=l)><88v*_|Y$NagzKtNd58I#HNWNjH$$Wf9kjM-4 zd2+ji87o2RLaM77X$|awHflA2SZ0Y#70t_OgO8PSATpMO$#0qOnJV4Tuh`|X43j4s zX8Kp#h#lc{@W$Fi1aC;qI@q6<;(T@J*>(KAJFWEX8|wp6ZOH zFv?k0wkT+i7DJG8+g{Sw+02MKP3n~umZ8z%H713(z9Ua~Tk)6El>2(PI%tArE+br* z25Q|@kcR6*v04uW%&0;H_?R1Z;p>uQi;JR?*@?b}PG0gm->r6*erzY_koM=(7d5(E z^xKG%8;2-kYJG+fs@{67lR9r2pW+v3PYxB+ktPlM#0pmxVeHan=ZWFw>*yxyr6RPl z?-=(S%PP$D!iyJUf1atq=TKQPNa;j}P?er!s?>XQsgc6{QfzHKEv=Fdcpa|lRg^oF z2J+0&w)c!<$u-!{VYZw#zRA7+DxfAy^RWjD#3_9LWse^!LRE)>^|H})C%*@)l5G-~ zY2Ldu?*ZYeg8tfG)2!X=#VM86WovbAx(3^cZUPva6Ho7qVr05ULKJ z%lA6KeO7I`Dr(0|6x`a=v{b!eP!eD@tuH=V<6O5@>T^;XQW+59LbhIJnOn+&Nu z%Cm33>U>eBRD*9Lu;YIebmhb2|HBb-KoUR_KoUR_Koa=33B(Yfo$lKf?A%x=;ONX) zkpIz={xe4;U59f2aBd9Iopt~Gw)NbbhMeiWbT^7$$A@!ds$`96Jg;l8y-iD~zj*8{ za>S1}$*JL8mUdko;&FekNKD`{xrs^-c+KwLNwh`9S(Sssl5(MfNrR8yKa8H@c@!HC zszqQAx$||G@k{6xY(py(1Gw^nV_0ab*Sdw$0&l&n1il*p2^fugw?$!<^yhXtqzcxU z-PE|6`D39a?fx*?Rqq;Q%`X1J`q|{juUhJ)=osQ(Y}3?)!$Y6UDiYfa7nj=Ukvy27 z@wRIKZu&k*j$)p4AzGy$6}>t6TK;T32B*!GuQOUsmLHP<&&bD5U%O%qGxI-oEE?G? zDe9+)Yg~zauB0%=+(r1V=C)(aZZz!MVh~Um!O_j636_*yXl-|&rH%MotVvExQ|CU| zH;f=4W_~0WBZ?UGx|&f^67G&wh7uWR#XIiRgXvTu3n~h!z~DR&aXR!W%_#+ZosBcI zjxj1vo7Lxw)-p2%Y8$q&Xb9dHMo0N%?%)l22}XHo#wT zC3m}H-=NZ&pVEId;7or19Sb}I#;%2Z@N#T3Rgzsx?p%(K`@n_gc+Co!CU0cBogd{GEeNx2 zJAKxws@_~%ve?)cMtlxoexR)R9{FC=%_l=!U7yMCg}W@4!N5TyoT_L(<;L@O-C@pE z6#4!-->ALckuyrY)7#*)n%RRL5pmb0uagl68wJxVy6>QLG_@)gXY za~GOp<5~9fqrlkrSwEeN=uhnC1z9MtYiUQV64Pc{#6xk5Mb6053O|?P9`{%Mwrryj z@Zj#M^uzc&^wJkZtj5AOs;{vbJ8)Se_Pv?Og#8`I&@^Snu*=lOO9!BKNt+k zYHMg(|1`DZD^H#Wz7UpZ)+h!N>d_xea1x~TK{M0aUBvfQ=rJ}7R>q6-njqjPQ&>;) zFj;U^eO6F0zAi{Hj~nS*-(y0JU8X&#ni@rzh1mDI@*?bSQ4ZD*905T)iucGq{UFTx z>09IV+^zB@ygd&iqp<~Z-fh>lS`$g?ucRcFfe+lCVOiJWP9uGj2NCQR{PT#b2Mb-IsH} z(8&JkThWANO|B+N5C?WAR!hxjRox7wdix6FmB8hanF|r=+)c(iq+r?&je?I@CCRzA zo(XnSsRQJg(^89*QY;5Mjukm9&xt_~STw1ZwZBn5uTo*s(W<=6yphvN!pqI>qg4dEz%rQ;qPhZHVaf z8~f?p-QMU7boPsUcva^Ic6+l+^}$3szd71y{oJQovG7Su`cQ~VUS2cXOAia@c!SAv z>eY)8qpfd~Maa-?&vQK%FWnV)e6=r97P?f;ftJc^y=xTMZ1b7WhuCKG>tJNYP}HyE zf7H|Mk^bMFBkTP89tqJc-T&MprM@Gu#Zgh;<*1Y9P8h?n(QV|c*!99YUzMJxFNC{)03tk2otmZROpYYWs`#!>R(F5Dc}9MK z4)$ST4;-(z&@W1tNPbP(r}1U>Is2uWhT-f)lJj*9O&8>tr(M!H>kOB+SoEjv?JpVqs#T8bXdK^1=>@6cfRNc=Xh-{)+4gsS^LP+7Oex^gLK_x)C%>gjff z=NZ9O`xb{>ebgEhg4|^{$qllJUww+E6qjTKG2dKfpQV A&;S4c literal 0 HcmV?d00001 diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java index 51b614c9f94..9e6120b724a 100644 --- a/test/jdk/sun/security/pkcs11/PKCS11Test.java +++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java @@ -627,12 +627,10 @@ private static Map getOsMap() { osMap.put("Linux-arm-32", new String[]{ "/usr/lib/arm-linux-gnueabi/nss/", "/usr/lib/arm-linux-gnueabihf/nss/"}); - // Exclude linux-aarch64 at the moment until the following bug is fixed: - // 8296631: NSS tests failing on OL9 linux-aarch64 hosts -// osMap.put("Linux-aarch64-64", new String[] { -// "/usr/lib/aarch64-linux-gnu/", -// "/usr/lib/aarch64-linux-gnu/nss/", -// "/usr/lib64/" }); + osMap.put("Linux-aarch64-64", new String[] { + "/usr/lib/aarch64-linux-gnu/", + "/usr/lib/aarch64-linux-gnu/nss/", + "/usr/lib64/" }); return osMap; } @@ -910,14 +908,22 @@ protected void copyNssCertKeyToClassesDir() throws IOException { protected void copyNssCertKeyToClassesDir(Path dbPath) throws IOException { Path destinationPath = Path.of(TEST_CLASSES); - String keyDbFile = "key3.db"; - String certDbFile = "cert8.db"; + String keyDbFile3 = "key3.db"; + String keyDbFile4 = "key4.db"; + String certDbFile8 = "cert8.db"; + String certDbFile9 = "cert9.db"; - Files.copy(dbPath.resolve(certDbFile), - destinationPath.resolve(certDbFile), + Files.copy(dbPath.resolve(certDbFile8), + destinationPath.resolve(certDbFile8), StandardCopyOption.REPLACE_EXISTING); - Files.copy(dbPath.resolve(keyDbFile), - destinationPath.resolve(keyDbFile), + Files.copy(dbPath.resolve(certDbFile9), + destinationPath.resolve(certDbFile9), + StandardCopyOption.REPLACE_EXISTING); + Files.copy(dbPath.resolve(keyDbFile3), + destinationPath.resolve(keyDbFile3), + StandardCopyOption.REPLACE_EXISTING); + Files.copy(dbPath.resolve(keyDbFile4), + destinationPath.resolve(keyDbFile4), StandardCopyOption.REPLACE_EXISTING); } diff --git a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh index 00dafabd03c..5ad75ca1363 100644 --- a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh +++ b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh @@ -98,6 +98,12 @@ esac # first make cert/key DBs writable +${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert9.db ${TESTCLASSES} +${CHMOD} +w ${TESTCLASSES}${FS}cert9.db + +${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key4.db ${TESTCLASSES} +${CHMOD} +w ${TESTCLASSES}${FS}key4.db + ${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES} ${CHMOD} +w ${TESTCLASSES}${FS}cert8.db diff --git a/test/jdk/sun/security/pkcs11/Secmod/cert9.db b/test/jdk/sun/security/pkcs11/Secmod/cert9.db index a202bea21e99c8063fdce58c3fedff9c29bcc306..b823a79864fa955eb0c458e52a17be72a40bc339 100644 GIT binary patch literal 28672 zcmeI4e{54#6vy9>u3guyT?Se4N9-dJ!w7- zQT!3<6voCzFro$nOiYLfQPc$q#)z^IBZ(oHOe6%NBogGO(IBYAc<*_yKj=o{KaL+c zFMGG=o^#Llp8M(DOWOC+C3V%&ctmRL>h1`}B{x^h@jN$Ak~oeN=xL#6>d2#pDb=B` ze3pGXQ{d+K@{1fdICH^y&i1?Gi0va=yKNTj;DH2?01`j~NB{{S0VIF~{zn4y%x0(4 z#WzJeTO!YeR|KOiojpB^6QNi%Y^kUZ_!|OJRZV4JsRS{pwnj?FrI|sQC}mINfkGoF z#DbwnEIq<}ivq-Q72IW&CbRP)7yk_8_as8?k#Ib%kavrM5zW<*iCpFv&CUl>>xlOB zBqH5u5z{RqdN5bRCztir@)oDd#c%3}2Sc$)Iz4R&hE9Wjesv(5L$pO&Twk@wU*9Ax z3^YlNHC1(u0X9QLZOww}s)`25KfkuVVYU<`^pxqT(9_Lqa4?U|Tt3$Iv91rgY=}=~ zjm8=eYrL%Sv8J3gLDqz5Qw~x@Z$XhT4VmckFcq0F8JRF0nJ^)lFeRBVDVZ=WnJ_V# zgjs8pr`HF{if)6l0?G;~E1;}^vI5EqC@Y}shFmw~x*^vMxo*hyK-2?K4@5l>_2^Mh z_JFb%Mgk=nFe$KJg|J)&)~i6xZt%Oo?*_jL9u+*Q;bF6=gw3J?85PK=ps#|y3h#pk zxf9!sss>M{UTUW5rDkd@HM7R1CZ^t0z0^!iOwH89 z)J#oGO}5oo4b)`&%`n-fGt8EZ8OfNfX%jY$J~osoC&bEW(SoEUL`az|n4JL^&*_(z zRWbUBet9qv?}GmF^#Ap8Ic6f{YcIW0_-|0AcQGL~1 zyzlIxEvJ82H0Q>N_!z%3u_?Ga*6{kk&V0YDm40!0`tbe_ig$XyD?i%&+LwnG44xJC zyzieg5FEWZ@`>xGv4^j%_5aNOQTEN@wU4_5|HZ?*0zd9swXN=I>C5jv+V z@zL3h8wQ4Xb~}*c`<~`sWZX)*{+Zm=WZSf?RVUljtln)*M)r0`4(SPoQF5PBH!Y=O z&5Fnx(knbgdifE-G{0-<5mIEf&RYNE`s+nJZ_49HOfDvNv)E`dPq8$1uITJ~wln3) zALp@*^AwEp*v5Ipw1+(6EFv0F6)!25y_&b#StPTrW^^aHn&fac4L*+(lS3Ry_6x}* zcc-_KAkxj0T^@b2L|Ru(@#f1focMF>%=$fFo!hFeUNAdwaAaBgm5p<+s$)AZ-4re~ z%-T}9uI}?wU+=B#*Q$4%>HE9exr9vV<{f>59o1w1e0+S_U*}F*-<(mh{p}Oe-xwTh z-!gRV!S6RF+E;G<@XYF0_S^cK-ui9I^z#F|M@OXt!}xgs^Zy3UvB5EPKP(W}fCP{L5)%(gguLY z=RW__=l`$c^Z)n!KEeec0VIF~kN^@u0!RP}AOR$R1dsp{&I&d3j7Nqb{%B^ delta 293 zcmZp8z}VoS5FF@}S(2)dmS2>cSfXIez{0@D$l#!$z`(%32*jKd73_r>8FWAHUHlW%cLPCm+SjO1$UOaMPpLQwz! diff --git a/test/jdk/sun/security/pkcs11/Secmod/key4.db b/test/jdk/sun/security/pkcs11/Secmod/key4.db index 222adb32286ad793715fbbce368af63e54ba48f5..8ddfc4c0fa6122eaeec290dce20624107aa725a0 100644 GIT binary patch delta 2473 zcmb7E3piA1A3tZ#+|A4xvvx*`87WOjXAB}^nWRr8C6^*4p+Z)lOPf?2dxkOv6#bZSt>6@XRwst<>^S$qRpYxvc|DFH;_rCA>{UQ%W zUPrN<9PRx=eObqYf&;xmSzLe$fFNMaVgUdE$p;~oWu*xLhGuv&JO|*3JV50SxIraf z#Y=@r>?QJu1!bz}38;*P9)L08vKfqI7bYNSAV4M5WO2X2??Gh~g>VX&7@&%?(&y z-o7SWW9}C2`>C-=9c~vjGfZi6s(AST$npWINC6e;dtOWA?0`5MPza*cC=>c@yF_OYzK<|DR!Ko3$oUo%qwd?E+Mox7`VhGNI(EYgyjeutD+ZU z7c)x+Nf;19R-x6(WWmy18B@m`I%hF=leIR|{NXQ9Acz*m_0p#uBW=>8i}OO~{bPQM zc_+=!X`BcbtajoSB+0@pQwI(Ctqe(^tAoHM#G)YMwjkZPDfO&XH>l@3_flH4%l32$ z&hB9K&KA=N^_h_lmntjYyE&`J9q#AZ);zgV+tE3W>AEmrCbsVhU%S3y3U*8W=Dak+ z(Jd=4-|Fa1_x0)_XA&~cC54g zV^0G~3j=9x8iUXIrMZK{t)!^0?vPw>SoGv*9x57N@7mF+FVQh-U)AbaP-xd!F1q_$ zhgtt(ZwrgF^?+U%aN9?BNcv&fw^duZ1uq^7s?!NAec~g1ae6ibulN6BsjQc#8u{L^ zS@(3|gT#35q!Zg4JY*YaI@`CawD?SAboqB_lE&h_FB0Ot2t|9+a4v3UWB1qjrGP(c zZ9a3VZmKOu7o+C4$M3PyvXkOJ8)~kb@BA(Op5P#(*UI=RRJFX?)r`H&f8F`)TLYy1 z=h@-YmZVp@mKlwiSnea?hKdsCNju5phD94YBF&`T^5M7+a}!I~=16+vP%&pF7B?NG zU$-`!*ApAYR$A7W`rt;^k<9p*q$^cMxz^h?<}b1YORLrKx#z}V0@BRg}>z)tC*Z$9p;~1-}LL1ISZLtL?ydDTbsrkWr)aAGi5yjSz+})h=f~C-$Am75gP~eKnb~dM zo&R}h3Dxb60d7#Z7LBorQUgN#PIw0RhI=BW=01q`F*DC)V>dEFghJ%7084o5Mi>gR z583wqk%X9_S%u>X6$w}=^R;d@CwNf3rfJ}ww&abD5CI?}zoWw{Oflk_Zjn)vx3?u>GXJ^tc3^y!eekxE5NGCbC5HJuPJ{ zCu&t5Brs)3!|OjuBzW+`x+?8kT_vsyMc-2S4fW5$S70faC8G#vR>;+fJ*~xaFpW2l zYt4?17>Qv1X=USb=}WtxnxEPe1BE&$4FBzBdiw^4zT3?$AMWPLG~3+vkxM)t4`SUs zI%=Qd@6U=ag$cx)ek3t1$#m&K?eACMxlFVEGg|B9XvHF-3!1Ny9UjfL?#%D6?b@zo zx(1U&$h8*gfGgAd+inV!9C~N;)O2Ls(AI!-$;|KKPkq>Gys@iy1f21x`e(&Xte*c# z^Jw!XHAZyJF!B8P1T0(MqLjdS!OlNQzID%6f3)^;p+bBZ_#6PAgKcSfXIez{0@D$l#!$z`(%31jO7E73_tX7<51GUDI0YBytK7gtnd>@(l| zgWHdBvJY?JWMw|F$$NRzCcE%Wp8SLFl&p?IqJ;q%7y_Besiwvz#%7k92vfy)nKm%6 zGYK*xToRKX@{1!m9y^l@>?P*;49xR4Hcn+$ zjb~()HEHB1NGvWc&o4@`>D_;#{rRFFF&YO2R6_YLtniwA*}!J9puDj0*WI314@arJ zsr(Y&;Mn!=NgTJw4<<%N7J)rV*SAhIne)q|=fn~Yw}81IpE5FkVPO8UvGEl%4>z+c HC(L*N&4_g- diff --git a/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt b/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt index 60cc1c56553..ba339b25c76 100644 --- a/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt +++ b/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt @@ -1,4 +1,9 @@ library= name=NSS Internal PKCS #11 Module -parameters=configdir='sql:./tmpdb' certPrefix='' keyPrefix='' secmod='' flags= updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription='' -NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512] askpw=any timeout=30}) +parameters=configdir='sql:./tmpdb' certPrefix='' keyPrefix='' secmod='secmod.db' flags= updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription='' +NSS=trustOrder=75 cipherOrder=100 slotParams={0x00000001=[slotFlags=RSA,RC4,RC2,DES,DH,SHA1,MD5,MD2,SSL,TLS,AES,RANDOM askpw=any timeout=30 ] } Flags=internal,critical + +library=libnssckbi.so +name=Builtin Roots Module +NSS=trustOrder=100 + diff --git a/test/jdk/sun/security/pkcs11/SecmodTest.java b/test/jdk/sun/security/pkcs11/SecmodTest.java index c5a01b0a739..c1b5e4471ba 100644 --- a/test/jdk/sun/security/pkcs11/SecmodTest.java +++ b/test/jdk/sun/security/pkcs11/SecmodTest.java @@ -36,7 +36,7 @@ public class SecmodTest extends PKCS11Test { static String DBDIR; static char[] password = "test12".toCharArray(); static String keyAlias = "mykey"; - static boolean useSqlite = false; + static boolean useSqlite = true; static void useSqlite(boolean b) { useSqlite = b; diff --git a/test/jdk/sun/security/pkcs11/tls/tls12/cert9.db b/test/jdk/sun/security/pkcs11/tls/tls12/cert9.db new file mode 100644 index 0000000000000000000000000000000000000000..57acfb4d18fc2ee95695d168fb6663a8baa546ec GIT binary patch literal 28672 zcmeI4eNYr-9LM+NI9~5I5Ic;N&3BOW*}J_LoCZ9Oa|8|XgiIZUJMN$pg5uDicS*3U zw5-W$EG>$(QE^OSOlK@DO-IAVutXWhDa%F@3NxCR=y{&oJ6;CIshR$uemm^L_xU}~ z^L>8%dG>Z@cW-Xtf_dIbk62V*alf-tG%&X?EX&LiMTTKGyocgFu!Ufu3RLiac7VQ- z)k-H;TL?+=1Y(M}A00AHX1b_e#00KbZUnDR~t=8!h*u~y5 zx2LMG#OZaH`FuGmU8UZ_P@BVU&9#e}*%|hGMcO9L&lZF2;#8-E^ogk<)FF>Llsa9W z(qIquAP3qu)WMLLp;GJO6WC>Ryl|O?`Br)= zf+ng#CjQ2u9u_Ha?R+*=myp1&zrWJyD)j`12L-42gxggI@X0XlAo;@$qmMdD*=R0zfMJK|$gm*pO4MfubiAW@5Ayo^hT4jNFjxj6fRt(P%GpwsUspD67tVOTqHznBt(29M2sXvoFqi7Bt*OPo4GDSx=qy)LBoR_0(BUoegxXfsQrMu?9NUK*ySBtBJOnXsd~~ zn*6QQ*+iYqv?rw`QA~Pzym~~&>gn<7Y0d^3H_*6&#$_6jX+%~cWEL5bS!7B^retL5 zFH?V+u7i<|HPW$0I@U<3Vo!wh5}90)Bzp^qBHFpoV>HMHBk7<>(m|1Ac14mD6iJR& zk>rpSNr)7+Dg32XlW8=0Fan{(P|v+(svIyAVp0 zIJM56z%u?z%Y&u(jy~VHva+1k^Mjx3d?_e-e5nm1ms<_qxrjwf)EHdA1_Xcr5C8%| z00;m9AOHmZ8G)zLxQA7-TJ7Ya!((G)t(MW^uvV*$iCGiH#0>6&8~yEr!+)oy`F!0u z+@E8aiu>{_e9nB|eNMg6L@eHAmehap{i>3Q8GANxGs`wMIXufRS;ym-Uih^aZp43w zyOV_@1+(W>9eXL-vv>7)x4GB5__h^Q)lC^+l*PLzG@4tTcQikrb&dax-Ml+vf7*o^ z*ZU@=H~oGzb?dc#A?ux~RqEx>RJ}7{M^oR|zQ%%w1lLLFVEvp!2VPgdcloOyj@3S7 zzWvI&#@crqrHd6)9*J*%;&8msw|3L*Qx`dB_C{&MyDa4wUW@5Ed1B++wWEs*7Hsd@ z=Lmb?`!!MHgek|np3MJ4_U2YiO*Or8yt!}Rs*JeUw$M}CXE*mQw_ZAOwR6_B^&Q=Y z0!X0mPUa=k8x+(9%FOBsTttAI0M76yC*mAe7zGPB`lpeQx^g**F zZpuW}*;neWPGiX%K!#oGW|b9uwv36*jvcT7+46wO4J29N8*M{Ye3)){1>0~KCo*US zQ4RMKs$pBV@*K-?oHiY4)Zs~WbLxK6uxw-qgA$~%C|=FysrXT`4v$-$gWqZ9dVH0l zqrALQv{}(OoklX_M+Nw9)`0KRmgqDxzL5@AZ*EY-jvqKF8^Z84tia%`BDfly@BjVm z;dp%h)Z+&dC|Vs}P&bFI>q%!>m5S$>RwUr189Pc9hSV(Ehd-Vuk^}_O%KkYJD_%>C zm1RWJhbP=jbDb7!lU$91BNA~s?vpaU2TII8kQ75^wo=V=5EIiVY6_FC2 zvg>L@C+Bt@om@RGG2XNJqUzD@H95#ajBrjkJz@?I5(NT400;m9AOHk_01yBI zKmZ5;0U!VbLirf-&Hlf0|KH9CokBaH0|Gz*2mk>f00e*l5C8%|00;m9AOHkLAc1Ip zGCSx8G`L&%$>D<{{`dbajBr_K8G%O#DFXo@00e*l5C8%|00;m9AOHk_01)^;5{Tnv PcDSGV<8-_nK3v0J%V2z3 literal 0 HcmV?d00001 diff --git a/test/jdk/sun/security/pkcs11/tls/tls12/key4.db b/test/jdk/sun/security/pkcs11/tls/tls12/key4.db new file mode 100644 index 0000000000000000000000000000000000000000..c68eaf0e77952c3d7c68d321ab5d419e5e8f3966 GIT binary patch literal 36864 zcmeI52~ZPR8ppen5N?79Mno{&Fe-EoLPSOkmltvb(ZMT*1O-9RByxFhsGx|bAc!vG zf#L{)VH5-u#}N<}4|K#5R6r3Fg%KQGJjNQfyOV5m2WMt$x3;$Qbbxl*WYgAsB|H(r6F_5z$o>U6l(N6(r>b`UroZKP8Ef14l!b z@&?k-a)q>?Q|h#fv<2GZwC-uSY88K~6Nm!>fB+x>2mk_r03ZMe{C^UNR9B~(n!?HB zrGk*i&=sLlfu}$!P(EsS@VvNlyl8W{?mk{LWt3(YE~5GKX3XaDf@!n7f@wj%GXjFV zXnwvl4?kaTpBWx=Xgn`}AFhYj1RDC6=?c31fno2cL8f|`!ccgWC^Sy8DiW>a3sy^` z@om1+pHEjRO?NVxN;QWU;0=Tkf^bokMB*;!a# zVLw$3_n3!!L<&MeBUMevA9>)Fzw=<)dy~ji6LXj^PkVL9@=&2v<)QYGheTfeI~O`a zxA!2Dsm99Lgi9o=L&Yi^(nmJ(+TXcw==NzmSe3x}y6{z(7|frttt4p<^Kqw#mUZIrt{lgu}uLC#+y&g)>%guwoKc2(Tgq zEhgbsh`hud5zK>*$j8B4=m=&*M=&2cf*H{f%!!U*R&)gOq9d3Y9T8%sB0YJ2xHChp zac2hZ%)p%)xHAKHX5h{Y+?jzpGx5Gmye|{)%f$OK@xE-lmW|i4@me-s%a+&T&TQP- z8E=VGqT`qt_WPIzA@oGR*xAPhP-xI$vtbFe6aHx`CEF`=pUKqYp(DI|8#DWpgxLsfF=KP7(9$lHdf(h0%R5jhDE zQ3!(AGYMqsH1kirFsh!xe7Z_w=k^-dyNWKl!kQuoy@Lf100aO5KmZT`1ONd*;J-v* zn=zaWlMMCrZ2r~I(14`}p*KA}2+}h!*r)>;Y=TnODsRf>Xg${KKUs7yrQb*U6Jb~! z#urNjd`Xyq;l#!)3!(Xk&OeTcu<|^yo!}CcRly5g+|9Lsu?4F{?{zOHP#Tta`@~(& z9uZoeY$0-fA09krd0c#j=k+KPk)_P}w!pk{+ss$Q*KmHB=NY#S$H5_M_lma{ryO`y zt(Ga65=UOVCGN0gNyX3|iEK$MCFC0Y+@a~UHG9e5^)x@ZyeZasY;U@3Q=yFhP;9%# zq%E<|gff)2d#v3&fy;XxU79N=x?_*Qz_qJc1)GePEeR+ZsOD*`e7sS|jAGk3ki`F$ z6+S1&}|$!u#&^Kbim zJ!%i^4(j+tc1V0XqQ+9Esd(LD5%o}nwV3Wcy3FXDGiS7|6{$5h_4#-hf{_%Mjo6X3 zze=5+`dSy(QGZ+Nbvo$g6eDxRt43kn|jqJp>z-Zyw|OZ6T-5r%e&U?UUyngyL95fX=cYP z%WYFD274YEESsMBw9cpUKDYAvJ9_%i$fH}=vzs!O9i6rO;13ILoJm@Cx3_puxas&S zo49X!M^2n{>BscKT2?sqSy^vNk?ZI)&*%Omi@8c#-4RjJdf}Y)&`O7#ODwfB`BlEW z%hIVxa>X#gz(<0~|{k&N_X&nk^=%7vHnew7qImnzJzFz}CtWN2rf$ zL=7T%>*Ir4O|$@vW?>>`6lTg&s0=B+NNl93ptN38<=Uko%{tG_56 z{r#;L+Z(eVRA-g*Pi=q=htE5I`+_M&2Oo&@Ci^?yH%z+V=(NK}p7%oknW;4+Ii>GL z@Uv_L<_A{}X5>jz9CUcBlXcHMNs*GYUElMenyBYlPtHXPGd1&rV^SsIxsAoT3wBb| zn+kigv!yHQf0I?4W)#60t)qJrHw^rEVvM8E;iX2i(W@Yqa8#V} zk|R|$h3P{pUEt#yV;}nMzi3(V^WozM#;{#|Z_VvZEZd!aB^lXmyuDa_^Xbbg;vF*^ zwRxxa`%E6OejlMHDy-A2=XkCKji1tw+zVI4Y&DxbFp>b zs7I&Xb>}s<7&0FS#;^FTP}fYu92x)AwWgWArY_jcvv>HsduE@k{v|c(H@ELo{6<|L zC!=YVWyNrTZ+%NwVAyYgf6kq(H5Cgws=d{u2}q}6B>JD)w`1}mHX6!c=OuBsBc6um9b~m zmxkBKT7R4RLN?Dv-N&z6-{B6sz|k&b$vVnd&%^un1c~SQ+jPaBeUmYK-aZ3A5qETD z$1EirS3g{lSKT7Ik)$}j+Y`=k%M#pA7NqZ-sIxa)I2z+J))QKcb?3%Fr{Qo^f zdH2mk_r03ZMe00MvjAn@4{AQKHV(f{m{pa1tml>X0dhG0T~03ZMe00MvjAOHve z0)PM@00;mAfWVhZK%Z!%`Oz1^$j|?KAWF}diUiCX5C8-K0YCr{00aO5KmZT`1ONd* z01)_m2vCVE&EdY~75n~wHQf;qWxigy9z}OKD!~E>00MvjAOHve0)PM@00;mAfWVhQ zV4j+q>4aoxr9dKyjTVbiekHWJ6h7-}zFc1t=5JMma1g7He+0sar0=G#lccx0?_KTq zVkRENy}R{q0*Rg}VH3zC{!iXkKkU&fCJjprjGA%`On3HkEh z(PJ=>lmxX>FO3WdEe1v&4Jip|Rf?-9O0| z6m(T4TM+*+N#rjiIqH6In!%*vO}m_Kd)3jQ9Jfo0gjd2^>t8?If8IK#(cw>%Y`5K< z)3I~X(YJ$?+h<$s_f^#lnJv1bo#a_Ilw@-1wnnlgL5-^*DGU`$l_*309hBwXnXemW z+S_o6x6<$T9V^p6LLRrb@7@lX_TG(6=c8W#X_jN+TKx5^^Fq3+5-$0^O5HH%7C3pm zY*S3<6w7$Z{);Qzp!bs?Ub(@#`Hmt z|1`_ko0IR}GHP@`*gf%PYtj1?me-mR8F#iE*}Q)GspKb@60y(!)hG!NC4tgOsiPE9 z(!PwRIhZ9N00;mAfB+x>2mk_r03ZMe00MvjAn?B-phGl;l~ Date: Tue, 9 Jan 2024 15:32:17 +0000 Subject: [PATCH 121/261] 8210410: Refactor java.util.Currency:i18n shell tests to plain java tests Backport-of: 2584bf87aef66744a8e586805735cded0d2f98f1 --- test/jdk/java/util/Currency/PropertiesTest.sh | 144 ---------------- .../java/util/Currency/PropertiesTestRun.java | 157 ++++++++++++++++++ 2 files changed, 157 insertions(+), 144 deletions(-) delete mode 100644 test/jdk/java/util/Currency/PropertiesTest.sh create mode 100644 test/jdk/java/util/Currency/PropertiesTestRun.java diff --git a/test/jdk/java/util/Currency/PropertiesTest.sh b/test/jdk/java/util/Currency/PropertiesTest.sh deleted file mode 100644 index f7825640480..00000000000 --- a/test/jdk/java/util/Currency/PropertiesTest.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# @test -# @bug 6332666 6863624 7180362 8003846 8074350 8074351 8130246 8149735 7102969 -# 8157138 8190904 -# @summary tests the capability of replacing the currency data with user -# specified currency properties file -# @build PropertiesTest -# @run shell/timeout=600 PropertiesTest.sh - -if [ "${TESTSRC}" = "" ] -then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTJAVA=${TESTJAVA}" -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTCLASSES=${TESTCLASSES}" -echo "CLASSPATH=${CLASSPATH}" - -# set platform-dependent variables -OS=`uname -s` -case "$OS" in - Linux | Darwin | AIX ) - PS=":" - FS="/" - ;; - Windows* ) - PS=";" - FS="/" - ;; - CYGWIN*|MSYS*|MINGW* ) - PS=";" - FS="/" - TESTJAVA=`cygpath -u ${TESTJAVA}` - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac - -failures=0 - -run() { - echo '' - ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} $* 2>&1 - if [ $? != 0 ]; then failures=`expr $failures + 1`; fi -} - -PROPS=${TESTSRC}${FS}currency.properties - - -# Dump built-in currency data - -run PropertiesTest -d dump1 -if [ ! -f dump1 ]; then echo "file dump1 not created. Test cannot execute. Failed."; exit 1; fi - -# Dump built-in currency data + overrides in properties file specified -# by system property. - -run -Djava.util.currency.data=${PROPS} PropertiesTest -d dump2 -if [ ! -f dump2 ]; then echo "file dump2 not created. Test cannot execute. Failed."; exit 1; fi -run PropertiesTest -c dump1 dump2 ${PROPS} - - -# Dump built-in currency data + overrides in properties file copied into -# JRE image. - -# Make a private copy of the jdk so we can write to the properties file location -# without disturbing other users, including concurrently executing tests. -WRITABLEJDK=.${FS}testjava -cp -H -R $TESTJAVA $WRITABLEJDK || exit 1 -PROPLOCATION=${WRITABLEJDK}${FS}lib -chmod -R u+w $WRITABLEJDK || exit 1 -cp ${PROPS} $PROPLOCATION || exit 1 -echo "Properties location: ${PROPLOCATION}" - -# run -echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest -d dump3 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi -if [ ! -f dump3 ]; then echo "file dump3 not created. Test cannot execute. Failed."; exit 1; fi - -# run bug7102969 test -echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest bug7102969 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi - -# run bug8157138 test -echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest bug8157138 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi - -# run bug8190904 test -echo '' -${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -cp ${TESTCLASSES} PropertiesTest bug8190904 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi - -# Cleanup -rm -rf $WRITABLEJDK - -# compare the two dump files -run PropertiesTest -c dump1 dump3 ${PROPS} - - -# Results -echo '' -if [ $failures -gt 0 ]; - then echo "$failures tests failed"; - else echo "All tests passed"; fi -exit $failures diff --git a/test/jdk/java/util/Currency/PropertiesTestRun.java b/test/jdk/java/util/Currency/PropertiesTestRun.java new file mode 100644 index 00000000000..6f2ea28a90d --- /dev/null +++ b/test/jdk/java/util/Currency/PropertiesTestRun.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6332666 6863624 7180362 8003846 8074350 8074351 8130246 8149735 7102969 + * 8157138 8190904 8210410 + * @summary Tests the capability of replacing the currency data with a user + * specified currency properties file in lib directory (old way) or + * via the system property in the cmdline (new way). + * @library /test/lib + * @build PropertiesTest + * @run junit PropertiesTestRun + */ + +import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.Arrays; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.fail; + +public class PropertiesTestRun { + + // String paths used for the cmdline processes + private static final String TEST_JDK = Utils.TEST_JDK; + private static final String TEST_PROPS = + Utils.TEST_SRC+Utils.FILE_SEPARATOR+"currency.properties"; + private static final String WRITABLE_JDK = + "."+Utils.FILE_SEPARATOR+"WRITABLE_JDK"; + private static final String WRITABLE_JDK_LIB = + WRITABLE_JDK+Utils.FILE_SEPARATOR+"lib"; + private static final String WRITABLE_JDK_BIN = + WRITABLE_JDK+Utils.FILE_SEPARATOR+"bin"; + private static final String WRITABLE_JDK_JAVA_PATH = + WRITABLE_JDK_BIN + Utils.FILE_SEPARATOR + "java"; + + // Create a writable JDK and set up dumps 1-3 + @BeforeAll + static void setUp() throws Throwable { + // Create separate JDK to supersede currencies via lib directory + createWritableJDK(); + // Create dump without user defined prop file + executeTestJDKMethod("PropertiesTest", "-d", "dump1"); + // Create dump with user defined prop file (via system property) + executeTestJDKMethod("-Djava.util.currency.data="+TEST_PROPS, + "PropertiesTest", "-d", "dump2"); + // Create dump with user defined prop file (via lib) + executeWritableJDKMethod("PropertiesTest", "-d", "dump3"); + } + + // Need to create a separate JDK to insert the user defined properties file + // into the lib folder. Create separate JDK to not disturb current TEST JDK. + private static void createWritableJDK() throws Throwable { + // Copy Test JDK into a separate JDK folder + executeProcess(new String[]{"cp", "-H", "-R", TEST_JDK, WRITABLE_JDK}); + // Make the separate JDK writable + executeProcess(new String[]{"chmod", "-R", "u+w", WRITABLE_JDK_LIB}); + // Copy the properties file into the writable JDK lib folder + executeProcess(new String[]{"cp", TEST_PROPS, WRITABLE_JDK_LIB}); + } + + // Compares the dumped output is expected between the default currencies + // and the user-defined custom currencies + @Test + void compareDumps() throws Throwable { + // Compare dump (from sys prop) + executeTestJDKMethod("PropertiesTest", "-c", "dump1", "dump2", + TEST_PROPS); + // Compare dump (from lib) + executeTestJDKMethod("PropertiesTest", "-c", "dump1", "dump3", + TEST_PROPS); + } + + // Launch a test from PropertiesTest. See PropertiesTest.java for more + // detail regarding a specific test that was launched. + @ParameterizedTest + @MethodSource("PropertiesTestMethods") + void launchPropertiesTests(String methodName) throws Throwable { + // Test via both the lib and system property + executeWritableJDKMethod("PropertiesTest", methodName); + executeTestJDKMethod("-Djava.util.currency.data="+TEST_PROPS, + "PropertiesTest", methodName); + } + + private static Stream PropertiesTestMethods() { + return Stream.of("bug7102969", "bug8157138", "bug8190904"); + } + + // Launch a PropertiesTest method using the TEST JDK + private static void executeTestJDKMethod(String... params) throws Throwable { + int exitStatus = ProcessTools.executeTestJvm(params).getExitValue(); + if (exitStatus != 0) { + fail("Process started with: " + Arrays.toString(params) + " failed"); + } + } + + // Launch a PropertiesTest method using the WRITABLE JDK + private static void executeWritableJDKMethod(String... params) throws Throwable { + // Need to include WritableJDK javapath, TEST JDK classpath + String[] allParams = new String[3+params.length+Utils.getTestJavaOpts().length]; + // We don't use executeTestJvm() because we want to point to separate JDK java path + allParams[0] = WRITABLE_JDK_JAVA_PATH; + allParams[1] = "-cp"; + allParams[2] = System.getProperty("java.class.path"); + // Add test.vm.opts and test.java.opts + System.arraycopy(Utils.getTestJavaOpts(), 0, allParams, 3, + Utils.getTestJavaOpts().length); + // Add the rest of the actual arguments + System.arraycopy(params, 0, allParams, Utils.getTestJavaOpts().length+3, + params.length); + // Launch the actual test method with all parameters set + executeProcess(allParams); + } + + // Execute a process and fail if the command is not successful + private static void executeProcess(String[] params) throws Throwable { + System.out.println("Command line: " + Arrays.toString(params)); + int exitStatus = ProcessTools.executeProcess(params).getExitValue(); + if (exitStatus != 0) { + fail("Process started with: " + Arrays.toString(params) + " failed"); + } + } + + @AfterAll + static void tearDown() throws Throwable { + // Remove the copied writable JDK image from scratch folder + executeProcess(new String[]{"rm", "-rf", WRITABLE_JDK}); + } +} From 36c21207f5a461929b48970f2c08b2a23c37a5a3 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 9 Jan 2024 16:24:15 +0000 Subject: [PATCH 122/261] 8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects Reviewed-by: eosterlund Backport-of: be49dabd0d7e1cd270399849e5353bf33361c4c5 --- src/hotspot/share/gc/z/zBarrierSet.cpp | 13 ++++++++++++ src/hotspot/share/gc/z/zBarrierSet.hpp | 2 ++ src/hotspot/share/gc/z/zBarrierSet.inline.hpp | 20 ++++++++++++++----- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/gc/z/zBarrierSet.cpp b/src/hotspot/share/gc/z/zBarrierSet.cpp index 160673e8059..a82cc67754b 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.cpp +++ b/src/hotspot/share/gc/z/zBarrierSet.cpp @@ -152,6 +152,19 @@ void ZBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) { deoptimize_allocation(thread); } +void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj, size_t size) { + volatile zpointer* src = (volatile zpointer*)src_obj->base(); + volatile zpointer* dst = (volatile zpointer*)dst_obj->base(); + + for (const zpointer* const end = cast_from_oop(src_obj) + size; src < end; src++, dst++) { + zaddress elem = ZBarrier::load_barrier_on_oop_field(src); + // We avoid healing here because the store below colors the pointer store good, + // hence avoiding the cost of a CAS. + ZBarrier::store_barrier_on_heap_oop_field(dst, false /* heal */); + Atomic::store(dst, ZAddress::store_good(elem)); + } +} + void ZBarrierSet::print_on(outputStream* st) const { st->print_cr("ZBarrierSet"); } diff --git a/src/hotspot/share/gc/z/zBarrierSet.hpp b/src/hotspot/share/gc/z/zBarrierSet.hpp index 213f85dcea8..adba5ee15c1 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.hpp +++ b/src/hotspot/share/gc/z/zBarrierSet.hpp @@ -39,6 +39,8 @@ class ZBarrierSet : public BarrierSet { static ZBarrierSetAssembler* assembler(); static bool barrier_needed(DecoratorSet decorators, BasicType type); + static void clone_obj_array(objArrayOop src, objArrayOop dst, size_t size); + virtual void on_thread_create(Thread* thread); virtual void on_thread_destroy(Thread* thread); virtual void on_thread_attach(Thread* thread); diff --git a/src/hotspot/share/gc/z/zBarrierSet.inline.hpp b/src/hotspot/share/gc/z/zBarrierSet.inline.hpp index bfbae74972d..997e5bae58d 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/z/zBarrierSet.inline.hpp @@ -403,14 +403,13 @@ inline bool ZBarrierSet::AccessBarrier::oop_arraycopy_i return oop_arraycopy_in_heap_no_check_cast(dst, src, length); } -class ZStoreBarrierOopClosure : public BasicOopIterateClosure { +class ZColorStoreGoodOopClosure : public BasicOopIterateClosure { public: virtual void do_oop(oop* p_) { volatile zpointer* const p = (volatile zpointer*)p_; const zpointer ptr = ZBarrier::load_atomic(p); const zaddress addr = ZPointer::uncolor(ptr); - ZBarrier::store_barrier_on_heap_oop_field(p, false /* heal */); - *p = ZAddress::store_good(addr); + Atomic::store(p, ZAddress::store_good(addr)); } virtual void do_oop(narrowOop* p) { @@ -433,6 +432,17 @@ template inline void ZBarrierSet::AccessBarrier::clone_in_heap(oop src, oop dst, size_t size) { assert_is_valid(to_zaddress(src)); + if (dst->is_objArray()) { + // Cloning an object array is similar to performing array copy. + // If an array is large enough to have its allocation segmented, + // this operation might require GC barriers. However, the intrinsics + // for cloning arrays transform the clone to an optimized allocation + // and arraycopy sequence, so the performance of this runtime call + // does not matter for object arrays. + clone_obj_array(objArrayOop(src), objArrayOop(dst), size); + return; + } + // Fix the oops ZLoadBarrierOopClosure cl; ZIterator::oop_iterate(src, &cl); @@ -440,10 +450,10 @@ inline void ZBarrierSet::AccessBarrier::clone_in_heap(o // Clone the object Raw::clone_in_heap(src, dst, size); - assert(ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects"); + assert(dst->is_typeArray() || ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects"); // Color store good before handing out - ZStoreBarrierOopClosure cl_sg; + ZColorStoreGoodOopClosure cl_sg; ZIterator::oop_iterate(dst, &cl_sg); } From 9406448ce21e3ccd48335bcc475fc6ebfe0ba0b7 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 9 Jan 2024 17:21:55 +0000 Subject: [PATCH 123/261] 8316132: CDSProtectionDomain::get_shared_protection_domain should check for exception Backport-of: 11394828b32941a69d549bae613ab4c3afb713d5 --- src/hotspot/share/cds/cdsProtectionDomain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/cds/cdsProtectionDomain.cpp b/src/hotspot/share/cds/cdsProtectionDomain.cpp index d1020b992e5..3ad2af670f0 100644 --- a/src/hotspot/share/cds/cdsProtectionDomain.cpp +++ b/src/hotspot/share/cds/cdsProtectionDomain.cpp @@ -241,7 +241,7 @@ Handle CDSProtectionDomain::get_shared_protection_domain(Handle class_loader, TRAPS) { Handle protection_domain; if (shared_protection_domain(shared_path_index) == nullptr) { - Handle pd = get_protection_domain_from_classloader(class_loader, url, THREAD); + Handle pd = get_protection_domain_from_classloader(class_loader, url, CHECK_NH); atomic_set_shared_protection_domain(shared_path_index, pd()); } From d5b8c283ba6d58eb4c3af9709c7c3ad60dc11366 Mon Sep 17 00:00:00 2001 From: Dan Lutker Date: Tue, 9 Jan 2024 17:24:59 +0000 Subject: [PATCH 124/261] 8322725: (tz) Update Timezone Data to 2023d Backport-of: 2a9c3589d941d9a57e536ea0b3d7919c6ddb82dc --- src/java.base/share/data/tzdata/VERSION | 2 +- src/java.base/share/data/tzdata/africa | 7 --- src/java.base/share/data/tzdata/antarctica | 57 ++++++++++++++++++- src/java.base/share/data/tzdata/asia | 6 +- src/java.base/share/data/tzdata/australasia | 8 ++- src/java.base/share/data/tzdata/backward | 1 - src/java.base/share/data/tzdata/europe | 29 +++++++--- src/java.base/share/data/tzdata/iso3166.tab | 17 ++++-- src/java.base/share/data/tzdata/leapseconds | 8 +-- src/java.base/share/data/tzdata/northamerica | 3 +- src/java.base/share/data/tzdata/southamerica | 6 ++ src/java.base/share/data/tzdata/zone.tab | 24 ++++---- .../java/util/TimeZone/TimeZoneData/VERSION | 2 +- .../util/TimeZone/TimeZoneData/aliases.txt | 1 - 14 files changed, 125 insertions(+), 46 deletions(-) diff --git a/src/java.base/share/data/tzdata/VERSION b/src/java.base/share/data/tzdata/VERSION index 66bd061e8bc..560884d1a82 100644 --- a/src/java.base/share/data/tzdata/VERSION +++ b/src/java.base/share/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2023c +tzdata2023d diff --git a/src/java.base/share/data/tzdata/africa b/src/java.base/share/data/tzdata/africa index a73405fdb01..b4789b16c71 100644 --- a/src/java.base/share/data/tzdata/africa +++ b/src/java.base/share/data/tzdata/africa @@ -308,13 +308,6 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 - # reproduced by other (more accessible) sites[, e.g.,]... # http://elgornal.net/news/news.aspx?id=4699258 -# From Paul Eggert (2014-06-04): -# Sarah El Deeb and Lee Keath of AP report that the Egyptian government says -# the change is because of blackouts in Cairo, even though Ahram Online (cited -# above) says DST had no affect on electricity consumption. There is -# no information about when DST will end this fall. See: -# http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833 - # From Steffen Thorsen (2015-04-08): # Egypt will start DST on midnight after Thursday, April 30, 2015. # This is based on a law (no 35) from May 15, 2014 saying it starts the last diff --git a/src/java.base/share/data/tzdata/antarctica b/src/java.base/share/data/tzdata/antarctica index 3de5e726eb4..fc7176cd0d5 100644 --- a/src/java.base/share/data/tzdata/antarctica +++ b/src/java.base/share/data/tzdata/antarctica @@ -103,6 +103,11 @@ # - 2018 Oct 7 4:00 - 2019 Mar 17 3:00 - 2019 Oct 4 3:00 - 2020 Mar 8 3:00 # and now - 2020 Oct 4 0:01 +# From Paul Eggert (2023-12-20): +# Transitions from 2021 on are taken from: +# https://www.timeanddate.com/time/zone/antarctica/casey +# retrieved at various dates. + # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - -00 1969 8:00 - +08 2009 Oct 18 2:00 @@ -116,7 +121,12 @@ Zone Antarctica/Casey 0 - -00 1969 8:00 - +08 2019 Oct 4 3:00 11:00 - +11 2020 Mar 8 3:00 8:00 - +08 2020 Oct 4 0:01 - 11:00 - +11 + 11:00 - +11 2021 Mar 14 0:00 + 8:00 - +08 2021 Oct 3 0:01 + 11:00 - +11 2022 Mar 13 0:00 + 8:00 - +08 2022 Oct 2 0:01 + 11:00 - +11 2023 Mar 9 3:00 + 8:00 - +08 Zone Antarctica/Davis 0 - -00 1957 Jan 13 7:00 - +07 1964 Nov 0 - -00 1969 Feb @@ -263,7 +273,50 @@ Zone Antarctica/Troll 0 - -00 2005 Feb 12 # year-round from 1960/61 to 1992 # Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11 -# See Asia/Urumqi. +# From Craig Mundell (1994-12-15): +# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP +# Vostok, which is one of the Russian stations, is set on the same +# time as Moscow, Russia. +# +# From Lee Hotz (2001-03-08): +# I queried the folks at Columbia who spent the summer at Vostok and this is +# what they had to say about time there: +# "in the US Camp (East Camp) we have been on New Zealand (McMurdo) +# time, which is 12 hours ahead of GMT. The Russian Station Vostok was +# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead +# of GMT). This is a time zone I think two hours east of Moscow. The +# natural time zone is in between the two: 8 hours ahead of GMT." +# +# From Paul Eggert (2001-05-04): +# This seems to be hopelessly confusing, so I asked Lee Hotz about it +# in person. He said that some Antarctic locations set their local +# time so that noon is the warmest part of the day, and that this +# changes during the year and does not necessarily correspond to mean +# solar noon. So the Vostok time might have been whatever the clocks +# happened to be during their visit. So we still don't really know what time +# it is at Vostok. +# +# From Zakhary V. Akulov (2023-12-17 22:00:48 +0700): +# ... from December, 18, 2023 00:00 by my decision the local time of +# the Antarctic research base Vostok will correspond to UTC+5. +# (2023-12-19): We constantly interact with Progress base, with company who +# builds new wintering station, with sledge convoys, with aviation - they all +# use UTC+5. Besides, difference between Moscow time is just 2 hours now, not 4. +# (2023-12-19, in response to the question "Has local time at Vostok +# been UTC+6 ever since 1957, or has it changed before?"): No. At least +# since my antarctic career start, 10 years ago, Vostok base has UTC+7. +# (In response to a 2023-12-18 question "from 02:00 to 00:00 today"): This. +# +# From Paul Eggert (2023-12-18): +# For lack of better info, guess Vostok was at +07 from founding through today, +# except when closed. + +# Zone NAME STDOFF RULES FORMAT [UNTIL] +Zone Antarctica/Vostok 0 - -00 1957 Dec 16 + 7:00 - +07 1994 Feb + 0 - -00 1994 Nov + 7:00 - +07 2023 Dec 18 2:00 + 5:00 - +05 # S Africa - year-round bases # Marion Island, -4653+03752 diff --git a/src/java.base/share/data/tzdata/asia b/src/java.base/share/data/tzdata/asia index 6a048c3ad28..f86f84b2d27 100644 --- a/src/java.base/share/data/tzdata/asia +++ b/src/java.base/share/data/tzdata/asia @@ -678,7 +678,6 @@ Zone Asia/Shanghai 8:05:43 - LMT 1901 8:00 PRC C%sT # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi # / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.) -# Vostok base in Antarctica matches this since 1970. Zone Asia/Urumqi 5:50:20 - LMT 1928 6:00 - +06 @@ -3450,6 +3449,9 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Heba Hamad (2023-03-22): # ... summer time will begin in Palestine from Saturday 04-29-2023, # 02:00 AM by 60 minutes forward. +# From Heba Hemad (2023-10-09): +# ... winter time will begin in Palestine from Saturday 10-28-2023, +# 02:00 AM by 60 minutes back. # # From Paul Eggert (2023-03-22): # For now, guess that spring and fall transitions will normally @@ -3571,13 +3573,13 @@ Rule Palestine 2070 only - Oct 4 2:00 0 - Rule Palestine 2071 only - Sep 19 2:00 0 - Rule Palestine 2072 only - Sep 10 2:00 0 - Rule Palestine 2072 only - Oct 15 2:00 1:00 S +Rule Palestine 2072 max - Oct Sat<=30 2:00 0 - Rule Palestine 2073 only - Sep 2 2:00 0 - Rule Palestine 2073 only - Oct 7 2:00 1:00 S Rule Palestine 2074 only - Aug 18 2:00 0 - Rule Palestine 2074 only - Sep 29 2:00 1:00 S Rule Palestine 2075 only - Aug 10 2:00 0 - Rule Palestine 2075 only - Sep 14 2:00 1:00 S -Rule Palestine 2075 max - Oct Sat<=30 2:00 0 - Rule Palestine 2076 only - Jul 25 2:00 0 - Rule Palestine 2076 only - Sep 5 2:00 1:00 S Rule Palestine 2077 only - Jul 17 2:00 0 - diff --git a/src/java.base/share/data/tzdata/australasia b/src/java.base/share/data/tzdata/australasia index 893d7055eab..366cfd10cc1 100644 --- a/src/java.base/share/data/tzdata/australasia +++ b/src/java.base/share/data/tzdata/australasia @@ -414,8 +414,14 @@ Zone Antarctica/Macquarie 0 - -00 1899 Nov # Please note that there will not be any daylight savings time change # in Fiji for 2022-2023.... # https://www.facebook.com/FijianGovernment/posts/pfbid0mmWVTYmTibn66ybpFda75pDcf34SSpoSaskJW5gXwaKo5Sgc7273Q4fXWc6kQV6Hl + +# From Almaz Mingaleev (2023-10-06): +# Cabinet approved the suspension of Daylight Saving and appropriate +# legislative changes will be considered including the repeal of the +# Daylight Saving Act 1998 +# https://www.fiji.gov.fj/Media-Centre/Speeches/English/CABINET-DECISIONS-3-OCTOBER-2023 # -# From Paul Eggert (2022-10-27): +# From Paul Eggert (2023-10-06): # For now, assume DST is suspended indefinitely. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S diff --git a/src/java.base/share/data/tzdata/backward b/src/java.base/share/data/tzdata/backward index c0746d6dd1b..7ddc6cc3d93 100644 --- a/src/java.base/share/data/tzdata/backward +++ b/src/java.base/share/data/tzdata/backward @@ -228,7 +228,6 @@ Link America/Puerto_Rico America/Tortola Link Pacific/Port_Moresby Antarctica/DumontDUrville Link Pacific/Auckland Antarctica/McMurdo Link Asia/Riyadh Antarctica/Syowa -Link Asia/Urumqi Antarctica/Vostok Link Europe/Berlin Arctic/Longyearbyen Link Asia/Riyadh Asia/Aden Link Asia/Qatar Asia/Bahrain diff --git a/src/java.base/share/data/tzdata/europe b/src/java.base/share/data/tzdata/europe index 446d2e1e658..f1b084f64d0 100644 --- a/src/java.base/share/data/tzdata/europe +++ b/src/java.base/share/data/tzdata/europe @@ -1146,6 +1146,23 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # 2. The shift *from* DST in 2023 happens as normal, but coincides with the # shift to UTC-02 normaltime (people will not change their clocks here). # 3. After this, DST is still observed, but as -02/-01 instead of -03/-02. +# +# From Múte Bourup Egede via Jógvan Svabo Samuelsen (2023-03-15): +# Greenland will not switch to Daylight Saving Time this year, 2023, +# because the standard time for Greenland will change from UTC -3 to UTC -2. +# However, Greenland will change to Daylight Saving Time again in 2024 +# and onwards. + +# From a contributor who wishes to remain anonymous for now (2023-10-29): +# https://www.dr.dk/nyheder/seneste/i-nat-skal-uret-stilles-en-time-tilbage-men-foerste-gang-sker-det-ikke-i-groenland +# with a link to that page: +# https://naalakkersuisut.gl/Nyheder/2023/10/2710_sommertid +# ... Ittoqqortoormiit joins the time of Nuuk at March 2024. +# What would mean that America/Scoresbysund would either be in -01 year round +# or in -02/-01 like America/Nuuk, but no longer in -01/+00. +# +# From Paul Eggert (2023-10-29): +# For now, assume it will be like America/Nuuk. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Thule 1991 1992 - Mar lastSun 2:00 1:00 D @@ -1166,10 +1183,12 @@ Zone America/Danmarkshavn -1:14:40 - LMT 1916 Jul 28 Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit -2:00 - -02 1980 Apr 6 2:00 -2:00 C-Eur -02/-01 1981 Mar 29 - -1:00 EU -01/+00 + -1:00 EU -01/+00 2024 Mar 31 + -2:00 EU -02/-01 Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb -3:00 - -03 1980 Apr 6 2:00 - -3:00 EU -03/-02 2023 Oct 29 1:00u + -3:00 EU -03/-02 2023 Mar 26 1:00u + -2:00 - -02 2023 Oct 29 1:00u -2:00 EU -02/-01 Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik -4:00 Thule A%sT @@ -3734,11 +3753,7 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 # and not at 3:00 as would have been under EU rules. # This is why I have set the change to EU rules into May 1996, # so that the change in March is stil covered by the Ukraine rule. -# The next change in October 1996 happened under EU rules.... -# TZ database holds three other zones for Ukraine.... I have not yet -# worked out the consequences for these three zones, as we (me and my -# US colleague David Cochrane) are still trying to get more -# information upon these local deviations from Kiev rules. +# The next change in October 1996 happened under EU rules. # # From Paul Eggert (2022-08-27): # For now, assume that Ukraine's zones all followed the same rules, diff --git a/src/java.base/share/data/tzdata/iso3166.tab b/src/java.base/share/data/tzdata/iso3166.tab index cea17732dd1..7fa350ecbe3 100644 --- a/src/java.base/share/data/tzdata/iso3166.tab +++ b/src/java.base/share/data/tzdata/iso3166.tab @@ -26,17 +26,22 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # -# From Paul Eggert (2022-11-18): +# From Paul Eggert (2023-09-06): # This file contains a table of two-letter country codes. Columns are # separated by a single tab. Lines beginning with '#' are comments. # All text uses UTF-8 encoding. The columns of the table are as follows: # # 1. ISO 3166-1 alpha-2 country code, current as of -# ISO 3166-1 N1087 (2022-09-02). See: Updates on ISO 3166-1 -# https://isotc.iso.org/livelink/livelink/Open/16944257 -# 2. The usual English name for the coded region, -# chosen so that alphabetic sorting of subsets produces helpful lists. -# This is not the same as the English name in the ISO 3166 tables. +# ISO/TC 46 N1108 (2023-04-05). See: ISO/TC 46 Documents +# https://www.iso.org/committee/48750.html?view=documents +# 2. The usual English name for the coded region. This sometimes +# departs from ISO-listed names, sometimes so that sorted subsets +# of names are useful (e.g., "Samoa (American)" and "Samoa +# (western)" rather than "American Samoa" and "Samoa"), +# sometimes to avoid confusion among non-experts (e.g., +# "Czech Republic" and "Turkey" rather than "Czechia" and "Türkiye"), +# and sometimes to omit needless detail or churn (e.g., "Netherlands" +# rather than "Netherlands (the)" or "Netherlands (Kingdom of the)"). # # The table is sorted by country code. # diff --git a/src/java.base/share/data/tzdata/leapseconds b/src/java.base/share/data/tzdata/leapseconds index 89ce8b89cd2..ab2c1af4bed 100644 --- a/src/java.base/share/data/tzdata/leapseconds +++ b/src/java.base/share/data/tzdata/leapseconds @@ -95,11 +95,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2023 Dec 28 00:00:00 +#Expires 2024 Jun 28 00:00:00 # POSIX timestamps for the data in this file: #updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1703721600 (2023-12-28 00:00:00 UTC) +#expires 1719532800 (2024-06-28 00:00:00 UTC) -# Updated through IERS Bulletin C65 -# File expires on: 28 December 2023 +# Updated through IERS Bulletin C66 +# File expires on: 28 June 2024 diff --git a/src/java.base/share/data/tzdata/northamerica b/src/java.base/share/data/tzdata/northamerica index e240cf35103..b96269a0e26 100644 --- a/src/java.base/share/data/tzdata/northamerica +++ b/src/java.base/share/data/tzdata/northamerica @@ -1,3 +1,4 @@ +# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -1475,7 +1476,7 @@ Rule StJohns 1989 2006 - Apr Sun>=1 0:01 1:00 D Rule StJohns 2007 2011 - Mar Sun>=8 0:01 1:00 D Rule StJohns 2007 2010 - Nov Sun>=1 0:01 0 S # -# St John's has an apostrophe, but Posix file names can't have apostrophes. +# St John's has an apostrophe, but POSIX file names can't have apostrophes. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/St_Johns -3:30:52 - LMT 1884 -3:30:52 StJohns N%sT 1918 diff --git a/src/java.base/share/data/tzdata/southamerica b/src/java.base/share/data/tzdata/southamerica index 4024e7180cd..da2c6239262 100644 --- a/src/java.base/share/data/tzdata/southamerica +++ b/src/java.base/share/data/tzdata/southamerica @@ -1720,6 +1720,12 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # From Carlos Raúl Perasso (2014-02-28): # Decree 1264 can be found at: # http://www.presidencia.gov.py/archivos/documentos/DECRETO1264_ey9r8zai.pdf +# +# From Paul Eggert (2023-07-26): +# Transition dates are now set by Law No. 7115, not by presidential decree. +# https://www.abc.com.py/politica/2023/07/12/promulgacion-el-cambio-de-hora-sera-por-ley/ +# From Carlos Raúl Perasso (2023-07-27): +# http://silpy.congreso.gov.py/descarga/ley-144138 Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] diff --git a/src/java.base/share/data/tzdata/zone.tab b/src/java.base/share/data/tzdata/zone.tab index 3edb0d61c80..0a01e8777dd 100644 --- a/src/java.base/share/data/tzdata/zone.tab +++ b/src/java.base/share/data/tzdata/zone.tab @@ -71,7 +71,7 @@ AR -3124-06411 America/Argentina/Cordoba Argentina (most areas: CB, CC, CN, ER, AR -2447-06525 America/Argentina/Salta Salta (SA, LP, NQ, RN) AR -2411-06518 America/Argentina/Jujuy Jujuy (JY) AR -2649-06513 America/Argentina/Tucuman Tucuman (TM) -AR -2828-06547 America/Argentina/Catamarca Catamarca (CT); Chubut (CH) +AR -2828-06547 America/Argentina/Catamarca Catamarca (CT), Chubut (CH) AR -2926-06651 America/Argentina/La_Rioja La Rioja (LR) AR -3132-06831 America/Argentina/San_Juan San Juan (SJ) AR -3253-06849 America/Argentina/Mendoza Mendoza (MZ) @@ -110,7 +110,7 @@ BN +0456+11455 Asia/Brunei BO -1630-06809 America/La_Paz BQ +120903-0681636 America/Kralendijk BR -0351-03225 America/Noronha Atlantic islands -BR -0127-04829 America/Belem Para (east); Amapa +BR -0127-04829 America/Belem Para (east), Amapa BR -0343-03830 America/Fortaleza Brazil (northeast: MA, PI, CE, RN, PB) BR -0803-03454 America/Recife Pernambuco BR -0712-04812 America/Araguaina Tocantins @@ -130,21 +130,21 @@ BT +2728+08939 Asia/Thimphu BW -2439+02555 Africa/Gaborone BY +5354+02734 Europe/Minsk BZ +1730-08812 America/Belize -CA +4734-05243 America/St_Johns Newfoundland; Labrador (southeast) -CA +4439-06336 America/Halifax Atlantic - NS (most areas); PE +CA +4734-05243 America/St_Johns Newfoundland, Labrador (SE) +CA +4439-06336 America/Halifax Atlantic - NS (most areas), PE CA +4612-05957 America/Glace_Bay Atlantic - NS (Cape Breton) CA +4606-06447 America/Moncton Atlantic - New Brunswick CA +5320-06025 America/Goose_Bay Atlantic - Labrador (most areas) CA +5125-05707 America/Blanc-Sablon AST - QC (Lower North Shore) -CA +4339-07923 America/Toronto Eastern - ON, QC (most areas) +CA +4339-07923 America/Toronto Eastern - ON & QC (most areas) CA +6344-06828 America/Iqaluit Eastern - NU (most areas) -CA +484531-0913718 America/Atikokan EST - ON (Atikokan); NU (Coral H) -CA +4953-09709 America/Winnipeg Central - ON (west); Manitoba +CA +484531-0913718 America/Atikokan EST - ON (Atikokan), NU (Coral H) +CA +4953-09709 America/Winnipeg Central - ON (west), Manitoba CA +744144-0944945 America/Resolute Central - NU (Resolute) CA +624900-0920459 America/Rankin_Inlet Central - NU (central) CA +5024-10439 America/Regina CST - SK (most areas) CA +5017-10750 America/Swift_Current CST - SK (midwest) -CA +5333-11328 America/Edmonton Mountain - AB; BC (E); NT (E); SK (W) +CA +5333-11328 America/Edmonton Mountain - AB, BC(E), NT(E), SK(W) CA +690650-1050310 America/Cambridge_Bay Mountain - NU (west) CA +682059-1334300 America/Inuvik Mountain - NT (west) CA +4906-11631 America/Creston MST - BC (Creston) @@ -230,8 +230,8 @@ HT +1832-07220 America/Port-au-Prince HU +4730+01905 Europe/Budapest ID -0610+10648 Asia/Jakarta Java, Sumatra ID -0002+10920 Asia/Pontianak Borneo (west, central) -ID -0507+11924 Asia/Makassar Borneo (east, south); Sulawesi/Celebes, Bali, Nusa Tengarra; Timor (west) -ID -0232+14042 Asia/Jayapura New Guinea (West Papua / Irian Jaya); Malukus/Moluccas +ID -0507+11924 Asia/Makassar Borneo (east, south), Sulawesi/Celebes, Bali, Nusa Tengarra, Timor (west) +ID -0232+14042 Asia/Jayapura New Guinea (West Papua / Irian Jaya), Malukus/Moluccas IE +5320-00615 Europe/Dublin IL +314650+0351326 Asia/Jerusalem IM +5409-00428 Europe/Isle_of_Man @@ -378,7 +378,7 @@ RU +4310+13156 Asia/Vladivostok MSK+07 - Amur River RU +643337+1431336 Asia/Ust-Nera MSK+07 - Oymyakonsky RU +5934+15048 Asia/Magadan MSK+08 - Magadan RU +4658+14242 Asia/Sakhalin MSK+08 - Sakhalin Island -RU +6728+15343 Asia/Srednekolymsk MSK+08 - Sakha (E); N Kuril Is +RU +6728+15343 Asia/Srednekolymsk MSK+08 - Sakha (E), N Kuril Is RU +5301+15839 Asia/Kamchatka MSK+09 - Kamchatka RU +6445+17729 Asia/Anadyr MSK+09 - Bering Sea RW -0157+03004 Africa/Kigali @@ -441,7 +441,7 @@ US +470659-1011757 America/North_Dakota/Center Central - ND (Oliver) US +465042-1012439 America/North_Dakota/New_Salem Central - ND (Morton rural) US +471551-1014640 America/North_Dakota/Beulah Central - ND (Mercer) US +394421-1045903 America/Denver Mountain (most areas) -US +433649-1161209 America/Boise Mountain - ID (south); OR (east) +US +433649-1161209 America/Boise Mountain - ID (south), OR (east) US +332654-1120424 America/Phoenix MST - AZ (except Navajo) US +340308-1181434 America/Los_Angeles Pacific US +611305-1495401 America/Anchorage Alaska (most areas) diff --git a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION index c5483b48512..f92096d49aa 100644 --- a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION +++ b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION @@ -1 +1 @@ -tzdata2023c +tzdata2023d diff --git a/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt b/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt index 07c5edbafee..82bad17c553 100644 --- a/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt +++ b/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt @@ -148,7 +148,6 @@ Link America/Puerto_Rico America/Tortola Link Pacific/Port_Moresby Antarctica/DumontDUrville Link Pacific/Auckland Antarctica/McMurdo Link Asia/Riyadh Antarctica/Syowa -Link Asia/Urumqi Antarctica/Vostok Link Europe/Berlin Arctic/Longyearbyen Link Asia/Riyadh Asia/Aden Link Asia/Qatar Asia/Bahrain From a1d7bcfd0754ed2748d08a9d55f90a2d73f2a4af Mon Sep 17 00:00:00 2001 From: Ichiroh Takiguchi Date: Wed, 10 Jan 2024 01:06:36 +0000 Subject: [PATCH 125/261] 6928542: Chinese characters in RTF are not decoded Backport-of: a26f7c03c72e4efe6d3219d294294c554aebc631 --- .../javax/swing/text/rtf/RTFParser.java | 57 +++++++- .../javax/swing/text/rtf/RTFReader.java | 102 +++++++++++++- .../text/rtf/RTFReadFontCharsetTest.java | 131 ++++++++++++++++++ 3 files changed, 286 insertions(+), 4 deletions(-) create mode 100644 test/jdk/javax/swing/text/rtf/RTFReadFontCharsetTest.java diff --git a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java index 259b63ed8ee..05f45cc6bb0 100644 --- a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java +++ b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, 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,6 +26,10 @@ import java.io.*; import java.lang.*; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CoderResult; /** * RTFParser is a subclass of AbstractFilter which understands basic RTF syntax @@ -69,6 +73,11 @@ abstract class RTFParser extends AbstractFilter private final int S_inblob = 6; // in a \bin blob + // For fcharset control word + protected CharsetDecoder decoder = null; + private byte[] ba = new byte[2]; + protected ByteBuffer decoderBB = ByteBuffer.wrap(ba); + /** Implemented by subclasses to interpret a parameter-less RTF keyword. * The keyword is passed without the leading '/' or any delimiting * whitespace. */ @@ -100,6 +109,9 @@ public void handleText(char ch) rtfSpecialsTable['\\'] = true; } + // Defined for replacement character + static final char REPLACEMENT_CHAR = '\uFFFD'; + public RTFParser() { currentCharacters = new StringBuffer(); @@ -109,6 +121,9 @@ public RTFParser() //warnings = System.out; specialsTable = rtfSpecialsTable; + // Initialize byte buffer for CharsetDecoder + decoderBB.clear(); + decoderBB.limit(1); } // TODO: Handle wrapup at end of file correctly. @@ -182,6 +197,9 @@ public void write(char ch) } state = S_backslashed; } else { + // SBCS: ASCII character + // DBCS: Non lead byte + ch = decode(ch); currentCharacters.append(ch); } break; @@ -301,7 +319,9 @@ public void write(char ch) if (Character.digit(ch, 16) != -1) { pendingCharacter = pendingCharacter * 16 + Character.digit(ch, 16); - ch = translationTable[pendingCharacter]; + // Use translationTable if decoder is not defined + ch = decoder == null ? translationTable[pendingCharacter] + : decode((char)pendingCharacter); if (ch != 0) handleText(ch); } @@ -360,4 +380,37 @@ public void close() super.close(); } + // For fcharset control word + private char[] ca = new char[1]; + private CharBuffer decoderCB = CharBuffer.wrap(ca); + + private char decode(char ch) { + if (decoder == null) return ch; + decoderBB.put((byte) ch); + decoderBB.rewind(); + decoderCB.clear(); + CoderResult cr = decoder.decode(decoderBB, decoderCB, false); + if (cr.isUnderflow()) { + if (decoderCB.position() == 1) { + // Converted to Unicode (including replacement character) + decoder.reset(); + decoderBB.clear(); + decoderBB.limit(1); + return ca[0]; + } else { + // Detected lead byte + decoder.reset(); + decoderBB.limit(2); + decoderBB.position(1); + return 0; // Skip write operation if return value is 0 + } + } else { + // Fallback, should not be called + decoder.reset(); + decoderBB.clear(); + decoderBB.limit(1); + return REPLACEMENT_CHAR; + } + } + } diff --git a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java index 9128a71ed01..60cfd585c73 100644 --- a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java +++ b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, 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,11 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.io.StreamTokenizer; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CodingErrorAction; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Dictionary; @@ -87,6 +92,10 @@ class RTFReader extends RTFParser /** This Dictionary maps Integer font numbers to String font names. */ Dictionary fontTable; + /** This Dictionary maps Integer font numbers to Charset font charset. */ + Dictionary fcharsetTable; + /** This Dictionary maps String font charset to String code page. */ + static Dictionary fcharsetToCP = null; /** This array maps color indices to Color objects. */ Color[] colorTable; /** This Map maps character style numbers to Style objects. */ @@ -133,6 +142,7 @@ class RTFReader extends RTFParser textKeywords.put("emspace", "\u2003"); textKeywords.put("endash", "\u2013"); textKeywords.put("enspace", "\u2002"); + textKeywords.put("line", "\n"); textKeywords.put("ldblquote", "\u201C"); textKeywords.put("lquote", "\u2018"); textKeywords.put("ltrmark", "\u200E"); @@ -159,7 +169,50 @@ class RTFReader extends RTFParser defineCharacterSet("ansicpg", latin1TranslationTable); } -/* TODO: per-font font encodings ( \fcharset control word ) ? */ + /** + * Windows font charset + */ + private static final int ANSI_CHARSET = 0; + private static final int DEFAULT_CHARSET = 1; + private static final int SYMBOL_CHARSET = 2; + private static final int MAC_CHARSET = 77; + private static final int SHIFTJIS_CHARSET = 128; + private static final int HANGUL_CHARSET = 129; + private static final int JOHAB_CHARSET = 130; + private static final int GB2312_CHARSET = 134; + private static final int CHINESEBIG5_CHARSET = 136; + private static final int GREEK_CHARSET = 161; + private static final int TURKISH_CHARSET = 162; + private static final int VIETNAMESE_CHARSET = 163; + private static final int HEBREW_CHARSET = 177; + private static final int ARABIC_CHARSET = 178; + private static final int BALTIC_CHARSET = 186; + private static final int RUSSIAN_CHARSET = 204; + private static final int THAI_CHARSET = 222; + private static final int EASTEUROPE_CHARSET = 238; + private static final int OEM_CHARSET = 255; + + static { + fcharsetToCP = new Hashtable(); + fcharsetToCP.put("fcharset" + ANSI_CHARSET, "windows-1252"); + fcharsetToCP.put("fcharset" + SHIFTJIS_CHARSET, "ms932"); + fcharsetToCP.put("fcharset" + HANGUL_CHARSET, "ms949"); + fcharsetToCP.put("fcharset" + JOHAB_CHARSET, "ms1361"); + fcharsetToCP.put("fcharset" + GB2312_CHARSET, "ms936"); + fcharsetToCP.put("fcharset" + CHINESEBIG5_CHARSET, "ms950"); + fcharsetToCP.put("fcharset" + GREEK_CHARSET, "windows-1253"); + fcharsetToCP.put("fcharset" + TURKISH_CHARSET, "windows-1254"); + fcharsetToCP.put("fcharset" + VIETNAMESE_CHARSET, "windows-1258"); + fcharsetToCP.put("fcharset" + HEBREW_CHARSET, "windows-1255"); + fcharsetToCP.put("fcharset" + ARABIC_CHARSET, "windows-1256"); + fcharsetToCP.put("fcharset" + BALTIC_CHARSET, "windows-1257"); + fcharsetToCP.put("fcharset" + RUSSIAN_CHARSET, "windows-1251"); + fcharsetToCP.put("fcharset" + THAI_CHARSET, "ms874"); + fcharsetToCP.put("fcharset" + EASTEUROPE_CHARSET, "windows-1250"); + } + + // Defined for replacement character + private static final String REPLACEMENT_CHAR = "\uFFFD"; /** * Creates a new RTFReader instance. Text will be sent to @@ -174,6 +227,7 @@ public RTFReader(StyledDocument destination) target = destination; parserState = new Hashtable(); fontTable = new Hashtable(); + fcharsetTable = new Hashtable(); rtfversion = -1; @@ -762,6 +816,25 @@ public boolean handleKeyword(String keyword, int parameter) nextFontNumber = parameter; return true; } + // For fcharset control word + if (keyword.equals("fcharset")) { + String fcharset = keyword+parameter; + String csName = fcharsetToCP.get(fcharset); + Charset cs; + if (csName != null) { + try { + cs = Charset.forName(csName); + } catch (IllegalArgumentException iae) { + // Fallback, should not be called + cs = ISO_8859_1; + } + } else { + // Fallback, fcharset control word number is not defined + cs = ISO_8859_1; + } + fcharsetTable.put(nextFontNumber, cs); + return true; + } return false; } @@ -1216,6 +1289,25 @@ public boolean handleKeyword(String keyword, int parameter) if (keyword.equals("f")) { parserState.put(keyword, Integer.valueOf(parameter)); + + // Check lead byte is stored or not + if (decoderBB.position() == 1) { + handleText(REPLACEMENT_CHAR); + } + // Reset decoder byte buffer + decoderBB.clear(); + decoderBB.limit(1); + // Check fcharset is used or not + Charset cs = fcharsetTable.get(parameter); + if (cs != null) { + decoder = cs.newDecoder(); + decoder.onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE); + } else { + // fcharset is not used, use translationTable + decoder = null; + } + return true; } if (keyword.equals("cf")) { @@ -1610,6 +1702,12 @@ public boolean handleKeyword(String keyword) if (keyword.equals("par")) { // warnings.println("Ending paragraph."); + // Check lead byte is stored or not + if (decoderBB.position() == 1) { + handleText(REPLACEMENT_CHAR); + decoderBB.clear(); + decoderBB.limit(1); + } endParagraph(); return true; } diff --git a/test/jdk/javax/swing/text/rtf/RTFReadFontCharsetTest.java b/test/jdk/javax/swing/text/rtf/RTFReadFontCharsetTest.java new file mode 100644 index 00000000000..629b37285a3 --- /dev/null +++ b/test/jdk/javax/swing/text/rtf/RTFReadFontCharsetTest.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6928542 + * @summary Verify RTFEditorKit.read() with fcharset + */ + +import java.io.ByteArrayInputStream; +import java.io.InputStreamReader; +import java.io.PrintStream; +import javax.swing.text.Document; +import javax.swing.text.Element; +import javax.swing.text.rtf.RTFEditorKit; + +import static java.nio.charset.StandardCharsets.ISO_8859_1; + +public class RTFReadFontCharsetTest { + public static void main(String[] args) throws Exception { + String s = + "{\\rtf1\\fbidis\\ansi\\ansicpg932\\deff0\\nouicomp" + + "at\\deflang1033\\deflangfe1041{\\fonttbl{\\f0\\fni" + + "l\\fcharset0 Segoe UI;}{\\f1\\fnil\\fcharset128 Yu" + + " Gothic UI;}{\\f2\\fswiss\\fprq2\\fcharset129 Malg" + + "un Gothic;}{\\f3\\fnil\\fcharset134 Microsoft YaHe" + + "i;}{\\f4\\fnil\\fcharset136 Microsoft JhengHei;}{\\" + + "f5\\fnil\\fcharset161 Segoe UI;}{\\f6\\fnil\\fcha" + + "rset162 Segoe UI;}{\\f7\\fnil\\fcharset163 Segoe U" + + "I;}{\\f8\\fnil\\fcharset177 Segoe UI;}{\\f9\\fnil\\" + + "fcharset178 Segoe UI;}{\\f10\\fnil\\fcharset186 S" + + "egoe UI;}{\\f11\\fnil\\fcharset204 Segoe UI;}{\\f1" + + "2\\fnil\\fcharset222 Leelawadee UI;}{\\f13\\fnil\\" + + "fcharset0 Leelawadee UI;}{\\f14\\fnil\\fcharset238" + + " Segoe UI;}}\r\n{\\*\\generator Riched20 10.0.1904" + + "1}\\viewkind4\\uc1 \r\n\\pard\\ltrpar\\nowidctlpar" + + "\\sa200\\sl276\\slmult1\\f0\\fs22\\lang1041 Gr\\'f" + + "cezi - Switzerland 0\\line\\f1\\'82\\'b1\\'82\\'f" + + "1\\'82\\'c9\\'82\\'bf\\'82\\'cd - Japanese 128\\li" + + "ne\\f2\\lang17\\'be\\'c8\\'b3\\'e7\\'c7\\'cf\\'bc\\" + + "'bc\\'bf\\'e4\\lang1041 - Korean 129\\line\\kern" + + "ing2\\f3\\lang1033\\'c4\\'e3\\'ba\\'c3 - China 134" + + "\\line\\f4\\'bb\\'4f\\'c6\\'57 - Traditional Chine" + + "se - Taiwan 136\\line\\kerning0\\f5\\lang17\\'e3\\" + + "'e5\\'e9\\'e1 \\'f3\\'ef\\'f5 - Greek\\f0\\lang104" + + "1 161\\line\\f6\\lang17 A\\'f0a\\'e7 - \\f0 Turki" + + "sh (Tree) 162\\line\\f7\\'fe\\f0\\lang1041 \\lang" + + "1033 - \\lang17 Vietnam currency\\lang1041 163\\l" + + "ine\\f8\\rtlch\\lang17\\'f9\\'c8\\'d1\\'ec\\'e5\\'" + + "c9\\'ed\\f0\\ltrch - Hebrew 177\\line\\f9\\rtlch\\" + + "lang1025\\'e3\\'d1\\'cd\\'c8\\'c7\\f0\\ltrch\\lan" + + "g17 - Arabic 178\\line\\kerning2\\f10\\lang1033 A" + + "\\'e8i\\'fb - Lithuanian (Thank you) 186\\kerning0" + + "\\f0\\lang1041\\line\\kerning2\\f11\\lang1049\\'c7" + + "\\'e4\\'f0\\'e0\\'e2\\'f1\\'f2\\'e2\\'f3\\'e9\\'f2" + + "\\'e5\\f0\\lang1033 - Russian 204\\line\\kerning0" + + "\\f12\\lang1054\\'ca\\'c7\\'d1\\'ca\\'b4\\'d5 \\f1" + + "3\\lang1033 - Thailand 222\\line\\kerning2\\f14 cz" + + "e\\'9c\\'e6 - Polish 238\\par\r\n}\r\n\u0000"; + String expected = + "Gr\u00fcezi - Switzerland 0\n" + + "\u3053\u3093\u306b\u3061\u306f - Japanese 128\n" + + "\uc548\ub155\ud558\uc138\uc694 - Korean 129\n" + + "\u4f60\u597d - China 134\n" + + "\u81fa\u7063 - Traditional Chinese - Taiwan 136\n" + + "\u03b3\u03b5\u03b9\u03b1 \u03c3\u03bf\u03c5 - Greek 161\n" + + "A\u011fa\u00e7 - Turkish (Tree) 162\n" + + "\u20ab - Vietnam currency 163\n" + + "\u05e9\u05b8\u05c1\u05dc\u05d5\u05b9\u05dd - Hebrew 177\n" + + "\u0645\u0631\u062d\u0628\u0627 - Arabic 178\n" + + "A\u010di\u016b - Lithuanian (Thank you) 186\n" + + "\u0417\u0434\u0440\u0430\u0432\u0441\u0442" + + "\u0432\u0443\u0439\u0442\u0435 - Russian 204\n" + + "\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 - Thailand 222\n" + + "cze\u015b\u0107 - Polish 238\n" + + "\n"; + ByteArrayInputStream bais = new ByteArrayInputStream( + s.getBytes(ISO_8859_1)); + InputStreamReader isr = new InputStreamReader(bais, ISO_8859_1); + RTFEditorKit kit = new RTFEditorKit(); + Document doc = kit.createDefaultDocument(); + kit.read(isr, doc, 0); + Element elem = doc.getDefaultRootElement(); + int elemStart = elem.getStartOffset(); + int elemEnd = elem.getEndOffset(); + String text = doc.getText(elemStart, elemEnd - elemStart); + if (!expected.equals(text)) { + System.err.println("Read data"); + System.err.println("========="); + dump(text, System.err); + System.err.println("Expected data"); + System.err.println("============="); + dump(expected, System.err); + throw new RuntimeException("Test failed"); + } + } + + private static void dump(String s, PrintStream ps) { + for(char ch : s.toCharArray()) { + if (ch == '\\') + ps.print("\\\\"); + else if (ch >= 0x20 && ch <= 0x7e) + ps.print(ch); + else if (ch == '\n') + ps.println(); + else + ps.printf("\\u%04x", (int)ch); + } + } + +} From a28d29c53b5c37781e8ced684b7b38e56f890711 Mon Sep 17 00:00:00 2001 From: Elif Aslan Date: Wed, 10 Jan 2024 12:19:24 +0000 Subject: [PATCH 126/261] 8318608: Enable parallelism in vmTestbase/nsk/stress/threads tests Backport-of: cee44a625594fd805a05c4a69033eb677a5a6f17 --- .../nsk/stress/thread/TEST.properties | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 test/hotspot/jtreg/vmTestbase/nsk/stress/thread/TEST.properties diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/TEST.properties b/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/TEST.properties deleted file mode 100644 index 8b51b2a9115..00000000000 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/TEST.properties +++ /dev/null @@ -1,24 +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. -# - -exclusiveAccess.dirs=. From 4537bfa9cc091ff1807d9e03f1c0c971345adf6e Mon Sep 17 00:00:00 2001 From: Elif Aslan Date: Wed, 10 Jan 2024 12:19:49 +0000 Subject: [PATCH 127/261] 8318607: Enable parallelism in vmTestbase/nsk/stress/jni tests Backport-of: 43f31d73852d63ccdcc2dcd8d6c7355435a50fb3 --- .../vmTestbase/nsk/stress/jni/TEST.properties | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 test/hotspot/jtreg/vmTestbase/nsk/stress/jni/TEST.properties diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/jni/TEST.properties b/test/hotspot/jtreg/vmTestbase/nsk/stress/jni/TEST.properties deleted file mode 100644 index 8b51b2a9115..00000000000 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/jni/TEST.properties +++ /dev/null @@ -1,24 +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. -# - -exclusiveAccess.dirs=. From 2bf21b4c87df7a718ea9a34c5a5af84fbb7d4d1c Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 10 Jan 2024 15:30:14 +0000 Subject: [PATCH 128/261] 8322783: prioritize /etc/os-release over /etc/SuSE-release in hs_err/info output Backport-of: a8e4229852fac703c6271aa8c5f94f67bea44902 --- src/hotspot/os/linux/os_linux.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 09d7f72afcc..2175d34b115 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015, 2022 SAP SE. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2038,7 +2038,6 @@ const char* distro_files[] = { "/etc/mandrake-release", "/etc/sun-release", "/etc/redhat-release", - "/etc/SuSE-release", "/etc/lsb-release", "/etc/turbolinux-release", "/etc/gentoo-release", @@ -2046,6 +2045,7 @@ const char* distro_files[] = { "/etc/angstrom-version", "/etc/system-release", "/etc/os-release", + "/etc/SuSE-release", // Deprecated in favor of os-release since SuSE 12 nullptr }; void os::Linux::print_distro_info(outputStream* st) { From 1ea0d080483202e7f9185fad769680d1a7e84332 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 11 Jan 2024 07:23:14 +0000 Subject: [PATCH 129/261] 8311992: Test java/lang/Thread/virtual/JfrEvents::testVirtualThreadPinned failed Backport-of: 0d2196f8e5b03577a14ff97505718f4fa53f3792 --- .../java/lang/Thread/virtual/JfrEvents.java | 63 ++++++++++++------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/test/jdk/java/lang/Thread/virtual/JfrEvents.java b/test/jdk/java/lang/Thread/virtual/JfrEvents.java index 9ff9c2f86e2..0cdd6a529d1 100644 --- a/test/jdk/java/lang/Thread/virtual/JfrEvents.java +++ b/test/jdk/java/lang/Thread/virtual/JfrEvents.java @@ -39,6 +39,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.LockSupport; import java.util.stream.Collectors; @@ -75,12 +76,12 @@ void testVirtualThreadStartAndEnd() throws Exception { } Map events = sumEvents(recording); - System.out.println(events); + System.err.println(events); int startCount = events.getOrDefault("jdk.VirtualThreadStart", 0); int endCount = events.getOrDefault("jdk.VirtualThreadEnd", 0); - assertTrue(startCount == 100); - assertTrue(endCount == 100); + assertEquals(100, startCount); + assertEquals(100, endCount); } } @@ -89,35 +90,51 @@ void testVirtualThreadStartAndEnd() throws Exception { */ @Test void testVirtualThreadPinned() throws Exception { + Runnable[] parkers = new Runnable[] { + () -> LockSupport.park(), + () -> LockSupport.parkNanos(Duration.ofDays(1).toNanos()) + }; + try (Recording recording = new Recording()) { - recording.enable("jdk.VirtualThreadPinned") - .withThreshold(Duration.ofMillis(500)); + recording.enable("jdk.VirtualThreadPinned"); - // execute task in a virtual thread, carrier thread is pinned 3 times. recording.start(); - ThreadFactory factory = Thread.ofVirtual().factory(); - try (var executor = Executors.newThreadPerTaskExecutor(factory)) { - executor.submit(() -> { - synchronized (lock) { - // pinned, duration < 500ms - Thread.sleep(1); - - // pinned, duration > 500ms - Thread.sleep(Duration.ofSeconds(3)); - Thread.sleep(Duration.ofSeconds(3)); + try (var executor = Executors.newVirtualThreadPerTaskExecutor()) { + for (Runnable parker : parkers) { + // execute parking task in virtual thread + var threadRef = new AtomicReference(); + executor.submit(() -> { + threadRef.set(Thread.currentThread()); + synchronized (lock) { + parker.run(); // should pin carrier + } + }); + + // wait for the task to start and the virtual thread to park + Thread thread; + while ((thread = threadRef.get()) == null) { + Thread.sleep(10); } - return null; - }); + try { + Thread.State state = thread.getState(); + while (state != Thread.State.WAITING && state != Thread.State.TIMED_WAITING) { + Thread.sleep(10); + state = thread.getState(); + } + } finally { + LockSupport.unpark(thread); + } + } } finally { recording.stop(); } Map events = sumEvents(recording); - System.out.println(events); + System.err.println(events); - // should have two pinned events recorded + // should have a pinned event for each park int pinnedCount = events.getOrDefault("jdk.VirtualThreadPinned", 0); - assertTrue(pinnedCount == 2); + assertEquals(parkers.length, pinnedCount); } } @@ -164,10 +181,10 @@ void testVirtualThreadSubmitFailed() throws Exception { } Map events = sumEvents(recording); - System.out.println(events); + System.err.println(events); int count = events.getOrDefault("jdk.VirtualThreadSubmitFailed", 0); - assertTrue(count == 2); + assertEquals(2, count); } } From 2abfc99d2cece7f6020cf97593bb63641dd8e7de Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 11 Jan 2024 07:26:44 +0000 Subject: [PATCH 130/261] 8310629: java/security/cert/CertPathValidator/OCSP/OCSPTimeout.java fails with RuntimeException Server not ready Backport-of: b20dc1e9cda1ea3a76b3f14c778c6816e5cc1c0c --- .../java/security/cert/CertPathValidator/OCSP/OCSPTimeout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/security/cert/CertPathValidator/OCSP/OCSPTimeout.java b/test/jdk/java/security/cert/CertPathValidator/OCSP/OCSPTimeout.java index 59873a368e5..4df00c5aa9a 100644 --- a/test/jdk/java/security/cert/CertPathValidator/OCSP/OCSPTimeout.java +++ b/test/jdk/java/security/cert/CertPathValidator/OCSP/OCSPTimeout.java @@ -189,7 +189,7 @@ private static void createPKI() throws Exception { rootOcsp.start(); // Wait 5 seconds for server ready - boolean readyStatus = rootOcsp.awaitServerReady(5, TimeUnit.SECONDS); + boolean readyStatus = rootOcsp.awaitServerReady(60, TimeUnit.SECONDS); if (!readyStatus) { throw new RuntimeException("Server not ready"); } From cd166703a20c4ac51bc6478e8a0bb1275d9cb913 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 11 Jan 2024 07:30:30 +0000 Subject: [PATCH 131/261] 8318490: Increase timeout for JDK tests that are close to the limit when run with libgraal Backport-of: 6f263111a1812873291e91870e341ccce804d049 --- .../intrinsics/string/TestStringIntrinsicRangeChecks.java | 2 +- .../jtreg/compiler/vectorapi/reshape/TestVectorCastAVX1.java | 2 +- .../jtreg/compiler/vectorapi/reshape/TestVectorCastAVX2.java | 2 +- .../jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512.java | 2 +- .../compiler/vectorapi/reshape/TestVectorCastAVX512BW.java | 2 +- .../compiler/vectorapi/reshape/TestVectorCastAVX512DQ.java | 2 +- .../jtreg/compiler/vectorapi/reshape/TestVectorCastNeon.java | 2 +- .../jtreg/compiler/vectorapi/reshape/TestVectorCastSVE.java | 2 +- test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread007.java | 2 +- test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread008.java | 2 +- test/jdk/jdk/incubator/vector/Byte128VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Byte256VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Byte512VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Byte64VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Double128VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Double256VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Double512VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Double64VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Float128VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Float256VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Float512VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Float64VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Int128VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Int256VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Int512VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Int64VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/IntMaxVectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Long128VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Long256VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Long512VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Long64VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/LongMaxVectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Short128VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Short256VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Short512VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/Short64VectorTests.java | 2 +- test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java | 2 +- test/jdk/jdk/incubator/vector/templates/Unit-header.template | 2 +- 41 files changed, 41 insertions(+), 41 deletions(-) diff --git a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java index 76bfda0f51f..a7d2cfe7fa7 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java +++ b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java @@ -27,7 +27,7 @@ * @summary Verifies that string intrinsics throw array out of bounds exceptions. * @library /compiler/patches /test/lib * @build java.base/java.lang.Helper - * @run main/othervm -Xbatch -XX:CompileThreshold=100 compiler.intrinsics.string.TestStringIntrinsicRangeChecks + * @run main/othervm/timeout=300 -Xbatch -XX:CompileThreshold=100 compiler.intrinsics.string.TestStringIntrinsicRangeChecks */ package compiler.intrinsics.string; diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX1.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX1.java index 1312ef3c46c..27643ae6d6e 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX1.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX1.java @@ -37,7 +37,7 @@ * @summary Test that vector cast intrinsics work as intended on avx1. * @requires vm.cpu.features ~= ".*avx.*" * @library /test/lib / - * @run main compiler.vectorapi.reshape.TestVectorCastAVX1 + * @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastAVX1 */ public class TestVectorCastAVX1 { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX2.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX2.java index a963f5b5bab..162f9d2d7df 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX2.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX2.java @@ -37,7 +37,7 @@ * @summary Test that vector cast intrinsics work as intended on avx2. * @requires vm.cpu.features ~= ".*avx2.*" * @library /test/lib / - * @run main compiler.vectorapi.reshape.TestVectorCastAVX2 + * @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastAVX2 */ public class TestVectorCastAVX2 { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512.java index 10becff9be3..1e77ee8d14c 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512.java @@ -37,7 +37,7 @@ * @summary Test that vector cast intrinsics work as intended on avx512. * @requires vm.cpu.features ~= ".*avx512.*" * @library /test/lib / - * @run main compiler.vectorapi.reshape.TestVectorCastAVX512 + * @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastAVX512 */ public class TestVectorCastAVX512 { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512BW.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512BW.java index 258241fe660..2224e3bb1bc 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512BW.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512BW.java @@ -37,7 +37,7 @@ * @summary Test that vector cast intrinsics work as intended on avx512bw. * @requires vm.cpu.features ~= ".*avx512bw.*" * @library /test/lib / - * @run main compiler.vectorapi.reshape.TestVectorCastAVX512BW + * @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastAVX512BW */ public class TestVectorCastAVX512BW { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512DQ.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512DQ.java index 359e32b6b71..3c0da9fff1c 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512DQ.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastAVX512DQ.java @@ -37,7 +37,7 @@ * @summary Test that vector cast intrinsics work as intended on avx512dq. * @requires vm.cpu.features ~= ".*avx512dq.*" * @library /test/lib / - * @run main compiler.vectorapi.reshape.TestVectorCastAVX512DQ + * @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastAVX512DQ */ public class TestVectorCastAVX512DQ { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastNeon.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastNeon.java index 74c377eeb07..e10ad034607 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastNeon.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastNeon.java @@ -37,7 +37,7 @@ * @summary Test that vector cast intrinsics work as intended on neon. * @requires vm.cpu.features ~= ".*asimd.*" * @library /test/lib / - * @run main compiler.vectorapi.reshape.TestVectorCastNeon + * @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastNeon */ public class TestVectorCastNeon { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastSVE.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastSVE.java index 48aff2b0ffd..6683d7db972 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastSVE.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/TestVectorCastSVE.java @@ -37,7 +37,7 @@ * @summary Test that vector cast intrinsics work as intended on sve. * @requires vm.cpu.features ~= ".*sve.*" * @library /test/lib / - * @run main compiler.vectorapi.reshape.TestVectorCastSVE + * @run main/timeout=300 compiler.vectorapi.reshape.TestVectorCastSVE */ public class TestVectorCastSVE { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread007.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread007.java index 07031a783bf..26388c28d0a 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread007.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread007.java @@ -32,7 +32,7 @@ * Try to start the given number of threads starting simultaneously * when notifyall() is signaled at the stopLine object. * - * @run main/othervm nsk.stress.thread.thread007 500 2m 5s + * @run main/othervm/timeout=300 nsk.stress.thread.thread007 500 2m 5s */ package nsk.stress.thread; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread008.java b/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread008.java index 40a76e00d11..2cbc198a693 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread008.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread008.java @@ -33,7 +33,7 @@ * starting simultaneously when notifyall() is signaled at the * stopLine object. * - * @run main/othervm nsk.stress.thread.thread008 500 2m 5s + * @run main/othervm/timeout=300 nsk.stress.thread.thread008 500 2m 5s */ package nsk.stress.thread; diff --git a/test/jdk/jdk/incubator/vector/Byte128VectorTests.java b/test/jdk/jdk/incubator/vector/Byte128VectorTests.java index 9d656f0e338..65a0acf6dac 100644 --- a/test/jdk/jdk/incubator/vector/Byte128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Byte128VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Byte128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte128VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Byte256VectorTests.java b/test/jdk/jdk/incubator/vector/Byte256VectorTests.java index 31ecc509c39..87c5f3a39c2 100644 --- a/test/jdk/jdk/incubator/vector/Byte256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Byte256VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Byte256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte256VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Byte512VectorTests.java b/test/jdk/jdk/incubator/vector/Byte512VectorTests.java index b677d6fde59..97e70d2f85d 100644 --- a/test/jdk/jdk/incubator/vector/Byte512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Byte512VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Byte512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte512VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Byte64VectorTests.java b/test/jdk/jdk/incubator/vector/Byte64VectorTests.java index 3c33d91854c..92019e6957a 100644 --- a/test/jdk/jdk/incubator/vector/Byte64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Byte64VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Byte64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte64VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java b/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java index 3d19d2ab6d0..921b2be725c 100644 --- a/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation ByteMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ByteMaxVectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Double128VectorTests.java b/test/jdk/jdk/incubator/vector/Double128VectorTests.java index 8336b59accb..383d42cfa55 100644 --- a/test/jdk/jdk/incubator/vector/Double128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Double128VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Double128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double128VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Double256VectorTests.java b/test/jdk/jdk/incubator/vector/Double256VectorTests.java index f170ccc406b..770e95938f5 100644 --- a/test/jdk/jdk/incubator/vector/Double256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Double256VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Double256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double256VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Double512VectorTests.java b/test/jdk/jdk/incubator/vector/Double512VectorTests.java index 406636bed0e..f42c5930f48 100644 --- a/test/jdk/jdk/incubator/vector/Double512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Double512VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Double512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double512VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Double64VectorTests.java b/test/jdk/jdk/incubator/vector/Double64VectorTests.java index c86b0281072..a58fda6dc06 100644 --- a/test/jdk/jdk/incubator/vector/Double64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Double64VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Double64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double64VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java b/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java index bcc7b6b0144..33bff482c9e 100644 --- a/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation DoubleMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation DoubleMaxVectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Float128VectorTests.java b/test/jdk/jdk/incubator/vector/Float128VectorTests.java index 21de8e1bd96..40637be249b 100644 --- a/test/jdk/jdk/incubator/vector/Float128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Float128VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Float128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float128VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Float256VectorTests.java b/test/jdk/jdk/incubator/vector/Float256VectorTests.java index bd74e79d24b..874a064544e 100644 --- a/test/jdk/jdk/incubator/vector/Float256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Float256VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Float256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float256VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Float512VectorTests.java b/test/jdk/jdk/incubator/vector/Float512VectorTests.java index 527900594f4..e006883aa9f 100644 --- a/test/jdk/jdk/incubator/vector/Float512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Float512VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Float512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float512VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Float64VectorTests.java b/test/jdk/jdk/incubator/vector/Float64VectorTests.java index a07c4f19b13..8d98d2a72f5 100644 --- a/test/jdk/jdk/incubator/vector/Float64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Float64VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Float64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float64VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java b/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java index 1c42c670b87..2030f620c62 100644 --- a/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation FloatMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation FloatMaxVectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Int128VectorTests.java b/test/jdk/jdk/incubator/vector/Int128VectorTests.java index f69423c12e2..fcfe286034d 100644 --- a/test/jdk/jdk/incubator/vector/Int128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Int128VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Int128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int128VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Int256VectorTests.java b/test/jdk/jdk/incubator/vector/Int256VectorTests.java index f580c39c091..64cad182a24 100644 --- a/test/jdk/jdk/incubator/vector/Int256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Int256VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Int256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int256VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Int512VectorTests.java b/test/jdk/jdk/incubator/vector/Int512VectorTests.java index 89cd557ec9b..468a2c3a8f1 100644 --- a/test/jdk/jdk/incubator/vector/Int512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Int512VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Int512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int512VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Int64VectorTests.java b/test/jdk/jdk/incubator/vector/Int64VectorTests.java index 0affccd742b..14b853c1e72 100644 --- a/test/jdk/jdk/incubator/vector/Int64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Int64VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Int64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int64VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java b/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java index c0fdcbf58a3..b608b548cee 100644 --- a/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation IntMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation IntMaxVectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Long128VectorTests.java b/test/jdk/jdk/incubator/vector/Long128VectorTests.java index a706b884f8b..e80497c3584 100644 --- a/test/jdk/jdk/incubator/vector/Long128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Long128VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Long128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long128VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Long256VectorTests.java b/test/jdk/jdk/incubator/vector/Long256VectorTests.java index 3056c8cbcaa..b3762b4c15a 100644 --- a/test/jdk/jdk/incubator/vector/Long256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Long256VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Long256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long256VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Long512VectorTests.java b/test/jdk/jdk/incubator/vector/Long512VectorTests.java index 5a0a5d106bf..57ba7738d13 100644 --- a/test/jdk/jdk/incubator/vector/Long512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Long512VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Long512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long512VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Long64VectorTests.java b/test/jdk/jdk/incubator/vector/Long64VectorTests.java index 1a3ecebd57c..8917281196f 100644 --- a/test/jdk/jdk/incubator/vector/Long64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Long64VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Long64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long64VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java b/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java index d467107e9f2..913f7d6f527 100644 --- a/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation LongMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation LongMaxVectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Short128VectorTests.java b/test/jdk/jdk/incubator/vector/Short128VectorTests.java index 81568661570..e40a40686c9 100644 --- a/test/jdk/jdk/incubator/vector/Short128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Short128VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Short128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short128VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Short256VectorTests.java b/test/jdk/jdk/incubator/vector/Short256VectorTests.java index 14a54fcc1df..02138e3e8aa 100644 --- a/test/jdk/jdk/incubator/vector/Short256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Short256VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Short256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short256VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Short512VectorTests.java b/test/jdk/jdk/incubator/vector/Short512VectorTests.java index 8d869e5a66f..9577f22f58c 100644 --- a/test/jdk/jdk/incubator/vector/Short512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Short512VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Short512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short512VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/Short64VectorTests.java b/test/jdk/jdk/incubator/vector/Short64VectorTests.java index 47f37beecb6..71b3c6046b4 100644 --- a/test/jdk/jdk/incubator/vector/Short64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/Short64VectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation Short64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short64VectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java b/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java index 7e657a3f398..4a6adbf2c8e 100644 --- a/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation ShortMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ShortMaxVectorTests */ // -- This file was mechanically generated: Do not edit! -- // diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-header.template b/test/jdk/jdk/incubator/vector/templates/Unit-header.template index 0f460c231dc..a23ee5941a0 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-header.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-header.template @@ -24,7 +24,7 @@ /* * @test * @modules jdk.incubator.vector - * @run testng/othervm -ea -esa -Xbatch -XX:-TieredCompilation $vectorteststype$ + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation $vectorteststype$ */ #warn This file is preprocessed before being compiled From d92ff7c35a4f9fca5b47958ca610f7ae6b99bc74 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Mon, 15 Jan 2024 15:15:45 +0000 Subject: [PATCH 132/261] 8320309: AIX: pthreads created by foreign test library don't work as expected Backport-of: 8b47a14958913c70291d46afdde4e527f9bdc91a --- test/lib/native/testlib_threads.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/lib/native/testlib_threads.h b/test/lib/native/testlib_threads.h index 3faf94f8e9f..575a5a3c15f 100644 --- a/test/lib/native/testlib_threads.h +++ b/test/lib/native/testlib_threads.h @@ -81,10 +81,15 @@ void run_in_new_thread_and_join(PROCEDURE proc, void* context) { } #else pthread_t thread; - int result = pthread_create(&thread, NULL, procedure, &helper); + pthread_attr_t attr; + pthread_attr_init(&attr); + size_t stack_size = 0x100000; + pthread_attr_setstacksize(&attr, stack_size); + int result = pthread_create(&thread, &attr, procedure, &helper); if (result != 0) { fatal("failed to create thread", result); } + pthread_attr_destroy(&attr); result = pthread_join(thread, NULL); if (result != 0) { fatal("failed to join thread", result); From e08eb0ec0181228468c51129a6a9378d749d6d02 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 15 Jan 2024 15:16:06 +0000 Subject: [PATCH 133/261] 8321582: yield .class not parsed correctly. Backport-of: ce8399fd6071766114f5f201b6e44a7abdba9f5a --- .../sun/tools/javac/parser/JavacParser.java | 1 + .../javac/switchexpr/ExpressionSwitch.java | 29 +++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java index 48d33dc51d3..e7b646cc8f9 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -2854,6 +2854,7 @@ List blockStatement() { case INTLITERAL: case LONGLITERAL: case FLOATLITERAL: case DOUBLELITERAL: case NULL: case IDENTIFIER: case TRUE: case FALSE: case NEW: case SWITCH: case THIS: case SUPER: + case BYTE, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE, VOID, BOOLEAN: isYieldStatement = true; break; case PLUSPLUS: case SUBSUB: diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java index b5c94d3ce94..1c040052e69 100644 --- a/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java +++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java @@ -1,12 +1,12 @@ /* * @test /nodynamiccopyright/ - * @bug 8206986 8222169 8224031 8240964 8267119 8268670 + * @bug 8206986 8222169 8224031 8240964 8267119 8268670 8321582 * @summary Check expression switch works. - * @compile/fail/ref=ExpressionSwitch-old.out --release 9 -XDrawDiagnostics ExpressionSwitch.java * @compile ExpressionSwitch.java * @run main ExpressionSwitch */ +// * @compile/fail/ref=ExpressionSwitch-old.out --release 9 -XDrawDiagnostics ExpressionSwitch.java import java.util.Objects; import java.util.function.Supplier; @@ -35,6 +35,16 @@ private void run() { localClass(T.A); assertEquals(castSwitchExpressions(T.A), "A"); testTypeInference(true, 0); + assertEquals(yieldPrimitiveDotClass("byte"), byte.class); + assertEquals(yieldPrimitiveDotClass("char"), char.class); + assertEquals(yieldPrimitiveDotClass("short"), short.class); + assertEquals(yieldPrimitiveDotClass("int"), int.class); + assertEquals(yieldPrimitiveDotClass("long"), long.class); + assertEquals(yieldPrimitiveDotClass("float"), float.class); + assertEquals(yieldPrimitiveDotClass("double"), double.class); + assertEquals(yieldPrimitiveDotClass("void"), void.class); + assertEquals(yieldPrimitiveDotClass("boolean"), boolean.class); + assertEquals(yieldPrimitiveDotClass("other"), null); } private String print(T t) { @@ -140,6 +150,21 @@ private boolean yieldUnaryNotOperator(String s, boolean b) { }; } + private Class yieldPrimitiveDotClass(String s) { + return switch (s) { + case "byte": yield byte.class; + case "char": yield char.class; + case "short": yield short.class; + case "int": yield int.class; + case "long": yield long.class; + case "float": yield float.class; + case "double": yield double.class; + case "void": yield void.class; + case "boolean": yield boolean.class; + default: yield null; + }; + } + private void localClass(T t) { String good = "good"; class L { From 6ee8f477721354ca6caaf62e74e24496b5ec850c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 15 Jan 2024 19:17:46 +0000 Subject: [PATCH 134/261] 8322512: StringBuffer.repeat does not work correctly after toString() was called Backport-of: df22fb322e6c4c9931a770bd0abf4c43b83c4e4a --- .../share/classes/java/lang/StringBuffer.java | 2 ++ .../lang/StringBuilder/StringBufferRepeat.java | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/lang/StringBuffer.java b/src/java.base/share/classes/java/lang/StringBuffer.java index ec7ecb5d245..d77462f0c70 100644 --- a/src/java.base/share/classes/java/lang/StringBuffer.java +++ b/src/java.base/share/classes/java/lang/StringBuffer.java @@ -715,6 +715,7 @@ public synchronized StringBuffer reverse() { */ @Override public synchronized StringBuffer repeat(int codePoint, int count) { + toStringCache = null; super.repeat(codePoint, count); return this; } @@ -726,6 +727,7 @@ public synchronized StringBuffer repeat(int codePoint, int count) { */ @Override public synchronized StringBuffer repeat(CharSequence cs, int count) { + toStringCache = null; super.repeat(cs, count); return this; } diff --git a/test/jdk/java/lang/StringBuilder/StringBufferRepeat.java b/test/jdk/java/lang/StringBuilder/StringBufferRepeat.java index 2d1f3c64f60..d78066fb417 100644 --- a/test/jdk/java/lang/StringBuilder/StringBufferRepeat.java +++ b/test/jdk/java/lang/StringBuilder/StringBufferRepeat.java @@ -29,7 +29,7 @@ /** * @test - * @bug 8302323 + * @bug 8302323 8322512 * @summary Test StringBuffer.repeat sanity tests * @run testng/othervm -XX:-CompactStrings StringBufferRepeat * @run testng/othervm -XX:+CompactStrings StringBufferRepeat @@ -129,6 +129,19 @@ public void sanity() { expected = "\u0000\u0000\u0000\u0000\u0000\u0000\u0020\u0020\u0020\u0020\u0020\u0020\u2461\u2462\u2462\u2462\u2462\u2462\udbff\udfff\udbff\udfff\udbff\udfff\udbff\udfff\udbff\udfff\udbff\udfff"; assertEquals(expected, sb.toString()); + // toStringCache + + sb.setLength(0); + sb.toString(); + sb.repeat('*', 5); + expected = "*****"; + assertEquals(sb.toString(), expected); + sb.setLength(0); + sb.toString(); + sb.repeat("*", 5); + assertEquals(sb.toString(), expected); + + } public void exceptions() { From 1b5aeb92607dd0bc8012dda0f28cc9d8a0fcff23 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 15 Jan 2024 19:20:02 +0000 Subject: [PATCH 135/261] 8323065: Unneccesary CodeBlob lookup in CompiledIC::internal_set_ic_destination Backport-of: eb9e754b3a439cc3ce36c2c9393bc8b250343844 --- src/hotspot/share/code/compiledIC.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/code/compiledIC.cpp b/src/hotspot/share/code/compiledIC.cpp index c19ee182d51..c6294ff5627 100644 --- a/src/hotspot/share/code/compiledIC.cpp +++ b/src/hotspot/share/code/compiledIC.cpp @@ -128,11 +128,13 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub tty->cr(); } +#ifdef ASSERT { CodeBlob* cb = CodeCache::find_blob(_call->instruction_address()); assert(cb != nullptr && cb->is_compiled(), "must be compiled"); - _call->set_destination_mt_safe(entry_point); } +#endif + _call->set_destination_mt_safe(entry_point); if (is_optimized() || is_icstub) { // Optimized call sites don't have a cache value and ICStub call From 7fe7cfce829cda52b612d457ebeffa4146a14748 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 16 Jan 2024 08:22:56 +0000 Subject: [PATCH 136/261] 8320907: Shenandoah: Remove ShenandoahSelfFixing flag Backport-of: 43c7f6a673c2fa0b4dbec232e92b621619a98246 --- src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp | 4 +--- .../share/gc/shenandoah/shenandoahBarrierSet.inline.hpp | 2 +- src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index ef6b08100b5..a04cfa60dd5 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -1386,11 +1386,9 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { Node* result_mem = nullptr; Node* addr; - if (ShenandoahSelfFixing) { + { VectorSet visited; addr = get_load_addr(phase, visited, lrb); - } else { - addr = phase->igvn().zerocon(T_OBJECT); } if (addr->Opcode() == Op_AddP) { Node* orig_base = addr->in(AddPNode::Base); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp index 413dfe10faa..b8da50dd6e1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp @@ -123,7 +123,7 @@ inline oop ShenandoahBarrierSet::load_reference_barrier(DecoratorSet decorators, } oop fwd = load_reference_barrier(obj); - if (ShenandoahSelfFixing && load_addr != nullptr && fwd != obj) { + if (load_addr != nullptr && fwd != obj) { // Since we are here and we know the load address, update the reference. ShenandoahHeap::atomic_update_oop(fwd, load_addr, obj); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index 6b5519a92e1..4d2ecb1cb1c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -361,9 +361,6 @@ product(bool, ShenandoahLoopOptsAfterExpansion, true, DIAGNOSTIC, \ "Attempt more loop opts after barrier expansion.") \ \ - product(bool, ShenandoahSelfFixing, true, DIAGNOSTIC, \ - "Fix references with load reference barrier. Disabling this " \ - "might degrade performance.") // end of GC_SHENANDOAH_FLAGS From b114a5e6a06580260de266a712c09a34dd758824 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 16 Jan 2024 08:33:39 +0000 Subject: [PATCH 137/261] 8320877: Shenandoah: Remove ShenandoahUnloadClassesFrequency support Backport-of: b65ccff357e2e294b027f693ceb3d25410236a6b --- .../shenandoahAggressiveHeuristics.cpp | 8 +------ .../heuristics/shenandoahHeuristics.cpp | 22 ++----------------- .../heuristics/shenandoahHeuristics.hpp | 1 - .../gc/shenandoah/shenandoah_globals.hpp | 5 ----- .../shenandoah/oom/TestClassLoaderLeak.java | 4 ---- 5 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp index 4ba3a0315b7..be758d14ed1 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp @@ -37,12 +37,6 @@ ShenandoahAggressiveHeuristics::ShenandoahAggressiveHeuristics() : ShenandoahHeu // Aggressive evacuates everything, so it needs as much evac space as it can get SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahEvacReserveOverflow); - - // If class unloading is globally enabled, aggressive does unloading even with - // concurrent cycles. - if (ClassUnloading) { - SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahUnloadClassesFrequency, 1); - } } void ShenandoahAggressiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* cset, @@ -62,7 +56,7 @@ bool ShenandoahAggressiveHeuristics::should_start_gc() { } bool ShenandoahAggressiveHeuristics::should_unload_classes() { - if (!can_unload_classes_normal()) return false; + if (!can_unload_classes()) return false; if (has_metaspace_oom()) return true; // Randomly unload classes with 50% chance. return (os::random() & 1) == 1; diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp index e571d39f6b3..ad924f87b67 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp @@ -53,11 +53,6 @@ ShenandoahHeuristics::ShenandoahHeuristics() : _gc_time_history(new TruncatedSeq(10, ShenandoahAdaptiveDecayFactor)), _metaspace_oom() { - // No unloading during concurrent mark? Communicate that to heuristics - if (!ClassUnloadingWithConcurrentMark) { - FLAG_SET_DEFAULT(ShenandoahUnloadClassesFrequency, 0); - } - size_t num_regions = ShenandoahHeap::heap()->num_regions(); assert(num_regions > 0, "Sanity"); @@ -262,23 +257,10 @@ bool ShenandoahHeuristics::can_unload_classes() { return true; } -bool ShenandoahHeuristics::can_unload_classes_normal() { - if (!can_unload_classes()) return false; - if (has_metaspace_oom()) return true; - if (!ClassUnloadingWithConcurrentMark) return false; - if (ShenandoahUnloadClassesFrequency == 0) return false; - return true; -} - bool ShenandoahHeuristics::should_unload_classes() { - if (!can_unload_classes_normal()) return false; + if (!can_unload_classes()) return false; if (has_metaspace_oom()) return true; - size_t cycle = ShenandoahHeap::heap()->shenandoah_policy()->cycle_counter(); - // Unload classes every Nth GC cycle. - // This should not happen in the same cycle as process_references to amortize costs. - // Offsetting by one is enough to break the rendezvous when periods are equal. - // When periods are not equal, offsetting by one is just as good as any other guess. - return (cycle + 1) % ShenandoahUnloadClassesFrequency == 0; + return ClassUnloadingWithConcurrentMark; } void ShenandoahHeuristics::initialize() { diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp index 288d306d089..8efe321692e 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp @@ -121,7 +121,6 @@ class ShenandoahHeuristics : public CHeapObj { virtual void choose_collection_set(ShenandoahCollectionSet* collection_set); virtual bool can_unload_classes(); - virtual bool can_unload_classes_normal(); virtual bool should_unload_classes(); virtual const char* name() = 0; diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index 4d2ecb1cb1c..6769c8c43c1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -76,11 +76,6 @@ " compact - run GC more frequently and with deeper targets to " \ "free up more memory.") \ \ - product(uintx, ShenandoahUnloadClassesFrequency, 1, EXPERIMENTAL, \ - "Unload the classes every Nth cycle. Normally affects concurrent "\ - "GC cycles, as degenerated and full GCs would try to unload " \ - "classes regardless. Set to zero to disable class unloading.") \ - \ product(uintx, ShenandoahGarbageThreshold, 25, EXPERIMENTAL, \ "How much garbage a region has to contain before it would be " \ "taken for collection. This a guideline only, as GC heuristics " \ diff --git a/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java b/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java index 080842c37f9..beb57b0b401 100644 --- a/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java +++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java @@ -140,14 +140,10 @@ public static void main(String[] args) throws Exception { // Even when concurrent unloading is disabled, Full GC has to recover passWith("-XX:ShenandoahGCMode=" + mode, "-XX:ShenandoahGCHeuristics=" + h, "-XX:+ClassUnloading", "-XX:-ClassUnloadingWithConcurrentMark"); - passWith("-XX:ShenandoahGCMode=" + mode, "-XX:ShenandoahGCHeuristics=" + h, "-XX:+ClassUnloading", "-XX:-ClassUnloadingWithConcurrentMark", "-XX:ShenandoahUnloadClassesFrequency=0"); - passWith("-XX:ShenandoahGCMode=" + mode, "-XX:ShenandoahGCHeuristics=" + h, "-XX:+ClassUnloading", "-XX:+ClassUnloadingWithConcurrentMark", "-XX:ShenandoahUnloadClassesFrequency=0"); // Should OOME when unloading forcefully disabled, even if local flags try to enable it back failWith("-XX:ShenandoahGCMode=" + mode, "-XX:ShenandoahGCHeuristics=" + h, "-XX:-ClassUnloading"); failWith("-XX:ShenandoahGCMode=" + mode, "-XX:ShenandoahGCHeuristics=" + h, "-XX:-ClassUnloading", "-XX:+ClassUnloadingWithConcurrentMark"); - failWith("-XX:ShenandoahGCMode=" + mode, "-XX:ShenandoahGCHeuristics=" + h, "-XX:-ClassUnloading", "-XX:+ClassUnloadingWithConcurrentMark", "-XX:ShenandoahUnloadClassesFrequency=1"); - failWith("-XX:ShenandoahGCMode=" + mode, "-XX:ShenandoahGCHeuristics=" + h, "-XX:-ClassUnloading", "-XX:-ClassUnloadingWithConcurrentMark", "-XX:ShenandoahUnloadClassesFrequency=1"); } } } From 77c743e5275aabcb7687a1a0f302f10535efdaf0 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 16 Jan 2024 08:34:04 +0000 Subject: [PATCH 138/261] 8320888: Shenandoah: Enable ShenandoahVerifyOptoBarriers in debug builds Backport-of: c86431767e6802317dc2be6221a5d0990b976ddc --- .../gc/shenandoah/shenandoah_globals.hpp | 2 +- .../gcbarriers/UnsafeIntrinsicsTest.java | 1 - .../gc/shenandoah/TestVerifyJCStress.java | 35 ------------------- .../options/TestSelectiveBarrierFlags.java | 3 +- 4 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index 6769c8c43c1..b41a971bba0 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -350,7 +350,7 @@ product(bool, ShenandoahStackWatermarkBarrier, true, DIAGNOSTIC, \ "Turn on/off stack watermark barriers in Shenandoah") \ \ - develop(bool, ShenandoahVerifyOptoBarriers, false, \ + develop(bool, ShenandoahVerifyOptoBarriers, trueInDebug, \ "Verify no missing barriers in C2.") \ \ product(bool, ShenandoahLoopOptsAfterExpansion, true, DIAGNOSTIC, \ diff --git a/test/hotspot/jtreg/compiler/gcbarriers/UnsafeIntrinsicsTest.java b/test/hotspot/jtreg/compiler/gcbarriers/UnsafeIntrinsicsTest.java index 06e43d2e08b..6a511fd60d9 100644 --- a/test/hotspot/jtreg/compiler/gcbarriers/UnsafeIntrinsicsTest.java +++ b/test/hotspot/jtreg/compiler/gcbarriers/UnsafeIntrinsicsTest.java @@ -97,7 +97,6 @@ * -XX:+UnlockDiagnosticVMOptions * -XX:-CreateCoredumpOnCrash * -XX:+ShenandoahVerify - * -XX:+IgnoreUnrecognizedVMOptions -XX:+ShenandoahVerifyOptoBarriers * -XX:CompileCommand=dontinline,*::mergeImpl* * compiler.gcbarriers.UnsafeIntrinsicsTest */ diff --git a/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java b/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java index 435c4c25004..312ab964f5e 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java @@ -40,30 +40,10 @@ * TestVerifyJCStress */ -/* - * @test id=default-debug - * @summary Tests that we pass at least one jcstress-like test with all verification turned on - * @requires vm.gc.Shenandoah - * @requires vm.debug - * @modules java.base/jdk.internal.misc - * java.management - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive - * -XX:+ShenandoahVerify -XX:+ShenandoahVerifyOptoBarriers - * TestVerifyJCStress - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact - * -XX:+ShenandoahVerify -XX:+ShenandoahVerifyOptoBarriers - * TestVerifyJCStress - */ - /* * @test id=default * @summary Tests that we pass at least one jcstress-like test with all verification turned on * @requires vm.gc.Shenandoah - * @requires !vm.debug * @modules java.base/jdk.internal.misc * java.management * @@ -78,25 +58,10 @@ * TestVerifyJCStress */ -/* - * @test id=iu-debug - * @summary Tests that we pass at least one jcstress-like test with all verification turned on - * @requires vm.gc.Shenandoah - * @requires vm.debug - * @modules java.base/jdk.internal.misc - * java.management - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu - * -XX:+ShenandoahVerify -XX:+ShenandoahVerifyOptoBarriers - * TestVerifyJCStress - */ - /* * @test id=iu * @summary Tests that we pass at least one jcstress-like test with all verification turned on * @requires vm.gc.Shenandoah - * @requires !vm.debug * @modules java.base/jdk.internal.misc * java.management * diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java index 1e1627d0fe5..5b34bfab3a0 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java @@ -35,9 +35,8 @@ * @summary Test selective barrier enabling works, by aggressively compiling HelloWorld with combinations * of barrier flags * @requires vm.gc.Shenandoah - * @requires vm.debug * @library /test/lib - * @run driver TestSelectiveBarrierFlags -Xbatch -XX:CompileThreshold=100 -XX:-TieredCompilation -XX:+ShenandoahVerifyOptoBarriers + * @run driver TestSelectiveBarrierFlags -Xbatch -XX:CompileThreshold=100 -XX:-TieredCompilation */ import java.util.*; From 45df078510ad6b8fb336e4180622ca3792bbe0cc Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 16 Jan 2024 09:02:01 +0000 Subject: [PATCH 139/261] 8319124: Update XML Security for Java to 3.0.3 Reviewed-by: mbaesken Backport-of: 1c0bd81a10f97c752818163a573d5983c7e481ac --- .../apache/xml/internal/security/Init.java | 50 +-- .../security/algorithms/JCEMapper.java | 22 +- .../algorithms/MessageDigestAlgorithm.java | 2 + .../algorithms/SignatureAlgorithm.java | 8 +- .../algorithms/SignatureAlgorithmSpi.java | 7 +- .../implementations/ECDSAUtils.java | 7 +- .../implementations/IntegrityHmac.java | 12 + .../implementations/SignatureBaseRSA.java | 174 +++++++++- .../implementations/SignatureDSA.java | 14 + .../implementations/SignatureECDSA.java | 22 +- .../implementations/SignatureEDDSA.java | 27 +- .../internal/security/c14n/Canonicalizer.java | 2 +- .../security/c14n/helper/AttrCompare.java | 6 +- .../Canonicalizer11_OmitComments.java | 1 + .../Canonicalizer11_WithComments.java | 1 + .../Canonicalizer20010315.java | 4 + .../Canonicalizer20010315Excl.java | 5 + ...Canonicalizer20010315ExclOmitComments.java | 1 + ...Canonicalizer20010315ExclWithComments.java | 1 + .../Canonicalizer20010315OmitComments.java | 1 + .../Canonicalizer20010315WithComments.java | 1 + .../implementations/CanonicalizerBase.java | 8 +- .../CanonicalizerPhysical.java | 4 + .../implementations/NameSpaceSymbTable.java | 22 +- .../exceptions/XMLSecurityException.java | 2 + .../xml/internal/security/keys/KeyInfo.java | 1 + .../keys/content/DEREncodedKeyValue.java | 1 + .../keys/content/KeyInfoReference.java | 1 + .../security/keys/content/KeyName.java | 1 + .../security/keys/content/KeyValue.java | 1 + .../security/keys/content/MgmtData.java | 1 + .../security/keys/content/PGPData.java | 1 + .../keys/content/RetrievalMethod.java | 1 + .../security/keys/content/SPKIData.java | 1 + .../security/keys/content/X509Data.java | 1 + .../keys/content/keyvalues/DSAKeyValue.java | 2 + .../keys/content/keyvalues/ECKeyValue.java | 11 +- .../keys/content/keyvalues/RSAKeyValue.java | 2 + .../keys/content/x509/XMLX509CRL.java | 1 + .../keys/content/x509/XMLX509Certificate.java | 7 +- .../keys/content/x509/XMLX509Digest.java | 1 + .../content/x509/XMLX509IssuerSerial.java | 3 + .../keys/content/x509/XMLX509SKI.java | 7 +- .../keys/content/x509/XMLX509SubjectName.java | 3 + .../keys/keyresolver/KeyResolver.java | 8 +- .../implementations/PrivateKeyResolver.java | 2 + .../implementations/RSAKeyValueResolver.java | 1 - .../implementations/SecretKeyResolver.java | 2 + .../implementations/SingleKeyResolver.java | 2 + .../X509CertificateResolver.java | 4 +- .../implementations/X509DigestResolver.java | 3 +- .../implementations/X509SKIResolver.java | 9 +- .../X509SubjectNameResolver.java | 15 +- .../keys/storage/StorageResolver.java | 3 + .../implementations/KeyStoreResolver.java | 4 + .../SingleCertificateResolver.java | 4 + .../internal/security/parser/XMLParser.java | 9 + .../security/parser/XMLParserImpl.java | 6 +- .../internal/security/signature/Manifest.java | 1 + .../security/signature/ObjectContainer.java | 1 + .../security/signature/Reference.java | 4 + .../signature/SignatureProperties.java | 1 + .../security/signature/SignatureProperty.java | 1 + .../security/signature/SignedInfo.java | 3 +- .../security/signature/XMLSignature.java | 1 + .../security/signature/XMLSignatureInput.java | 1 + .../reference/ReferenceSubTreeData.java | 5 + .../xml/internal/security/utils/Base64.java | 44 +-- .../security/utils/DOMNamespaceContext.java | 3 + .../security/utils/DigesterOutputStream.java | 5 +- .../internal/security/utils/ElementProxy.java | 2 +- .../security/utils/HelperNodeList.java | 2 + .../internal/security/utils/JDKXPathAPI.java | 3 + .../security/utils/JDKXPathFactory.java | 1 + .../internal/security/utils/JavaUtils.java | 2 +- .../utils/Signature11ElementProxy.java | 1 + .../security/utils/SignatureElementProxy.java | 1 + .../security/utils/SignerOutputStream.java | 3 + .../utils/UnsyncByteArrayOutputStream.java | 3 + .../xml/internal/security/utils/XMLUtils.java | 95 +++++- .../implementations/ResolverDirectHTTP.java | 3 +- .../implementations/ResolverFragment.java | 1 + .../ResolverLocalFilesystem.java | 1 + .../implementations/ResolverXPointer.java | 1 + .../xml/crypto/dsig/SignatureMethod.java | 1 + .../dsig/internal/DigesterOutputStream.java | 1 + .../xml/dsig/internal/MacOutputStream.java | 1 + .../dom/AbstractDOMSignatureMethod.java | 6 +- .../internal/dom/ApacheCanonicalizer.java | 14 +- .../jcp/xml/dsig/internal/dom/ApacheData.java | 1 + .../dsig/internal/dom/ApacheNodeSetData.java | 7 +- .../internal/dom/ApacheOctetStreamData.java | 3 + .../dsig/internal/dom/ApacheTransform.java | 28 +- .../dom/DOMCanonicalXMLC14N11Method.java | 11 +- .../dom/DOMCanonicalXMLC14NMethod.java | 12 +- .../dom/DOMCanonicalizationMethod.java | 10 +- .../dsig/internal/dom/DOMCryptoBinary.java | 3 +- .../dsig/internal/dom/DOMDigestMethod.java | 19 +- .../internal/dom/DOMEnvelopedTransform.java | 2 + .../dsig/internal/dom/DOMExcC14NMethod.java | 22 +- .../internal/dom/DOMHMACSignatureMethod.java | 38 ++- .../jcp/xml/dsig/internal/dom/DOMKeyInfo.java | 3 + .../dsig/internal/dom/DOMKeyInfoFactory.java | 14 +- .../jcp/xml/dsig/internal/dom/DOMKeyName.java | 1 + .../xml/dsig/internal/dom/DOMKeyValue.java | 2 + .../xml/dsig/internal/dom/DOMManifest.java | 16 +- .../jcp/xml/dsig/internal/dom/DOMPGPData.java | 13 +- .../dom/DOMRSAPSSSignatureMethod.java | 34 +- .../xml/dsig/internal/dom/DOMReference.java | 64 +++- .../dsig/internal/dom/DOMRetrievalMethod.java | 5 + .../dsig/internal/dom/DOMSignatureMethod.java | 308 ++++++++++++------ .../internal/dom/DOMSignatureProperties.java | 14 +- .../internal/dom/DOMSignatureProperty.java | 15 +- .../xml/dsig/internal/dom/DOMSignedInfo.java | 55 ++-- .../xml/dsig/internal/dom/DOMStructure.java | 6 +- .../xml/dsig/internal/dom/DOMSubTreeData.java | 7 +- .../xml/dsig/internal/dom/DOMTransform.java | 4 + .../dsig/internal/dom/DOMURIDereferencer.java | 18 +- .../xml/dsig/internal/dom/DOMX509Data.java | 7 +- .../internal/dom/DOMX509IssuerSerial.java | 8 +- .../xml/dsig/internal/dom/DOMXMLObject.java | 19 +- .../dsig/internal/dom/DOMXMLSignature.java | 61 ++-- .../internal/dom/DOMXMLSignatureFactory.java | 64 +++- .../dom/DOMXPathFilter2Transform.java | 3 + .../dsig/internal/dom/DOMXPathTransform.java | 2 + .../dsig/internal/dom/DOMXSLTTransform.java | 11 +- .../org/jcp/xml/dsig/internal/dom/Utils.java | 6 +- .../jcp/xml/dsig/internal/dom/XMLDSigRI.java | 18 +- src/java.xml.crypto/share/legal/santuario.md | 2 +- .../xml/crypto/dsig/GenerationTests.java | 46 ++- 130 files changed, 1300 insertions(+), 417 deletions(-) diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java index a35a4699d82..72153164340 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java @@ -57,17 +57,22 @@ */ public class Init { - /** The namespace for CONF file **/ + /** + * The namespace for CONF file + **/ public static final String CONF_NS = "http://www.xmlsecurity.org/NS/#configuration"; private static final com.sun.org.slf4j.internal.Logger LOG = - com.sun.org.slf4j.internal.LoggerFactory.getLogger(Init.class); + com.sun.org.slf4j.internal.LoggerFactory.getLogger(Init.class); - /** Field alreadyInitialized */ + /** + * Field alreadyInitialized + */ private static boolean alreadyInitialized = false; /** * Method isInitialized + * * @return true if the library is already initialized. */ public static final synchronized boolean isInitialized() { @@ -76,35 +81,28 @@ public static final synchronized boolean isInitialized() { /** * Method init - * */ public static synchronized void init() { if (alreadyInitialized) { return; } + PrivilegedAction action = () -> { + String cfile = System.getProperty("com.sun.org.apache.xml.internal.security.resource.config"); + if (cfile == null) { + return null; + } + return getResourceAsStream(cfile, Init.class); + }; - @SuppressWarnings("removal") - InputStream is = //NOPMD - AccessController.doPrivileged( - (PrivilegedAction) - () -> { - String cfile = - System.getProperty("com.sun.org.apache.xml.internal.security.resource.config"); - if (cfile == null) { - return null; - } - return getResourceAsStream(cfile, Init.class); - } - ); - if (is == null) { - dynamicInit(); - } else { - fileInit(is); - try { - is.close(); - } catch (IOException ex) { - LOG.warn(ex.getMessage()); + try (@SuppressWarnings("removal") + InputStream is = AccessController.doPrivileged(action)) { + if (is == null) { + dynamicInit(); + } else { + fileInit(is); } + } catch (IOException ex) { + LOG.warn(ex.getMessage(), ex); } alreadyInitialized = true; @@ -412,9 +410,11 @@ private static List getResources(String resourceName, Class callingClass } List ret = new ArrayList<>(); Enumeration urls = new Enumeration() { + @Override public boolean hasMoreElements() { return false; } + @Override public URL nextElement() { return null; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java index 5483f02f127..e4c1a30d525 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java @@ -40,7 +40,9 @@ public class JCEMapper { private static Map algorithmsMap = new ConcurrentHashMap<>(); - private static String providerName; + private static String globalProviderName; + + private static final ThreadLocal threadSpecificProviderName = new ThreadLocal<>(); /** * Method register @@ -344,7 +346,10 @@ private static Algorithm getAlgorithm(String algorithmURI) { * @return the default providerId. */ public static String getProviderId() { - return providerName; + if (threadSpecificProviderName.get() != null) { + return threadSpecificProviderName.get(); + } + return globalProviderName; } /** @@ -355,7 +360,18 @@ public static String getProviderId() { */ public static void setProviderId(String provider) { JavaUtils.checkRegisterPermission(); - providerName = provider; + globalProviderName = provider; + } + + /** + * Sets the default Provider for this thread to obtain the security algorithms + * @param threadSpecificProviderName the default providerId. + * @throws SecurityException if a security manager is installed and the + * caller does not have permission to register the JCE algorithm + */ + public static void setThreadSpecificProviderName(String threadSpecificProviderName) { + JavaUtils.checkRegisterPermission(); + JCEMapper.threadSpecificProviderName.set(threadSpecificProviderName); } /** diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java index 6c3f500dbe8..17351f0211e 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java @@ -256,11 +256,13 @@ public void update(byte[] buf, int offset, int len) { } /** {@inheritDoc} */ + @Override public String getBaseNamespace() { return Constants.SignatureSpecNS; } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_DIGESTMETHOD; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java index 0c984d4e030..439eefb10dc 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java @@ -31,7 +31,11 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import com.sun.org.apache.xml.internal.security.algorithms.implementations.*; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.IntegrityHmac; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureBaseRSA; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureDSA; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureECDSA; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureEDDSA; import com.sun.org.apache.xml.internal.security.exceptions.AlgorithmAlreadyRegisteredException; import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.signature.XMLSignature; @@ -524,6 +528,7 @@ public static void registerDefaultAlgorithms() { * * @return URI of this element */ + @Override public String getBaseNamespace() { return Constants.SignatureSpecNS; } @@ -533,6 +538,7 @@ public String getBaseNamespace() { * * @return Local name */ + @Override public String getBaseLocalName() { return Constants._TAG_SIGNATUREMETHOD; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithmSpi.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithmSpi.java index a049733c0ad..fde070f6354 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithmSpi.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithmSpi.java @@ -22,7 +22,12 @@ */ package com.sun.org.apache.xml.internal.security.algorithms; -import java.security.*; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.Signature; import java.security.spec.AlgorithmParameterSpec; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureException; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java index 510fab21584..73e02864bd9 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java @@ -28,7 +28,12 @@ import java.io.IOException; import java.math.BigInteger; import java.security.interfaces.ECPublicKey; -import java.security.spec.*; +import java.security.spec.ECField; +import java.security.spec.ECFieldF2m; +import java.security.spec.ECFieldFp; +import java.security.spec.ECParameterSpec; +import java.security.spec.ECPoint; +import java.security.spec.EllipticCurve; import java.util.ArrayList; import java.util.List; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java index fdaf8643279..8f833756ff8 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java @@ -90,6 +90,7 @@ public IntegrityHmac(Provider provider) throws XMLSignatureException { * @param params * @throws XMLSignatureException */ + @Override protected void engineSetParameter(AlgorithmParameterSpec params) throws XMLSignatureException { throw new XMLSignatureException("empty", new Object[]{"Incorrect method call"}); } @@ -102,6 +103,7 @@ protected void engineSetParameter(AlgorithmParameterSpec params) throws XMLSigna * @return true if the signature is correct * @throws XMLSignatureException */ + @Override protected boolean engineVerify(byte[] signature) throws XMLSignatureException { try { if (hmacOutputLength != null && hmacOutputLength.length < getDigestLength()) { @@ -124,6 +126,7 @@ protected boolean engineVerify(byte[] signature) throws XMLSignatureException { * @param secretKey * @throws XMLSignatureException */ + @Override protected void engineInitVerify(Key secretKey) throws XMLSignatureException { if (!(secretKey instanceof SecretKey)) { String supplied = null; @@ -150,6 +153,7 @@ protected void engineInitVerify(Key secretKey) throws XMLSignatureException { * @return the result of the {@link java.security.Signature#sign()} method * @throws XMLSignatureException */ + @Override protected byte[] engineSign() throws XMLSignatureException { try { if (hmacOutputLength != null && hmacOutputLength.length < getDigestLength()) { @@ -170,6 +174,7 @@ protected byte[] engineSign() throws XMLSignatureException { * @param secretKey * @throws XMLSignatureException */ + @Override protected void engineInitSign(Key secretKey) throws XMLSignatureException { engineInitSign(secretKey, (AlgorithmParameterSpec)null); } @@ -181,6 +186,7 @@ protected void engineInitSign(Key secretKey) throws XMLSignatureException { * @param algorithmParameterSpec * @throws XMLSignatureException */ + @Override protected void engineInitSign( Key secretKey, AlgorithmParameterSpec algorithmParameterSpec ) throws XMLSignatureException { @@ -213,6 +219,7 @@ protected void engineInitSign( * @param secureRandom * @throws XMLSignatureException */ + @Override protected void engineInitSign(Key secretKey, SecureRandom secureRandom) throws XMLSignatureException { throw new XMLSignatureException("algorithms.CannotUseSecureRandomOnMAC"); @@ -225,6 +232,7 @@ protected void engineInitSign(Key secretKey, SecureRandom secureRandom) * @param input * @throws XMLSignatureException */ + @Override protected void engineUpdate(byte[] input) throws XMLSignatureException { try { this.macAlgorithm.update(input); @@ -240,6 +248,7 @@ protected void engineUpdate(byte[] input) throws XMLSignatureException { * @param input * @throws XMLSignatureException */ + @Override protected void engineUpdate(byte input) throws XMLSignatureException { try { this.macAlgorithm.update(input); @@ -257,6 +266,7 @@ protected void engineUpdate(byte input) throws XMLSignatureException { * @param len * @throws XMLSignatureException */ + @Override protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignatureException { try { this.macAlgorithm.update(buf, offset, len); @@ -270,6 +280,7 @@ protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignature * {@inheritDoc} * */ + @Override protected String engineGetJCEAlgorithmString() { return this.macAlgorithm.getAlgorithm(); } @@ -279,6 +290,7 @@ protected String engineGetJCEAlgorithmString() { * * {@inheritDoc} */ + @Override protected String engineGetJCEProviderName() { return this.macAlgorithm.getProvider().getName(); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureBaseRSA.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureBaseRSA.java index 5186520729a..45dafc3ad38 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureBaseRSA.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureBaseRSA.java @@ -31,6 +31,8 @@ import java.security.Signature; import java.security.SignatureException; import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.MGF1ParameterSpec; +import java.security.spec.PSSParameterSpec; import com.sun.org.apache.xml.internal.security.algorithms.JCEMapper; import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithmSpi; @@ -43,8 +45,6 @@ import org.w3c.dom.Text; import javax.xml.crypto.dsig.DigestMethod; -import java.security.spec.MGF1ParameterSpec; -import java.security.spec.PSSParameterSpec; public abstract class SignatureBaseRSA extends SignatureAlgorithmSpi { @@ -65,20 +65,25 @@ public SignatureBaseRSA() throws XMLSignatureException { public SignatureBaseRSA(Provider provider) throws XMLSignatureException { String algorithmID = JCEMapper.translateURItoJCEID(this.engineGetURI()); - LOG.debug("Created SignatureRSA using {}", algorithmID); + this.signatureAlgorithm = getSignature(provider, algorithmID); + LOG.debug("Created SignatureRSA using {0} and provider {1}", + algorithmID, signatureAlgorithm.getProvider()); + } + Signature getSignature(Provider provider, String algorithmID) + throws XMLSignatureException { try { if (provider == null) { String providerId = JCEMapper.getProviderId(); if (providerId == null) { - this.signatureAlgorithm = Signature.getInstance(algorithmID); + return Signature.getInstance(algorithmID); } else { - this.signatureAlgorithm = Signature.getInstance(algorithmID, providerId); + return Signature.getInstance(algorithmID, providerId); } } else { - this.signatureAlgorithm = Signature.getInstance(algorithmID, provider); + return Signature.getInstance(algorithmID, provider); } } catch (NoSuchAlgorithmException | NoSuchProviderException ex) { @@ -88,6 +93,7 @@ public SignatureBaseRSA(Provider provider) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineSetParameter(AlgorithmParameterSpec params) throws XMLSignatureException { try { @@ -98,6 +104,7 @@ protected void engineSetParameter(AlgorithmParameterSpec params) } /** {@inheritDoc} */ + @Override protected boolean engineVerify(byte[] signature) throws XMLSignatureException { try { return this.signatureAlgorithm.verify(signature); @@ -107,11 +114,13 @@ protected boolean engineVerify(byte[] signature) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineInitVerify(Key publicKey) throws XMLSignatureException { engineInitVerify(publicKey, this.signatureAlgorithm); } /** {@inheritDoc} */ + @Override protected byte[] engineSign() throws XMLSignatureException { try { return this.signatureAlgorithm.sign(); @@ -121,17 +130,20 @@ protected byte[] engineSign() throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey, SecureRandom secureRandom) throws XMLSignatureException { engineInitSign(privateKey, secureRandom, this.signatureAlgorithm); } /** {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey) throws XMLSignatureException { engineInitSign(privateKey, (SecureRandom)null); } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte[] input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -141,6 +153,7 @@ protected void engineUpdate(byte[] input) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -150,6 +163,7 @@ protected void engineUpdate(byte input) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignatureException { try { this.signatureAlgorithm.update(buf, offset, len); @@ -159,22 +173,26 @@ protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignature } /** {@inheritDoc} */ + @Override protected String engineGetJCEAlgorithmString() { return this.signatureAlgorithm.getAlgorithm(); } /** {@inheritDoc} */ + @Override protected String engineGetJCEProviderName() { return this.signatureAlgorithm.getProvider().getName(); } /** {@inheritDoc} */ + @Override protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatureException { throw new XMLSignatureException("algorithms.HMACOutputLengthOnlyForHMAC"); } /** {@inheritDoc} */ + @Override protected void engineInitSign( Key signingKey, AlgorithmParameterSpec algorithmParameterSpec ) throws XMLSignatureException { @@ -356,10 +374,53 @@ public String engineGetURI() { } } + public abstract static class SignatureBaseRSAPSS extends SignatureBaseRSA { + + public SignatureBaseRSAPSS() throws XMLSignatureException { + super(); + } + + public SignatureBaseRSAPSS(Provider provider) throws XMLSignatureException { + super(provider); + } + + @Override + Signature getSignature(Provider provider, String algorithmID) + throws XMLSignatureException { + try { + Signature sig; + if (provider == null) { + String providerId = JCEMapper.getProviderId(); + if (providerId == null) { + sig = Signature.getInstance("RSASSA-PSS"); + } else { + sig = Signature.getInstance("RSASSA-PSS", providerId); + } + } else { + sig = Signature.getInstance("RSASSA-PSS", provider); + } + try { + sig.setParameter(getPSSParameterSpec()); + } catch (InvalidAlgorithmParameterException e) { + throw new NoSuchAlgorithmException("Should not happen", e); + } + return sig; + } catch (NoSuchAlgorithmException | NoSuchProviderException e) { + return super.getSignature(provider, algorithmID); + } + } + + abstract PSSParameterSpec getPSSParameterSpec(); + } + /** * Class SignatureRSASHA1MGF1 */ - public static class SignatureRSASHA1MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA1MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA1_MGF1_PARAMS + = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, + 20, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA1MGF1 @@ -379,12 +440,21 @@ public SignatureRSASHA1MGF1(Provider provider) throws XMLSignatureException { public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA1_MGF1_PARAMS; + } } /** * Class SignatureRSASHA224MGF1 */ - public static class SignatureRSASHA224MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA224MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA224_MGF1_PARAMS + = new PSSParameterSpec("SHA-224", "MGF1", MGF1ParameterSpec.SHA224, + 28, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA224MGF1 @@ -404,12 +474,21 @@ public SignatureRSASHA224MGF1(Provider provider) throws XMLSignatureException { public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA224_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA224_MGF1_PARAMS; + } } /** * Class SignatureRSASHA256MGF1 */ - public static class SignatureRSASHA256MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA256MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA256_MGF1_PARAMS + = new PSSParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, + 32, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA256MGF1 @@ -429,12 +508,21 @@ public SignatureRSASHA256MGF1(Provider provider) throws XMLSignatureException { public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA256_MGF1_PARAMS; + } } /** * Class SignatureRSASHA384MGF1 */ - public static class SignatureRSASHA384MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA384MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA384_MGF1_PARAMS + = new PSSParameterSpec("SHA-384", "MGF1", MGF1ParameterSpec.SHA384, + 48, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA384MGF1 @@ -454,12 +542,21 @@ public SignatureRSASHA384MGF1(Provider provider) throws XMLSignatureException { public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA384_MGF1_PARAMS; + } } /** * Class SignatureRSASHA512MGF1 */ - public static class SignatureRSASHA512MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA512MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA512_MGF1_PARAMS + = new PSSParameterSpec("SHA-512", "MGF1", MGF1ParameterSpec.SHA512, + 64, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA512MGF1 @@ -479,12 +576,22 @@ public SignatureRSASHA512MGF1(Provider provider) throws XMLSignatureException { public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA512_MGF1_PARAMS; + } } /** * Class SignatureRSA3_SHA224MGF1 */ - public static class SignatureRSASHA3_224MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA3_224MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA3_224_MGF1_PARAMS + = new PSSParameterSpec("SHA3-224", "MGF1", + new MGF1ParameterSpec("SHA3-224"), + 28, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA3_224MGF1 @@ -504,12 +611,22 @@ public SignatureRSASHA3_224MGF1(Provider provider) throws XMLSignatureException public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_224_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_224_MGF1_PARAMS; + } } /** * Class SignatureRSA3_SHA256MGF1 */ - public static class SignatureRSASHA3_256MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA3_256MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA3_256_MGF1_PARAMS + = new PSSParameterSpec("SHA3-256", "MGF1", + new MGF1ParameterSpec("SHA3-256"), + 32, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA3_256MGF1 @@ -529,12 +646,22 @@ public SignatureRSASHA3_256MGF1(Provider provider) throws XMLSignatureException public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_256_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_256_MGF1_PARAMS; + } } /** * Class SignatureRSA3_SHA384MGF1 */ - public static class SignatureRSASHA3_384MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA3_384MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA3_384_MGF1_PARAMS + = new PSSParameterSpec("SHA3-384", "MGF1", + new MGF1ParameterSpec("SHA3-384"), + 48, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA3_384MGF1 @@ -554,12 +681,22 @@ public SignatureRSASHA3_384MGF1(Provider provider) throws XMLSignatureException public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_384_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_384_MGF1_PARAMS; + } } /** * Class SignatureRSASHA3_512MGF1 */ - public static class SignatureRSASHA3_512MGF1 extends SignatureBaseRSA { + public static class SignatureRSASHA3_512MGF1 extends SignatureBaseRSAPSS { + + private static final PSSParameterSpec SHA3_512_MGF1_PARAMS + = new PSSParameterSpec("SHA3-512", "MGF1", + new MGF1ParameterSpec("SHA3-512"), + 64, PSSParameterSpec.TRAILER_FIELD_BC); /** * Constructor SignatureRSASHA3_512MGF1 @@ -579,10 +716,15 @@ public SignatureRSASHA3_512MGF1(Provider provider) throws XMLSignatureException public String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_512_MGF1; } + + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_512_MGF1_PARAMS; + } } public static class SignatureRSASSAPSS extends SignatureBaseRSA { - PSSParameterSpec pssParameterSpec; + private PSSParameterSpec pssParameterSpec; public enum DigestAlgorithm { SHA224("SHA-224", DigestMethod.SHA224, 28), diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java index 0f9f8463252..c2b0d05763d 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java @@ -60,6 +60,7 @@ public class SignatureDSA extends SignatureAlgorithmSpi { * * {@inheritDoc} */ + @Override protected String engineGetURI() { return XMLSignature.ALGO_ID_SIGNATURE_DSA; } @@ -100,6 +101,7 @@ public SignatureDSA(Provider provider) throws XMLSignatureException { /** * {@inheritDoc} */ + @Override protected void engineSetParameter(AlgorithmParameterSpec params) throws XMLSignatureException { try { @@ -112,6 +114,7 @@ protected void engineSetParameter(AlgorithmParameterSpec params) /** * {@inheritDoc} */ + @Override protected boolean engineVerify(byte[] signature) throws XMLSignatureException { try { @@ -130,6 +133,7 @@ protected boolean engineVerify(byte[] signature) /** * {@inheritDoc} */ + @Override protected void engineInitVerify(Key publicKey) throws XMLSignatureException { engineInitVerify(publicKey, this.signatureAlgorithm); size = ((DSAKey)publicKey).getParams().getQ().bitLength(); @@ -138,6 +142,7 @@ protected void engineInitVerify(Key publicKey) throws XMLSignatureException { /** * {@inheritDoc} */ + @Override protected byte[] engineSign() throws XMLSignatureException { try { byte[] jcebytes = this.signatureAlgorithm.sign(); @@ -151,6 +156,7 @@ protected byte[] engineSign() throws XMLSignatureException { /** * {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey, SecureRandom secureRandom) throws XMLSignatureException { engineInitSign(privateKey, secureRandom, this.signatureAlgorithm); @@ -160,6 +166,7 @@ protected void engineInitSign(Key privateKey, SecureRandom secureRandom) /** * {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey) throws XMLSignatureException { engineInitSign(privateKey, (SecureRandom)null); } @@ -167,6 +174,7 @@ protected void engineInitSign(Key privateKey) throws XMLSignatureException { /** * {@inheritDoc} */ + @Override protected void engineUpdate(byte[] input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -178,6 +186,7 @@ protected void engineUpdate(byte[] input) throws XMLSignatureException { /** * {@inheritDoc} */ + @Override protected void engineUpdate(byte input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -189,6 +198,7 @@ protected void engineUpdate(byte input) throws XMLSignatureException { /** * {@inheritDoc} */ + @Override protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignatureException { try { this.signatureAlgorithm.update(buf, offset, len); @@ -202,6 +212,7 @@ protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignature * * {@inheritDoc} */ + @Override protected String engineGetJCEAlgorithmString() { return this.signatureAlgorithm.getAlgorithm(); } @@ -211,6 +222,7 @@ protected String engineGetJCEAlgorithmString() { * * {@inheritDoc} */ + @Override protected String engineGetJCEProviderName() { return this.signatureAlgorithm.getProvider().getName(); } @@ -221,6 +233,7 @@ protected String engineGetJCEProviderName() { * @param HMACOutputLength * @throws XMLSignatureException */ + @Override protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatureException { throw new XMLSignatureException("algorithms.HMACOutputLengthOnlyForHMAC"); } @@ -232,6 +245,7 @@ protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatu * @param algorithmParameterSpec * @throws XMLSignatureException */ + @Override protected void engineInitSign( Key signingKey, AlgorithmParameterSpec algorithmParameterSpec ) throws XMLSignatureException { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureECDSA.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureECDSA.java index 381ead9ec2e..75a88b8eb13 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureECDSA.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureECDSA.java @@ -26,7 +26,14 @@ package com.sun.org.apache.xml.internal.security.algorithms.implementations; import java.io.IOException; -import java.security.*; +import java.security.InvalidAlgorithmParameterException; +import java.security.Key; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.Provider; +import java.security.SecureRandom; +import java.security.Signature; +import java.security.SignatureException; import java.security.interfaces.ECPrivateKey; import java.security.spec.AlgorithmParameterSpec; @@ -118,6 +125,7 @@ public SignatureECDSA(Provider provider) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineSetParameter(AlgorithmParameterSpec params) throws XMLSignatureException { try { @@ -128,6 +136,7 @@ protected void engineSetParameter(AlgorithmParameterSpec params) } /** {@inheritDoc} */ + @Override protected boolean engineVerify(byte[] signature) throws XMLSignatureException { try { byte[] jcebytes = SignatureECDSA.convertXMLDSIGtoASN1(signature); @@ -143,11 +152,13 @@ protected boolean engineVerify(byte[] signature) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineInitVerify(Key publicKey) throws XMLSignatureException { engineInitVerify(publicKey, signatureAlgorithm); } /** {@inheritDoc} */ + @Override protected byte[] engineSign() throws XMLSignatureException { try { byte[] jcebytes = this.signatureAlgorithm.sign(); @@ -158,6 +169,7 @@ protected byte[] engineSign() throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey, SecureRandom secureRandom) throws XMLSignatureException { if (privateKey instanceof ECPrivateKey) { @@ -169,11 +181,13 @@ protected void engineInitSign(Key privateKey, SecureRandom secureRandom) } /** {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey) throws XMLSignatureException { engineInitSign(privateKey, (SecureRandom)null); } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte[] input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -183,6 +197,7 @@ protected void engineUpdate(byte[] input) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -192,6 +207,7 @@ protected void engineUpdate(byte input) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignatureException { try { this.signatureAlgorithm.update(buf, offset, len); @@ -201,22 +217,26 @@ protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignature } /** {@inheritDoc} */ + @Override protected String engineGetJCEAlgorithmString() { return this.signatureAlgorithm.getAlgorithm(); } /** {@inheritDoc} */ + @Override protected String engineGetJCEProviderName() { return this.signatureAlgorithm.getProvider().getName(); } /** {@inheritDoc} */ + @Override protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatureException { throw new XMLSignatureException("algorithms.HMACOutputLengthOnlyForHMAC"); } /** {@inheritDoc} */ + @Override protected void engineInitSign( Key signingKey, AlgorithmParameterSpec algorithmParameterSpec ) throws XMLSignatureException { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureEDDSA.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureEDDSA.java index 03eb36e076c..c297d96faea 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureEDDSA.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureEDDSA.java @@ -22,16 +22,22 @@ */ package com.sun.org.apache.xml.internal.security.algorithms.implementations; +import java.security.InvalidAlgorithmParameterException; +import java.security.Key; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.Provider; +import java.security.SecureRandom; +import java.security.Signature; +import java.security.SignatureException; +import java.security.spec.AlgorithmParameterSpec; + import com.sun.org.apache.xml.internal.security.algorithms.JCEMapper; import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithmSpi; import com.sun.org.apache.xml.internal.security.signature.XMLSignature; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureException; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; -import java.io.IOException; -import java.security.*; -import java.security.spec.AlgorithmParameterSpec; - /** * */ @@ -77,6 +83,7 @@ public SignatureEDDSA(Provider provider) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineSetParameter(AlgorithmParameterSpec params) throws XMLSignatureException { try { @@ -87,6 +94,7 @@ protected void engineSetParameter(AlgorithmParameterSpec params) } /** {@inheritDoc} */ + @Override protected boolean engineVerify(byte[] signature) throws XMLSignatureException { try { @@ -101,11 +109,13 @@ protected boolean engineVerify(byte[] signature) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineInitVerify(Key publicKey) throws XMLSignatureException { engineInitVerify(publicKey, signatureAlgorithm); } /** {@inheritDoc} */ + @Override protected byte[] engineSign() throws XMLSignatureException { try { return this.signatureAlgorithm.sign(); @@ -115,6 +125,7 @@ protected byte[] engineSign() throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey, SecureRandom secureRandom) throws XMLSignatureException { @@ -122,11 +133,13 @@ protected void engineInitSign(Key privateKey, SecureRandom secureRandom) } /** {@inheritDoc} */ + @Override protected void engineInitSign(Key privateKey) throws XMLSignatureException { engineInitSign(privateKey, (SecureRandom)null); } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte[] input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -136,6 +149,7 @@ protected void engineUpdate(byte[] input) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte input) throws XMLSignatureException { try { this.signatureAlgorithm.update(input); @@ -145,6 +159,7 @@ protected void engineUpdate(byte input) throws XMLSignatureException { } /** {@inheritDoc} */ + @Override protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignatureException { try { this.signatureAlgorithm.update(buf, offset, len); @@ -154,22 +169,26 @@ protected void engineUpdate(byte[] buf, int offset, int len) throws XMLSignature } /** {@inheritDoc} */ + @Override protected String engineGetJCEAlgorithmString() { return this.signatureAlgorithm.getAlgorithm(); } /** {@inheritDoc} */ + @Override protected String engineGetJCEProviderName() { return this.signatureAlgorithm.getProvider().getName(); } /** {@inheritDoc} */ + @Override protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatureException { throw new XMLSignatureException("algorithms.HMACOutputLengthOnlyForHMAC"); } /** {@inheritDoc} */ + @Override protected void engineInitSign( Key signingKey, AlgorithmParameterSpec algorithmParameterSpec ) throws XMLSignatureException { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java index 71e2d976b57..4e639339523 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java @@ -122,7 +122,7 @@ private Canonicalizer(String algorithmURI) throws InvalidCanonicalizerException * @return a Canonicalizer instance ready for the job * @throws InvalidCanonicalizerException */ - public static final Canonicalizer getInstance(String algorithmURI) + public static Canonicalizer getInstance(String algorithmURI) throws InvalidCanonicalizerException { return new Canonicalizer(algorithmURI); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/AttrCompare.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/AttrCompare.java index 5ac239cd3a3..cbd541e63b0 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/AttrCompare.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/AttrCompare.java @@ -22,11 +22,12 @@ */ package com.sun.org.apache.xml.internal.security.c14n.helper; -import com.sun.org.apache.xml.internal.security.utils.Constants; -import org.w3c.dom.Attr; import java.io.Serializable; import java.util.Comparator; +import com.sun.org.apache.xml.internal.security.utils.Constants; +import org.w3c.dom.Attr; + /** * Compares two attributes based on the C14n specification. * @@ -69,6 +70,7 @@ public class AttrCompare implements Comparator, Serializable { * obj0 is less than, equal to, or greater than obj1 * */ + @Override public int compare(Attr attr0, Attr attr1) { String namespaceURI0 = attr0.getNamespaceURI(); String namespaceURI1 = attr1.getNamespaceURI(); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_OmitComments.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_OmitComments.java index 867faad7a8d..2f8254449f8 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_OmitComments.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_OmitComments.java @@ -32,6 +32,7 @@ public Canonicalizer11_OmitComments() { super(false, true); } + @Override public final String engineGetURI() { return Canonicalizer.ALGO_ID_C14N11_OMIT_COMMENTS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_WithComments.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_WithComments.java index b4ded12429f..181e559f5a1 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_WithComments.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_WithComments.java @@ -32,6 +32,7 @@ public Canonicalizer11_WithComments() { super(true, true); } + @Override public final String engineGetURI() { return Canonicalizer.ALGO_ID_C14N11_WITH_COMMENTS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java index f0cd610b320..6b6fda395c9 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java @@ -83,6 +83,7 @@ public Canonicalizer20010315(boolean includeComments, boolean c14n11) { * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException always */ + @Override public void engineCanonicalizeXPathNodeSet(Set xpathNodeSet, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException { @@ -98,6 +99,7 @@ public void engineCanonicalizeXPathNodeSet(Set xpathNodeSet, String inclus * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException { @@ -113,6 +115,7 @@ public void engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree( Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream writer) throws CanonicalizationException { @@ -297,6 +300,7 @@ protected void outputAttributes(Element element, NameSpaceSymbTable ns, } } + @Override protected void circumventBugIfNeeded(XMLSignatureInput input) throws XMLParserException, IOException { if (!input.isNeedsToBeExpanded()) { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java index b7c543e583a..44323692ee7 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java @@ -82,6 +82,7 @@ public Canonicalizer20010315Excl(boolean includeComments) { * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree(Node rootNode, OutputStream writer) throws CanonicalizationException { engineCanonicalizeSubTree(rootNode, "", null, writer); @@ -95,6 +96,7 @@ public void engineCanonicalizeSubTree(Node rootNode, OutputStream writer) * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree( Node rootNode, String inclusiveNamespaces, OutputStream writer ) throws CanonicalizationException { @@ -110,6 +112,7 @@ public void engineCanonicalizeSubTree( * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree( Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream writer ) throws CanonicalizationException { @@ -155,6 +158,7 @@ public void engineCanonicalize( * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeXPathNodeSet( Set xpathNodeSet, String inclusiveNamespaces, OutputStream writer ) throws CanonicalizationException { @@ -336,6 +340,7 @@ protected void outputAttributes(Element element, NameSpaceSymbTable ns, } } + @Override protected void circumventBugIfNeeded(XMLSignatureInput input) throws XMLParserException, IOException { if (!input.isNeedsToBeExpanded() || inclusiveNSSet.isEmpty()) { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclOmitComments.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclOmitComments.java index df9f88a8386..ab6a65ccabc 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclOmitComments.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclOmitComments.java @@ -34,6 +34,7 @@ public Canonicalizer20010315ExclOmitComments() { } /** {@inheritDoc} */ + @Override public final String engineGetURI() { return Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclWithComments.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclWithComments.java index 6b80e68525e..054343005ff 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclWithComments.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclWithComments.java @@ -38,6 +38,7 @@ public Canonicalizer20010315ExclWithComments() { } /** {@inheritDoc} */ + @Override public final String engineGetURI() { return Canonicalizer.ALGO_ID_C14N_EXCL_WITH_COMMENTS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315OmitComments.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315OmitComments.java index 6615436467f..46f44362d8c 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315OmitComments.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315OmitComments.java @@ -37,6 +37,7 @@ public Canonicalizer20010315OmitComments() { } /** {@inheritDoc} */ + @Override public final String engineGetURI() { return Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315WithComments.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315WithComments.java index 23dd3496da5..54742c6b80e 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315WithComments.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315WithComments.java @@ -36,6 +36,7 @@ public Canonicalizer20010315WithComments() { } /** {@inheritDoc} */ + @Override public final String engineGetURI() { return Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java index d57a947dc0d..c1f499078fa 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java @@ -107,6 +107,7 @@ protected CanonicalizerBase(boolean includeComments) { * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree(Node rootNode, OutputStream writer) throws CanonicalizationException { engineCanonicalizeSubTree(rootNode, (Node)null, writer); @@ -119,6 +120,7 @@ public void engineCanonicalizeSubTree(Node rootNode, OutputStream writer) * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeXPathNodeSet(Set xpathNodeSet, OutputStream writer) throws CanonicalizationException { this.xpathNodeSet = xpathNodeSet; @@ -457,8 +459,7 @@ private void canonicalizeXPathNodeSet(Node currentNode, Node endnode, OutputStre } while(true); } - protected int isVisibleDO(Node currentNode, int level) - throws CanonicalizationException { + protected int isVisibleDO(Node currentNode, int level) throws CanonicalizationException { if (nodeFilter != null) { for (NodeFilter filter : nodeFilter) { try { @@ -477,8 +478,7 @@ protected int isVisibleDO(Node currentNode, int level) return 1; } - protected int isVisibleInt(Node currentNode) - throws CanonicalizationException { + protected int isVisibleInt(Node currentNode) throws CanonicalizationException { if (nodeFilter != null) { for (NodeFilter filter : nodeFilter) { try { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java index 66ad12029fc..c0756d5e09c 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java @@ -68,6 +68,7 @@ public CanonicalizerPhysical() { * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException always */ + @Override public void engineCanonicalizeXPathNodeSet(Set xpathNodeSet, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException { @@ -83,6 +84,7 @@ public void engineCanonicalizeXPathNodeSet(Set xpathNodeSet, String inclus * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException { @@ -98,6 +100,7 @@ public void engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, * @param writer OutputStream to write the canonicalization result * @throws CanonicalizationException */ + @Override public void engineCanonicalizeSubTree( Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream writer) throws CanonicalizationException { @@ -165,6 +168,7 @@ protected void handleParent(Element e, NameSpaceSymbTable ns) { } /** {@inheritDoc} */ + @Override public final String engineGetURI() { return Canonicalizer.ALGO_ID_C14N_PHYSICAL; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java index 2ffe6805957..290ff35ea61 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java @@ -26,7 +26,6 @@ import java.util.Collection; import java.util.List; - import org.w3c.dom.Attr; import org.w3c.dom.Node; @@ -74,16 +73,16 @@ public NameSpaceSymbTable() { * @param result the list where to fill the unrendered xmlns definitions. **/ public void getUnrenderedNodes(Collection result) { - for (NameSpaceSymbEntry n : symb.entrySet()) { + for (NameSpaceSymbEntry nsEntry : symb.entrySet()) { //put them rendered? - if (!n.rendered && n.n != null) { - n = n.clone(); + if (!nsEntry.rendered && nsEntry.n != null) { + nsEntry = nsEntry.clone(); needsClone(); - symb.put(n.prefix, n); - n.lastrendered = n.uri; - n.rendered = true; + symb.put(nsEntry.prefix, nsEntry); + nsEntry.lastrendered = nsEntry.uri; + nsEntry.rendered = true; - result.add(n.n); + result.add(nsEntry.n); } } } @@ -311,6 +310,7 @@ class NameSpaceSymbEntry implements Cloneable { } /** {@inheritDoc} */ + @Override public NameSpaceSymbEntry clone() { //NOPMD try { return (NameSpaceSymbEntry)super.clone(); @@ -344,9 +344,9 @@ void put(String key, NameSpaceSymbEntry value) { List entrySet() { List a = new ArrayList<>(); - for (int i = 0;i < entries.length;i++) { - if (entries[i] != null && entries[i].uri.length() != 0) { - a.add(entries[i]); + for (NameSpaceSymbEntry nsEntry : entries) { + if (nsEntry != null && !nsEntry.uri.isEmpty()) { + a.add(nsEntry); } } return a; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityException.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityException.java index 98764012ea7..18314073d51 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityException.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityException.java @@ -160,6 +160,7 @@ public String getMsgID() { } /** {@inheritDoc} */ + @Override public String toString() { String s = this.getClass().getName(); String message = super.getLocalizedMessage(); @@ -181,6 +182,7 @@ public String toString() { * Method printStackTrace * */ + @Override public void printStackTrace() { synchronized (System.err) { super.printStackTrace(System.err); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java index 519df28b814..62f25d1298d 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java @@ -1184,6 +1184,7 @@ public void addStorageResolver(StorageResolver storageResolver) { /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_KEYINFO; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/DEREncodedKeyValue.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/DEREncodedKeyValue.java index 6a727b2c719..823a5036680 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/DEREncodedKeyValue.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/DEREncodedKeyValue.java @@ -98,6 +98,7 @@ public String getId() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_DERENCODEDKEYVALUE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyInfoReference.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyInfoReference.java index 89e95dec431..66ef3e36c84 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyInfoReference.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyInfoReference.java @@ -95,6 +95,7 @@ public String getId() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_KEYINFOREFERENCE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyName.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyName.java index c098cfa8d1f..45c18b63014 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyName.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyName.java @@ -65,6 +65,7 @@ public String getKeyName() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_KEYNAME; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyValue.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyValue.java index d30f504cf29..ee999e65783 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyValue.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyValue.java @@ -160,6 +160,7 @@ public PublicKey getPublicKey() throws XMLSecurityException { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_KEYVALUE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/MgmtData.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/MgmtData.java index 53fcf0f8954..affe29c3276 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/MgmtData.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/MgmtData.java @@ -66,6 +66,7 @@ public String getMgmtData() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_MGMTDATA; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/PGPData.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/PGPData.java index 27e2550f4dd..240bf48a03b 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/PGPData.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/PGPData.java @@ -44,6 +44,7 @@ public PGPData(Element element, String baseURI) throws XMLSecurityException { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_PGPDATA; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/RetrievalMethod.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/RetrievalMethod.java index 82a949d34d3..84054ddd745 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/RetrievalMethod.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/RetrievalMethod.java @@ -129,6 +129,7 @@ public Transforms getTransforms() throws XMLSecurityException { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_RETRIEVALMETHOD; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/SPKIData.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/SPKIData.java index a352c056ef7..23eaf1c1257 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/SPKIData.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/SPKIData.java @@ -45,6 +45,7 @@ public SPKIData(Element element, String baseURI) } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_SPKIDATA; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/X509Data.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/X509Data.java index 06aeae25fa7..c7640e4e4e1 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/X509Data.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/X509Data.java @@ -528,6 +528,7 @@ public boolean containsUnknownElement() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_X509DATA; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/DSAKeyValue.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/DSAKeyValue.java index 95697892df8..9b2a2d258ea 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/DSAKeyValue.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/DSAKeyValue.java @@ -97,6 +97,7 @@ public DSAKeyValue(Document doc, Key key) throws IllegalArgumentException { } /** {@inheritDoc} */ + @Override public PublicKey getPublicKey() throws XMLSecurityException { try { DSAPublicKeySpec pkspec = @@ -123,6 +124,7 @@ public PublicKey getPublicKey() throws XMLSecurityException { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_DSAKEYVALUE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/ECKeyValue.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/ECKeyValue.java index 0517aa4f711..839d9e4285d 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/ECKeyValue.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/ECKeyValue.java @@ -40,16 +40,15 @@ import javax.xml.crypto.MarshalException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.Text; - import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.I18n; import com.sun.org.apache.xml.internal.security.utils.Signature11ElementProxy; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.Text; public class ECKeyValue extends Signature11ElementProxy implements KeyValueContent { @@ -161,6 +160,7 @@ public ECKeyValue(Document doc, Key key) throws IllegalArgumentException { } /** {@inheritDoc} */ + @Override public PublicKey getPublicKey() throws XMLSecurityException { try { ECParameterSpec ecParams = null; @@ -210,6 +210,7 @@ public PublicKey getPublicKey() throws XMLSecurityException { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_ECKEYVALUE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/RSAKeyValue.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/RSAKeyValue.java index 5025dcd345f..b691091e518 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/RSAKeyValue.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/RSAKeyValue.java @@ -93,6 +93,7 @@ public RSAKeyValue(Document doc, Key key) throws IllegalArgumentException { } /** {@inheritDoc} */ + @Override public PublicKey getPublicKey() throws XMLSecurityException { try { KeyFactory rsaFactory = KeyFactory.getInstance("RSA"); @@ -115,6 +116,7 @@ public PublicKey getPublicKey() throws XMLSecurityException { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_RSAKEYVALUE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509CRL.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509CRL.java index 5b50fa966cd..2d0a13a85bb 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509CRL.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509CRL.java @@ -64,6 +64,7 @@ public byte[] getCRLBytes() throws XMLSecurityException { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_X509CRL; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Certificate.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Certificate.java index 56844e472ff..c50458f2bdc 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Certificate.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Certificate.java @@ -127,6 +127,7 @@ public PublicKey getPublicKey() throws XMLSecurityException, IOException { } /** {@inheritDoc} */ + @Override public boolean equals(Object obj) { if (!(obj instanceof XMLX509Certificate)) { return false; @@ -139,12 +140,13 @@ public boolean equals(Object obj) { } } + @Override public int hashCode() { int result = 17; try { byte[] bytes = getCertificateBytes(); - for (int i = 0; i < bytes.length; i++) { - result = 31 * result + bytes[i]; + for (byte element : bytes) { + result = 31 * result + element; } } catch (XMLSecurityException e) { LOG.debug(e.getMessage(), e); @@ -153,6 +155,7 @@ public int hashCode() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_X509CERTIFICATE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Digest.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Digest.java index 502a9a4dc82..7011016cfb6 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Digest.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Digest.java @@ -132,6 +132,7 @@ public static byte[] getDigestBytesFromCert(X509Certificate cert, String algorit } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_X509DIGEST; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509IssuerSerial.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509IssuerSerial.java index 0a186da2d92..6e90ae6592c 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509IssuerSerial.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509IssuerSerial.java @@ -132,6 +132,7 @@ public String getIssuerName() { } /** {@inheritDoc} */ + @Override public boolean equals(Object obj) { if (!(obj instanceof XMLX509IssuerSerial)) { return false; @@ -143,6 +144,7 @@ public boolean equals(Object obj) { && this.getIssuerName().equals(other.getIssuerName()); } + @Override public int hashCode() { int result = 17; result = 31 * result + getSerialNumber().hashCode(); @@ -151,6 +153,7 @@ public int hashCode() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_X509ISSUERSERIAL; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java index 197d417c00e..451f955ea3c 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java @@ -145,6 +145,7 @@ public static byte[] getSKIBytesFromCert(X509Certificate cert) } /** {@inheritDoc} */ + @Override public boolean equals(Object obj) { if (!(obj instanceof XMLX509SKI)) { return false; @@ -159,12 +160,13 @@ public boolean equals(Object obj) { } } + @Override public int hashCode() { int result = 17; try { byte[] bytes = getSKIBytes(); - for (int i = 0; i < bytes.length; i++) { - result = 31 * result + bytes[i]; + for (byte element : bytes) { + result = 31 * result + element; } } catch (XMLSecurityException e) { LOG.debug(e.getMessage(), e); @@ -174,6 +176,7 @@ public int hashCode() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_X509SKI; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SubjectName.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SubjectName.java index 564c45e437a..7b8008fef12 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SubjectName.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SubjectName.java @@ -80,6 +80,7 @@ public String getSubjectName() { } /** {@inheritDoc} */ + @Override public boolean equals(Object obj) { if (!(obj instanceof XMLX509SubjectName)) { return false; @@ -92,6 +93,7 @@ public boolean equals(Object obj) { return thisSubject.equals(otherSubject); } + @Override public int hashCode() { int result = 17; result = 31 * result + this.getSubjectName().hashCode(); @@ -99,6 +101,7 @@ public int hashCode() { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_X509SUBJECTNAME; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java index 7445013e9cb..f0e0785efe6 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java @@ -31,9 +31,6 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicBoolean; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.DEREncodedKeyValueResolver; import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.DSAKeyValueResolver; import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.ECKeyValueResolver; @@ -47,6 +44,8 @@ import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509SubjectNameResolver; import com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver; import com.sun.org.apache.xml.internal.security.utils.JavaUtils; +import org.w3c.dom.Element; +import org.w3c.dom.Node; /** * KeyResolver is factory class for subclass of KeyResolverSpi that @@ -295,10 +294,12 @@ public ResolverIterator(List list) { it = res.iterator(); } + @Override public boolean hasNext() { return it.hasNext(); } + @Override public KeyResolverSpi next() { KeyResolverSpi resolver = it.next(); if (resolver == null) { @@ -308,6 +309,7 @@ public KeyResolverSpi next() { return resolver; } + @Override public void remove() { throw new UnsupportedOperationException("Can't remove resolvers using the iterator"); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/PrivateKeyResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/PrivateKeyResolver.java index 20ecdbee0a5..a891104143f 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/PrivateKeyResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/PrivateKeyResolver.java @@ -32,7 +32,9 @@ import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.Enumeration; + import javax.crypto.SecretKey; + import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.keys.content.X509Data; import com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509Certificate; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RSAKeyValueResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RSAKeyValueResolver.java index 6c21cf0130e..3c448333798 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RSAKeyValueResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RSAKeyValueResolver.java @@ -26,7 +26,6 @@ import java.security.PublicKey; import java.security.cert.X509Certificate; - import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.keys.content.keyvalues.RSAKeyValue; import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverSpi; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SecretKeyResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SecretKeyResolver.java index f8b60402349..761ac9fd012 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SecretKeyResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SecretKeyResolver.java @@ -27,7 +27,9 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.cert.X509Certificate; + import javax.crypto.SecretKey; + import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverException; import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverSpi; import com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SingleKeyResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SingleKeyResolver.java index 6d543808354..4e6223fad06 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SingleKeyResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SingleKeyResolver.java @@ -25,7 +25,9 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.cert.X509Certificate; + import javax.crypto.SecretKey; + import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverException; import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverSpi; import com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509CertificateResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509CertificateResolver.java index 0be1e5bf4f5..7977a5538f2 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509CertificateResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509CertificateResolver.java @@ -86,8 +86,8 @@ protected X509Certificate engineResolveX509Certificate( } // populate Object array - for (int i = 0; i < els.length; i++) { - XMLX509Certificate xmlCert = new XMLX509Certificate(els[i], baseURI); + for (Element el : els) { + XMLX509Certificate xmlCert = new XMLX509Certificate(el, baseURI); X509Certificate cert = xmlCert.getX509Certificate(); if (cert != null) { return cert; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509DigestResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509DigestResolver.java index 9826ea3b9c8..047e7acbf5d 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509DigestResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509DigestResolver.java @@ -134,8 +134,7 @@ private X509Certificate resolveCertificate(Element element, String baseURI, Stor while (storageIterator.hasNext()) { X509Certificate cert = (X509Certificate) storageIterator.next(); - for (int i = 0; i < x509Digests.length; i++) { - XMLX509Digest keyInfoDigest = x509Digests[i]; + for (XMLX509Digest keyInfoDigest : x509Digests) { byte[] certDigestBytes = XMLX509Digest.getDigestBytesFromCert(cert, keyInfoDigest.getAlgorithm()); if (Arrays.equals(keyInfoDigest.getDigestBytes(), certDigestBytes)) { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SKIResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SKIResolver.java index c2d8f9cef60..09150a548f1 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SKIResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SKIResolver.java @@ -28,7 +28,6 @@ import java.security.cert.X509Certificate; import java.util.Iterator; - import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509SKI; import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverException; @@ -95,20 +94,18 @@ protected X509Certificate engineResolveX509Certificate( } XMLX509SKI[] x509childObject = new XMLX509SKI[x509childNodes.length]; - for (int i = 0; i < x509childNodes.length; i++) { x509childObject[i] = new XMLX509SKI(x509childNodes[i], baseURI); } Iterator storageIterator = storage.getIterator(); while (storageIterator.hasNext()) { - X509Certificate cert = (X509Certificate)storageIterator.next(); + X509Certificate cert = (X509Certificate) storageIterator.next(); XMLX509SKI certSKI = new XMLX509SKI(element.getOwnerDocument(), cert); - for (int i = 0; i < x509childObject.length; i++) { - if (certSKI.equals(x509childObject[i])) { + for (XMLX509SKI childNodeSKI : x509childObject) { + if (certSKI.equals(childNodeSKI)) { LOG.debug("Return PublicKey from {}", cert.getSubjectX500Principal().getName()); - return cert; } } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SubjectNameResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SubjectNameResolver.java index f90ff896711..b2bd0770b15 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SubjectNameResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SubjectNameResolver.java @@ -28,7 +28,6 @@ import java.security.cert.X509Certificate; import java.util.Iterator; - import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509SubjectName; import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverException; @@ -101,18 +100,15 @@ protected X509Certificate engineResolveX509Certificate( Iterator storageIterator = storage.getIterator(); while (storageIterator.hasNext()) { - X509Certificate cert = (X509Certificate)storageIterator.next(); - XMLX509SubjectName certSN = - new XMLX509SubjectName(element.getOwnerDocument(), cert); - + X509Certificate cert = (X509Certificate) storageIterator.next(); + XMLX509SubjectName certSN = new XMLX509SubjectName(element.getOwnerDocument(), cert); LOG.debug("Found Certificate SN: {}", certSN.getSubjectName()); - for (int i = 0; i < x509childObject.length; i++) { - LOG.debug("Found Element SN: {}", x509childObject[i].getSubjectName()); + for (XMLX509SubjectName childSubject : x509childObject) { + LOG.debug("Found Element SN: {}", childSubject.getSubjectName()); - if (certSN.equals(x509childObject[i])) { + if (certSN.equals(childSubject)) { LOG.debug("match !!! "); - return cert; } LOG.debug("no match..."); @@ -122,7 +118,6 @@ protected X509Certificate engineResolveX509Certificate( return null; } catch (XMLSecurityException ex) { LOG.debug("XMLSecurityException", ex); - throw new KeyResolverException(ex); } } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java index 2da744cad8c..2b90e7901fd 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java @@ -133,6 +133,7 @@ public StorageResolverIterator(Iterator resolvers) { } /** {@inheritDoc} */ + @Override public boolean hasNext() { if (currentResolver == null) { return false; @@ -147,6 +148,7 @@ public boolean hasNext() { } /** {@inheritDoc} */ + @Override public Certificate next() { if (hasNext()) { return currentResolver.next(); @@ -158,6 +160,7 @@ public Certificate next() { /** * Method remove */ + @Override public void remove() { throw new UnsupportedOperationException("Can't remove keys from KeyStore"); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java index 6f7ff7deb92..cfe9c6e98a5 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java @@ -64,6 +64,7 @@ public KeyStoreResolver(KeyStore keyStore) throws StorageResolverException { } /** {@inheritDoc} */ + @Override public Iterator getIterator() { return new KeyStoreIterator(this.keyStore); } @@ -103,11 +104,13 @@ public KeyStoreIterator(KeyStore keyStore) { } /** {@inheritDoc} */ + @Override public boolean hasNext() { return this.i < this.certs.size(); } /** {@inheritDoc} */ + @Override public Certificate next() { if (hasNext()) { return this.certs.get(this.i++); @@ -119,6 +122,7 @@ public Certificate next() { /** * Method remove */ + @Override public void remove() { throw new UnsupportedOperationException("Can't remove keys from KeyStore"); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java index 2b57b3c4e2c..9476cfdffe5 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java @@ -46,6 +46,7 @@ public SingleCertificateResolver(X509Certificate x509cert) { } /** {@inheritDoc} */ + @Override public Iterator getIterator() { return new InternalIterator(this.certificate); } @@ -71,11 +72,13 @@ public InternalIterator(X509Certificate x509cert) { } /** {@inheritDoc} */ + @Override public boolean hasNext() { return !this.alreadyReturned; } /** {@inheritDoc} */ + @Override public Certificate next() { if (this.alreadyReturned) { throw new NoSuchElementException(); @@ -87,6 +90,7 @@ public Certificate next() { /** * Method remove */ + @Override public void remove() { throw new UnsupportedOperationException("Can't remove keys from KeyStore"); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParser.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParser.java index 0942b6b296f..24acfe33aa9 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParser.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParser.java @@ -31,6 +31,15 @@ */ public interface XMLParser { + /** + * Parses a document from the input stream. + * Caller is responsible for closing the stream. + * + * @param inputStream + * @param disallowDocTypeDeclarations + * @return {@link Document} + * @throws XMLParserException + */ Document parse(InputStream inputStream, boolean disallowDocTypeDeclarations) throws XMLParserException; } \ No newline at end of file diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParserImpl.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParserImpl.java index be28d2861a2..91f4054dc89 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParserImpl.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParserImpl.java @@ -51,10 +51,10 @@ public class XMLParserImpl implements XMLParser { (PrivilegedAction) () -> Integer.getInteger("com.sun.org.apache.xml.internal.security.parser.pool-size", 20)); private static final Map> DOCUMENT_BUILDERS = - Collections.synchronizedMap(new WeakHashMap>()); + Collections.synchronizedMap(new WeakHashMap<>()); private static final Map> DOCUMENT_BUILDERS_DISALLOW_DOCTYPE = - Collections.synchronizedMap(new WeakHashMap>()); + Collections.synchronizedMap(new WeakHashMap<>()); @Override public Document parse(InputStream inputStream, boolean disallowDocTypeDeclarations) throws XMLParserException { @@ -119,6 +119,7 @@ private static ClassLoader getContextClassLoader() { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { return AccessController.doPrivileged(new PrivilegedAction() { + @Override public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } @@ -132,6 +133,7 @@ private static ClassLoader getClassLoader(final Class clazz) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { return AccessController.doPrivileged(new PrivilegedAction() { + @Override public ClassLoader run() { return clazz.getClassLoader(); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java index 9d0ac02d75e..f63ac107fd0 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java @@ -575,6 +575,7 @@ public int getSignedContentLength() { * * {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_MANIFEST; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java index 5ab6c361643..d1f049b5bc9 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java @@ -130,6 +130,7 @@ public Node appendChild(Node node) { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_OBJECT; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java index 384436b7b4e..9636031b9a5 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java @@ -193,10 +193,12 @@ protected Reference( // Create DigestMethod Element without actually instantiating a MessageDigest Object Algorithm digestAlgorithm = new Algorithm(getDocument(), messageDigestAlgorithm) { + @Override public String getBaseNamespace() { return Constants.SignatureSpecNS; } + @Override public String getBaseLocalName() { return Constants._TAG_DIGESTMETHOD; } @@ -612,6 +614,7 @@ private void cacheDereferencedElement(XMLSignatureInput input) { try { final Set s = input.getNodeSet(); referenceData = new ReferenceNodeSetData() { + @Override public Iterator iterator() { return new Iterator() { @@ -808,6 +811,7 @@ public boolean verify() * Method getBaseLocalName * {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_REFERENCE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java index e409c992500..8434b291c94 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java @@ -139,6 +139,7 @@ public void addSignatureProperty(SignatureProperty sp) { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_SIGNATUREPROPERTIES; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java index 1929f126a14..bc9a7003c46 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java @@ -126,6 +126,7 @@ public Node appendChild(Node node) { } /** {@inheritDoc} */ + @Override public String getBaseLocalName() { return Constants._TAG_SIGNATUREPROPERTY; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java index 6d4e4adf740..90511f10fbc 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java @@ -27,6 +27,7 @@ import java.io.OutputStream; import java.security.Provider; import java.security.spec.AlgorithmParameterSpec; + import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -38,7 +39,6 @@ import com.sun.org.apache.xml.internal.security.transforms.params.InclusiveNamespaces; import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; - import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -401,6 +401,7 @@ public SignatureAlgorithm getSignatureAlgorithm() { * {@inheritDoc} * */ + @Override public String getBaseLocalName() { return Constants._TAG_SIGNEDINFO; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java index dff41c30e51..cfa545e5826 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java @@ -1031,6 +1031,7 @@ public void setFollowNestedManifests(boolean followManifests) { * * @return Constants._TAG_SIGNATURE */ + @Override public String getBaseLocalName() { return Constants._TAG_SIGNATURE; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java index 165bc98721f..1f192e05533 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java @@ -391,6 +391,7 @@ public void setSourceURI(String sourceURI) { * Method toString * {@inheritDoc} */ + @Override public String toString() { if (isNodeSet()) { return "XMLSignatureInput/NodeSet/" + inputNodeSet.size() diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceSubTreeData.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceSubTreeData.java index 215206015f8..14050f0715e 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceSubTreeData.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceSubTreeData.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.ListIterator; import java.util.NoSuchElementException; + import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -51,6 +52,7 @@ public ReferenceSubTreeData(Node root, boolean excludeComments) { this.excludeComments = excludeComments; } + @Override public Iterator iterator() { return new DelayedNodeIterator(root, excludeComments); } @@ -78,6 +80,7 @@ static class DelayedNodeIterator implements Iterator { this.withComments = !excludeComments; } + @Override public boolean hasNext() { if (nodeSet == null) { nodeSet = dereferenceSameDocumentURI(root); @@ -86,6 +89,7 @@ public boolean hasNext() { return li.hasNext(); } + @Override public Node next() { if (nodeSet == null) { nodeSet = dereferenceSameDocumentURI(root); @@ -98,6 +102,7 @@ public Node next() { } } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java index 0534fff3844..2d5c0196549 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java @@ -108,7 +108,7 @@ private Base64() { * @param bitlen {@code int} the desired length in bits of the representation * @return a byte array with {@code bitlen} bits of {@code big} */ - static final byte[] getBytes(BigInteger big, int bitlen) { + static byte[] getBytes(BigInteger big, int bitlen) { //round bitlen bitlen = ((bitlen + 7) >> 3) << 3; @@ -148,7 +148,7 @@ static final byte[] getBytes(BigInteger big, int bitlen) { * @param big * @return String with Base64 encoding */ - public static final String encode(BigInteger big) { + public static String encode(BigInteger big) { byte[] bytes = XMLUtils.getBytes(big, big.bitLength()); return XMLUtils.encodeToString(bytes); } @@ -164,7 +164,7 @@ public static final String encode(BigInteger big) { * @param bitlen {@code int} the desired length in bits of the representation * @return a byte array with {@code bitlen} bits of {@code big} */ - public static final byte[] encode(BigInteger big, int bitlen) { + public static byte[] encode(BigInteger big, int bitlen) { //round bitlen bitlen = ((bitlen + 7) >> 3) << 3; @@ -205,7 +205,7 @@ public static final byte[] encode(BigInteger big, int bitlen) { * @return the biginteger obtained from the node * @throws Base64DecodingException */ - public static final BigInteger decodeBigIntegerFromElement(Element element) + public static BigInteger decodeBigIntegerFromElement(Element element) throws Base64DecodingException { return new BigInteger(1, Base64.decode(element)); } @@ -216,7 +216,7 @@ public static final BigInteger decodeBigIntegerFromElement(Element element) * @return a decoded BigInteger * @throws Base64DecodingException */ - public static final BigInteger decodeBigIntegerFromText(Text text) + public static BigInteger decodeBigIntegerFromText(Text text) throws Base64DecodingException { return new BigInteger(1, Base64.decode(text.getData())); } @@ -228,7 +228,7 @@ public static final BigInteger decodeBigIntegerFromText(Text text) * @param element * @param biginteger */ - public static final void fillElementWithBigInteger(Element element, BigInteger biginteger) { + public static void fillElementWithBigInteger(Element element, BigInteger biginteger) { String encodedInt = encode(biginteger); @@ -253,7 +253,7 @@ public static final void fillElementWithBigInteger(Element element, BigInteger b * $todo$ not tested yet * @throws Base64DecodingException */ - public static final byte[] decode(Element element) throws Base64DecodingException { + public static byte[] decode(Element element) throws Base64DecodingException { Node sibling = element.getFirstChild(); StringBuilder sb = new StringBuilder(); @@ -279,7 +279,7 @@ public static final byte[] decode(Element element) throws Base64DecodingExceptio * @return an Element with the base64 encoded in the text. * */ - public static final Element encodeToElement(Document doc, String localName, byte[] bytes) { + public static Element encodeToElement(Document doc, String localName, byte[] bytes) { Element el = XMLUtils.createElementInSignatureSpace(doc, localName); Text text = doc.createTextNode(encode(bytes)); @@ -296,7 +296,7 @@ public static final Element encodeToElement(Document doc, String localName, byte * @throws Base64DecodingException * */ - public static final byte[] decode(byte[] base64) throws Base64DecodingException { + public static byte[] decode(byte[] base64) throws Base64DecodingException { return decodeInternal(base64, -1); } @@ -307,7 +307,7 @@ public static final byte[] decode(byte[] base64) throws Base64DecodingException * @param binaryData {@code byte[]} to be base64 encoded * @return the {@code String} with encoded data */ - public static final String encode(byte[] binaryData) { + public static String encode(byte[] binaryData) { return XMLUtils.ignoreLineBreaks() ? encode(binaryData, Integer.MAX_VALUE) : encode(binaryData, BASE64DEFAULTLENGTH); @@ -323,7 +323,7 @@ public static final String encode(byte[] binaryData) { * @throws IOException * @throws Base64DecodingException */ - public static final byte[] decode(BufferedReader reader) + public static byte[] decode(BufferedReader reader) throws IOException, Base64DecodingException { byte[] retBytes = null; @@ -342,11 +342,11 @@ public static final byte[] decode(BufferedReader reader) return retBytes; } - protected static final boolean isWhiteSpace(byte octet) { + protected static boolean isWhiteSpace(byte octet) { return octet == 0x20 || octet == 0xd || octet == 0xa || octet == 0x9; } - protected static final boolean isPad(byte octet) { + protected static boolean isPad(byte octet) { return octet == PAD; } @@ -364,7 +364,7 @@ protected static final boolean isPad(byte octet) { * @param length {@code int} length of wrapped lines; No wrapping if less than 4. * @return a {@code String} with encoded data */ - public static final String encode(byte[] binaryData, int length) { + public static String encode(byte[] binaryData, int length) { if (length < 4) { length = Integer.MAX_VALUE; } @@ -474,7 +474,7 @@ public static final String encode(byte[] binaryData, int length) { * @return byte array containing the decoded data * @throws Base64DecodingException if there is a problem decoding the data */ - public static final byte[] decode(String encoded) throws Base64DecodingException { + public static byte[] decode(String encoded) throws Base64DecodingException { if (encoded == null) { return null; } @@ -483,7 +483,7 @@ public static final byte[] decode(String encoded) throws Base64DecodingException return decodeInternal(bytes, len); } - protected static final int getBytesInternal(String s, byte[] result) { + protected static int getBytesInternal(String s, byte[] result) { int length = s.length(); int newSize = 0; @@ -496,7 +496,7 @@ protected static final int getBytesInternal(String s, byte[] result) { return newSize; } - protected static final byte[] decodeInternal(byte[] base64Data, int len) + protected static byte[] decodeInternal(byte[] base64Data, int len) throws Base64DecodingException { // remove white spaces if (len == -1) { @@ -591,7 +591,7 @@ protected static final byte[] decodeInternal(byte[] base64Data, int len) * @throws IOException * @throws Base64DecodingException */ - public static final void decode(String base64Data, OutputStream os) + public static void decode(String base64Data, OutputStream os) throws Base64DecodingException, IOException { byte[] bytes = new byte[base64Data.length()]; int len = getBytesInternal(base64Data, bytes); @@ -606,12 +606,12 @@ public static final void decode(String base64Data, OutputStream os) * @throws IOException * @throws Base64DecodingException */ - public static final void decode(byte[] base64Data, OutputStream os) + public static void decode(byte[] base64Data, OutputStream os) throws Base64DecodingException, IOException { decode(base64Data, os, -1); } - protected static final void decode(byte[] base64Data, OutputStream os, int len) + protected static void decode(byte[] base64Data, OutputStream os, int len) throws Base64DecodingException, IOException { // remove white spaces if (len == -1) { @@ -694,7 +694,7 @@ protected static final void decode(byte[] base64Data, OutputStream os, int len) * @throws IOException * @throws Base64DecodingException */ - public static final void decode(InputStream is, OutputStream os) + public static void decode(InputStream is, OutputStream os) throws Base64DecodingException, IOException { //byte[] decodedData = null; byte b1 = 0, b2 = 0, b3 = 0, b4 = 0; @@ -771,7 +771,7 @@ public static final void decode(InputStream is, OutputStream os) * @param data the byte array of base64 data (with WS) * @return the new length */ - protected static final int removeWhiteSpace(byte[] data) { + protected static int removeWhiteSpace(byte[] data) { if (data == null) { return 0; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java index 6a2f5d5af26..0c2c5c84043 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java @@ -84,6 +84,7 @@ public void setContext(Node context) { this.context = context; } + @Override public String getNamespaceURI(String prefix) { if (prefix == null) { throw new IllegalArgumentException("prefix is null"); @@ -107,6 +108,7 @@ public String getNamespaceURI(String prefix) { return NULL_NS_URI; } + @Override public String getPrefix(String namespaceURI) { if (namespaceURI == null) { throw new IllegalArgumentException("namespace URI is null"); @@ -140,6 +142,7 @@ public String getPrefix(String namespaceURI) { /** * Throws {@link UnsupportedOperationException}. */ + @Override public Iterator getPrefixes(String namespaceURI) { throw new UnsupportedOperationException(); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DigesterOutputStream.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DigesterOutputStream.java index 8f584c354f6..06840f74e41 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DigesterOutputStream.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DigesterOutputStream.java @@ -43,16 +43,19 @@ public DigesterOutputStream(MessageDigestAlgorithm mda) { } /** {@inheritDoc} */ + @Override public void write(byte[] arg0) { write(arg0, 0, arg0.length); } /** {@inheritDoc} */ - public void write(int arg0) { + @Override + public synchronized void write(int arg0) { mda.update((byte)arg0); } /** {@inheritDoc} */ + @Override public void write(byte[] arg0, int arg1, int arg2) { if (LOG.isDebugEnabled()) { LOG.debug("Pre-digested input:"); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java index c1d4c5d0367..6f061fc9772 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java @@ -23,8 +23,8 @@ package com.sun.org.apache.xml.internal.security.utils; import java.math.BigInteger; -import java.util.concurrent.ConcurrentHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import org.w3c.dom.Attr; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java index 65f9b8f93f9..b198861d041 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java @@ -57,6 +57,7 @@ public HelperNodeList(boolean allNodesMustHaveSameParent) { * @param index * @return node with index i */ + @Override public Node item(int index) { return nodes.get(index); } @@ -66,6 +67,7 @@ public Node item(int index) { * * @return length of the list */ + @Override public int getLength() { return nodes.size(); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathAPI.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathAPI.java index e6b65e07a00..ea5524e3b8b 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathAPI.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathAPI.java @@ -57,6 +57,7 @@ class JDKXPathAPI implements XPathAPI { * * @throws TransformerException */ + @Override public NodeList selectNodeList( Node contextNode, Node xpathnode, String str, Node namespaceNode ) throws TransformerException { @@ -92,6 +93,7 @@ public NodeList selectNodeList( * @param str The XPath expression * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. */ + @Override public boolean evaluate(Node contextNode, Node xpathnode, String str, Node namespaceNode) throws TransformerException { if (!str.equals(xpathStr) || xpathExpression == null) { @@ -122,6 +124,7 @@ public boolean evaluate(Node contextNode, Node xpathnode, String str, Node names /** * Clear any context information from this object */ + @Override public void clear() { xpathStr = null; xpathExpression = null; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathFactory.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathFactory.java index 98c1872898a..2659fc0ecd0 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathFactory.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathFactory.java @@ -31,6 +31,7 @@ public class JDKXPathFactory extends XPathFactory { /** * Get a new XPathAPI instance */ + @Override public XPathAPI newXPathAPI() { return new JDKXPathAPI(); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java index 4f5cb7d68a9..647675ae61c 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java @@ -95,7 +95,7 @@ public static void writeBytesToFilename(String filename, byte[] bytes) { /** * This method reads all bytes from the given InputStream till EOF and - * returns them as a byte array. + * returns them as a byte array. The method doesn't close the input stream. * * @param inputStream * @return the bytes read from the stream diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Signature11ElementProxy.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Signature11ElementProxy.java index 6a5981f61cb..086698cdad5 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Signature11ElementProxy.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Signature11ElementProxy.java @@ -69,6 +69,7 @@ public Signature11ElementProxy(Element element, String baseURI) throws XMLSecuri } /** {@inheritDoc} */ + @Override public String getBaseNamespace() { return Constants.SignatureSpec11NS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignatureElementProxy.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignatureElementProxy.java index e10f09fa7e5..847ed4ecefb 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignatureElementProxy.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignatureElementProxy.java @@ -63,6 +63,7 @@ public SignatureElementProxy(Element element, String baseURI) throws XMLSecurity } /** {@inheritDoc} */ + @Override public String getBaseNamespace() { return Constants.SignatureSpecNS; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignerOutputStream.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignerOutputStream.java index beb0604f2e6..04c255504ef 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignerOutputStream.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/SignerOutputStream.java @@ -44,6 +44,7 @@ public SignerOutputStream(SignatureAlgorithm sa) { } /** {@inheritDoc} */ + @Override public void write(byte[] arg0) { try { sa.update(arg0); @@ -53,6 +54,7 @@ public void write(byte[] arg0) { } /** {@inheritDoc} */ + @Override public void write(int arg0) { try { sa.update((byte)arg0); @@ -62,6 +64,7 @@ public void write(int arg0) { } /** {@inheritDoc} */ + @Override public void write(byte[] arg0, int arg1, int arg2) { if (LOG.isDebugEnabled()) { LOG.debug("Canonicalized SignedInfo:"); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java index a0358ffbf77..f0dc1432d5a 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java @@ -44,6 +44,7 @@ public UnsyncByteArrayOutputStream() { buf = new byte[INITIAL_SIZE]; } + @Override public void write(byte[] arg0) { if ((VM_ARRAY_INDEX_MAX_VALUE - pos) < arg0.length) { throw new OutOfMemoryError("Required length exceeds implementation limit"); @@ -56,6 +57,7 @@ public void write(byte[] arg0) { pos = newPos; } + @Override public void write(byte[] arg0, int arg1, int arg2) { if ((VM_ARRAY_INDEX_MAX_VALUE - pos) < arg2) { throw new OutOfMemoryError("Required length exceeds implementation limit"); @@ -68,6 +70,7 @@ public void write(byte[] arg0, int arg1, int arg2) { pos = newPos; } + @Override public void write(int arg0) { if (VM_ARRAY_INDEX_MAX_VALUE - pos == 0) { throw new OutOfMemoryError("Required length exceeds implementation limit"); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java index 446d640194e..ca1eea1da44 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java @@ -22,11 +22,15 @@ */ package com.sun.org.apache.xml.internal.security.utils; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.math.BigInteger; +import java.nio.file.Files; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; @@ -42,6 +46,8 @@ import com.sun.org.apache.xml.internal.security.parser.XMLParser; import com.sun.org.apache.xml.internal.security.parser.XMLParserException; import com.sun.org.apache.xml.internal.security.parser.XMLParserImpl; +import com.sun.org.slf4j.internal.Logger; +import com.sun.org.slf4j.internal.LoggerFactory; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -50,6 +56,8 @@ import org.w3c.dom.NodeList; import org.w3c.dom.Text; +import static java.nio.charset.StandardCharsets.UTF_8; + /** * DOM and XML accessibility and comfort functions. * @@ -61,8 +69,7 @@ public final class XMLUtils { AccessController.doPrivileged( (PrivilegedAction) () -> Boolean.getBoolean("com.sun.org.apache.xml.internal.security.ignoreLineBreaks")); - private static final com.sun.org.slf4j.internal.Logger LOG = - com.sun.org.slf4j.internal.LoggerFactory.getLogger(XMLUtils.class); + private static final Logger LOG = LoggerFactory.getLogger(XMLUtils.class); @SuppressWarnings("removal") private static XMLParser xmlParserImpl = @@ -74,7 +81,7 @@ public final class XMLUtils { return (XMLParser) JavaUtils.newInstanceWithEmptyConstructor( ClassLoaderUtils.loadClass(xmlParserClass, XMLUtils.class)); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | InvocationTargetException e) { - LOG.error("Error instantiating XMLParser. Falling back to XMLParserImpl"); + LOG.error("Error instantiating XMLParser. Falling back to XMLParserImpl", e); } } return new XMLParserImpl(); @@ -149,18 +156,18 @@ public static Element getNextElement(Node el) { * @param rootNode * @param result * @param exclude - * @param com whether comments or not + * @param comments whether comments or not */ - public static void getSet(Node rootNode, Set result, Node exclude, boolean com) { + public static void getSet(Node rootNode, Set result, Node exclude, boolean comments) { if (exclude != null && isDescendantOrSelf(exclude, rootNode)) { return; } - getSetRec(rootNode, result, exclude, com); + getSetRec(rootNode, result, exclude, comments); } @SuppressWarnings("fallthrough") private static void getSetRec(final Node rootNode, final Set result, - final Node exclude, final boolean com) { + final Node exclude, final boolean comments) { if (rootNode == exclude) { return; } @@ -187,11 +194,11 @@ private static void getSetRec(final Node rootNode, final Set result, return; } } - getSetRec(r, result, exclude, com); + getSetRec(r, result, exclude, comments); } break; case Node.COMMENT_NODE: - if (com) { + if (comments) { result.add(rootNode); } break; @@ -202,6 +209,18 @@ private static void getSetRec(final Node rootNode, final Set result, } } + /** + * Outputs a DOM tree to a {@link File}. + * + * @param contextNode root node of the DOM tree + * @param outputFile the file to write to + * @throws IOException + */ + public static void outputDOM(Node contextNode, File outputFile) throws IOException { + try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(outputFile.toPath()), 8192)) { + outputDOM(contextNode, os, false); + } + } /** * Outputs a DOM tree to an {@link OutputStream}. @@ -210,7 +229,7 @@ private static void getSetRec(final Node rootNode, final Set result, * @param os the {@link OutputStream} */ public static void outputDOM(Node contextNode, OutputStream os) { - XMLUtils.outputDOM(contextNode, os, false); + outputDOM(contextNode, os, false); } /** @@ -225,13 +244,12 @@ public static void outputDOM(Node contextNode, OutputStream os) { public static void outputDOM(Node contextNode, OutputStream os, boolean addPreamble) { try { if (addPreamble) { - os.write("\n".getBytes(java.nio.charset.StandardCharsets.UTF_8)); + os.write("\n".getBytes(UTF_8)); } - Canonicalizer.getInstance( Canonicalizer.ALGO_ID_C14N_PHYSICAL).canonicalizeSubtree(contextNode, os); } catch (IOException | InvalidCanonicalizerException | CanonicalizationException ex) { - LOG.debug(ex.getMessage(), ex); + LOG.error(ex.getMessage(), ex); } } @@ -253,7 +271,7 @@ public static void outputDOMc14nWithComments(Node contextNode, OutputStream os) Canonicalizer.getInstance( Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS).canonicalizeSubtree(contextNode, os); } catch (InvalidCanonicalizerException | CanonicalizationException ex) { - LOG.debug(ex.getMessage(), ex); + LOG.error(ex.getMessage(), ex); // throw new RuntimeException(ex.getMessage()); } } @@ -862,7 +880,7 @@ public static boolean protectAgainstWrappingAttack(Node startNode, String value) // Continue searching to find duplicates foundElement = attr.getOwnerElement(); } else { - LOG.debug("Multiple elements with the same 'Id' attribute value!"); + LOG.warn("Multiple elements with the same 'Id' attribute value!"); return false; } } @@ -921,8 +939,8 @@ public static boolean protectAgainstWrappingAttack( int length = attributes.getLength(); for (int i = 0; i < length; i++) { Attr attr = (Attr)attributes.item(i); - if (attr.isId() && id.equals(attr.getValue()) && se != knownElement) { - LOG.debug("Multiple elements with the same 'Id' attribute value!"); + if (attr.isId() && id.equals(attr.getValue()) && !knownElement.isSameNode(se)) { + LOG.warn("Multiple elements with the same 'Id' attribute value!"); return false; } } @@ -952,6 +970,49 @@ public static boolean protectAgainstWrappingAttack( return true; } + /** + * Reads a document from the input stream. + * + * @param file + * @param disallowDocTypeDeclarations + * @return {@link Document} + * @throws XMLParserException + * @throws IOException + */ + public static Document read(File file, boolean disallowDocTypeDeclarations) throws XMLParserException, IOException { + try (InputStream inputStream = new BufferedInputStream(Files.newInputStream(file.toPath()), 8192)) { + return read(inputStream, disallowDocTypeDeclarations); + } + } + + /** + * Reads a document from the input stream and closes it. + * + * @param name - resource name to be opened by the class loader + * @param loader + * @param disallowDocTypeDeclarations + * @return {@link Document} + * @throws XMLParserException + * @throws IOException inputStream.close() failed. + */ + public static Document readResource(String name, ClassLoader loader, boolean disallowDocTypeDeclarations) + throws XMLParserException, IOException { + // Delegate to XMLParser implementation + try (InputStream inputStream = loader.getResourceAsStream(name)) { + return read(inputStream, disallowDocTypeDeclarations); + } + + } + + /** + * Reads a document from the input stream. + * Caller is responsible for closing the stream. + * + * @param inputStream + * @param disallowDocTypeDeclarations + * @return {@link Document} + * @throws XMLParserException + */ public static Document read(InputStream inputStream, boolean disallowDocTypeDeclarations) throws XMLParserException { // Delegate to XMLParser implementation return xmlParserImpl.parse(inputStream, disallowDocTypeDeclarations); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java index c1f9e199fb2..deda69e98b9 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java @@ -27,8 +27,8 @@ import java.io.InputStream; import java.net.InetSocketAddress; import java.net.Proxy; -import java.net.URISyntaxException; import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.nio.charset.StandardCharsets; @@ -205,6 +205,7 @@ private URLConnection openConnection(URL url, ResourceResolverContext context) t * @param context * @return true if can be resolved */ + @Override public boolean engineCanResolveURI(ResourceResolverContext context) { if (context.uriToResolve == null) { LOG.debug("quick fail, uri == null"); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java index 9af7ee1feff..4526a8a1d51 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java @@ -110,6 +110,7 @@ public XMLSignatureInput engineResolveURI(ResourceResolverContext context) * {@inheritDoc} * @param context */ + @Override public boolean engineCanResolveURI(ResourceResolverContext context) { if (context.uriToResolve == null) { LOG.debug("Quick fail for null uri"); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java index 9d7e00bdbd6..d3970a3ea69 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java @@ -66,6 +66,7 @@ public XMLSignatureInput engineResolveURI(ResourceResolverContext context) /** * {@inheritDoc} */ + @Override public boolean engineCanResolveURI(ResourceResolverContext context) { if (context.uriToResolve == null) { return false; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java index c3608800ece..fc0447ec21b 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java @@ -104,6 +104,7 @@ public XMLSignatureInput engineResolveURI(ResourceResolverContext context) /** * {@inheritDoc} */ + @Override public boolean engineCanResolveURI(ResourceResolverContext context) { return isXPointerSlash(context.uriToResolve) || isXPointerId(context.uriToResolve); } diff --git a/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/SignatureMethod.java b/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/SignatureMethod.java index 6bb1b2d2da0..ce6d5d3b176 100644 --- a/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/SignatureMethod.java +++ b/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/SignatureMethod.java @@ -275,6 +275,7 @@ public interface SignatureMethod extends XMLStructure, AlgorithmMethod { */ String ED448 = "http://www.w3.org/2021/04/xmldsig-more#eddsa-ed448"; + /** * Returns the algorithm-specific input parameters of this * SignatureMethod. diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/DigesterOutputStream.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/DigesterOutputStream.java index 774eb362065..3b03dc8024b 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/DigesterOutputStream.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/DigesterOutputStream.java @@ -71,6 +71,7 @@ public DigesterOutputStream(MessageDigest md, boolean buffer) { } } + @Override public void write(int input) { if (buffer) { bos.write(input); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/MacOutputStream.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/MacOutputStream.java index be554308928..727b3b966a0 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/MacOutputStream.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/MacOutputStream.java @@ -23,6 +23,7 @@ package org.jcp.xml.dsig.internal; import java.io.ByteArrayOutputStream; + import javax.crypto.Mac; /** diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/AbstractDOMSignatureMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/AbstractDOMSignatureMethod.java index 4bc0a543117..75b21c16a02 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/AbstractDOMSignatureMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/AbstractDOMSignatureMethod.java @@ -23,20 +23,22 @@ package org.jcp.xml.dsig.internal.dom; -import java.security.Key; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; +import java.security.Key; import java.security.SignatureException; import java.security.spec.AlgorithmParameterSpec; + import javax.xml.crypto.MarshalException; import javax.xml.crypto.dom.DOMCryptoContext; import javax.xml.crypto.dsig.SignatureMethod; import javax.xml.crypto.dsig.SignedInfo; +import javax.xml.crypto.dsig.XMLSignContext; import javax.xml.crypto.dsig.XMLSignature; import javax.xml.crypto.dsig.XMLSignatureException; -import javax.xml.crypto.dsig.XMLSignContext; import javax.xml.crypto.dsig.XMLValidateContext; import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java index 7655866ad74..5dff44e3ec0 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java @@ -28,11 +28,16 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.OutputStream; -import java.security.spec.AlgorithmParameterSpec; import java.security.InvalidAlgorithmParameterException; +import java.security.spec.AlgorithmParameterSpec; import java.util.Set; -import javax.xml.crypto.*; +import javax.xml.crypto.Data; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.NodeSetData; +import javax.xml.crypto.OctetStreamData; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.XMLStructure; import javax.xml.crypto.dom.DOMCryptoContext; import javax.xml.crypto.dsig.TransformException; import javax.xml.crypto.dsig.TransformService; @@ -61,11 +66,13 @@ public abstract class ApacheCanonicalizer extends TransformService { protected Document ownerDoc; protected Element transformElem; + @Override public final AlgorithmParameterSpec getParameterSpec() { return params; } + @Override public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException { @@ -84,6 +91,7 @@ public void init(XMLStructure parent, XMLCryptoContext context) ownerDoc = DOMUtils.getOwnerDocument(transformElem); } + @Override public void marshalParams(XMLStructure parent, XMLCryptoContext context) throws MarshalException { @@ -182,6 +190,7 @@ private byte[] getC14nBytes(OutputStream outputStream, boolean isByteArrayOutput return null; } + @Override public Data transform(Data data, XMLCryptoContext xc, OutputStream os) throws TransformException { @@ -249,6 +258,7 @@ public Data transform(Data data, XMLCryptoContext xc, OutputStream os) } } + @Override public final boolean isFeatureSupported(String feature) { if (feature == null) { throw new NullPointerException(); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheData.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheData.java index 109309d0086..0515066bbd5 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheData.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheData.java @@ -26,6 +26,7 @@ package org.jcp.xml.dsig.internal.dom; import javax.xml.crypto.Data; + import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; /** diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java index b15c8784d5c..a59e41cce30 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java @@ -30,13 +30,14 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; + import javax.xml.crypto.NodeSetData; -import com.sun.org.apache.xml.internal.security.transforms.TransformationException; -import org.w3c.dom.Node; import com.sun.org.apache.xml.internal.security.signature.NodeFilter; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; +import com.sun.org.apache.xml.internal.security.transforms.TransformationException; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; +import org.w3c.dom.Node; public class ApacheNodeSetData implements ApacheData, NodeSetData { @@ -46,6 +47,7 @@ public ApacheNodeSetData(XMLSignatureInput xi) { this.xi = xi; } + @Override public Iterator iterator() { // If nodefilters are set, must execute them first to create node-set try { @@ -61,6 +63,7 @@ public Iterator iterator() { } } + @Override public XMLSignatureInput getXMLSignatureInput() { return xi; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheOctetStreamData.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheOctetStreamData.java index f00bb802cfc..9b919fcd909 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheOctetStreamData.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheOctetStreamData.java @@ -26,7 +26,9 @@ package org.jcp.xml.dsig.internal.dom; import java.io.IOException; + import javax.xml.crypto.OctetStreamData; + import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; public class ApacheOctetStreamData extends OctetStreamData @@ -41,6 +43,7 @@ public ApacheOctetStreamData(XMLSignatureInput xi) this.xi = xi; } + @Override public XMLSignatureInput getXMLSignatureInput() { return xi; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java index 25211920f68..2efbcb8b540 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java @@ -30,17 +30,26 @@ import java.security.spec.AlgorithmParameterSpec; import java.util.Set; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; -import com.sun.org.apache.xml.internal.security.transforms.Transform; -import javax.xml.crypto.*; +import javax.xml.crypto.Data; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.NodeSetData; +import javax.xml.crypto.OctetStreamData; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.XMLStructure; import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; +import javax.xml.crypto.dsig.TransformException; +import javax.xml.crypto.dsig.TransformService; import javax.xml.crypto.dsig.spec.TransformParameterSpec; +import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; +import com.sun.org.apache.xml.internal.security.transforms.Transform; +import com.sun.org.apache.xml.internal.security.transforms.Transforms; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + /** * This is a wrapper/glue class which invokes the Apache XML-Security * Transform. @@ -64,6 +73,7 @@ public final AlgorithmParameterSpec getParameterSpec() { return params; } + @Override public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException { @@ -82,6 +92,7 @@ public void init(XMLStructure parent, XMLCryptoContext context) ownerDoc = DOMUtils.getOwnerDocument(transformElem); } + @Override public void marshalParams(XMLStructure parent, XMLCryptoContext context) throws MarshalException { @@ -100,6 +111,7 @@ public void marshalParams(XMLStructure parent, XMLCryptoContext context) ownerDoc = DOMUtils.getOwnerDocument(transformElem); } + @Override public Data transform(Data data, XMLCryptoContext xc) throws TransformException { @@ -109,6 +121,7 @@ public Data transform(Data data, XMLCryptoContext xc) return transformIt(data, xc, null); } + @Override public Data transform(Data data, XMLCryptoContext xc, OutputStream os) throws TransformException { @@ -197,6 +210,7 @@ private Data transformIt(Data data, XMLCryptoContext xc, OutputStream os) } } + @Override public final boolean isFeatureSupported(String feature) { if (feature == null) { throw new NullPointerException(); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14N11Method.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14N11Method.java index 1c6c192e634..4ea74c62cc9 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14N11Method.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14N11Method.java @@ -25,12 +25,13 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.spec.TransformParameterSpec; - import java.security.InvalidAlgorithmParameterException; +import javax.xml.crypto.Data; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dsig.TransformException; +import javax.xml.crypto.dsig.spec.TransformParameterSpec; + import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer; import com.sun.org.apache.xml.internal.security.c14n.InvalidCanonicalizerException; @@ -45,6 +46,7 @@ public final class DOMCanonicalXMLC14N11Method extends ApacheCanonicalizer { public static final String C14N_11_WITH_COMMENTS = "http://www.w3.org/2006/12/xml-c14n11#WithComments"; + @Override public void init(TransformParameterSpec params) throws InvalidAlgorithmParameterException { if (params != null) { @@ -53,6 +55,7 @@ public void init(TransformParameterSpec params) } } + @Override public Data transform(Data data, XMLCryptoContext xc) throws TransformException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14NMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14NMethod.java index e2d524b3450..4b600157664 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14NMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14NMethod.java @@ -25,12 +25,14 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.spec.TransformParameterSpec; - import java.security.InvalidAlgorithmParameterException; +import javax.xml.crypto.Data; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dsig.CanonicalizationMethod; +import javax.xml.crypto.dsig.TransformException; +import javax.xml.crypto.dsig.spec.TransformParameterSpec; + import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer; import com.sun.org.apache.xml.internal.security.c14n.InvalidCanonicalizerException; @@ -41,6 +43,7 @@ */ public final class DOMCanonicalXMLC14NMethod extends ApacheCanonicalizer { + @Override public void init(TransformParameterSpec params) throws InvalidAlgorithmParameterException { if (params != null) { @@ -49,6 +52,7 @@ public void init(TransformParameterSpec params) } } + @Override public Data transform(Data data, XMLCryptoContext xc) throws TransformException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java index ecef17f35ae..c182a225363 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java @@ -33,10 +33,14 @@ import java.util.HashSet; import java.util.Set; -import org.w3c.dom.Element; +import javax.xml.crypto.Data; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dsig.CanonicalizationMethod; +import javax.xml.crypto.dsig.TransformException; +import javax.xml.crypto.dsig.TransformService; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; +import org.w3c.dom.Element; /** * DOM-based abstract implementation of CanonicalizationMethod. diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCryptoBinary.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCryptoBinary.java index 9a81a215d22..1b124810451 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCryptoBinary.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCryptoBinary.java @@ -26,7 +26,8 @@ package org.jcp.xml.dsig.internal.dom; import java.math.BigInteger; -import javax.xml.crypto.*; + +import javax.xml.crypto.MarshalException; import javax.xml.crypto.dom.DOMCryptoContext; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMDigestMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMDigestMethod.java index a4d5fea4ab6..259c7a988fc 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMDigestMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMDigestMethod.java @@ -25,13 +25,15 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; +import java.security.InvalidAlgorithmParameterException; +import java.security.spec.AlgorithmParameterSpec; + +import javax.xml.crypto.MarshalException; import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; +import javax.xml.crypto.dsig.DigestMethod; +import javax.xml.crypto.dsig.XMLSignature; import javax.xml.crypto.dsig.spec.DigestMethodParameterSpec; -import java.security.InvalidAlgorithmParameterException; -import java.security.spec.AlgorithmParameterSpec; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -147,6 +149,7 @@ void checkParams(DigestMethodParameterSpec params) } } + @Override public final AlgorithmParameterSpec getParameterSpec() { return params; } @@ -251,9 +254,11 @@ static final class SHA1 extends DOMDigestMethod { SHA1(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return DigestMethod.SHA1; } + @Override String getMessageDigestAlgorithm() { return "SHA-1"; } @@ -285,9 +290,11 @@ static final class SHA256 extends DOMDigestMethod { SHA256(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return DigestMethod.SHA256; } + @Override String getMessageDigestAlgorithm() { return "SHA-256"; } @@ -301,9 +308,11 @@ static final class SHA384 extends DOMDigestMethod { SHA384(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return SHA384; } + @Override String getMessageDigestAlgorithm() { return "SHA-384"; } @@ -317,9 +326,11 @@ static final class SHA512 extends DOMDigestMethod { SHA512(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return DigestMethod.SHA512; } + @Override String getMessageDigestAlgorithm() { return "SHA-512"; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMEnvelopedTransform.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMEnvelopedTransform.java index a43cb81567c..9a0ba0b2cae 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMEnvelopedTransform.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMEnvelopedTransform.java @@ -26,6 +26,7 @@ package org.jcp.xml.dsig.internal.dom; import java.security.InvalidAlgorithmParameterException; + import javax.xml.crypto.dsig.spec.TransformParameterSpec; /** @@ -35,6 +36,7 @@ */ public final class DOMEnvelopedTransform extends ApacheTransform { + @Override public void init(TransformParameterSpec params) throws InvalidAlgorithmParameterException { if (params != null) { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java index a8cd434874c..0490e781537 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java @@ -25,19 +25,24 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; +import java.security.InvalidAlgorithmParameterException; +import java.security.spec.AlgorithmParameterSpec; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.crypto.Data; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.XMLStructure; +import javax.xml.crypto.dsig.CanonicalizationMethod; +import javax.xml.crypto.dsig.TransformException; import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec; import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec; import javax.xml.crypto.dsig.spec.TransformParameterSpec; -import java.security.InvalidAlgorithmParameterException; -import java.security.spec.AlgorithmParameterSpec; -import java.util.*; - -import org.w3c.dom.Element; import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer; import com.sun.org.apache.xml.internal.security.c14n.InvalidCanonicalizerException; +import org.w3c.dom.Element; /** * DOM-based implementation of CanonicalizationMethod for Exclusive @@ -47,6 +52,7 @@ */ public final class DOMExcC14NMethod extends ApacheCanonicalizer { + @Override public void init(TransformParameterSpec params) throws InvalidAlgorithmParameterException { @@ -59,6 +65,7 @@ public void init(TransformParameterSpec params) } } + @Override public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException { @@ -137,6 +144,7 @@ public String getParamsNSURI() { return CanonicalizationMethod.EXCLUSIVE; } + @Override public Data transform(Data data, XMLCryptoContext xc) throws TransformException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java index 40bb99c3145..0a9ef187573 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java @@ -25,11 +25,6 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.spec.HMACParameterSpec; -import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; - import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.Key; @@ -38,12 +33,22 @@ import java.security.Provider; import java.security.SignatureException; import java.security.spec.AlgorithmParameterSpec; + import javax.crypto.Mac; import javax.crypto.SecretKey; -import org.w3c.dom.Document; -import org.w3c.dom.Element; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.dsig.SignatureMethod; +import javax.xml.crypto.dsig.SignedInfo; +import javax.xml.crypto.dsig.XMLSignContext; +import javax.xml.crypto.dsig.XMLSignature; +import javax.xml.crypto.dsig.XMLSignatureException; +import javax.xml.crypto.dsig.XMLValidateContext; +import javax.xml.crypto.dsig.spec.HMACParameterSpec; +import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; import org.jcp.xml.dsig.internal.MacOutputStream; +import org.w3c.dom.Document; +import org.w3c.dom.Element; /** * DOM-based implementation of HMAC SignatureMethod. @@ -118,10 +123,12 @@ void checkParams(SignatureMethodParameterSpec params) } } + @Override public final AlgorithmParameterSpec getParameterSpec() { return params; } + @Override SignatureMethodParameterSpec unmarshalParams(Element paramsElem) throws MarshalException { @@ -135,6 +142,7 @@ SignatureMethodParameterSpec unmarshalParams(Element paramsElem) return new HMACParameterSpec(outputLength); } + @Override void marshalParams(Element parent, String prefix) throws MarshalException { @@ -147,6 +155,7 @@ void marshalParams(Element parent, String prefix) parent.appendChild(hmacElem); } + @Override boolean verify(Key key, SignedInfo si, byte[] sig, XMLValidateContext context) throws InvalidKeyException, SignatureException, XMLSignatureException @@ -178,6 +187,7 @@ boolean verify(Key key, SignedInfo si, byte[] sig, return MessageDigest.isEqual(sig, result); } + @Override byte[] sign(Key key, SignedInfo si, XMLSignContext context) throws InvalidKeyException, XMLSignatureException { @@ -206,6 +216,7 @@ byte[] sign(Key key, SignedInfo si, XMLSignContext context) return hmac.doFinal(); } + @Override boolean paramsEqual(AlgorithmParameterSpec spec) { if (getParameterSpec() == spec) { return true; @@ -218,6 +229,7 @@ boolean paramsEqual(AlgorithmParameterSpec spec) { return outputLength == ospec.getOutputLength(); } + @Override Type getAlgorithmType() { return Type.HMAC; } @@ -235,12 +247,15 @@ static final class SHA1 extends DOMHMACSignatureMethod { SHA1(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return SignatureMethod.HMAC_SHA1; } + @Override String getJCAAlgorithm() { return "HmacSHA1"; } + @Override int getDigestLength() { return 160; } @@ -276,12 +291,15 @@ static final class SHA256 extends DOMHMACSignatureMethod { SHA256(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return HMAC_SHA256; } + @Override String getJCAAlgorithm() { return "HmacSHA256"; } + @Override int getDigestLength() { return 256; } @@ -295,12 +313,15 @@ static final class SHA384 extends DOMHMACSignatureMethod { SHA384(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return HMAC_SHA384; } + @Override String getJCAAlgorithm() { return "HmacSHA384"; } + @Override int getDigestLength() { return 384; } @@ -314,12 +335,15 @@ static final class SHA512 extends DOMHMACSignatureMethod { SHA512(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return HMAC_SHA512; } + @Override String getJCAAlgorithm() { return "HmacSHA512"; } + @Override int getDigestLength() { return 512; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java index 19cedafd9fc..d13b47ccdcf 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java @@ -141,14 +141,17 @@ public DOMKeyInfo(Element kiElem, XMLCryptoContext context, keyInfoTypes = Collections.unmodifiableList(content); } + @Override public String getId() { return id; } + @Override public List getContent() { return keyInfoTypes; } + @Override public void marshal(XMLStructure parent, XMLCryptoContext context) throws MarshalException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java index 99ca1dce722..cec1224affa 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java @@ -28,8 +28,8 @@ import java.math.BigInteger; import java.security.KeyException; import java.security.PublicKey; -import java.security.interfaces.ECPublicKey; import java.security.interfaces.DSAPublicKey; +import java.security.interfaces.ECPublicKey; import java.security.interfaces.RSAPublicKey; import java.util.List; @@ -59,20 +59,24 @@ public final class DOMKeyInfoFactory extends KeyInfoFactory { public DOMKeyInfoFactory() { } + @Override @SuppressWarnings("rawtypes") public KeyInfo newKeyInfo(List content) { return newKeyInfo(content, null); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public KeyInfo newKeyInfo(List content, String id) { return new DOMKeyInfo(content, id); } + @Override public KeyName newKeyName(String name) { return new DOMKeyName(name); } + @Override public KeyValue newKeyValue(PublicKey key) throws KeyException { String algorithm = key.getAlgorithm(); if ("DSA".equals(algorithm)) { @@ -86,24 +90,29 @@ public KeyValue newKeyValue(PublicKey key) throws KeyException { } } + @Override public PGPData newPGPData(byte[] keyId) { return newPGPData(keyId, null, null); } + @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public PGPData newPGPData(byte[] keyId, byte[] keyPacket, List other) { return new DOMPGPData(keyId, keyPacket, other); } + @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public PGPData newPGPData(byte[] keyPacket, List other) { return new DOMPGPData(keyPacket, other); } + @Override public RetrievalMethod newRetrievalMethod(String uri) { return newRetrievalMethod(uri, null, null); } + @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public RetrievalMethod newRetrievalMethod(String uri, String type, List transforms) { @@ -113,6 +122,7 @@ public RetrievalMethod newRetrievalMethod(String uri, String type, return new DOMRetrievalMethod(uri, type, transforms); } + @Override @SuppressWarnings({ "rawtypes" }) public X509Data newX509Data(List content) { return new DOMX509Data(content); @@ -124,6 +134,7 @@ public X509IssuerSerial newX509IssuerSerial(String issuerName, return new DOMX509IssuerSerial(issuerName, serialNumber); } + @Override public boolean isFeatureSupported(String feature) { if (feature == null) { throw new NullPointerException(); @@ -132,6 +143,7 @@ public boolean isFeatureSupported(String feature) { } } + @Override public URIDereferencer getURIDereferencer() { return DOMURIDereferencer.INSTANCE; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyName.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyName.java index 888a9c76024..3c83e48880b 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyName.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyName.java @@ -64,6 +64,7 @@ public DOMKeyName(Element knElem) { name = knElem.getFirstChild().getNodeValue(); } + @Override public String getName() { return name; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java index 307d0ae45ce..0933c21bfd3 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java @@ -101,6 +101,7 @@ static KeyValue unmarshal(Element kvElem) throws MarshalException { } } + @Override public PublicKey getPublicKey() throws KeyException { if (publicKey == null) { throw new KeyException("can't convert KeyValue to PublicKey"); @@ -198,6 +199,7 @@ static final class RSA extends DOMKeyValue { super(elem); } + @Override void marshalPublicKey(Node parent, Document doc, String dsPrefix, DOMCryptoContext context) throws MarshalException { Element rsaElem = DOMUtils.createElement(doc, "RSAKeyValue", diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java index be65eb8fb1f..6ed7ee8025d 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java @@ -25,12 +25,17 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; - import java.security.Provider; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dsig.Manifest; +import javax.xml.crypto.dsig.Reference; +import javax.xml.crypto.dsig.XMLSignature; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -114,6 +119,7 @@ public DOMManifest(Element manElem, XMLCryptoContext context, this.references = Collections.unmodifiableList(refs); } + @Override public String getId() { return id; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java index f9802c4698d..df591ce00ef 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java @@ -25,19 +25,21 @@ */ package org.jcp.xml.dsig.internal.dom; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; -import javax.xml.crypto.*; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLStructure; import javax.xml.crypto.dom.DOMCryptoContext; import javax.xml.crypto.dsig.XMLSignature; import javax.xml.crypto.dsig.keyinfo.PGPData; +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import com.sun.org.apache.xml.internal.security.utils.XMLUtils; - /** * DOM-based implementation of PGPData. * @@ -171,14 +173,17 @@ public DOMPGPData(Element pdElem) throws MarshalException { this.externalElements = Collections.unmodifiableList(other); } + @Override public byte[] getKeyId() { return keyId == null ? null : keyId.clone(); } + @Override public byte[] getKeyPacket() { return keyPacket == null ? null : keyPacket.clone(); } + @Override public List getExternalElements() { return externalElements; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java index 8e4c2424eb7..c131ab689d7 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java @@ -25,25 +25,33 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.spec.RSAPSSParameterSpec; -import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; - import java.io.IOException; -import java.security.*; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.PublicKey; +import java.security.Signature; +import java.security.SignatureException; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.MGF1ParameterSpec; import java.security.spec.PSSParameterSpec; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Text; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.dsig.*; +import javax.xml.crypto.dsig.spec.RSAPSSParameterSpec; +import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; + import org.jcp.xml.dsig.internal.SignerOutputStream; import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureBaseRSA.SignatureRSASSAPSS.DigestAlgorithm; import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Text; /** * DOM-based abstract implementation of SignatureMethod for RSA-PSS. @@ -125,10 +133,12 @@ void checkParams(SignatureMethodParameterSpec params) LOG.debug("Setting RSAPSSParameterSpec to: {}", params.toString()); } + @Override public final AlgorithmParameterSpec getParameterSpec() { return params; } + @Override void marshalParams(Element parent, String prefix) throws MarshalException { @@ -203,6 +213,7 @@ private static DigestAlgorithm validateDigestAlgorithm(String input) } } + @Override SignatureMethodParameterSpec unmarshalParams(Element paramsElem) throws MarshalException { @@ -250,6 +261,7 @@ SignatureMethodParameterSpec unmarshalParams(Element paramsElem) return DEFAULT_PSS_SPEC; } + @Override boolean verify(Key key, SignedInfo si, byte[] sig, XMLValidateContext context) throws InvalidKeyException, SignatureException, XMLSignatureException @@ -291,6 +303,7 @@ boolean verify(Key key, SignedInfo si, byte[] sig, } } + @Override byte[] sign(Key key, SignedInfo si, XMLSignContext context) throws InvalidKeyException, XMLSignatureException { @@ -318,7 +331,6 @@ byte[] sign(Key key, SignedInfo si, XMLSignContext context) throw new XMLSignatureException(e); } LOG.debug("Signature provider: {}", signature.getProvider()); - LOG.debug("Signing with key: {}", key); LOG.debug("JCA Algorithm: {}", getJCAAlgorithm()); try (SignerOutputStream outputStream = new SignerOutputStream(signature)) { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java index d278808ea05..69215340089 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java @@ -32,28 +32,52 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dom.DOMURIReference; - -import java.io.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.net.URI; import java.net.URISyntaxException; -import java.security.*; -import java.util.*; +import java.security.AccessController; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivilegedAction; +import java.security.Provider; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import javax.xml.crypto.Data; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.NodeSetData; +import javax.xml.crypto.OctetStreamData; +import javax.xml.crypto.URIDereferencer; +import javax.xml.crypto.URIReferenceException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dom.DOMURIReference; +import javax.xml.crypto.dsig.CanonicalizationMethod; +import javax.xml.crypto.dsig.DigestMethod; +import javax.xml.crypto.dsig.Reference; +import javax.xml.crypto.dsig.Transform; +import javax.xml.crypto.dsig.TransformException; +import javax.xml.crypto.dsig.TransformService; +import javax.xml.crypto.dsig.XMLSignContext; +import javax.xml.crypto.dsig.XMLSignature; +import javax.xml.crypto.dsig.XMLSignatureException; +import javax.xml.crypto.dsig.XMLValidateContext; +import org.jcp.xml.dsig.internal.DigesterOutputStream; +import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; +import com.sun.org.apache.xml.internal.security.utils.UnsyncBufferedOutputStream; +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import com.sun.org.apache.xml.internal.security.utils.XMLUtils; - -import org.jcp.xml.dsig.internal.DigesterOutputStream; -import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; -import com.sun.org.apache.xml.internal.security.utils.UnsyncBufferedOutputStream; - /** * DOM-based implementation of Reference. * @@ -270,30 +294,37 @@ public DOMReference(Element refElem, XMLCryptoContext context, this.provider = provider; } + @Override public DigestMethod getDigestMethod() { return digestMethod; } + @Override public String getId() { return id; } + @Override public String getURI() { return uri; } + @Override public String getType() { return type; } + @Override public List getTransforms() { return Collections.unmodifiableList(allTransforms); } + @Override public byte[] getDigestValue() { return digestValue == null ? null : digestValue.clone(); } + @Override public byte[] getCalculatedDigestValue() { return calcDigestValue == null ? null : calcDigestValue.clone(); @@ -372,6 +403,7 @@ public void digest(XMLSignContext signContext) LOG.debug("Reference digesting completed"); } + @Override public boolean validate(XMLValidateContext validateContext) throws XMLSignatureException { @@ -394,10 +426,12 @@ public boolean validate(XMLValidateContext validateContext) return validationStatus; } + @Override public Data getDereferencedData() { return derefData; } + @Override public InputStream getDigestInputStream() { return dis; } @@ -568,6 +602,7 @@ private byte[] transform(Data dereferencedData, } } + @Override public Node getHere() { return here; } @@ -631,6 +666,7 @@ private static Data copyDerefData(Data dereferencedData) { try { final Set s = xsi.getNodeSet(); return new NodeSetData() { + @Override public Iterator iterator() { return s.iterator(); } }; } catch (Exception e) { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java index 33343808fad..e5c92e8c535 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java @@ -176,14 +176,17 @@ public DOMRetrievalMethod(Element rmElem, XMLCryptoContext context, } } + @Override public String getURI() { return uri; } + @Override public String getType() { return type; } + @Override public List getTransforms() { return transforms; } @@ -219,10 +222,12 @@ public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) here = rmElem.getAttributeNodeNS(null, "URI"); } + @Override public Node getHere() { return here; } + @Override public Data dereference(XMLCryptoContext context) throws URIReferenceException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java index 267e29d901d..5e44ccaeae8 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java @@ -25,23 +25,36 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; - import java.io.IOException; -import java.security.*; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.PublicKey; +import java.security.Signature; +import java.security.SignatureException; import java.security.interfaces.DSAKey; import java.security.interfaces.ECPrivateKey; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.MGF1ParameterSpec; import java.security.spec.PSSParameterSpec; -import org.w3c.dom.Element; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.dsig.SignatureMethod; +import javax.xml.crypto.dsig.SignedInfo; +import javax.xml.crypto.dsig.XMLSignContext; +import javax.xml.crypto.dsig.XMLSignatureException; +import javax.xml.crypto.dsig.XMLValidateContext; +import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; +import org.jcp.xml.dsig.internal.SignerOutputStream; import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureECDSA; import com.sun.org.apache.xml.internal.security.utils.JavaUtils; -import org.jcp.xml.dsig.internal.SignerOutputStream; +import org.w3c.dom.Element; + import sun.security.util.KeyUtil; /** @@ -103,6 +116,14 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod { "http://www.w3.org/2007/05/xmldsig-more#sha512-rsa-MGF1"; static final String RSA_RIPEMD160_MGF1 = "http://www.w3.org/2007/05/xmldsig-more#ripemd160-rsa-MGF1"; + static final String RSA_SHA3_224_MGF1 = + "http://www.w3.org/2007/05/xmldsig-more#sha3-224-rsa-MGF1"; + static final String RSA_SHA3_256_MGF1 = + "http://www.w3.org/2007/05/xmldsig-more#sha3-256-rsa-MGF1"; + static final String RSA_SHA3_384_MGF1 = + "http://www.w3.org/2007/05/xmldsig-more#sha3-384-rsa-MGF1"; + static final String RSA_SHA3_512_MGF1 = + "http://www.w3.org/2007/05/xmldsig-more#sha3-512-rsa-MGF1"; /** * Creates a {@code DOMSignatureMethod}. @@ -194,6 +215,14 @@ static SignatureMethod unmarshal(Element smElem) throws MarshalException { return new SHA384withRSAandMGF1(smElem); } else if (alg.equals(RSA_SHA512_MGF1)) { return new SHA512withRSAandMGF1(smElem); + } else if (alg.equals(RSA_SHA3_224_MGF1)) { + return new SHA3_224withRSAandMGF1(smElem); + } else if (alg.equals(RSA_SHA3_256_MGF1)) { + return new SHA3_256withRSAandMGF1(smElem); + } else if (alg.equals(RSA_SHA3_384_MGF1)) { + return new SHA3_384withRSAandMGF1(smElem); + } else if (alg.equals(RSA_SHA3_512_MGF1)) { + return new SHA3_512withRSAandMGF1(smElem); } else if (alg.equals(DOMRSAPSSSignatureMethod.RSA_PSS)) { return new DOMRSAPSSSignatureMethod.RSAPSS(smElem); } else if (alg.equals(RSA_RIPEMD160_MGF1)) { @@ -236,6 +265,7 @@ static SignatureMethod unmarshal(Element smElem) throws MarshalException { } } + @Override public final AlgorithmParameterSpec getParameterSpec() { return params; } @@ -257,6 +287,7 @@ Signature getSignature(Provider p) : Signature.getInstance(getJCAAlgorithm(), p); } + @Override boolean verify(Key key, SignedInfo si, byte[] sig, XMLValidateContext context) throws InvalidKeyException, SignatureException, XMLSignatureException @@ -323,6 +354,7 @@ private static void checkKeySize(XMLCryptoContext context, Key key) } } + @Override byte[] sign(Key key, SignedInfo si, XMLSignContext context) throws InvalidKeyException, XMLSignatureException { @@ -344,7 +376,6 @@ byte[] sign(Key key, SignedInfo si, XMLSignContext context) } signature.initSign((PrivateKey)key); LOG.debug("Signature provider: {}", signature.getProvider()); - LOG.debug("Signing with key: {}", key); LOG.debug("JCA Algorithm: {}", getJCAAlgorithm()); try (SignerOutputStream outputStream = new SignerOutputStream(signature)) { @@ -383,6 +414,11 @@ byte[] postSignFormat(Key key, byte[] sig) { byte[] preVerifyFormat(Key key, byte[] sig) { return sig; } + + @Override + Type getAlgorithmType() { + return Type.RSA; + } } abstract static class AbstractRSAPSSSignatureMethod @@ -397,7 +433,7 @@ abstract static class AbstractRSAPSSSignatureMethod super(dmElem); } - abstract public PSSParameterSpec getPSSParameterSpec(); + public abstract PSSParameterSpec getPSSParameterSpec(); @Override Signature getSignature(Provider p) @@ -413,9 +449,7 @@ Signature getSignature(Provider p) } return s; } catch (NoSuchAlgorithmException nsae) { - return (p == null) - ? Signature.getInstance(getJCAAlgorithm()) - : Signature.getInstance(getJCAAlgorithm(), p); + return super.getSignature(p); } } } @@ -509,6 +543,11 @@ byte[] preVerifyFormat(Key key, byte[] sig) throws IOException { return sig; } } + + @Override + Type getAlgorithmType() { + return Type.DSA; + } } abstract static class AbstractECDSASignatureMethod @@ -550,6 +589,11 @@ byte[] preVerifyFormat(Key key, byte[] sig) throws IOException { return sig; } } + + @Override + Type getAlgorithmType() { + return Type.ECDSA; + } } abstract static class AbstractEDDSASignatureMethod @@ -583,6 +627,10 @@ byte[] preVerifyFormat(Key key, byte[] sig) { return sig; } + @Override + Type getAlgorithmType() { + return Type.EDDSA; + } } static final class SHA1withRSA extends AbstractRSASignatureMethod { @@ -601,10 +649,6 @@ public String getAlgorithm() { String getJCAAlgorithm() { return "SHA1withRSA"; } - @Override - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA224withRSA extends AbstractRSASignatureMethod { @@ -615,15 +659,14 @@ static final class SHA224withRSA extends AbstractRSASignatureMethod { SHA224withRSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return RSA_SHA224; } + @Override String getJCAAlgorithm() { return "SHA224withRSA"; } - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA256withRSA extends AbstractRSASignatureMethod { @@ -634,15 +677,14 @@ static final class SHA256withRSA extends AbstractRSASignatureMethod { SHA256withRSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return RSA_SHA256; } + @Override String getJCAAlgorithm() { return "SHA256withRSA"; } - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA384withRSA extends AbstractRSASignatureMethod { @@ -653,15 +695,14 @@ static final class SHA384withRSA extends AbstractRSASignatureMethod { SHA384withRSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return RSA_SHA384; } + @Override String getJCAAlgorithm() { return "SHA384withRSA"; } - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA512withRSA extends AbstractRSASignatureMethod { @@ -672,15 +713,14 @@ static final class SHA512withRSA extends AbstractRSASignatureMethod { SHA512withRSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return RSA_SHA512; } + @Override String getJCAAlgorithm() { return "SHA512withRSA"; } - Type getAlgorithmType() { - return Type.RSA; - } } static final class RIPEMD160withRSA extends AbstractRSASignatureMethod { @@ -699,15 +739,11 @@ public String getAlgorithm() { String getJCAAlgorithm() { return "RIPEMD160withRSA"; } - @Override - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA1withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { - private static PSSParameterSpec spec + private static final PSSParameterSpec SHA1_MGF1_PARAMS = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, PSSParameterSpec.TRAILER_FIELD_BC); @@ -724,21 +760,17 @@ public String getAlgorithm() { } @Override public PSSParameterSpec getPSSParameterSpec() { - return spec; + return SHA1_MGF1_PARAMS; } @Override String getJCAAlgorithm() { return "SHA1withRSAandMGF1"; } - @Override - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA224withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { - private static PSSParameterSpec spec + private static final PSSParameterSpec SHA224_MGF1_PARAMS = new PSSParameterSpec("SHA-224", "MGF1", MGF1ParameterSpec.SHA224, 28, PSSParameterSpec.TRAILER_FIELD_BC); @@ -755,21 +787,17 @@ public String getAlgorithm() { } @Override public PSSParameterSpec getPSSParameterSpec() { - return spec; + return SHA224_MGF1_PARAMS; } @Override String getJCAAlgorithm() { return "SHA224withRSAandMGF1"; } - @Override - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA256withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { - private static PSSParameterSpec spec + private static final PSSParameterSpec SHA256_MGF1_PARAMS = new PSSParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, 32, PSSParameterSpec.TRAILER_FIELD_BC); @@ -786,21 +814,17 @@ public String getAlgorithm() { } @Override public PSSParameterSpec getPSSParameterSpec() { - return spec; + return SHA256_MGF1_PARAMS; } @Override String getJCAAlgorithm() { return "SHA256withRSAandMGF1"; } - @Override - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA384withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { - private static PSSParameterSpec spec + private static final PSSParameterSpec SHA384_MGF1_PARAMS = new PSSParameterSpec("SHA-384", "MGF1", MGF1ParameterSpec.SHA384, 48, PSSParameterSpec.TRAILER_FIELD_BC); @@ -817,21 +841,17 @@ public String getAlgorithm() { } @Override public PSSParameterSpec getPSSParameterSpec() { - return spec; + return SHA384_MGF1_PARAMS; } @Override String getJCAAlgorithm() { return "SHA384withRSAandMGF1"; } - @Override - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA512withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { - private static PSSParameterSpec spec + private static final PSSParameterSpec SHA512_MGF1_PARAMS = new PSSParameterSpec("SHA-512", "MGF1", MGF1ParameterSpec.SHA512, 64, PSSParameterSpec.TRAILER_FIELD_BC); @@ -848,15 +868,123 @@ public String getAlgorithm() { } @Override public PSSParameterSpec getPSSParameterSpec() { - return spec; + return SHA512_MGF1_PARAMS; } @Override String getJCAAlgorithm() { return "SHA512withRSAandMGF1"; } + } + + static final class SHA3_224withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { + + private static final PSSParameterSpec SHA3_224_MGF1_PARAMS + = new PSSParameterSpec("SHA3-224", "MGF1", + new MGF1ParameterSpec("SHA3-224"), 28, + PSSParameterSpec.TRAILER_FIELD_BC); + + SHA3_224withRSAandMGF1(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException { + super(params); + } + SHA3_224withRSAandMGF1(Element dmElem) throws MarshalException { + super(dmElem); + } @Override - Type getAlgorithmType() { - return Type.RSA; + public String getAlgorithm() { + return RSA_SHA3_224_MGF1; + } + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_224_MGF1_PARAMS; + } + @Override + String getJCAAlgorithm() { + return "SHA3-224withRSAandMGF1"; + } + } + + static final class SHA3_256withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { + + private static final PSSParameterSpec SHA3_256_MGF1_PARAMS + = new PSSParameterSpec("SHA3-256", "MGF1", + new MGF1ParameterSpec("SHA3-256"), 32, + PSSParameterSpec.TRAILER_FIELD_BC); + + SHA3_256withRSAandMGF1(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException { + super(params); + } + SHA3_256withRSAandMGF1(Element dmElem) throws MarshalException { + super(dmElem); + } + @Override + public String getAlgorithm() { + return RSA_SHA3_256_MGF1; + } + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_256_MGF1_PARAMS; + } + @Override + String getJCAAlgorithm() { + return "SHA3-256withRSAandMGF1"; + } + } + + static final class SHA3_384withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { + + private static final PSSParameterSpec SHA3_384_MGF1_PARAMS + = new PSSParameterSpec("SHA3-384", "MGF1", + new MGF1ParameterSpec("SHA3-384"), 48, + PSSParameterSpec.TRAILER_FIELD_BC); + + SHA3_384withRSAandMGF1(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException { + super(params); + } + SHA3_384withRSAandMGF1(Element dmElem) throws MarshalException { + super(dmElem); + } + @Override + public String getAlgorithm() { + return RSA_SHA3_384_MGF1; + } + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_384_MGF1_PARAMS; + } + @Override + String getJCAAlgorithm() { + return "SHA3-384withRSAandMGF1"; + } + } + + static final class SHA3_512withRSAandMGF1 extends AbstractRSAPSSSignatureMethod { + + private static final PSSParameterSpec SHA3_512_MGF1_PARAMS + = new PSSParameterSpec("SHA3-512", "MGF1", + new MGF1ParameterSpec("SHA3-512"), 64, + PSSParameterSpec.TRAILER_FIELD_BC); + + SHA3_512withRSAandMGF1(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException { + super(params); + } + SHA3_512withRSAandMGF1(Element dmElem) throws MarshalException { + super(dmElem); + } + @Override + public String getAlgorithm() { + return RSA_SHA3_512_MGF1; + } + @Override + public PSSParameterSpec getPSSParameterSpec() { + return SHA3_512_MGF1_PARAMS; + } + @Override + String getJCAAlgorithm() { + return "SHA3-512withRSAandMGF1"; } } @@ -876,10 +1004,6 @@ public String getAlgorithm() { String getJCAAlgorithm() { return "RIPEMD160withRSAandMGF1"; } - @Override - Type getAlgorithmType() { - return Type.RSA; - } } static final class SHA1withDSA extends AbstractDSASignatureMethod { @@ -890,18 +1014,18 @@ static final class SHA1withDSA extends AbstractDSASignatureMethod { SHA1withDSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return SignatureMethod.DSA_SHA1; } + @Override String getJCAAlgorithm() { return "SHA1withDSAinP1363Format"; } + @Override String getJCAFallbackAlgorithm() { return "SHA1withDSA"; } - Type getAlgorithmType() { - return Type.DSA; - } } static final class SHA256withDSA extends AbstractDSASignatureMethod { @@ -912,18 +1036,18 @@ static final class SHA256withDSA extends AbstractDSASignatureMethod { SHA256withDSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return DSA_SHA256; } + @Override String getJCAAlgorithm() { return "SHA256withDSAinP1363Format"; } + @Override String getJCAFallbackAlgorithm() { return "SHA256withDSA"; } - Type getAlgorithmType() { - return Type.DSA; - } } static final class SHA1withECDSA extends AbstractECDSASignatureMethod { @@ -934,18 +1058,18 @@ static final class SHA1withECDSA extends AbstractECDSASignatureMethod { SHA1withECDSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return ECDSA_SHA1; } + @Override String getJCAAlgorithm() { return "SHA1withECDSAinP1363Format"; } + @Override String getJCAFallbackAlgorithm() { return "SHA1withECDSA"; } - Type getAlgorithmType() { - return Type.ECDSA; - } } static final class SHA224withECDSA extends AbstractECDSASignatureMethod { @@ -964,13 +1088,10 @@ public String getAlgorithm() { String getJCAAlgorithm() { return "SHA224withECDSAinP1363Format"; } + @Override String getJCAFallbackAlgorithm() { return "SHA224withECDSA"; } - @Override - Type getAlgorithmType() { - return Type.ECDSA; - } } static final class SHA256withECDSA extends AbstractECDSASignatureMethod { @@ -981,18 +1102,18 @@ static final class SHA256withECDSA extends AbstractECDSASignatureMethod { SHA256withECDSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return ECDSA_SHA256; } + @Override String getJCAAlgorithm() { return "SHA256withECDSAinP1363Format"; } + @Override String getJCAFallbackAlgorithm() { return "SHA256withECDSA"; } - Type getAlgorithmType() { - return Type.ECDSA; - } } static final class SHA384withECDSA extends AbstractECDSASignatureMethod { @@ -1003,18 +1124,18 @@ static final class SHA384withECDSA extends AbstractECDSASignatureMethod { SHA384withECDSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return ECDSA_SHA384; } + @Override String getJCAAlgorithm() { return "SHA384withECDSAinP1363Format"; } + @Override String getJCAFallbackAlgorithm() { return "SHA384withECDSA"; } - Type getAlgorithmType() { - return Type.ECDSA; - } } static final class SHA512withECDSA extends AbstractECDSASignatureMethod { @@ -1025,18 +1146,18 @@ static final class SHA512withECDSA extends AbstractECDSASignatureMethod { SHA512withECDSA(Element dmElem) throws MarshalException { super(dmElem); } + @Override public String getAlgorithm() { return ECDSA_SHA512; } + @Override String getJCAAlgorithm() { return "SHA512withECDSAinP1363Format"; } + @Override String getJCAFallbackAlgorithm() { return "SHA512withECDSA"; } - Type getAlgorithmType() { - return Type.ECDSA; - } } static final class RIPEMD160withECDSA extends AbstractECDSASignatureMethod { @@ -1055,13 +1176,10 @@ public String getAlgorithm() { String getJCAAlgorithm() { return "RIPEMD160withECDSAinP1363Format"; // Is this real? } + @Override String getJCAFallbackAlgorithm() { return "RIPEMD160withECDSA"; } - @Override - Type getAlgorithmType() { - return Type.ECDSA; - } } static final class EDDSA_ED25519 extends AbstractEDDSASignatureMethod { @@ -1084,11 +1202,6 @@ public String getAlgorithm() { String getJCAAlgorithm() { return "Ed25519"; } - - @Override - Type getAlgorithmType() { - return Type.EDDSA; - } } static final class EDDSA_ED448 extends AbstractEDDSASignatureMethod { @@ -1110,10 +1223,5 @@ public String getAlgorithm() { String getJCAAlgorithm() { return "Ed448"; } - - @Override - Type getAlgorithmType() { - return Type.EDDSA; - } } } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java index efa9d3fc80a..ba72b2725ea 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java @@ -25,11 +25,15 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; -import java.util.*; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dsig.SignatureProperties; +import javax.xml.crypto.dsig.SignatureProperty; +import javax.xml.crypto.dsig.XMLSignature; import org.w3c.dom.Attr; import org.w3c.dom.Document; @@ -117,10 +121,12 @@ public DOMSignatureProperties(Element propsElem) } } + @Override public List getProperties() { return properties; } + @Override public String getId() { return id; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java index 136847b491f..61994cd85f8 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java @@ -25,11 +25,15 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; -import java.util.*; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLStructure; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dsig.SignatureProperty; +import javax.xml.crypto.dsig.XMLSignature; import org.w3c.dom.Attr; import org.w3c.dom.Document; @@ -117,14 +121,17 @@ public DOMSignatureProperty(Element propElem) } } + @Override public List getContent() { return content; } + @Override public String getId() { return id; } + @Override public String getTarget() { return target; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java index f4f8bfd4386..170b179564b 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java @@ -25,28 +25,38 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.spec.RSAPSSParameterSpec; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.io.IOException; import java.security.Provider; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.MGF1ParameterSpec; import java.security.spec.PSSParameterSpec; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dsig.CanonicalizationMethod; +import javax.xml.crypto.dsig.Reference; +import javax.xml.crypto.dsig.SignatureMethod; +import javax.xml.crypto.dsig.SignedInfo; +import javax.xml.crypto.dsig.TransformException; +import javax.xml.crypto.dsig.XMLSignature; +import javax.xml.crypto.dsig.XMLSignatureException; +import javax.xml.crypto.dsig.spec.RSAPSSParameterSpec; import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureBaseRSA; +import com.sun.org.apache.xml.internal.security.utils.UnsyncBufferedOutputStream; +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import com.sun.org.apache.xml.internal.security.utils.UnsyncBufferedOutputStream; -import com.sun.org.apache.xml.internal.security.utils.XMLUtils; + /** * DOM-based implementation of SignedInfo. @@ -57,9 +67,9 @@ public final class DOMSignedInfo extends DOMStructure implements SignedInfo { private static final com.sun.org.slf4j.internal.Logger LOG = com.sun.org.slf4j.internal.LoggerFactory.getLogger(DOMSignedInfo.class); - private List references; - private CanonicalizationMethod canonicalizationMethod; - private SignatureMethod signatureMethod; + private final List references; + private final CanonicalizationMethod canonicalizationMethod; + private final SignatureMethod signatureMethod; private String id; private Document ownerDoc; private Element localSiElem; @@ -86,17 +96,13 @@ public DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, } this.canonicalizationMethod = cm; this.signatureMethod = sm; - this.references = Collections.unmodifiableList( - new ArrayList<>(references)); + this.references = Collections.unmodifiableList(new ArrayList<>(references)); if (this.references.isEmpty()) { - throw new IllegalArgumentException("list of references must " + - "contain at least one entry"); + throw new IllegalArgumentException("list of references must contain at least one entry"); } - for (int i = 0, size = this.references.size(); i < size; i++) { - Object obj = this.references.get(i); + for (Object obj : this.references) { if (!(obj instanceof Reference)) { - throw new ClassCastException("list of references contains " + - "an illegal type"); + throw new ClassCastException("list of references contains an illegal " + obj.getClass()); } } } @@ -210,22 +216,27 @@ public DOMSignedInfo(Element siElem, XMLCryptoContext context, Provider provider references = Collections.unmodifiableList(refList); } + @Override public CanonicalizationMethod getCanonicalizationMethod() { return canonicalizationMethod; } + @Override public SignatureMethod getSignatureMethod() { return signatureMethod; } + @Override public String getId() { return id; } + @Override public List getReferences() { return references; } + @Override public InputStream getCanonicalizedData() { return canonData; } @@ -249,8 +260,8 @@ public void canonicalize(XMLCryptoContext context, ByteArrayOutputStream bos) if (LOG.isDebugEnabled()) { LOG.debug("Canonicalized SignedInfo:"); StringBuilder sb = new StringBuilder(signedInfoBytes.length); - for (int i = 0; i < signedInfoBytes.length; i++) { - sb.append((char)signedInfoBytes[i]); + for (byte signedInfoByte : signedInfoBytes) { + sb.append((char) signedInfoByte); } LOG.debug(sb.toString()); LOG.debug("Data to be signed/verified:" + XMLUtils.encodeToString(signedInfoBytes)); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMStructure.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMStructure.java index e7ddd0050df..77818ea27c2 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMStructure.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMStructure.java @@ -25,12 +25,13 @@ */ package org.jcp.xml.dsig.internal.dom; +import java.util.List; + import javax.xml.crypto.MarshalException; import javax.xml.crypto.XMLStructure; import javax.xml.crypto.dom.DOMCryptoContext; -import org.w3c.dom.Node; -import java.util.List; +import org.w3c.dom.Node; /** * DOM-based abstract implementation of XMLStructure. @@ -38,6 +39,7 @@ */ public abstract class DOMStructure implements XMLStructure { + @Override public final boolean isFeatureSupported(String feature) { if (feature == null) { throw new NullPointerException(); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java index 404942e72bf..dab41a917e0 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java @@ -25,12 +25,14 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.NodeSetData; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.NoSuchElementException; + +import javax.xml.crypto.NodeSetData; + import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -79,6 +81,7 @@ static class DelayedNodeIterator implements Iterator { this.withComments = !excludeComments; } + @Override public boolean hasNext() { if (nodeSet == null) { nodeSet = dereferenceSameDocumentURI(root); @@ -87,6 +90,7 @@ public boolean hasNext() { return li.hasNext(); } + @Override public Node next() { if (nodeSet == null) { nodeSet = dereferenceSameDocumentURI(root); @@ -99,6 +103,7 @@ public Node next() { } } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java index fd6a89229c4..0e6fce6e601 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java @@ -98,10 +98,12 @@ public DOMTransform(Element transElem, XMLCryptoContext context, } } + @Override public final AlgorithmParameterSpec getParameterSpec() { return spi.getParameterSpec(); } + @Override public final String getAlgorithm() { return spi.getAlgorithm(); } @@ -145,6 +147,7 @@ public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) * @throws XMLSignatureException if an unexpected error occurs while * executing the transform */ + @Override public Data transform(Data data, XMLCryptoContext xc) throws TransformException { @@ -164,6 +167,7 @@ public Data transform(Data data, XMLCryptoContext xc) * @throws XMLSignatureException if an unexpected error occurs while * executing the transform */ + @Override public Data transform(Data data, XMLCryptoContext xc, OutputStream os) throws TransformException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java index e72642bbff3..212ffc9676d 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java @@ -25,18 +25,23 @@ */ package org.jcp.xml.dsig.internal.dom; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.Node; +import javax.xml.crypto.Data; +import javax.xml.crypto.URIDereferencer; +import javax.xml.crypto.URIReference; +import javax.xml.crypto.URIReferenceException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dom.DOMURIReference; import com.sun.org.apache.xml.internal.security.Init; +import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverContext; -import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.Node; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.*; import java.net.URI; /** @@ -53,6 +58,7 @@ private DOMURIDereferencer() { Init.init(); } + @Override public Data dereference(URIReference uriRef, XMLCryptoContext context) throws URIReferenceException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java index bf8de888bb5..2da7628d266 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java @@ -46,12 +46,11 @@ import javax.xml.crypto.dsig.keyinfo.X509Data; import javax.xml.crypto.dsig.keyinfo.X509IssuerSerial; +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import com.sun.org.apache.xml.internal.security.utils.XMLUtils; - /** * DOM-based implementation of X509Data. * @@ -134,6 +133,7 @@ public DOMX509Data(Element xdElem) throws MarshalException { this.content = Collections.unmodifiableList(newContent); } + @Override public List getContent() { return content; } @@ -147,8 +147,7 @@ public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) XMLSignature.XMLNS, dsPrefix); // append children and preserve order - for (int i = 0, size = content.size(); i < size; i++) { - Object object = content.get(i); + for (Object object : content) { if (object instanceof X509Certificate) { marshalCert((X509Certificate)object,xdElem,ownerDoc,dsPrefix); } else if (object instanceof XMLStructure) { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509IssuerSerial.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509IssuerSerial.java index 959b78636b9..c20088479bc 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509IssuerSerial.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509IssuerSerial.java @@ -25,14 +25,14 @@ */ package org.jcp.xml.dsig.internal.dom; +import java.math.BigInteger; + +import javax.security.auth.x500.X500Principal; import javax.xml.crypto.MarshalException; import javax.xml.crypto.dom.DOMCryptoContext; import javax.xml.crypto.dsig.XMLSignature; import javax.xml.crypto.dsig.keyinfo.X509IssuerSerial; -import java.math.BigInteger; - -import javax.security.auth.x500.X500Principal; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -88,10 +88,12 @@ public DOMX509IssuerSerial(Element isElem) throws MarshalException { serialNumber = new BigInteger(sNElem.getFirstChild().getNodeValue()); } + @Override public String getIssuerName() { return issuerName; } + @Override public BigInteger getSerialNumber() { return serialNumber; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java index 925a6b81baf..bf36537e308 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java @@ -25,12 +25,17 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; - import java.security.Provider; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.XMLStructure; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dsig.XMLObject; +import javax.xml.crypto.dsig.XMLSignature; import org.w3c.dom.Attr; import org.w3c.dom.Document; @@ -145,18 +150,22 @@ public DOMXMLObject(Element objElem, XMLCryptoContext context, this.objectElem = objElem; } + @Override public List getContent() { return content; } + @Override public String getId() { return id; } + @Override public String getMimeType() { return mimeType; } + @Override public String getEncoding() { return encoding; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java index 746a1e57cab..30b35b45bc9 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java @@ -32,29 +32,42 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.*; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.dom.DOMSignContext; -import javax.xml.crypto.dsig.dom.DOMValidateContext; -import javax.xml.crypto.dsig.keyinfo.KeyInfo; - import java.security.InvalidKeyException; import java.security.Key; import java.security.Provider; -import java.util.Collections; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.xml.crypto.KeySelector; +import javax.xml.crypto.KeySelectorException; +import javax.xml.crypto.KeySelectorResult; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.XMLStructure; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dsig.Manifest; +import javax.xml.crypto.dsig.Reference; +import javax.xml.crypto.dsig.SignatureMethod; +import javax.xml.crypto.dsig.SignedInfo; +import javax.xml.crypto.dsig.Transform; +import javax.xml.crypto.dsig.XMLObject; +import javax.xml.crypto.dsig.XMLSignContext; +import javax.xml.crypto.dsig.XMLSignature; +import javax.xml.crypto.dsig.XMLSignatureException; +import javax.xml.crypto.dsig.XMLValidateContext; +import javax.xml.crypto.dsig.dom.DOMSignContext; +import javax.xml.crypto.dsig.dom.DOMValidateContext; +import javax.xml.crypto.dsig.keyinfo.KeyInfo; + +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import com.sun.org.apache.xml.internal.security.utils.XMLUtils; - /** * DOM-based implementation of XMLSignature. * @@ -64,11 +77,11 @@ public final class DOMXMLSignature extends DOMStructure private static final com.sun.org.slf4j.internal.Logger LOG = com.sun.org.slf4j.internal.LoggerFactory.getLogger(DOMXMLSignature.class); - private String id; - private SignatureValue sv; + private final String id; + private final SignatureValue sv; private KeyInfo ki; private List objects; - private SignedInfo si; + private final SignedInfo si; private Document ownerDoc = null; private Element localSigElem = null; private Element sigElem = null; @@ -174,26 +187,32 @@ public DOMXMLSignature(Element sigElem, XMLCryptoContext context, } } + @Override public String getId() { return id; } + @Override public KeyInfo getKeyInfo() { return ki; } + @Override public SignedInfo getSignedInfo() { return si; } + @Override public List getObjects() { return objects; } + @Override public SignatureValue getSignatureValue() { return sv; } + @Override public KeySelectorResult getKeySelectorResult() { return ksr; } @@ -234,8 +253,8 @@ public void marshal(Node parent, Node nextSibling, String dsPrefix, } // create and append Object elements if necessary - for (int i = 0, size = objects.size(); i < size; i++) { - ((DOMXMLObject)objects.get(i)).marshal(sigElem, dsPrefix, context); + for (XMLObject object : objects) { + ((DOMXMLObject)object).marshal(sigElem, dsPrefix, context); } // append Id attribute @@ -460,13 +479,12 @@ private void digestReference(DOMReference ref, XMLSignContext signContext) if (parsedId != null && signatureIdMap.containsKey(parsedId)) { XMLStructure xs = signatureIdMap.get(parsedId); if (xs instanceof DOMReference) { - digestReference((DOMReference)xs, signContext); + digestReference((DOMReference) xs, signContext); } else if (xs instanceof Manifest) { - Manifest man = (Manifest)xs; + Manifest man = (Manifest) xs; List manRefs = DOMManifest.getManifestReferences(man); - for (int i = 0, size = manRefs.size(); i < size; i++) { - digestReference((DOMReference)manRefs.get(i), - signContext); + for (Reference manRef : manRefs) { + digestReference((DOMReference) manRef, signContext); } } } @@ -518,10 +536,12 @@ public class DOMSignatureValue extends DOMStructure this.sigValueElem = sigValueElem; } + @Override public String getId() { return id; } + @Override public byte[] getValue() { return (value == null) ? null : value.clone(); } @@ -605,6 +625,7 @@ public int hashCode() { return result; } + @Override public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java index 5ee0f78a053..119bf16bc32 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java @@ -25,17 +25,37 @@ */ package org.jcp.xml.dsig.internal.dom; -import javax.xml.crypto.*; -import javax.xml.crypto.dom.DOMCryptoContext; -import javax.xml.crypto.dsig.*; -import javax.xml.crypto.dsig.dom.DOMValidateContext; -import javax.xml.crypto.dsig.keyinfo.*; -import javax.xml.crypto.dsig.spec.*; - import java.security.InvalidAlgorithmParameterException; import java.security.NoSuchAlgorithmException; import java.util.List; +import javax.xml.crypto.Data; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.URIDereferencer; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.XMLStructure; +import javax.xml.crypto.dom.DOMCryptoContext; +import javax.xml.crypto.dsig.CanonicalizationMethod; +import javax.xml.crypto.dsig.DigestMethod; +import javax.xml.crypto.dsig.Manifest; +import javax.xml.crypto.dsig.Reference; +import javax.xml.crypto.dsig.SignatureMethod; +import javax.xml.crypto.dsig.SignatureProperties; +import javax.xml.crypto.dsig.SignatureProperty; +import javax.xml.crypto.dsig.SignedInfo; +import javax.xml.crypto.dsig.Transform; +import javax.xml.crypto.dsig.TransformService; +import javax.xml.crypto.dsig.XMLObject; +import javax.xml.crypto.dsig.XMLSignature; +import javax.xml.crypto.dsig.XMLSignatureFactory; +import javax.xml.crypto.dsig.XMLValidateContext; +import javax.xml.crypto.dsig.dom.DOMValidateContext; +import javax.xml.crypto.dsig.keyinfo.KeyInfo; +import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec; +import javax.xml.crypto.dsig.spec.DigestMethodParameterSpec; +import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec; +import javax.xml.crypto.dsig.spec.TransformParameterSpec; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -51,20 +71,24 @@ public final class DOMXMLSignatureFactory extends XMLSignatureFactory { */ public DOMXMLSignatureFactory() {} + @Override public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki) { return new DOMXMLSignature(si, ki, null, null, null); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki, List objects, String id, String signatureValueId) { return new DOMXMLSignature(si, ki, objects, id, signatureValueId); } + @Override public Reference newReference(String uri, DigestMethod dm) { return newReference(uri, dm, null, null, null); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Reference newReference(String uri, DigestMethod dm, List transforms, String type, String id) { @@ -89,6 +113,7 @@ public Reference newReference(String uri, DigestMethod dm, (uri, type, dm, appliedTransforms, result, transforms, id, getProvider()); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Reference newReference(String uri, DigestMethod dm, List transforms, String type, String id, byte[] digestValue) { @@ -99,12 +124,14 @@ public Reference newReference(String uri, DigestMethod dm, List transforms, (uri, type, dm, null, null, transforms, id, digestValue, getProvider()); } + @Override @SuppressWarnings({ "rawtypes" }) public SignedInfo newSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List references) { return newSignedInfo(cm, sm, references, null); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public SignedInfo newSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List references, String id) { @@ -112,33 +139,39 @@ public SignedInfo newSignedInfo(CanonicalizationMethod cm, } // Object factory methods + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public XMLObject newXMLObject(List content, String id, String mimeType, String encoding) { return new DOMXMLObject(content, id, mimeType, encoding); } + @Override @SuppressWarnings({ "rawtypes" }) public Manifest newManifest(List references) { return newManifest(references, null); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Manifest newManifest(List references, String id) { return new DOMManifest(references, id); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public SignatureProperties newSignatureProperties(List props, String id) { return new DOMSignatureProperties(props, id); } + @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public SignatureProperty newSignatureProperty (List info, String target, String id) { return new DOMSignatureProperty(info, target, id); } + @Override public XMLSignature unmarshalXMLSignature(XMLValidateContext context) throws MarshalException { @@ -148,6 +181,7 @@ public XMLSignature unmarshalXMLSignature(XMLValidateContext context) return unmarshal(((DOMValidateContext) context).getNode(), context); } + @Override public XMLSignature unmarshalXMLSignature(XMLStructure xmlStructure) throws MarshalException { @@ -201,6 +235,7 @@ private XMLSignature unmarshal(Node node, XMLCryptoContext context) } } + @Override public boolean isFeatureSupported(String feature) { if (feature == null) { throw new NullPointerException(); @@ -209,6 +244,7 @@ public boolean isFeatureSupported(String feature) { } } + @Override public DigestMethod newDigestMethod(String algorithm, DigestMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { @@ -242,6 +278,7 @@ public DigestMethod newDigestMethod(String algorithm, } } + @Override public SignatureMethod newSignatureMethod(String algorithm, SignatureMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { @@ -270,6 +307,14 @@ public SignatureMethod newSignatureMethod(String algorithm, return new DOMSignatureMethod.SHA384withRSAandMGF1(params); } else if (algorithm.equals(DOMSignatureMethod.RSA_SHA512_MGF1)) { return new DOMSignatureMethod.SHA512withRSAandMGF1(params); + } else if (algorithm.equals(DOMSignatureMethod.RSA_SHA3_224_MGF1)) { + return new DOMSignatureMethod.SHA3_224withRSAandMGF1(params); + } else if (algorithm.equals(DOMSignatureMethod.RSA_SHA3_256_MGF1)) { + return new DOMSignatureMethod.SHA3_256withRSAandMGF1(params); + } else if (algorithm.equals(DOMSignatureMethod.RSA_SHA3_384_MGF1)) { + return new DOMSignatureMethod.SHA3_384withRSAandMGF1(params); + } else if (algorithm.equals(DOMSignatureMethod.RSA_SHA3_512_MGF1)) { + return new DOMSignatureMethod.SHA3_512withRSAandMGF1(params); } else if (algorithm.equals(DOMRSAPSSSignatureMethod.RSA_PSS)) { return new DOMRSAPSSSignatureMethod.RSAPSS(params); } else if (algorithm.equals(DOMSignatureMethod.RSA_RIPEMD160_MGF1)) { @@ -311,6 +356,7 @@ public SignatureMethod newSignatureMethod(String algorithm, } } + @Override public Transform newTransform(String algorithm, TransformParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { @@ -330,6 +376,7 @@ public Transform newTransform(String algorithm, return new DOMTransform(spi); } + @Override public Transform newTransform(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { @@ -352,6 +399,7 @@ public Transform newTransform(String algorithm, return new DOMTransform(spi); } + @Override public CanonicalizationMethod newCanonicalizationMethod(String algorithm, C14NMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { @@ -370,6 +418,7 @@ public CanonicalizationMethod newCanonicalizationMethod(String algorithm, return new DOMCanonicalizationMethod(spi); } + @Override public CanonicalizationMethod newCanonicalizationMethod(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { @@ -392,6 +441,7 @@ public CanonicalizationMethod newCanonicalizationMethod(String algorithm, return new DOMCanonicalizationMethod(spi); } + @Override public URIDereferencer getURIDereferencer() { return DOMURIDereferencer.INSTANCE; } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathFilter2Transform.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathFilter2Transform.java index 1d538aa3edd..bb7fee9f1ce 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathFilter2Transform.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathFilter2Transform.java @@ -58,6 +58,7 @@ */ public final class DOMXPathFilter2Transform extends ApacheTransform { + @Override public void init(TransformParameterSpec params) throws InvalidAlgorithmParameterException { @@ -70,6 +71,7 @@ public void init(TransformParameterSpec params) this.params = params; } + @Override public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException { @@ -125,6 +127,7 @@ private void unmarshalParams(Element curXPathElem) throws MarshalException this.params = new XPathFilter2ParameterSpec(list); } + @Override public void marshalParams(XMLStructure parent, XMLCryptoContext context) throws MarshalException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathTransform.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathTransform.java index 9888e63d74a..b427f7be4be 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathTransform.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathTransform.java @@ -61,6 +61,7 @@ public void init(TransformParameterSpec params) this.params = params; } + @Override public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException { @@ -89,6 +90,7 @@ private void unmarshalParams(Element paramsElem) { } } + @Override public void marshalParams(XMLStructure parent, XMLCryptoContext context) throws MarshalException { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXSLTTransform.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXSLTTransform.java index 2551f949ae1..467157f4e6f 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXSLTTransform.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXSLTTransform.java @@ -26,13 +26,16 @@ package org.jcp.xml.dsig.internal.dom; import java.security.InvalidAlgorithmParameterException; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import javax.xml.crypto.*; +import javax.xml.crypto.MarshalException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.XMLStructure; import javax.xml.crypto.dsig.spec.TransformParameterSpec; import javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + /** * DOM-based implementation of XSLT Transform. * (Uses Apache XML-Sec Transform implementation) @@ -52,6 +55,7 @@ public void init(TransformParameterSpec params) this.params = params; } + @Override public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException { @@ -64,6 +68,7 @@ private void unmarshalParams(Element sheet) { (new javax.xml.crypto.dom.DOMStructure(sheet)); } + @Override public void marshalParams(XMLStructure parent, XMLCryptoContext context) throws MarshalException { super.marshalParams(parent, context); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java index 0e2a832e145..70fb50e3c31 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java @@ -30,8 +30,12 @@ import java.io.IOException; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.*; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + import javax.xml.crypto.XMLCryptoContext; + import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java index f169a44391c..2982291c8e2 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java @@ -32,10 +32,18 @@ */ package org.jcp.xml.dsig.internal.dom; -import java.util.*; -import java.security.*; - -import javax.xml.crypto.dsig.*; +import java.security.AccessController; +import java.security.InvalidParameterException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivilegedAction; +import java.security.Provider; +import java.security.ProviderException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.crypto.dsig.CanonicalizationMethod; +import javax.xml.crypto.dsig.Transform; /** * The XMLDSig RI Provider. @@ -134,7 +142,7 @@ public Object newInstance(Object ctrParamObj) @SuppressWarnings("removal") public XMLDSigRI() { // This is the JDK XMLDSig provider, synced from - // Apache Santuario XML Security for Java, version 3.0.2 + // Apache Santuario XML Security for Java, version 3.0.3 super("XMLDSig", VER, INFO); final Provider p = this; diff --git a/src/java.xml.crypto/share/legal/santuario.md b/src/java.xml.crypto/share/legal/santuario.md index bee55d85a83..768f0c7b144 100644 --- a/src/java.xml.crypto/share/legal/santuario.md +++ b/src/java.xml.crypto/share/legal/santuario.md @@ -1,4 +1,4 @@ -## Apache Santuario v3.0.2 +## Apache Santuario v3.0.3 ### Apache 2.0 License ``` diff --git a/test/jdk/javax/xml/crypto/dsig/GenerationTests.java b/test/jdk/javax/xml/crypto/dsig/GenerationTests.java index 53cb147fa1d..693cc3c1bbb 100644 --- a/test/jdk/javax/xml/crypto/dsig/GenerationTests.java +++ b/test/jdk/javax/xml/crypto/dsig/GenerationTests.java @@ -101,6 +101,7 @@ public class GenerationTests { ecdsaSha1, ecdsaSha224, ecdsaSha256, ecdsaSha384, ecdsaSha512, hmacSha1, hmacSha224, hmacSha256, hmacSha384, hmacSha512, rsaSha1mgf1, rsaSha224mgf1, rsaSha256mgf1, rsaSha384mgf1, rsaSha512mgf1, + rsaSha3_224mgf1, rsaSha3_256mgf1, rsaSha3_384mgf1, rsaSha3_512mgf1, rsaShaPSS, ed25519, ed448; private static DigestMethod sha1, sha224, sha256, sha384, sha512, sha3_224, sha3_256, sha3_384, sha3_512; @@ -209,6 +210,7 @@ public class GenerationTests { SignatureMethod.ECDSA_SHA256, SignatureMethod.HMAC_SHA256, SignatureMethod.SHA256_RSA_MGF1, + "http://www.w3.org/2007/05/xmldsig-more#sha3-256-rsa-MGF1", SignatureMethod.RSA_PSS, SignatureMethod.ED25519); @@ -242,7 +244,7 @@ public class GenerationTests { }) .toArray(String[]::new); - // As of JDK 17, the number of defined algorithms are... + // As of JDK 21, the number of defined algorithms are... static { if (allSignatureMethods.length != 25 || allDigestMethods.length != 9) { @@ -334,6 +336,10 @@ public static void main(String args[]) throws Exception { test_create_signature_enveloping_sha512_rsa_sha256_mgf1(); test_create_signature_enveloping_sha512_rsa_sha384_mgf1(); test_create_signature_enveloping_sha512_rsa_sha512_mgf1(); + test_create_signature_enveloping_sha512_rsa_sha3_224_mgf1(); + test_create_signature_enveloping_sha512_rsa_sha3_256_mgf1(); + test_create_signature_enveloping_sha512_rsa_sha3_384_mgf1(); + test_create_signature_enveloping_sha512_rsa_sha3_512_mgf1(); test_create_signature_enveloping_sha512_rsa_pss(); test_create_signature_reference_dependency(); test_create_signature_with_attr_in_no_namespace(); @@ -542,6 +548,10 @@ private static void setup() throws Exception { rsaSha256mgf1 = fac.newSignatureMethod(SignatureMethod.SHA256_RSA_MGF1, null); rsaSha384mgf1 = fac.newSignatureMethod(SignatureMethod.SHA384_RSA_MGF1, null); rsaSha512mgf1 = fac.newSignatureMethod(SignatureMethod.SHA512_RSA_MGF1, null); + rsaSha3_224mgf1 = fac.newSignatureMethod("http://www.w3.org/2007/05/xmldsig-more#sha3-224-rsa-MGF1", null); + rsaSha3_256mgf1 = fac.newSignatureMethod("http://www.w3.org/2007/05/xmldsig-more#sha3-256-rsa-MGF1", null); + rsaSha3_384mgf1 = fac.newSignatureMethod("http://www.w3.org/2007/05/xmldsig-more#sha3-384-rsa-MGF1", null); + rsaSha3_512mgf1 = fac.newSignatureMethod("http://www.w3.org/2007/05/xmldsig-more#sha3-512-rsa-MGF1", null); rsaShaPSS = fac.newSignatureMethod(SignatureMethod. RSA_PSS, null); ecdsaSha1 = fac.newSignatureMethod(SignatureMethod.ECDSA_SHA1, null); @@ -807,6 +817,38 @@ static void test_create_signature_enveloping_sha512_rsa_sha512_mgf1() System.out.println(); } + static void test_create_signature_enveloping_sha512_rsa_sha3_224_mgf1() + throws Exception { + System.out.println("* Generating signature-enveloping-sha512-rsa_sha3_224_mgf1.xml"); + test_create_signature_enveloping(sha512, rsaSha3_224mgf1, rsa1024, + getPrivateKey("RSA", 1024), kvks, false, true); + System.out.println(); + } + + static void test_create_signature_enveloping_sha512_rsa_sha3_256_mgf1() + throws Exception { + System.out.println("* Generating signature-enveloping-sha512-rsa_sha3_256_mgf1.xml"); + test_create_signature_enveloping(sha512, rsaSha3_256mgf1, rsa1024, + getPrivateKey("RSA", 1024), kvks, false, true); + System.out.println(); + } + + static void test_create_signature_enveloping_sha512_rsa_sha3_384_mgf1() + throws Exception { + System.out.println("* Generating signature-enveloping-sha512-rsa_sha3_384_mgf1.xml"); + test_create_signature_enveloping(sha512, rsaSha3_384mgf1, rsa1024, + getPrivateKey("RSA", 1024), kvks, false, true); + System.out.println(); + } + + static void test_create_signature_enveloping_sha512_rsa_sha3_512_mgf1() + throws Exception { + System.out.println("* Generating signature-enveloping-sha512-rsa_sha3_512_mgf1.xml"); + test_create_signature_enveloping(sha512, rsaSha3_512mgf1, rsa2048, + getPrivateKey("RSA", 2048), kvks, false, true); + System.out.println(); + } + static void test_create_signature_enveloping_sha512_rsa_pss() throws Exception { System.out.println("* Generating signature-enveloping-sha512_rsa_pss.xml"); @@ -1973,7 +2015,7 @@ private static Key[] getCachedKeys(String signatureMethod) { || sm.contains("-rsa-MGF1")) { kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize( - sm.contains("#sha512-rsa-MGF1") ? 2048 : 1024); + sm.contains("512-rsa-MGF1") ? 2048 : 1024); } else if (sm.contains("#dsa-")) { kpg = KeyPairGenerator.getInstance("DSA"); kpg.initialize(1024); From 4b829786ccb984ef2378b55bfc14a1c5d3fc6347 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 16 Jan 2024 09:04:12 +0000 Subject: [PATCH 140/261] 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files Backport-of: 8ae309ebacd6947bbad2ef168ca13702e1cba099 --- .../share/classes/sun/tools/jar/Main.java | 6 ++ test/jdk/tools/jar/InputFilesTest.java | 82 ++++++++++++++++++- 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java index fce80372b1e..6163ef82647 100644 --- a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java +++ b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java @@ -292,6 +292,9 @@ public synchronized boolean run(String args[]) { } } expand(); + if (!ok) { + return false; + } if (!moduleInfos.isEmpty()) { // All actual file entries (excl manifest and module-info.class) Set jentries = new HashSet<>(); @@ -338,6 +341,9 @@ public synchronized boolean run(String args[]) { tmpFile = createTemporaryFile("tmpjar", ".jar"); } expand(); + if (!ok) { + return false; + } try (FileInputStream in = (fname != null) ? new FileInputStream(inputFile) : new FileInputStream(FileDescriptor.in); FileOutputStream out = new FileOutputStream(tmpFile); diff --git a/test/jdk/tools/jar/InputFilesTest.java b/test/jdk/tools/jar/InputFilesTest.java index 3dc08293a76..6a0a7e29021 100644 --- a/test/jdk/tools/jar/InputFilesTest.java +++ b/test/jdk/tools/jar/InputFilesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8165944 + * @bug 8165944 8318971 * @summary test several jar tool input file scenarios with variations on -C * options with/without a --release option. Some input files are * duplicates that sometimes cause exceptions and other times do not, @@ -153,6 +153,84 @@ public void test6() throws IOException { jar("cf test.jar --release 9 -C test1 a -C test2 a"); } + /** + * Containing non-existent file in the file list + * The final jar should not be created and correct error message should be caught. + * IOException is triggered as expected. + */ + @Test + public void testNonExistentFileInput() throws IOException { + touch("existingTestFile.txt"); + onCompletion = () -> rm("existingTestFile.txt"); + try { + jar("cf test.jar existingTestFile.txt nonExistentTestFile.txt"); + Assert.fail("jar tool unexpectedly completed successfully"); + } catch (IOException e) { + Assert.assertEquals(e.getMessage().trim(), "nonExistentTestFile.txt : no such file or directory"); + Assert.assertTrue(Files.notExists(Path.of("test.jar")), "Jar file should not be created."); + } + } + + /** + * With @File as a part of jar command line, where the File is containing one or more + * non-existent files or directories + * The final jar should not be created and correct error message should be caught. + * IOException is triggered as expected. + */ + @Test + public void testNonExistentFileInputClassList() throws IOException { + touch("existingTestFile.txt"); + touch("classes.list"); + Files.writeString(Path.of("classes.list"), """ + existingTestFile.txt + nonExistentTestFile.txt + nonExistentDirectory + """); + onCompletion = () -> rm("existingTestFile.txt classes.list"); + try { + jar("cf test.jar @classes.list"); + Assert.fail("jar tool unexpectedly completed successfully"); + } catch (IOException e) { + String msg = e.getMessage().trim(); + Assert.assertTrue(msg.contains("nonExistentTestFile.txt : no such file or directory")); + Assert.assertTrue(msg.trim().contains("nonExistentDirectory : no such file or directory")); + Assert.assertTrue(Files.notExists(Path.of("test.jar")), "Jar file should not be created."); + } + + } + + /** + * Create a jar file; then with @File as a part of jar command line, where the File is containing one or more + * non-existent files or directories + * The final jar should not be created and correct error message should be caught. + * IOException is triggered as expected. + */ + @Test + public void testUpdateNonExistentFileInputClassList() throws IOException { + touch("existingTestFileUpdate.txt"); + touch("existingTestFileUpdate2.txt"); + touch("classesUpdate.list"); + Files.writeString(Path.of("classesUpdate.list"), """ + existingTestFileUpdate2.txt + nonExistentTestFileUpdate.txt + nonExistentDirectoryUpdate + """); + onCompletion = () -> rm("existingTestFileUpdate.txt existingTestFileUpdate2.txt " + + "classesUpdate.list testUpdate.jar"); + try { + jar("cf testUpdate.jar existingTestFileUpdate.txt"); + Assert.assertTrue(Files.exists(Path.of("testUpdate.jar"))); + jar("uf testUpdate.jar @classesUpdate.list"); + Assert.fail("jar tool unexpectedly completed successfully"); + } catch (IOException e) { + String msg = e.getMessage().trim(); + Assert.assertFalse(msg.contains("existingTestFileUpdate.txt : no such file or directory")); + Assert.assertTrue(msg.contains("nonExistentTestFileUpdate.txt : no such file or directory")); + Assert.assertTrue(msg.trim().contains("nonExistentDirectoryUpdate : no such file or directory")); + } + + } + private Stream mkpath(String... args) { return Arrays.stream(args).map(d -> Paths.get(".", d.split("/"))); } From 551855c0dd88a34b79dbed46d15dc8dfe2132ae9 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 16 Jan 2024 14:25:09 +0000 Subject: [PATCH 141/261] 8310631: test/jdk/sun/nio/cs/TestCharsetMapping.java is spuriously passing Backport-of: e3201d1d13433857a1b34ff0ca93f9ae1a4e22aa --- make/data/charsetmapping/MS950_HKSCS.map | 5019 +++++++++++++++++++ test/jdk/sun/nio/cs/TestCharsetMapping.java | 24 +- 2 files changed, 5037 insertions(+), 6 deletions(-) create mode 100644 make/data/charsetmapping/MS950_HKSCS.map diff --git a/make/data/charsetmapping/MS950_HKSCS.map b/make/data/charsetmapping/MS950_HKSCS.map new file mode 100644 index 00000000000..77e2f014dc0 --- /dev/null +++ b/make/data/charsetmapping/MS950_HKSCS.map @@ -0,0 +1,5019 @@ +# +# http://www.ogcio.gov.hk/ccli/eng/hskcs/mapping_table_2008.html +# +# commnent out following entries +# +# 88A3 <00EA,0304> +# 88A5 <00EA,030C> +# 8862 <00CA,0304> +# 8864 <00CA,030C> +# +8740 43F0 +8741 4C32 +8742 4603 +8743 45A6 +8744 4578 +8745 27267 +8746 4D77 +8747 45B3 +8748 27CB1 +8749 4CE2 +874A 27CC5 +874B 3B95 +874C 4736 +874D 4744 +874E 4C47 +874F 4C40 +8750 242BF +8751 23617 +8752 27352 +8753 26E8B +8754 270D2 +8755 4C57 +8756 2A351 +8757 474F +8758 45DA +8759 4C85 +875A 27C6C +875B 4D07 +875C 4AA4 +875D 46A1 +875E 26B23 +875F 7225 +8760 25A54 +8761 21A63 +8762 23E06 +8763 23F61 +8764 664D +8765 56FB +8767 7D95 +8768 591D +8769 28BB9 +876A 3DF4 +876B 9734 +876C 27BEF +876D 5BDB +876E 21D5E +876F 5AA4 +8770 3625 +8771 29EB0 +8772 5AD1 +8773 5BB7 +8774 5CFC +8775 676E +8776 8593 +8777 29945 +8778 7461 +8779 749D +877A 3875 +877B 21D53 +877C 2369E +877D 26021 +877E 3EEC +87A1 258DE +87A2 3AF5 +87A3 7AFC +87A4 9F97 +87A5 24161 +87A6 2890D +87A7 231EA +87A8 20A8A +87A9 2325E +87AA 430A +87AB 8484 +87AC 9F96 +87AD 942F +87AE 4930 +87AF 8613 +87B0 5896 +87B1 974A +87B2 9218 +87B3 79D0 +87B4 7A32 +87B5 6660 +87B6 6A29 +87B7 889D +87B8 744C +87B9 7BC5 +87BA 6782 +87BB 7A2C +87BC 524F +87BD 9046 +87BE 34E6 +87BF 73C4 +87C0 25DB9 +87C1 74C6 +87C2 9FC7 +87C3 57B3 +87C4 492F +87C5 544C +87C6 4131 +87C7 2368E +87C8 5818 +87C9 7A72 +87CA 27B65 +87CB 8B8F +87CC 46AE +87CD 26E88 +87CE 4181 +87CF 25D99 +87D0 7BAE +87D1 224BC +87D2 9FC8 +87D3 224C1 +87D4 224C9 +87D5 224CC +87D6 9FC9 +87D7 8504 +87D8 235BB +87D9 40B4 +87DA 9FCA +87DB 44E1 +87DC 2ADFF +87DD 62C1 +87DE 706E +87DF 9FCB +8840 31C0 +8841 31C1 +8842 31C2 +8843 31C3 +8844 31C4 +8845 2010C +8846 31C5 +8847 200D1 +8848 200CD +8849 31C6 +884A 31C7 +884B 200CB +884C 21FE8 +884D 31C8 +884E 200CA +884F 31C9 +8850 31CA +8851 31CB +8852 31CC +8853 2010E +8854 31CD +8855 31CE +8856 0100 +8857 00C1 +8858 01CD +8859 00C0 +885A 0112 +885B 00C9 +885C 011A +885D 00C8 +885E 014C +885F 00D3 +8860 01D1 +8861 00D2 +#8862 <00CA,0304> +8863 1EBE +#8864 <00CA,030C> +8865 1EC0 +8866 00CA +8867 0101 +8868 00E1 +8869 01CE +886A 00E0 +886B 0251 +886C 0113 +886D 00E9 +886E 011B +886F 00E8 +8870 012B +8871 00ED +8872 01D0 +8873 00EC +8874 014D +8875 00F3 +8876 01D2 +8877 00F2 +8878 016B +8879 00FA +887A 01D4 +887B 00F9 +887C 01D6 +887D 01D8 +887E 01DA +88A1 01DC +88A2 00FC +#88A3 <00EA,0304> +88A4 1EBF +#88A5 <00EA,030C> +88A6 1EC1 +88A7 00EA +88A8 0261 +88A9 23DA +88AA 23DB +8940 2A3A9 +8941 21145 +8943 650A +8946 4E3D +8947 6EDD +8948 9D4E +8949 91DF +894C 27735 +894D 6491 +894E 4F1A +894F 4F28 +8950 4FA8 +8951 5156 +8952 5174 +8953 519C +8954 51E4 +8955 52A1 +8956 52A8 +8957 533B +8958 534E +8959 53D1 +895A 53D8 +895B 56E2 +895C 58F0 +895D 5904 +895E 5907 +895F 5932 +8960 5934 +8961 5B66 +8962 5B9E +8963 5B9F +8964 5C9A +8965 5E86 +8966 603B +8967 6589 +8968 67FE +8969 6804 +896A 6865 +896B 6D4E +896C 70BC +896D 7535 +896E 7EA4 +896F 7EAC +8970 7EBA +8971 7EC7 +8972 7ECF +8973 7EDF +8974 7F06 +8975 7F37 +8976 827A +8977 82CF +8978 836F +8979 89C6 +897A 8BBE +897B 8BE2 +897C 8F66 +897D 8F67 +897E 8F6E +89A1 7411 +89A2 7CFC +89A3 7DCD +89A4 6946 +89A5 7AC9 +89A6 5227 +89AB 918C +89AC 78B8 +89AD 915E +89AE 80BC +89B0 8D0B +89B1 80F6 +89B2 209E7 +89B5 809F +89B6 9EC7 +89B7 4CCD +89B8 9DC9 +89B9 9E0C +89BA 4C3E +89BB 29DF6 +89BC 2700E +89BD 9E0A +89BE 2A133 +89BF 35C1 +89C1 6E9A +89C2 823E +89C3 7519 +89C5 4911 +89C6 9A6C +89C7 9A8F +89C8 9F99 +89C9 7987 +89CA 2846C +89CB 21DCA +89CC 205D0 +89CD 22AE6 +89CE 4E24 +89CF 4E81 +89D0 4E80 +89D1 4E87 +89D2 4EBF +89D3 4EEB +89D4 4F37 +89D5 344C +89D6 4FBD +89D7 3E48 +89D8 5003 +89D9 5088 +89DA 347D +89DB 3493 +89DC 34A5 +89DD 5186 +89DE 5905 +89DF 51DB +89E0 51FC +89E1 5205 +89E2 4E89 +89E3 5279 +89E4 5290 +89E5 5327 +89E6 35C7 +89E7 53A9 +89E8 3551 +89E9 53B0 +89EA 3553 +89EB 53C2 +89EC 5423 +89ED 356D +89EE 3572 +89EF 3681 +89F0 5493 +89F1 54A3 +89F2 54B4 +89F3 54B9 +89F4 54D0 +89F5 54EF +89F6 5518 +89F7 5523 +89F8 5528 +89F9 3598 +89FA 553F +89FB 35A5 +89FC 35BF +89FD 55D7 +89FE 35C5 +8A40 27D84 +8A41 5525 +8A43 20C42 +8A44 20D15 +8A45 2512B +8A46 5590 +8A47 22CC6 +8A48 39EC +8A49 20341 +8A4A 8E46 +8A4B 24DB8 +8A4C 294E5 +8A4D 4053 +8A4E 280BE +8A4F 777A +8A50 22C38 +8A51 3A34 +8A52 47D5 +8A53 2815D +8A54 269F2 +8A55 24DEA +8A56 64DD +8A57 20D7C +8A58 20FB4 +8A59 20CD5 +8A5A 210F4 +8A5B 648D +8A5C 8E7E +8A5D 20E96 +8A5E 20C0B +8A5F 20F64 +8A60 22CA9 +8A61 28256 +8A62 244D3 +8A64 20D46 +8A65 29A4D +8A66 280E9 +8A67 47F4 +8A68 24EA7 +8A69 22CC2 +8A6A 9AB2 +8A6B 3A67 +8A6C 295F4 +8A6D 3FED +8A6E 3506 +8A6F 252C7 +8A70 297D4 +8A71 278C8 +8A72 22D44 +8A73 9D6E +8A74 9815 +8A76 43D9 +8A77 260A5 +8A78 64B4 +8A79 54E3 +8A7A 22D4C +8A7B 22BCA +8A7C 21077 +8A7D 39FB +8A7E 2106F +8AA1 266DA +8AA2 26716 +8AA3 279A0 +8AA4 64EA +8AA5 25052 +8AA6 20C43 +8AA7 8E68 +8AA8 221A1 +8AA9 28B4C +8AAA 20731 +8AAC 480B +8AAD 201A9 +8AAE 3FFA +8AAF 5873 +8AB0 22D8D +8AB2 245C8 +8AB3 204FC +8AB4 26097 +8AB5 20F4C +8AB6 20D96 +8AB7 5579 +8AB8 40BB +8AB9 43BA +8ABB 4AB4 +8ABC 22A66 +8ABD 2109D +8ABE 81AA +8ABF 98F5 +8AC0 20D9C +8AC1 6379 +8AC2 39FE +8AC3 22775 +8AC4 8DC0 +8AC5 56A1 +8AC6 647C +8AC7 3E43 +8AC9 2A601 +8ACA 20E09 +8ACB 22ACF +8ACC 22CC9 +8ACE 210C8 +8ACF 239C2 +8AD0 3992 +8AD1 3A06 +8AD2 2829B +8AD3 3578 +8AD4 25E49 +8AD5 220C7 +8AD6 5652 +8AD7 20F31 +8AD8 22CB2 +8AD9 29720 +8ADA 34BC +8ADB 6C3D +8ADC 24E3B +8ADF 27574 +8AE0 22E8B +8AE1 22208 +8AE2 2A65B +8AE3 28CCD +8AE4 20E7A +8AE5 20C34 +8AE6 2681C +8AE7 7F93 +8AE8 210CF +8AE9 22803 +8AEA 22939 +8AEB 35FB +8AEC 251E3 +8AED 20E8C +8AEE 20F8D +8AEF 20EAA +8AF0 3F93 +8AF1 20F30 +8AF2 20D47 +8AF3 2114F +8AF4 20E4C +8AF6 20EAB +8AF7 20BA9 +8AF8 20D48 +8AF9 210C0 +8AFA 2113D +8AFB 3FF9 +8AFC 22696 +8AFD 6432 +8AFE 20FAD +8B40 233F4 +8B41 27639 +8B42 22BCE +8B43 20D7E +8B44 20D7F +8B45 22C51 +8B46 22C55 +8B47 3A18 +8B48 20E98 +8B49 210C7 +8B4A 20F2E +8B4B 2A632 +8B4C 26B50 +8B4D 28CD2 +8B4E 28D99 +8B4F 28CCA +8B50 95AA +8B51 54CC +8B52 82C4 +8B53 55B9 +8B55 29EC3 +8B56 9C26 +8B57 9AB6 +8B58 2775E +8B59 22DEE +8B5A 7140 +8B5B 816D +8B5C 80EC +8B5D 5C1C +8B5E 26572 +8B5F 8134 +8B60 3797 +8B61 535F +8B62 280BD +8B63 91B6 +8B64 20EFA +8B65 20E0F +8B66 20E77 +8B67 20EFB +8B68 35DD +8B69 24DEB +8B6A 3609 +8B6B 20CD6 +8B6C 56AF +8B6D 227B5 +8B6E 210C9 +8B6F 20E10 +8B70 20E78 +8B71 21078 +8B72 21148 +8B73 28207 +8B74 21455 +8B75 20E79 +8B76 24E50 +8B77 22DA4 +8B78 5A54 +8B79 2101D +8B7A 2101E +8B7B 210F5 +8B7C 210F6 +8B7D 579C +8B7E 20E11 +8BA1 27694 +8BA2 282CD +8BA3 20FB5 +8BA4 20E7B +8BA5 2517E +8BA6 3703 +8BA7 20FB6 +8BA8 21180 +8BA9 252D8 +8BAA 2A2BD +8BAB 249DA +8BAC 2183A +8BAD 24177 +8BAE 2827C +8BAF 5899 +8BB0 5268 +8BB1 361A +8BB2 2573D +8BB3 7BB2 +8BB4 5B68 +8BB5 4800 +8BB6 4B2C +8BB7 9F27 +8BB8 49E7 +8BB9 9C1F +8BBA 9B8D +8BBB 25B74 +8BBC 2313D +8BBD 55FB +8BBE 35F2 +8BBF 5689 +8BC0 4E28 +8BC1 5902 +8BC2 21BC1 +8BC3 2F878 +8BC4 9751 +8BC5 20086 +8BC6 4E5B +8BC7 4EBB +8BC8 353E +8BC9 5C23 +8BCA 5F51 +8BCB 5FC4 +8BCC 38FA +8BCD 624C +8BCE 6535 +8BCF 6B7A +8BD0 6C35 +8BD1 6C3A +8BD2 706C +8BD3 722B +8BD4 4E2C +8BD5 72AD +8BD6 248E9 +8BD7 7F52 +8BD8 793B +8BD9 7CF9 +8BDA 7F53 +8BDB 2626A +8BDC 34C1 +8BDE 2634B +8BDF 8002 +8BE0 8080 +8BE1 26612 +8BE2 26951 +8BE3 535D +8BE4 8864 +8BE5 89C1 +8BE6 278B2 +8BE7 8BA0 +8BE8 8D1D +8BE9 9485 +8BEA 9578 +8BEB 957F +8BEC 95E8 +8BED 28E0F +8BEE 97E6 +8BEF 9875 +8BF0 98CE +8BF1 98DE +8BF2 9963 +8BF3 29810 +8BF4 9C7C +8BF5 9E1F +8BF6 9EC4 +8BF7 6B6F +8BF8 F907 +8BF9 4E37 +8BFA 20087 +8BFB 961D +8BFC 6237 +8BFD 94A2 +8C40 503B +8C41 6DFE +8C42 29C73 +8C43 9FA6 +8C44 3DC9 +8C45 888F +8C46 2414E +8C47 7077 +8C48 5CF5 +8C49 4B20 +8C4A 251CD +8C4B 3559 +8C4C 25D30 +8C4D 6122 +8C4E 28A32 +8C4F 8FA7 +8C50 91F6 +8C51 7191 +8C52 6719 +8C53 73BA +8C54 23281 +8C55 2A107 +8C56 3C8B +8C57 21980 +8C58 4B10 +8C59 78E4 +8C5A 7402 +8C5B 51AE +8C5C 2870F +8C5D 4009 +8C5E 6A63 +8C5F 2A2BA +8C60 4223 +8C61 860F +8C62 20A6F +8C63 7A2A +8C64 29947 +8C65 28AEA +8C66 9755 +8C67 704D +8C68 5324 +8C69 2207E +8C6A 93F4 +8C6B 76D9 +8C6C 289E3 +8C6D 9FA7 +8C6E 77DD +8C6F 4EA3 +8C70 4FF0 +8C71 50BC +8C72 4E2F +8C73 4F17 +8C74 9FA8 +8C75 5434 +8C76 7D8B +8C77 5892 +8C78 58D0 +8C79 21DB6 +8C7A 5E92 +8C7B 5E99 +8C7C 5FC2 +8C7D 22712 +8C7E 658B +8CA1 233F9 +8CA2 6919 +8CA3 6A43 +8CA4 23C63 +8CA5 6CFF +8CA7 7200 +8CA8 24505 +8CA9 738C +8CAA 3EDB +8CAB 24A13 +8CAC 5B15 +8CAD 74B9 +8CAE 8B83 +8CAF 25CA4 +8CB0 25695 +8CB1 7A93 +8CB2 7BEC +8CB3 7CC3 +8CB4 7E6C +8CB5 82F8 +8CB6 8597 +8CB7 9FA9 +8CB8 8890 +8CB9 9FAA +8CBA 8EB9 +8CBB 9FAB +8CBC 8FCF +8CBD 855F +8CBE 99E0 +8CBF 9221 +8CC0 9FAC +8CC1 28DB9 +8CC2 2143F +8CC3 4071 +8CC4 42A2 +8CC5 5A1A +8CC9 9868 +8CCA 676B +8CCB 4276 +8CCC 573D +8CCE 85D6 +8CCF 2497B +8CD0 82BF +8CD1 2710D +8CD2 4C81 +8CD3 26D74 +8CD4 5D7B +8CD5 26B15 +8CD6 26FBE +8CD7 9FAD +8CD8 9FAE +8CD9 5B96 +8CDA 9FAF +8CDB 66E7 +8CDC 7E5B +8CDD 6E57 +8CDE 79CA +8CDF 3D88 +8CE0 44C3 +8CE1 23256 +8CE2 22796 +8CE3 439A +8CE4 4536 +8CE6 5CD5 +8CE7 23B1A +8CE8 8AF9 +8CE9 5C78 +8CEA 3D12 +8CEB 23551 +8CEC 5D78 +8CED 9FB2 +8CEE 7157 +8CEF 4558 +8CF0 240EC +8CF1 21E23 +8CF2 4C77 +8CF3 3978 +8CF4 344A +8CF5 201A4 +8CF6 26C41 +8CF7 8ACC +8CF8 4FB4 +8CF9 20239 +8CFA 59BF +8CFB 816C +8CFC 9856 +8CFD 298FA +8CFE 5F3B +8D40 20B9F +8D42 221C1 +8D43 2896D +8D44 4102 +8D45 46BB +8D46 29079 +8D47 3F07 +8D48 9FB3 +8D49 2A1B5 +8D4A 40F8 +8D4B 37D6 +8D4C 46F7 +8D4D 26C46 +8D4E 417C +8D4F 286B2 +8D50 273FF +8D51 456D +8D52 38D4 +8D53 2549A +8D54 4561 +8D55 451B +8D56 4D89 +8D57 4C7B +8D58 4D76 +8D59 45EA +8D5A 3FC8 +8D5B 24B0F +8D5C 3661 +8D5D 44DE +8D5E 44BD +8D5F 41ED +8D60 5D3E +8D61 5D48 +8D62 5D56 +8D63 3DFC +8D64 380F +8D65 5DA4 +8D66 5DB9 +8D67 3820 +8D68 3838 +8D69 5E42 +8D6A 5EBD +8D6B 5F25 +8D6C 5F83 +8D6D 3908 +8D6E 3914 +8D6F 393F +8D70 394D +8D71 60D7 +8D72 613D +8D73 5CE5 +8D74 3989 +8D75 61B7 +8D76 61B9 +8D77 61CF +8D78 39B8 +8D79 622C +8D7A 6290 +8D7B 62E5 +8D7C 6318 +8D7D 39F8 +8D7E 56B1 +8DA1 3A03 +8DA2 63E2 +8DA3 63FB +8DA4 6407 +8DA5 645A +8DA6 3A4B +8DA7 64C0 +8DA8 5D15 +8DA9 5621 +8DAA 9F9F +8DAB 3A97 +8DAC 6586 +8DAD 3ABD +8DAE 65FF +8DAF 6653 +8DB0 3AF2 +8DB1 6692 +8DB2 3B22 +8DB3 6716 +8DB4 3B42 +8DB5 67A4 +8DB6 6800 +8DB7 3B58 +8DB8 684A +8DB9 6884 +8DBA 3B72 +8DBB 3B71 +8DBC 3B7B +8DBD 6909 +8DBE 6943 +8DBF 725C +8DC0 6964 +8DC1 699F +8DC2 6985 +8DC3 3BBC +8DC4 69D6 +8DC5 3BDD +8DC6 6A65 +8DC7 6A74 +8DC8 6A71 +8DC9 6A82 +8DCA 3BEC +8DCB 6A99 +8DCC 3BF2 +8DCD 6AAB +8DCE 6AB5 +8DCF 6AD4 +8DD0 6AF6 +8DD1 6B81 +8DD2 6BC1 +8DD3 6BEA +8DD4 6C75 +8DD5 6CAA +8DD6 3CCB +8DD7 6D02 +8DD8 6D06 +8DD9 6D26 +8DDA 6D81 +8DDB 3CEF +8DDC 6DA4 +8DDD 6DB1 +8DDE 6E15 +8DDF 6E18 +8DE0 6E29 +8DE1 6E86 +8DE2 289C0 +8DE3 6EBB +8DE4 6EE2 +8DE5 6EDA +8DE6 9F7F +8DE7 6EE8 +8DE8 6EE9 +8DE9 6F24 +8DEA 6F34 +8DEB 3D46 +8DEC 23F41 +8DED 6F81 +8DEE 6FBE +8DEF 3D6A +8DF0 3D75 +8DF1 71B7 +8DF2 5C99 +8DF3 3D8A +8DF4 702C +8DF5 3D91 +8DF6 7050 +8DF7 7054 +8DF8 706F +8DF9 707F +8DFA 7089 +8DFB 20325 +8DFC 43C1 +8DFD 35F1 +8DFE 20ED8 +8E40 23ED7 +8E41 57BE +8E42 26ED3 +8E43 713E +8E44 257E0 +8E45 364E +8E46 69A2 +8E47 28BE9 +8E48 5B74 +8E49 7A49 +8E4A 258E1 +8E4B 294D9 +8E4C 7A65 +8E4D 7A7D +8E4E 259AC +8E4F 7ABB +8E50 7AB0 +8E51 7AC2 +8E52 7AC3 +8E53 71D1 +8E54 2648D +8E55 41CA +8E56 7ADA +8E57 7ADD +8E58 7AEA +8E59 41EF +8E5A 54B2 +8E5B 25C01 +8E5C 7B0B +8E5D 7B55 +8E5E 7B29 +8E5F 2530E +8E60 25CFE +8E61 7BA2 +8E62 7B6F +8E63 839C +8E64 25BB4 +8E65 26C7F +8E66 7BD0 +8E67 8421 +8E68 7B92 +8E6A 25D20 +8E6B 3DAD +8E6C 25C65 +8E6D 8492 +8E6E 7BFA +8E70 7C35 +8E71 25CC1 +8E72 7C44 +8E73 7C83 +8E74 24882 +8E75 7CA6 +8E76 667D +8E77 24578 +8E78 7CC9 +8E79 7CC7 +8E7A 7CE6 +8E7B 7C74 +8E7C 7CF3 +8E7D 7CF5 +8EA1 7E67 +8EA2 451D +8EA3 26E44 +8EA4 7D5D +8EA5 26ED6 +8EA6 748D +8EA7 7D89 +8EA8 7DAB +8EA9 7135 +8EAA 7DB3 +8EAC 24057 +8EAD 26029 +8EAE 7DE4 +8EAF 3D13 +8EB0 7DF5 +8EB1 217F9 +8EB2 7DE5 +8EB3 2836D +8EB5 26121 +8EB6 2615A +8EB7 7E6E +8EB8 7E92 +8EB9 432B +8EBA 946C +8EBB 7E27 +8EBC 7F40 +8EBD 7F41 +8EBE 7F47 +8EBF 7936 +8EC0 262D0 +8EC1 99E1 +8EC2 7F97 +8EC3 26351 +8EC4 7FA3 +8EC5 21661 +8EC6 20068 +8EC7 455C +8EC8 23766 +8EC9 4503 +8ECA 2833A +8ECB 7FFA +8ECC 26489 +8ECE 8008 +8ECF 801D +8ED1 802F +8ED2 2A087 +8ED3 26CC3 +8ED4 803B +8ED5 803C +8ED6 8061 +8ED7 22714 +8ED8 4989 +8ED9 26626 +8EDA 23DE3 +8EDB 266E8 +8EDC 6725 +8EDD 80A7 +8EDE 28A48 +8EDF 8107 +8EE0 811A +8EE1 58B0 +8EE2 226F6 +8EE3 6C7F +8EE4 26498 +8EE5 24FB8 +8EE6 64E7 +8EE7 2148A +8EE8 8218 +8EE9 2185E +8EEA 6A53 +8EEB 24A65 +8EEC 24A95 +8EED 447A +8EEE 8229 +8EEF 20B0D +8EF0 26A52 +8EF1 23D7E +8EF2 4FF9 +8EF3 214FD +8EF4 84E2 +8EF5 8362 +8EF6 26B0A +8EF7 249A7 +8EF8 23530 +8EF9 21773 +8EFA 23DF8 +8EFB 82AA +8EFC 691B +8EFD 2F994 +8EFE 41DB +8F40 854B +8F41 82D0 +8F42 831A +8F43 20E16 +8F44 217B4 +8F45 36C1 +8F46 2317D +8F47 2355A +8F48 827B +8F49 82E2 +8F4A 8318 +8F4B 23E8B +8F4C 26DA3 +8F4D 26B05 +8F4E 26B97 +8F4F 235CE +8F50 3DBF +8F51 831D +8F52 55EC +8F53 8385 +8F54 450B +8F55 26DA5 +8F56 83AC +8F58 83D3 +8F59 347E +8F5A 26ED4 +8F5B 6A57 +8F5C 855A +8F5D 3496 +8F5E 26E42 +8F5F 22EEF +8F60 8458 +8F61 25BE4 +8F62 8471 +8F63 3DD3 +8F64 44E4 +8F65 6AA7 +8F66 844A +8F67 23CB5 +8F68 7958 +8F6A 26B96 +8F6B 26E77 +8F6C 26E43 +8F6D 84DE +8F6F 8391 +8F70 44A0 +8F71 8493 +8F72 84E4 +8F73 25C91 +8F74 4240 +8F75 25CC0 +8F76 4543 +8F77 8534 +8F78 5AF2 +8F79 26E99 +8F7A 4527 +8F7B 8573 +8F7C 4516 +8F7D 67BF +8F7E 8616 +8FA1 28625 +8FA2 2863B +8FA3 85C1 +8FA4 27088 +8FA5 8602 +8FA6 21582 +8FA7 270CD +8FA8 2F9B2 +8FA9 456A +8FAA 8628 +8FAB 3648 +8FAC 218A2 +8FAD 53F7 +8FAE 2739A +8FAF 867E +8FB0 8771 +8FB1 2A0F8 +8FB2 87EE +8FB3 22C27 +8FB4 87B1 +8FB5 87DA +8FB6 880F +8FB7 5661 +8FB8 866C +8FB9 6856 +8FBA 460F +8FBB 8845 +8FBC 8846 +8FBD 275E0 +8FBE 23DB9 +8FBF 275E4 +8FC0 885E +8FC1 889C +8FC2 465B +8FC3 88B4 +8FC4 88B5 +8FC5 63C1 +8FC6 88C5 +8FC7 7777 +8FC8 2770F +8FC9 8987 +8FCA 898A +8FCD 89A7 +8FCE 89BC +8FCF 28A25 +8FD0 89E7 +8FD1 27924 +8FD2 27ABD +8FD3 8A9C +8FD4 7793 +8FD5 91FE +8FD6 8A90 +8FD7 27A59 +8FD8 7AE9 +8FD9 27B3A +8FDA 23F8F +8FDB 4713 +8FDC 27B38 +8FDD 717C +8FDE 8B0C +8FDF 8B1F +8FE0 25430 +8FE1 25565 +8FE2 8B3F +8FE3 8B4C +8FE4 8B4D +8FE5 8AA9 +8FE6 24A7A +8FE7 8B90 +8FE8 8B9B +8FE9 8AAF +8FEA 216DF +8FEB 4615 +8FEC 884F +8FED 8C9B +8FEE 27D54 +8FEF 27D8F +8FF0 2F9D4 +8FF1 3725 +8FF2 27D53 +8FF3 8CD6 +8FF4 27D98 +8FF5 27DBD +8FF6 8D12 +8FF7 8D03 +8FF8 21910 +8FF9 8CDB +8FFA 705C +8FFB 8D11 +8FFC 24CC9 +8FFD 3ED0 +9040 8DA9 +9041 28002 +9042 21014 +9043 2498A +9044 3B7C +9045 281BC +9046 2710C +9047 7AE7 +9048 8EAD +9049 8EB6 +904A 8EC3 +904B 92D4 +904C 8F19 +904D 8F2D +904E 28365 +904F 28412 +9050 8FA5 +9051 9303 +9052 2A29F +9053 20A50 +9054 8FB3 +9055 492A +9056 289DE +9057 2853D +9058 23DBB +9059 5EF8 +905A 23262 +905B 8FF9 +905C 2A014 +905D 286BC +905E 28501 +905F 22325 +9060 3980 +9061 26ED7 +9062 9037 +9063 2853C +9064 27ABE +9065 9061 +9066 2856C +9067 2860B +9068 90A8 +9069 28713 +906A 90C4 +906B 286E6 +906C 90AE +906E 9167 +906F 3AF0 +9070 91A9 +9071 91C4 +9072 7CAC +9073 28933 +9074 21E89 +9075 920E +9076 6C9F +9077 9241 +9078 9262 +9079 255B9 +907B 28AC6 +907C 23C9B +907D 28B0C +907E 255DB +90A1 20D31 +90A2 932C +90A3 936B +90A4 28AE1 +90A5 28BEB +90A6 708F +90A7 5AC3 +90A8 28AE2 +90A9 28AE5 +90AA 4965 +90AB 9244 +90AC 28BEC +90AD 28C39 +90AE 28BFF +90AF 9373 +90B0 945B +90B1 8EBC +90B2 9585 +90B3 95A6 +90B4 9426 +90B5 95A0 +90B6 6FF6 +90B7 42B9 +90B8 2267A +90B9 286D8 +90BA 2127C +90BB 23E2E +90BC 49DF +90BD 6C1C +90BE 967B +90BF 9696 +90C0 416C +90C1 96A3 +90C2 26ED5 +90C3 61DA +90C4 96B6 +90C5 78F5 +90C6 28AE0 +90C7 96BD +90C8 53CC +90C9 49A1 +90CA 26CB8 +90CB 20274 +90CC 26410 +90CD 290AF +90CE 290E5 +90CF 24AD1 +90D0 21915 +90D1 2330A +90D2 9731 +90D3 8642 +90D4 9736 +90D5 4A0F +90D6 453D +90D7 4585 +90D8 24AE9 +90D9 7075 +90DA 5B41 +90DB 971B +90DD 291D5 +90DE 9757 +90DF 5B4A +90E0 291EB +90E1 975F +90E2 9425 +90E3 50D0 +90E4 230B7 +90E5 230BC +90E6 9789 +90E7 979F +90E8 97B1 +90E9 97BE +90EA 97C0 +90EB 97D2 +90EC 97E0 +90ED 2546C +90EE 97EE +90EF 741C +90F0 29433 +90F2 97F5 +90F3 2941D +90F4 2797A +90F5 4AD1 +90F6 9834 +90F7 9833 +90F8 984B +90F9 9866 +90FA 3B0E +90FB 27175 +90FC 3D51 +90FD 20630 +90FE 2415C +9140 25706 +9141 98CA +9142 98B7 +9143 98C8 +9144 98C7 +9145 4AFF +9146 26D27 +9147 216D3 +9148 55B0 +9149 98E1 +914A 98E6 +914B 98EC +914C 9378 +914D 9939 +914E 24A29 +914F 4B72 +9150 29857 +9151 29905 +9152 99F5 +9153 9A0C +9154 9A3B +9155 9A10 +9156 9A58 +9157 25725 +9158 36C4 +9159 290B1 +915A 29BD5 +915B 9AE0 +915C 9AE2 +915D 29B05 +915E 9AF4 +915F 4C0E +9160 9B14 +9161 9B2D +9162 28600 +9163 5034 +9164 9B34 +9165 269A8 +9166 38C3 +9167 2307D +9168 9B50 +9169 9B40 +916A 29D3E +916B 5A45 +916C 21863 +916D 9B8E +916E 2424B +916F 9C02 +9170 9BFF +9171 9C0C +9172 29E68 +9173 9DD4 +9174 29FB7 +9175 2A192 +9176 2A1AB +9177 2A0E1 +9178 2A123 +9179 2A1DF +917A 9D7E +917B 9D83 +917C 2A134 +917D 9E0E +917E 6888 +91A1 9DC4 +91A2 2215B +91A3 2A193 +91A4 2A220 +91A5 2193B +91A6 2A233 +91A7 9D39 +91A8 2A0B9 +91A9 2A2B4 +91AA 9E90 +91AB 9E95 +91AC 9E9E +91AD 9EA2 +91AE 4D34 +91AF 9EAA +91B0 9EAF +91B1 24364 +91B2 9EC1 +91B3 3B60 +91B4 39E5 +91B5 3D1D +91B6 4F32 +91B7 37BE +91B8 28C2B +91B9 9F02 +91BA 9F08 +91BB 4B96 +91BC 9424 +91BD 26DA2 +91BE 9F17 +91C0 9F39 +91C1 569F +91C2 568A +91C3 9F45 +91C4 99B8 +91C5 2908B +91C6 97F2 +91C7 847F +91C8 9F62 +91C9 9F69 +91CA 7ADC +91CB 9F8E +91CC 7216 +91CD 4BBE +91CE 24975 +91CF 249BB +91D0 7177 +91D1 249F8 +91D2 24348 +91D3 24A51 +91D4 739E +91D5 28BDA +91D6 218FA +91D7 799F +91D8 2897E +91D9 28E36 +91DA 9369 +91DB 93F3 +91DC 28A44 +91DD 92EC +91DE 9381 +91DF 93CB +91E0 2896C +91E1 244B9 +91E2 7217 +91E3 3EEB +91E4 7772 +91E5 7A43 +91E6 70D0 +91E7 24473 +91E8 243F8 +91E9 717E +91EA 217EF +91EB 70A3 +91EC 218BE +91ED 23599 +91EE 3EC7 +91EF 21885 +91F0 2542F +91F1 217F8 +91F2 3722 +91F3 216FB +91F4 21839 +91F5 36E1 +91F6 21774 +91F7 218D1 +91F8 25F4B +91F9 3723 +91FA 216C0 +91FB 575B +91FC 24A25 +91FD 213FE +91FE 212A8 +9240 213C6 +9241 214B6 +9242 8503 +9243 236A6 +9245 8455 +9246 24994 +9247 27165 +9248 23E31 +9249 2555C +924A 23EFB +924B 27052 +924C 44F4 +924D 236EE +924E 2999D +924F 26F26 +9250 67F9 +9251 3733 +9252 3C15 +9253 3DE7 +9254 586C +9255 21922 +9256 6810 +9257 4057 +9258 2373F +9259 240E1 +925A 2408B +925B 2410F +925C 26C21 +925D 54CB +925E 569E +925F 266B1 +9260 5692 +9261 20FDF +9262 20BA8 +9263 20E0D +9264 93C6 +9265 28B13 +9266 939C +9267 4EF8 +9268 512B +9269 3819 +926A 24436 +926B 4EBC +926C 20465 +926D 2037F +926E 4F4B +926F 4F8A +9270 25651 +9271 5A68 +9272 201AB +9273 203CB +9274 3999 +9275 2030A +9276 20414 +9277 3435 +9278 4F29 +9279 202C0 +927A 28EB3 +927B 20275 +927C 8ADA +927D 2020C +927E 4E98 +92A1 50CD +92A2 510D +92A3 4FA2 +92A4 4F03 +92A5 24A0E +92A6 23E8A +92A7 4F42 +92A8 502E +92A9 506C +92AA 5081 +92AB 4FCC +92AC 4FE5 +92AD 5058 +92AE 50FC +92B3 6E76 +92B4 23595 +92B5 23E39 +92B6 23EBF +92B7 6D72 +92B8 21884 +92B9 23E89 +92BA 51A8 +92BB 51C3 +92BC 205E0 +92BD 44DD +92BE 204A3 +92BF 20492 +92C0 20491 +92C1 8D7A +92C2 28A9C +92C3 2070E +92C4 5259 +92C5 52A4 +92C6 20873 +92C7 52E1 +92C9 467A +92CA 718C +92CB 2438C +92CC 20C20 +92CD 249AC +92CE 210E4 +92CF 69D1 +92D0 20E1D +92D2 3EDE +92D3 7499 +92D4 7414 +92D5 7456 +92D6 7398 +92D7 4B8E +92D8 24ABC +92D9 2408D +92DA 53D0 +92DB 3584 +92DC 720F +92DD 240C9 +92DE 55B4 +92DF 20345 +92E0 54CD +92E1 20BC6 +92E2 571D +92E3 925D +92E4 96F4 +92E5 9366 +92E6 57DD +92E7 578D +92E8 577F +92E9 363E +92EA 58CB +92EB 5A99 +92EC 28A46 +92ED 216FA +92EE 2176F +92EF 21710 +92F0 5A2C +92F1 59B8 +92F2 928F +92F3 5A7E +92F4 5ACF +92F5 5A12 +92F6 25946 +92F7 219F3 +92F8 21861 +92F9 24295 +92FA 36F5 +92FB 6D05 +92FC 7443 +92FD 5A21 +92FE 25E83 +9340 5A81 +9341 28BD7 +9342 20413 +9343 93E0 +9344 748C +9345 21303 +9346 7105 +9347 4972 +9348 9408 +9349 289FB +934A 93BD +934B 37A0 +934C 5C1E +934D 5C9E +934E 5E5E +934F 5E48 +9350 21996 +9351 2197C +9352 23AEE +9353 5ECD +9354 5B4F +9355 21903 +9356 21904 +9357 3701 +9358 218A0 +9359 36DD +935A 216FE +935B 36D3 +935C 812A +935D 28A47 +935E 21DBA +935F 23472 +9360 289A8 +9361 5F0C +9362 5F0E +9363 21927 +9364 217AB +9365 5A6B +9366 2173B +9367 5B44 +9368 8614 +9369 275FD +936A 8860 +936B 607E +936C 22860 +936D 2262B +936E 5FDB +936F 3EB8 +9370 225AF +9371 225BE +9372 29088 +9373 26F73 +9374 61C0 +9375 2003E +9376 20046 +9377 2261B +9378 6199 +9379 6198 +937A 6075 +937B 22C9B +937C 22D07 +937D 246D4 +937E 2914D +93A1 6471 +93A2 24665 +93A3 22B6A +93A4 3A29 +93A5 22B22 +93A6 23450 +93A7 298EA +93A8 22E78 +93A9 6337 +93AA 2A45B +93AB 64B6 +93AC 6331 +93AD 63D1 +93AE 249E3 +93AF 22D67 +93B0 62A4 +93B1 22CA1 +93B2 643B +93B3 656B +93B4 6972 +93B5 3BF4 +93B6 2308E +93B7 232AD +93B8 24989 +93B9 232AB +93BA 550D +93BB 232E0 +93BC 218D9 +93BD 2943F +93BE 66CE +93BF 23289 +93C0 231B3 +93C1 3AE0 +93C2 4190 +93C3 25584 +93C4 28B22 +93C5 2558F +93C6 216FC +93C7 2555B +93C8 25425 +93C9 78EE +93CA 23103 +93CB 2182A +93CC 23234 +93CD 3464 +93CE 2320F +93CF 23182 +93D0 242C9 +93D1 668E +93D2 26D24 +93D3 666B +93D4 4B93 +93D5 6630 +93D6 27870 +93D7 21DEB +93D8 6663 +93D9 232D2 +93DA 232E1 +93DB 661E +93DC 25872 +93DD 38D1 +93DE 2383A +93DF 237BC +93E0 3B99 +93E1 237A2 +93E2 233FE +93E3 74D0 +93E4 3B96 +93E5 678F +93E6 2462A +93E7 68B6 +93E8 681E +93E9 3BC4 +93EA 6ABE +93EB 3863 +93EC 237D5 +93ED 24487 +93EE 6A33 +93EF 6A52 +93F0 6AC9 +93F1 6B05 +93F2 21912 +93F3 6511 +93F4 6898 +93F5 6A4C +93F6 3BD7 +93F7 6A7A +93F8 6B57 +93F9 23FC0 +93FA 23C9A +93FB 93A0 +93FC 92F2 +93FD 28BEA +93FE 28ACB +9440 9289 +9441 2801E +9442 289DC +9443 9467 +9444 6DA5 +9445 6F0B +9446 249EC +9448 23F7F +9449 3D8F +944A 6E04 +944B 2403C +944C 5A3D +944D 6E0A +944E 5847 +944F 6D24 +9450 7842 +9451 713B +9452 2431A +9453 24276 +9454 70F1 +9455 7250 +9456 7287 +9457 7294 +9458 2478F +9459 24725 +945A 5179 +945B 24AA4 +945C 205EB +945D 747A +945E 23EF8 +945F 2365F +9460 24A4A +9461 24917 +9462 25FE1 +9463 3F06 +9464 3EB1 +9465 24ADF +9466 28C23 +9467 23F35 +9468 60A7 +9469 3EF3 +946A 74CC +946B 743C +946C 9387 +946D 7437 +946E 449F +946F 26DEA +9470 4551 +9471 7583 +9472 3F63 +9473 24CD9 +9474 24D06 +9475 3F58 +9476 7555 +9477 7673 +9478 2A5C6 +9479 3B19 +947A 7468 +947B 28ACC +947C 249AB +947D 2498E +947E 3AFB +94A1 3DCD +94A2 24A4E +94A3 3EFF +94A4 249C5 +94A5 248F3 +94A6 91FA +94A7 5732 +94A8 9342 +94A9 28AE3 +94AA 21864 +94AB 50DF +94AC 25221 +94AD 251E7 +94AE 7778 +94AF 23232 +94B0 770E +94B1 770F +94B2 777B +94B3 24697 +94B4 23781 +94B5 3A5E +94B6 248F0 +94B7 7438 +94B8 749B +94B9 3EBF +94BA 24ABA +94BB 24AC7 +94BC 40C8 +94BD 24A96 +94BE 261AE +94BF 9307 +94C0 25581 +94C1 781E +94C2 788D +94C3 7888 +94C4 78D2 +94C5 73D0 +94C6 7959 +94C7 27741 +94C8 256E3 +94C9 410E +94CB 8496 +94CC 79A5 +94CD 6A2D +94CE 23EFA +94CF 7A3A +94D0 79F4 +94D1 416E +94D2 216E6 +94D3 4132 +94D4 9235 +94D5 79F1 +94D6 20D4C +94D7 2498C +94D8 20299 +94D9 23DBA +94DA 2176E +94DB 3597 +94DC 556B +94DD 3570 +94DE 36AA +94DF 201D4 +94E0 20C0D +94E1 7AE2 +94E2 5A59 +94E3 226F5 +94E4 25AAF +94E5 25A9C +94E6 5A0D +94E7 2025B +94E8 78F0 +94E9 5A2A +94EA 25BC6 +94EB 7AFE +94EC 41F9 +94ED 7C5D +94EE 7C6D +94EF 4211 +94F0 25BB3 +94F1 25EBC +94F2 25EA6 +94F3 7CCD +94F4 249F9 +94F5 217B0 +94F6 7C8E +94F7 7C7C +94F8 7CAE +94F9 6AB2 +94FA 7DDC +94FB 7E07 +94FC 7DD3 +94FD 7F4E +94FE 26261 +9540 2615C +9541 27B48 +9542 7D97 +9543 25E82 +9544 426A +9545 26B75 +9546 20916 +9547 67D6 +9548 2004E +9549 235CF +954A 57C4 +954B 26412 +954C 263F8 +954D 24962 +954E 7FDD +954F 7B27 +9550 2082C +9551 25AE9 +9552 25D43 +9553 7B0C +9554 25E0E +9555 99E6 +9556 8645 +9557 9A63 +9558 6A1C +9559 2343F +955A 39E2 +955B 249F7 +955C 265AD +955D 9A1F +955E 265A0 +955F 8480 +9560 27127 +9561 26CD1 +9562 44EA +9563 8137 +9564 4402 +9565 80C6 +9566 8109 +9567 8142 +9568 267B4 +9569 98C3 +956A 26A42 +956B 8262 +956C 8265 +956D 26A51 +956E 8453 +956F 26DA7 +9570 8610 +9571 2721B +9572 5A86 +9573 417F +9574 21840 +9575 5B2B +9576 218A1 +9577 5AE4 +9578 218D8 +9579 86A0 +957A 2F9BC +957B 23D8F +957C 882D +957D 27422 +957E 5A02 +95A1 886E +95A2 4F45 +95A3 8887 +95A4 88BF +95A5 88E6 +95A6 8965 +95A7 894D +95A8 25683 +95A9 8954 +95AA 27785 +95AB 27784 +95AC 28BF5 +95AD 28BD9 +95AE 28B9C +95AF 289F9 +95B0 3EAD +95B1 84A3 +95B2 46F5 +95B3 46CF +95B4 37F2 +95B5 8A3D +95B6 8A1C +95B7 29448 +95B8 5F4D +95B9 922B +95BA 24284 +95BB 65D4 +95BC 7129 +95BD 70C4 +95BE 21845 +95BF 9D6D +95C0 8C9F +95C1 8CE9 +95C2 27DDC +95C3 599A +95C4 77C3 +95C5 59F0 +95C6 436E +95C7 36D4 +95C8 8E2A +95C9 8EA7 +95CA 24C09 +95CB 8F30 +95CC 8F4A +95CD 42F4 +95CE 6C58 +95CF 6FBB +95D0 22321 +95D1 489B +95D2 6F79 +95D3 6E8B +95D4 217DA +95D5 9BE9 +95D6 36B5 +95D7 2492F +95D8 90BB +95DA 5571 +95DB 4906 +95DC 91BB +95DD 9404 +95DE 28A4B +95DF 4062 +95E0 28AFC +95E1 9427 +95E2 28C1D +95E3 28C3B +95E4 84E5 +95E5 8A2B +95E6 9599 +95E7 95A7 +95E8 9597 +95E9 9596 +95EA 28D34 +95EB 7445 +95EC 3EC2 +95ED 248FF +95EE 24A42 +95EF 243EA +95F0 3EE7 +95F1 23225 +95F2 968F +95F3 28EE7 +95F4 28E66 +95F5 28E65 +95F6 3ECC +95F7 249ED +95F8 24A78 +95F9 23FEE +95FA 7412 +95FB 746B +95FC 3EFC +95FD 9741 +95FE 290B0 +9640 6847 +9641 4A1D +9642 29093 +9643 257DF +9645 9368 +9646 28989 +9647 28C26 +9648 28B2F +9649 263BE +964A 92BA +964B 5B11 +964C 8B69 +964D 493C +964E 73F9 +964F 2421B +9650 979B +9651 9771 +9652 9938 +9653 20F26 +9654 5DC1 +9655 28BC5 +9656 24AB2 +9657 981F +9658 294DA +9659 92F6 +965A 295D7 +965B 91E5 +965C 44C0 +965D 28B50 +965E 24A67 +965F 28B64 +9660 98DC +9661 28A45 +9662 3F00 +9663 922A +9664 4925 +9665 8414 +9666 993B +9667 994D +9668 27B06 +9669 3DFD +966A 999B +966B 4B6F +966C 99AA +966D 9A5C +966E 28B65 +966F 258C8 +9670 6A8F +9671 9A21 +9672 5AFE +9673 9A2F +9674 298F1 +9675 4B90 +9676 29948 +9677 99BC +9678 4BBD +9679 4B97 +967A 937D +967B 5872 +967C 21302 +967D 5822 +967E 249B8 +96A1 214E8 +96A2 7844 +96A3 2271F +96A4 23DB8 +96A5 68C5 +96A6 3D7D +96A7 9458 +96A8 3927 +96A9 6150 +96AA 22781 +96AB 2296B +96AC 6107 +96AD 9C4F +96AE 9C53 +96AF 9C7B +96B0 9C35 +96B1 9C10 +96B2 9B7F +96B3 9BCF +96B4 29E2D +96B5 9B9F +96B6 2A1F5 +96B7 2A0FE +96B8 9D21 +96B9 4CAE +96BA 24104 +96BB 9E18 +96BC 4CB0 +96BD 9D0C +96BE 2A1B4 +96BF 2A0ED +96C0 2A0F3 +96C1 2992F +96C2 9DA5 +96C3 84BD +96C4 26E12 +96C5 26FDF +96C6 26B82 +96C7 85FC +96C8 4533 +96C9 26DA4 +96CA 26E84 +96CB 26DF0 +96CC 8420 +96CD 85EE +96CE 26E00 +96CF 237D7 +96D0 26064 +96D1 79E2 +96D2 2359C +96D3 23640 +96D4 492D +96D5 249DE +96D6 3D62 +96D7 93DB +96D8 92BE +96D9 9348 +96DA 202BF +96DB 78B9 +96DC 9277 +96DD 944D +96DE 4FE4 +96DF 3440 +96E0 9064 +96E1 2555D +96E2 783D +96E3 7854 +96E4 78B6 +96E5 784B +96E6 21757 +96E7 231C9 +96E8 24941 +96E9 369A +96EA 4F72 +96EB 6FDA +96EC 6FD9 +96EE 701E +96EF 5414 +96F0 241B5 +96F1 57BB +96F2 58F3 +96F3 578A +96F4 9D16 +96F5 57D7 +96F6 7134 +96F7 34AF +96F8 241AC +96F9 71EB +96FA 26C40 +96FB 24F97 +96FD 217B5 +96FE 28A49 +9740 610C +9741 5ACE +9742 5A0B +9743 42BC +9744 24488 +9745 372C +9746 4B7B +9747 289FC +9748 93BB +9749 93B8 +974A 218D6 +974B 20F1D +974C 8472 +974D 26CC0 +974E 21413 +974F 242FA +9750 22C26 +9751 243C1 +9752 5994 +9753 23DB7 +9754 26741 +9755 7DA8 +9756 2615B +9757 260A4 +9758 249B9 +9759 2498B +975A 289FA +975B 92E5 +975C 73E2 +975D 3EE9 +975E 74B4 +975F 28B63 +9760 2189F +9761 3EE1 +9762 24AB3 +9763 6AD8 +9764 73F3 +9765 73FB +9766 3ED6 +9767 24A3E +9768 24A94 +9769 217D9 +976A 24A66 +976B 203A7 +976C 21424 +976D 249E5 +976E 7448 +976F 24916 +9770 70A5 +9771 24976 +9772 9284 +9773 73E6 +9774 935F +9775 204FE +9776 9331 +9777 28ACE +9778 28A16 +9779 9386 +977A 28BE7 +977B 255D5 +977C 4935 +977D 28A82 +977E 716B +97A1 24943 +97A2 20CFF +97A3 56A4 +97A4 2061A +97A5 20BEB +97A6 20CB8 +97A7 5502 +97A8 79C4 +97A9 217FA +97AA 7DFE +97AB 216C2 +97AC 24A50 +97AD 21852 +97AE 452E +97AF 9401 +97B0 370A +97B1 28AC0 +97B2 249AD +97B3 59B0 +97B4 218BF +97B5 21883 +97B6 27484 +97B7 5AA1 +97B8 36E2 +97B9 23D5B +97BA 36B0 +97BB 925F +97BC 5A79 +97BD 28A81 +97BE 21862 +97BF 9374 +97C0 3CCD +97C1 20AB4 +97C2 4A96 +97C3 398A +97C4 50F4 +97C5 3D69 +97C6 3D4C +97C7 2139C +97C8 7175 +97C9 42FB +97CA 28218 +97CB 6E0F +97CC 290E4 +97CD 44EB +97CE 6D57 +97CF 27E4F +97D0 7067 +97D1 6CAF +97D2 3CD6 +97D3 23FED +97D4 23E2D +97D5 6E02 +97D6 6F0C +97D7 3D6F +97D8 203F5 +97D9 7551 +97DA 36BC +97DB 34C8 +97DC 4680 +97DD 3EDA +97DE 4871 +97DF 59C4 +97E0 926E +97E1 493E +97E2 8F41 +97E3 28C1C +97E4 26BC0 +97E5 5812 +97E6 57C8 +97E7 36D6 +97E8 21452 +97E9 70FE +97EA 24362 +97EB 24A71 +97EC 22FE3 +97ED 212B0 +97EE 223BD +97EF 68B9 +97F0 6967 +97F1 21398 +97F2 234E5 +97F3 27BF4 +97F4 236DF +97F5 28A83 +97F6 237D6 +97F7 233FA +97F8 24C9F +97F9 6A1A +97FA 236AD +97FB 26CB7 +97FC 843E +97FD 44DF +97FE 44CE +9840 26D26 +9841 26D51 +9842 26C82 +9843 26FDE +9844 6F17 +9845 27109 +9846 833D +9847 2173A +9848 83ED +9849 26C80 +984A 27053 +984B 217DB +984C 5989 +984D 5A82 +984E 217B3 +984F 5A61 +9850 5A71 +9851 21905 +9852 241FC +9853 372D +9854 59EF +9855 2173C +9856 36C7 +9857 718E +9858 9390 +9859 669A +985A 242A5 +985B 5A6E +985C 5A2B +985D 24293 +985E 6A2B +985F 23EF9 +9860 27736 +9861 2445B +9862 242CA +9863 711D +9864 24259 +9865 289E1 +9866 4FB0 +9867 26D28 +9868 5CC2 +9869 244CE +986A 27E4D +986B 243BD +986C 6A0C +986D 24256 +986E 21304 +986F 70A6 +9870 7133 +9871 243E9 +9872 3DA5 +9873 6CDF +9874 2F825 +9875 24A4F +9876 7E65 +9877 59EB +9878 5D2F +9879 3DF3 +987A 5F5C +987B 24A5D +987C 217DF +987D 7DA4 +987E 8426 +98A1 5485 +98A2 23AFA +98A3 23300 +98A4 20214 +98A5 577E +98A6 208D5 +98A7 20619 +98A8 3FE5 +98A9 21F9E +98AA 2A2B6 +98AB 7003 +98AC 2915B +98AD 5D70 +98AE 738F +98AF 7CD3 +98B0 28A59 +98B1 29420 +98B2 4FC8 +98B3 7FE7 +98B4 72CD +98B5 7310 +98B6 27AF4 +98B7 7338 +98B8 7339 +98B9 256F6 +98BA 7341 +98BB 7348 +98BC 3EA9 +98BD 27B18 +98BE 906C +98BF 71F5 +98C0 248F2 +98C1 73E1 +98C2 81F6 +98C3 3ECA +98C4 770C +98C5 3ED1 +98C6 6CA2 +98C7 56FD +98C8 7419 +98C9 741E +98CA 741F +98CB 3EE2 +98CC 3EF0 +98CD 3EF4 +98CE 3EFA +98CF 74D3 +98D0 3F0E +98D1 3F53 +98D2 7542 +98D3 756D +98D4 7572 +98D5 758D +98D6 3F7C +98D7 75C8 +98D8 75DC +98D9 3FC0 +98DA 764D +98DB 3FD7 +98DC 7674 +98DD 3FDC +98DE 767A +98DF 24F5C +98E0 7188 +98E1 5623 +98E2 8980 +98E3 5869 +98E4 401D +98E5 7743 +98E6 4039 +98E7 6761 +98E8 4045 +98E9 35DB +98EA 7798 +98EB 406A +98EC 406F +98ED 5C5E +98EE 77BE +98EF 77CB +98F0 58F2 +98F1 7818 +98F2 70B9 +98F3 781C +98F4 40A8 +98F5 7839 +98F6 7847 +98F7 7851 +98F8 7866 +98F9 8448 +98FA 25535 +98FB 7933 +98FC 6803 +98FD 7932 +98FE 4103 +9940 4109 +9941 7991 +9942 7999 +9943 8FBB +9944 7A06 +9945 8FBC +9946 4167 +9947 7A91 +9948 41B2 +9949 7ABC +994A 8279 +994B 41C4 +994C 7ACF +994D 7ADB +994E 41CF +994F 4E21 +9950 7B62 +9951 7B6C +9952 7B7B +9953 7C12 +9954 7C1B +9955 4260 +9956 427A +9957 7C7B +9958 7C9C +9959 428C +995A 7CB8 +995B 4294 +995C 7CED +995D 8F93 +995E 70C0 +995F 20CCF +9960 7DCF +9961 7DD4 +9962 7DD0 +9963 7DFD +9964 7FAE +9965 7FB4 +9966 729F +9967 4397 +9968 8020 +9969 8025 +996A 7B39 +996B 802E +996C 8031 +996D 8054 +996E 3DCC +996F 57B4 +9970 70A0 +9971 80B7 +9972 80E9 +9973 43ED +9974 810C +9975 732A +9976 810E +9977 8112 +9978 7560 +9979 8114 +997A 4401 +997B 3B39 +997C 8156 +997D 8159 +997E 815A +99A1 4413 +99A2 583A +99A3 817C +99A4 8184 +99A5 4425 +99A6 8193 +99A7 442D +99A8 81A5 +99A9 57EF +99AA 81C1 +99AB 81E4 +99AC 8254 +99AD 448F +99AE 82A6 +99AF 8276 +99B0 82CA +99B1 82D8 +99B2 82FF +99B3 44B0 +99B4 8357 +99B5 9669 +99B6 698A +99B7 8405 +99B8 70F5 +99B9 8464 +99BA 60E3 +99BB 8488 +99BC 4504 +99BD 84BE +99BE 84E1 +99BF 84F8 +99C0 8510 +99C1 8538 +99C2 8552 +99C3 453B +99C4 856F +99C5 8570 +99C6 85E0 +99C7 4577 +99C8 8672 +99C9 8692 +99CA 86B2 +99CB 86EF +99CC 9645 +99CD 878B +99CE 4606 +99CF 4617 +99D0 88AE +99D1 88FF +99D2 8924 +99D3 8947 +99D4 8991 +99D5 27967 +99D6 8A29 +99D7 8A38 +99D8 8A94 +99D9 8AB4 +99DA 8C51 +99DB 8CD4 +99DC 8CF2 +99DD 8D1C +99DE 4798 +99DF 585F +99E0 8DC3 +99E1 47ED +99E2 4EEE +99E3 8E3A +99E4 55D8 +99E5 5754 +99E6 8E71 +99E7 55F5 +99E8 8EB0 +99E9 4837 +99EA 8ECE +99EB 8EE2 +99EC 8EE4 +99ED 8EED +99EE 8EF2 +99EF 8FB7 +99F0 8FC1 +99F1 8FCA +99F2 8FCC +99F3 9033 +99F4 99C4 +99F5 48AD +99F6 98E0 +99F7 9213 +99F8 491E +99F9 9228 +99FA 9258 +99FB 926B +99FC 92B1 +99FD 92AE +99FE 92BF +9A40 92E3 +9A41 92EB +9A42 92F3 +9A43 92F4 +9A44 92FD +9A45 9343 +9A46 9384 +9A47 93AD +9A48 4945 +9A49 4951 +9A4A 9EBF +9A4B 9417 +9A4C 5301 +9A4D 941D +9A4E 942D +9A4F 943E +9A50 496A +9A51 9454 +9A52 9479 +9A53 952D +9A54 95A2 +9A55 49A7 +9A56 95F4 +9A57 9633 +9A58 49E5 +9A59 67A0 +9A5A 4A24 +9A5B 9740 +9A5C 4A35 +9A5D 97B2 +9A5E 97C2 +9A5F 5654 +9A60 4AE4 +9A61 60E8 +9A62 98B9 +9A63 4B19 +9A64 98F1 +9A65 5844 +9A66 990E +9A67 9919 +9A68 51B4 +9A69 991C +9A6A 9937 +9A6B 9942 +9A6C 995D +9A6D 9962 +9A6E 4B70 +9A6F 99C5 +9A70 4B9D +9A71 9A3C +9A72 9B0F +9A73 7A83 +9A74 9B69 +9A75 9B81 +9A76 9BDD +9A77 9BF1 +9A78 9BF4 +9A79 4C6D +9A7A 9C20 +9A7B 376F +9A7C 21BC2 +9A7D 9D49 +9A7E 9C3A +9AA1 9EFE +9AA2 5650 +9AA3 9D93 +9AA4 9DBD +9AA5 9DC0 +9AA6 9DFC +9AA7 94F6 +9AA8 8FB6 +9AA9 9E7B +9AAA 9EAC +9AAB 9EB1 +9AAC 9EBD +9AAD 9EC6 +9AAE 94DC +9AAF 9EE2 +9AB0 9EF1 +9AB1 9EF8 +9AB2 7AC8 +9AB3 9F44 +9AB4 20094 +9AB5 202B7 +9AB6 203A0 +9AB7 691A +9AB8 94C3 +9AB9 59AC +9ABA 204D7 +9ABB 5840 +9ABC 94C1 +9ABD 37B9 +9ABE 205D5 +9ABF 20615 +9AC0 20676 +9AC1 216BA +9AC2 5757 +9AC3 7173 +9AC4 20AC2 +9AC5 20ACD +9AC6 20BBF +9AC7 546A +9AC8 2F83B +9AC9 20BCB +9ACA 549E +9ACB 20BFB +9ACC 20C3B +9ACD 20C53 +9ACE 20C65 +9ACF 20C7C +9AD0 60E7 +9AD1 20C8D +9AD2 567A +9AD3 20CB5 +9AD4 20CDD +9AD5 20CED +9AD6 20D6F +9AD7 20DB2 +9AD8 20DC8 +9AD9 6955 +9ADA 9C2F +9ADB 87A5 +9ADC 20E04 +9ADD 20E0E +9ADE 20ED7 +9ADF 20F90 +9AE0 20F2D +9AE1 20E73 +9AE2 5C20 +9AE3 20FBC +9AE4 5E0B +9AE5 2105C +9AE6 2104F +9AE7 21076 +9AE8 671E +9AE9 2107B +9AEA 21088 +9AEB 21096 +9AEC 3647 +9AED 210BF +9AEE 210D3 +9AEF 2112F +9AF0 2113B +9AF1 5364 +9AF2 84AD +9AF3 212E3 +9AF4 21375 +9AF5 21336 +9AF6 8B81 +9AF7 21577 +9AF8 21619 +9AF9 217C3 +9AFA 217C7 +9AFB 4E78 +9AFC 70BB +9AFD 2182D +9AFE 2196A +9B40 21A2D +9B41 21A45 +9B42 21C2A +9B43 21C70 +9B44 21CAC +9B45 21EC8 +9B46 62C3 +9B47 21ED5 +9B48 21F15 +9B49 7198 +9B4A 6855 +9B4B 22045 +9B4C 69E9 +9B4D 36C8 +9B4E 2227C +9B4F 223D7 +9B50 223FA +9B51 2272A +9B52 22871 +9B53 2294F +9B54 82FD +9B55 22967 +9B56 22993 +9B57 22AD5 +9B58 89A5 +9B59 22AE8 +9B5A 8FA0 +9B5B 22B0E +9B5C 97B8 +9B5D 22B3F +9B5E 9847 +9B5F 9ABD +9B60 22C4C +9B62 22C88 +9B63 22CB7 +9B64 25BE8 +9B65 22D08 +9B66 22D12 +9B67 22DB7 +9B68 22D95 +9B69 22E42 +9B6A 22F74 +9B6B 22FCC +9B6C 23033 +9B6D 23066 +9B6E 2331F +9B6F 233DE +9B70 5FB1 +9B71 6648 +9B72 66BF +9B73 27A79 +9B74 23567 +9B75 235F3 +9B77 249BA +9B79 2361A +9B7A 23716 +9B7C 20346 +9B7D 58B5 +9B7E 670E +9BA1 6918 +9BA2 23AA7 +9BA3 27657 +9BA4 25FE2 +9BA5 23E11 +9BA6 23EB9 +9BA7 275FE +9BA8 2209A +9BA9 48D0 +9BAA 4AB8 +9BAB 24119 +9BAC 28A9A +9BAD 242EE +9BAE 2430D +9BAF 2403B +9BB0 24334 +9BB1 24396 +9BB2 24A45 +9BB3 205CA +9BB4 51D2 +9BB5 20611 +9BB6 599F +9BB7 21EA8 +9BB8 3BBE +9BB9 23CFF +9BBA 24404 +9BBB 244D6 +9BBC 5788 +9BBD 24674 +9BBE 399B +9BBF 2472F +9BC0 285E8 +9BC1 299C9 +9BC2 3762 +9BC3 221C3 +9BC4 8B5E +9BC5 28B4E +9BC7 24812 +9BC8 248FB +9BC9 24A15 +9BCA 7209 +9BCB 24AC0 +9BCC 20C78 +9BCD 5965 +9BCE 24EA5 +9BCF 24F86 +9BD0 20779 +9BD1 8EDA +9BD2 2502C +9BD3 528F +9BD4 573F +9BD5 7171 +9BD6 25299 +9BD7 25419 +9BD8 23F4A +9BD9 24AA7 +9BDA 55BC +9BDB 25446 +9BDC 2546E +9BDD 26B52 +9BDF 3473 +9BE0 2553F +9BE1 27632 +9BE2 2555E +9BE3 4718 +9BE4 25562 +9BE5 25566 +9BE6 257C7 +9BE7 2493F +9BE8 2585D +9BE9 5066 +9BEA 34FB +9BEB 233CC +9BED 25903 +9BEE 477C +9BEF 28948 +9BF0 25AAE +9BF1 25B89 +9BF2 25C06 +9BF3 21D90 +9BF4 57A1 +9BF5 7151 +9BF7 26102 +9BF8 27C12 +9BF9 9056 +9BFA 261B2 +9BFB 24F9A +9BFC 8B62 +9BFD 26402 +9BFE 2644A +9C40 5D5B +9C41 26BF7 +9C43 26484 +9C44 2191C +9C45 8AEA +9C46 249F6 +9C47 26488 +9C48 23FEF +9C49 26512 +9C4A 4BC0 +9C4B 265BF +9C4C 266B5 +9C4D 2271B +9C4E 9465 +9C4F 257E1 +9C50 6195 +9C51 5A27 +9C52 2F8CD +9C54 56B9 +9C55 24521 +9C56 266FC +9C57 4E6A +9C58 24934 +9C59 9656 +9C5A 6D8F +9C5B 26CBD +9C5C 3618 +9C5D 8977 +9C5E 26799 +9C5F 2686E +9C60 26411 +9C61 2685E +9C63 268C7 +9C64 7B42 +9C65 290C0 +9C66 20A11 +9C67 26926 +9C69 26939 +9C6A 7A45 +9C6C 269FA +9C6D 9A26 +9C6E 26A2D +9C6F 365F +9C70 26469 +9C71 20021 +9C72 7983 +9C73 26A34 +9C74 26B5B +9C75 5D2C +9C76 23519 +9C78 26B9D +9C79 46D0 +9C7A 26CA4 +9C7B 753B +9C7C 8865 +9C7D 26DAE +9C7E 58B6 +9CA1 371C +9CA2 2258D +9CA3 2704B +9CA4 271CD +9CA5 3C54 +9CA6 27280 +9CA7 27285 +9CA8 9281 +9CA9 2217A +9CAA 2728B +9CAB 9330 +9CAC 272E6 +9CAD 249D0 +9CAE 6C39 +9CAF 949F +9CB0 27450 +9CB1 20EF8 +9CB2 8827 +9CB3 88F5 +9CB4 22926 +9CB5 28473 +9CB6 217B1 +9CB7 6EB8 +9CB8 24A2A +9CB9 21820 +9CBA 39A4 +9CBB 36B9 +9CBE 453F +9CBF 66B6 +9CC0 29CAD +9CC1 298A4 +9CC2 8943 +9CC3 277CC +9CC4 27858 +9CC5 56D6 +9CC6 40DF +9CC7 2160A +9CC8 39A1 +9CC9 2372F +9CCA 280E8 +9CCB 213C5 +9CCC 71AD +9CCD 8366 +9CCE 279DD +9CCF 291A8 +9CD1 4CB7 +9CD2 270AF +9CD3 289AB +9CD4 279FD +9CD5 27A0A +9CD6 27B0B +9CD7 27D66 +9CD8 2417A +9CD9 7B43 +9CDA 797E +9CDB 28009 +9CDC 6FB5 +9CDD 2A2DF +9CDE 6A03 +9CDF 28318 +9CE0 53A2 +9CE1 26E07 +9CE2 93BF +9CE3 6836 +9CE4 975D +9CE5 2816F +9CE6 28023 +9CE7 269B5 +9CE8 213ED +9CE9 2322F +9CEA 28048 +9CEB 5D85 +9CEC 28C30 +9CED 28083 +9CEE 5715 +9CEF 9823 +9CF0 28949 +9CF1 5DAB +9CF2 24988 +9CF3 65BE +9CF4 69D5 +9CF5 53D2 +9CF6 24AA5 +9CF7 23F81 +9CF8 3C11 +9CF9 6736 +9CFA 28090 +9CFB 280F4 +9CFC 2812E +9CFD 21FA1 +9CFE 2814F +9D40 28189 +9D41 281AF +9D42 2821A +9D43 28306 +9D44 2832F +9D45 2838A +9D46 35CA +9D47 28468 +9D48 286AA +9D49 48FA +9D4A 63E6 +9D4B 28956 +9D4C 7808 +9D4D 9255 +9D4E 289B8 +9D4F 43F2 +9D50 289E7 +9D51 43DF +9D52 289E8 +9D53 28B46 +9D54 28BD4 +9D55 59F8 +9D56 28C09 +9D58 28FC5 +9D59 290EC +9D5B 29110 +9D5C 2913C +9D5D 3DF7 +9D5E 2915E +9D5F 24ACA +9D60 8FD0 +9D61 728F +9D62 568B +9D63 294E7 +9D64 295E9 +9D65 295B0 +9D66 295B8 +9D67 29732 +9D68 298D1 +9D69 29949 +9D6A 2996A +9D6B 299C3 +9D6C 29A28 +9D6D 29B0E +9D6E 29D5A +9D6F 29D9B +9D70 7E9F +9D71 29EF8 +9D72 29F23 +9D73 4CA4 +9D74 9547 +9D75 2A293 +9D76 71A2 +9D77 2A2FF +9D78 4D91 +9D79 9012 +9D7A 2A5CB +9D7B 4D9C +9D7C 20C9C +9D7D 8FBE +9D7E 55C1 +9DA1 8FBA +9DA2 224B0 +9DA3 8FB9 +9DA4 24A93 +9DA5 4509 +9DA6 7E7F +9DA7 6F56 +9DA8 6AB1 +9DA9 4EEA +9DAA 34E4 +9DAB 28B2C +9DAC 2789D +9DAD 373A +9DAE 8E80 +9DAF 217F5 +9DB0 28024 +9DB1 28B6C +9DB2 28B99 +9DB3 27A3E +9DB4 266AF +9DB5 3DEB +9DB6 27655 +9DB7 23CB7 +9DB8 25635 +9DB9 25956 +9DBA 4E9A +9DBB 25E81 +9DBC 26258 +9DBD 56BF +9DBE 20E6D +9DBF 8E0E +9DC0 5B6D +9DC1 23E88 +9DC2 24C9E +9DC3 63DE +9DC5 217F6 +9DC6 2187B +9DC7 6530 +9DC8 562D +9DC9 25C4A +9DCA 541A +9DCB 25311 +9DCC 3DC6 +9DCD 29D98 +9DCE 4C7D +9DCF 5622 +9DD0 561E +9DD1 7F49 +9DD2 25ED8 +9DD3 5975 +9DD4 23D40 +9DD5 8770 +9DD6 4E1C +9DD7 20FEA +9DD8 20D49 +9DD9 236BA +9DDA 8117 +9DDB 9D5E +9DDC 8D18 +9DDD 763B +9DDE 9C45 +9DDF 764E +9DE0 77B9 +9DE1 9345 +9DE2 5432 +9DE3 8148 +9DE4 82F7 +9DE5 5625 +9DE6 8132 +9DE7 8418 +9DE8 80BD +9DE9 55EA +9DEA 7962 +9DEB 5643 +9DEC 5416 +9DED 20E9D +9DEE 35CE +9DEF 5605 +9DF0 55F1 +9DF1 66F1 +9DF2 282E2 +9DF3 362D +9DF4 7534 +9DF5 55F0 +9DF6 55BA +9DF7 5497 +9DF8 5572 +9DF9 20C41 +9DFA 20C96 +9DFB 5ED0 +9DFC 25148 +9DFD 20E76 +9DFE 22C62 +9E40 20EA2 +9E41 9EAB +9E42 7D5A +9E43 55DE +9E44 21075 +9E45 629D +9E46 976D +9E47 5494 +9E48 8CCD +9E49 71F6 +9E4A 9176 +9E4B 63FC +9E4C 63B9 +9E4D 63FE +9E4E 5569 +9E4F 22B43 +9E50 9C72 +9E51 22EB3 +9E52 519A +9E53 34DF +9E54 20DA7 +9E55 51A7 +9E56 544D +9E57 551E +9E58 5513 +9E59 7666 +9E5A 8E2D +9E5B 2688A +9E5C 75B1 +9E5D 80B6 +9E5E 8804 +9E5F 8786 +9E60 88C7 +9E61 81B6 +9E62 841C +9E63 210C1 +9E64 44EC +9E65 7304 +9E66 24706 +9E67 5B90 +9E68 830B +9E69 26893 +9E6A 567B +9E6B 226F4 +9E6C 27D2F +9E6D 241A3 +9E6E 27D73 +9E6F 26ED0 +9E70 272B6 +9E71 9170 +9E72 211D9 +9E73 9208 +9E74 23CFC +9E75 2A6A9 +9E76 20EAC +9E77 20EF9 +9E78 7266 +9E79 21CA2 +9E7A 474E +9E7B 24FC2 +9E7C 27FF9 +9E7D 20FEB +9E7E 40FA +9EA1 9C5D +9EA2 651F +9EA3 22DA0 +9EA4 48F3 +9EA5 247E0 +9EA6 29D7C +9EA7 20FEC +9EA8 20E0A +9EAA 275A3 +9EAB 20FED +9EAD 26048 +9EAE 21187 +9EAF 71A3 +9EB0 7E8E +9EB1 9D50 +9EB2 4E1A +9EB3 4E04 +9EB4 3577 +9EB5 5B0D +9EB6 6CB2 +9EB7 5367 +9EB8 36AC +9EB9 39DC +9EBA 537D +9EBB 36A5 +9EBC 24618 +9EBD 589A +9EBE 24B6E +9EBF 822D +9EC0 544B +9EC1 57AA +9EC2 25A95 +9EC3 20979 +9EC5 3A52 +9EC6 22465 +9EC7 7374 +9EC8 29EAC +9EC9 4D09 +9ECA 9BED +9ECB 23CFE +9ECC 29F30 +9ECD 4C5B +9ECE 24FA9 +9ECF 2959E +9ED0 29FDE +9ED1 845C +9ED2 23DB6 +9ED3 272B2 +9ED4 267B3 +9ED5 23720 +9ED6 632E +9ED7 7D25 +9ED8 23EF7 +9ED9 23E2C +9EDA 3A2A +9EDB 9008 +9EDC 52CC +9EDD 3E74 +9EDE 367A +9EDF 45E9 +9EE0 2048E +9EE1 7640 +9EE2 5AF0 +9EE3 20EB6 +9EE4 787A +9EE5 27F2E +9EE6 58A7 +9EE7 40BF +9EE8 567C +9EE9 9B8B +9EEA 5D74 +9EEB 7654 +9EEC 2A434 +9EED 9E85 +9EEE 4CE1 +9EF0 37FB +9EF1 6119 +9EF2 230DA +9EF3 243F2 +9EF5 565D +9EF6 212A9 +9EF7 57A7 +9EF8 24963 +9EF9 29E06 +9EFA 5234 +9EFB 270AE +9EFC 35AD +9EFE 9D7C +9F40 7C56 +9F41 9B39 +9F42 57DE +9F43 2176C +9F44 5C53 +9F45 64D3 +9F46 294D0 +9F47 26335 +9F48 27164 +9F49 86AD +9F4A 20D28 +9F4B 26D22 +9F4C 24AE2 +9F4D 20D71 +9F4F 51FE +9F50 21F0F +9F51 5D8E +9F52 9703 +9F53 21DD1 +9F54 9E81 +9F55 904C +9F56 7B1F +9F57 9B02 +9F58 5CD1 +9F59 7BA3 +9F5A 6268 +9F5B 6335 +9F5C 9AFF +9F5D 7BCF +9F5E 9B2A +9F5F 7C7E +9F61 7C42 +9F62 7C86 +9F63 9C15 +9F64 7BFC +9F65 9B09 +9F67 9C1B +9F68 2493E +9F69 9F5A +9F6A 5573 +9F6B 5BC3 +9F6C 4FFD +9F6D 9E98 +9F6E 4FF2 +9F6F 5260 +9F70 3E06 +9F71 52D1 +9F72 5767 +9F73 5056 +9F74 59B7 +9F75 5E12 +9F76 97C8 +9F77 9DAB +9F78 8F5C +9F79 5469 +9F7A 97B4 +9F7B 9940 +9F7C 97BA +9F7D 532C +9F7E 6130 +9FA1 692C +9FA2 53DA +9FA3 9C0A +9FA4 9D02 +9FA5 4C3B +9FA6 9641 +9FA7 6980 +9FA8 50A6 +9FA9 7546 +9FAA 2176D +9FAB 99DA +9FAC 5273 +9FAE 9159 +9FAF 9681 +9FB0 915C +9FB2 9151 +9FB3 28E97 +9FB4 637F +9FB5 26D23 +9FB6 6ACA +9FB7 5611 +9FB8 918E +9FB9 757A +9FBA 6285 +9FBB 203FC +9FBC 734F +9FBD 7C70 +9FBE 25C21 +9FBF 23CFD +9FC1 24919 +9FC2 76D6 +9FC3 9B9D +9FC4 4E2A +9FC5 20CD4 +9FC6 83BE +9FC7 8842 +9FC9 5C4A +9FCA 69C0 +9FCC 577A +9FCD 521F +9FCE 5DF5 +9FCF 4ECE +9FD0 6C31 +9FD1 201F2 +9FD2 4F39 +9FD3 549C +9FD4 54DA +9FD5 529A +9FD6 8D82 +9FD7 35FE +9FD9 35F3 +9FDB 6B52 +9FDC 917C +9FDD 9FA5 +9FDE 9B97 +9FDF 982E +9FE0 98B4 +9FE1 9ABA +9FE2 9EA8 +9FE3 9E84 +9FE4 717A +9FE5 7B14 +9FE7 6BFA +9FE8 8818 +9FE9 7F78 +9FEB 5620 +9FEC 2A64A +9FED 8E77 +9FEE 9F53 +9FF0 8DD4 +9FF1 8E4F +9FF2 9E1C +9FF3 8E01 +9FF4 6282 +9FF5 2837D +9FF6 8E28 +9FF7 8E75 +9FF8 7AD3 +9FF9 24A77 +9FFA 7A3E +9FFB 78D8 +9FFC 6CEA +9FFD 8A67 +9FFE 7607 +A040 28A5A +A041 9F26 +A042 6CCE +A043 87D6 +A044 75C3 +A045 2A2B2 +A046 7853 +A047 2F840 +A048 8D0C +A049 72E2 +A04A 7371 +A04B 8B2D +A04C 7302 +A04D 74F1 +A04E 8CEB +A04F 24ABB +A050 862F +A051 5FBA +A052 88A0 +A053 44B7 +A055 2183B +A056 26E05 +A058 8A7E +A059 2251B +A05B 60FD +A05C 7667 +A05D 9AD7 +A05E 9D44 +A05F 936E +A060 9B8F +A061 87F5 +A064 8CF7 +A065 732C +A066 9721 +A067 9BB0 +A068 35D6 +A069 72B2 +A06A 4C07 +A06B 7C51 +A06C 994A +A06D 26159 +A06E 6159 +A06F 4C04 +A070 9E96 +A071 617D +A073 575F +A074 616F +A075 62A6 +A076 6239 +A078 3A5C +A079 61E2 +A07A 53AA +A07B 233F5 +A07C 6364 +A07D 6802 +A07E 35D2 +A0A1 5D57 +A0A2 28BC2 +A0A3 8FDA +A0A4 28E39 +A0A6 50D9 +A0A7 21D46 +A0A8 7906 +A0A9 5332 +A0AA 9638 +A0AB 20F3B +A0AC 4065 +A0AE 77FE +A0B0 7CC2 +A0B1 25F1A +A0B2 7CDA +A0B3 7A2D +A0B4 8066 +A0B5 8063 +A0B6 7D4D +A0B7 7505 +A0B8 74F2 +A0B9 8994 +A0BA 821A +A0BB 670C +A0BC 8062 +A0BD 27486 +A0BE 805B +A0BF 74F0 +A0C0 8103 +A0C1 7724 +A0C2 8989 +A0C3 267CC +A0C4 7553 +A0C5 26ED1 +A0C6 87A9 +A0C7 87CE +A0C8 81C8 +A0C9 878C +A0CA 8A49 +A0CB 8CAD +A0CC 8B43 +A0CD 772B +A0CE 74F8 +A0CF 84DA +A0D0 3635 +A0D1 69B2 +A0D2 8DA6 +A0D4 89A9 +A0D6 6DB9 +A0D7 87C1 +A0D8 24011 +A0D9 74E7 +A0DA 3DDB +A0DB 7176 +A0DC 60A4 +A0DD 619C +A0DE 3CD1 +A0E0 6077 +A0E2 7F71 +A0E3 28B2D +A0E5 60E9 +A0E6 4B7E +A0E7 5220 +A0E8 3C18 +A0E9 23CC7 +A0EA 25ED7 +A0EB 27656 +A0EC 25531 +A0ED 21944 +A0EE 212FE +A0EF 29903 +A0F0 26DDC +A0F1 270AD +A0F2 5CC1 +A0F3 261AD +A0F4 28A0F +A0F5 23677 +A0F6 200EE +A0F7 26846 +A0F8 24F0E +A0F9 4562 +A0FA 5B1F +A0FB 2634C +A0FC 9F50 +A0FD 9EA6 +A0FE 2626B +C6A1 2460 +C6A2 2461 +C6A3 2462 +C6A4 2463 +C6A5 2464 +C6A6 2465 +C6A7 2466 +C6A8 2467 +C6A9 2468 +C6AA 2469 +C6AB 2474 +C6AC 2475 +C6AD 2476 +C6AE 2477 +C6AF 2478 +C6B0 2479 +C6B1 247A +C6B2 247B +C6B3 247C +C6B4 247D +C6B5 2170 +C6B6 2171 +C6B7 2172 +C6B8 2173 +C6B9 2174 +C6BA 2175 +C6BB 2176 +C6BC 2177 +C6BD 2178 +C6BE 2179 +C6BF 4E36 +C6C0 4E3F +C6C1 4E85 +C6C2 4EA0 +C6C3 5182 +C6C4 5196 +C6C5 51AB +C6C6 52F9 +C6C7 5338 +C6C8 5369 +C6C9 53B6 +C6CA 590A +C6CB 5B80 +C6CC 5DDB +C6CD 2F33 +C6CE 5E7F +C6D0 5F50 +C6D1 5F61 +C6D2 6534 +C6D4 7592 +C6D6 8FB5 +C6D8 00A8 +C6D9 02C6 +C6DA 30FD +C6DB 30FE +C6DC 309D +C6DD 309E +C6E0 3005 +C6E1 3006 +C6E2 3007 +C6E3 30FC +C6E4 FF3B +C6E5 FF3D +C6E6 273D +C6E7 3041 +C6E8 3042 +C6E9 3043 +C6EA 3044 +C6EB 3045 +C6EC 3046 +C6ED 3047 +C6EE 3048 +C6EF 3049 +C6F0 304A +C6F1 304B +C6F2 304C +C6F3 304D +C6F4 304E +C6F5 304F +C6F6 3050 +C6F7 3051 +C6F8 3052 +C6F9 3053 +C6FA 3054 +C6FB 3055 +C6FC 3056 +C6FD 3057 +C6FE 3058 +C740 3059 +C741 305A +C742 305B +C743 305C +C744 305D +C745 305E +C746 305F +C747 3060 +C748 3061 +C749 3062 +C74A 3063 +C74B 3064 +C74C 3065 +C74D 3066 +C74E 3067 +C74F 3068 +C750 3069 +C751 306A +C752 306B +C753 306C +C754 306D +C755 306E +C756 306F +C757 3070 +C758 3071 +C759 3072 +C75A 3073 +C75B 3074 +C75C 3075 +C75D 3076 +C75E 3077 +C75F 3078 +C760 3079 +C761 307A +C762 307B +C763 307C +C764 307D +C765 307E +C766 307F +C767 3080 +C768 3081 +C769 3082 +C76A 3083 +C76B 3084 +C76C 3085 +C76D 3086 +C76E 3087 +C76F 3088 +C770 3089 +C771 308A +C772 308B +C773 308C +C774 308D +C775 308E +C776 308F +C777 3090 +C778 3091 +C779 3092 +C77A 3093 +C77B 30A1 +C77C 30A2 +C77D 30A3 +C77E 30A4 +C7A1 30A5 +C7A2 30A6 +C7A3 30A7 +C7A4 30A8 +C7A5 30A9 +C7A6 30AA +C7A7 30AB +C7A8 30AC +C7A9 30AD +C7AA 30AE +C7AB 30AF +C7AC 30B0 +C7AD 30B1 +C7AE 30B2 +C7AF 30B3 +C7B0 30B4 +C7B1 30B5 +C7B2 30B6 +C7B3 30B7 +C7B4 30B8 +C7B5 30B9 +C7B6 30BA +C7B7 30BB +C7B8 30BC +C7B9 30BD +C7BA 30BE +C7BB 30BF +C7BC 30C0 +C7BD 30C1 +C7BE 30C2 +C7BF 30C3 +C7C0 30C4 +C7C1 30C5 +C7C2 30C6 +C7C3 30C7 +C7C4 30C8 +C7C5 30C9 +C7C6 30CA +C7C7 30CB +C7C8 30CC +C7C9 30CD +C7CA 30CE +C7CB 30CF +C7CC 30D0 +C7CD 30D1 +C7CE 30D2 +C7CF 30D3 +C7D0 30D4 +C7D1 30D5 +C7D2 30D6 +C7D3 30D7 +C7D4 30D8 +C7D5 30D9 +C7D6 30DA +C7D7 30DB +C7D8 30DC +C7D9 30DD +C7DA 30DE +C7DB 30DF +C7DC 30E0 +C7DD 30E1 +C7DE 30E2 +C7DF 30E3 +C7E0 30E4 +C7E1 30E5 +C7E2 30E6 +C7E3 30E7 +C7E4 30E8 +C7E5 30E9 +C7E6 30EA +C7E7 30EB +C7E8 30EC +C7E9 30ED +C7EA 30EE +C7EB 30EF +C7EC 30F0 +C7ED 30F1 +C7EE 30F2 +C7EF 30F3 +C7F0 30F4 +C7F1 30F5 +C7F2 30F6 +C7F3 0410 +C7F4 0411 +C7F5 0412 +C7F6 0413 +C7F7 0414 +C7F8 0415 +C7F9 0401 +C7FA 0416 +C7FB 0417 +C7FC 0418 +C7FD 0419 +C7FE 041A +C840 041B +C841 041C +C842 041D +C843 041E +C844 041F +C845 0420 +C846 0421 +C847 0422 +C848 0423 +C849 0424 +C84A 0425 +C84B 0426 +C84C 0427 +C84D 0428 +C84E 0429 +C84F 042A +C850 042B +C851 042C +C852 042D +C853 042E +C854 042F +C855 0430 +C856 0431 +C857 0432 +C858 0433 +C859 0434 +C85A 0435 +C85B 0451 +C85C 0436 +C85D 0437 +C85E 0438 +C85F 0439 +C860 043A +C861 043B +C862 043C +C863 043D +C864 043E +C865 043F +C866 0440 +C867 0441 +C868 0442 +C869 0443 +C86A 0444 +C86B 0445 +C86C 0446 +C86D 0447 +C86E 0448 +C86F 0449 +C870 044A +C871 044B +C872 044C +C873 044D +C874 044E +C875 044F +C876 21E7 +C877 21B8 +C878 21B9 +C879 31CF +C87A 200CC +C87B 4E5A +C87C 2008A +C87D 5202 +C87E 4491 +C8A1 9FB0 +C8A2 5188 +C8A3 9FB1 +C8A4 27607 +C8CD FFE2 +C8CE FFE4 +C8CF FF07 +C8D0 FF02 +C8D1 3231 +C8D2 2116 +C8D3 2121 +C8D4 309B +C8D5 309C +C8D6 2E80 +C8D7 2E84 +C8D8 2E86 +C8D9 2E87 +C8DA 2E88 +C8DB 2E8A +C8DC 2E8C +C8DD 2E8D +C8DE 2E95 +C8DF 2E9C +C8E0 2E9D +C8E1 2EA5 +C8E2 2EA7 +C8E3 2EAA +C8E4 2EAC +C8E5 2EAE +C8E6 2EB6 +C8E7 2EBC +C8E8 2EBE +C8E9 2EC6 +C8EA 2ECA +C8EB 2ECC +C8EC 2ECD +C8ED 2ECF +C8EE 2ED6 +C8EF 2ED7 +C8F0 2EDE +C8F1 2EE3 +C8F5 0283 +C8F6 0250 +C8F7 025B +C8F8 0254 +C8F9 0275 +C8FA 0153 +C8FB 00F8 +C8FC 014B +C8FD 028A +C8FE 026A +F9D6 7881 +F9D7 92B9 +F9D8 88CF +F9D9 58BB +F9DA 6052 +F9DB 7CA7 +F9DC 5AFA +F9DD 2554 +F9DE 2566 +F9DF 2557 +F9E0 2560 +F9E1 256C +F9E2 2563 +F9E3 255A +F9E4 2569 +F9E5 255D +F9E6 2552 +F9E7 2564 +F9E8 2555 +F9E9 255E +F9EA 256A +F9EB 2561 +F9EC 2558 +F9ED 2567 +F9EE 255B +F9EF 2553 +F9F0 2565 +F9F1 2556 +F9F2 255F +F9F3 256B +F9F4 2562 +F9F5 2559 +F9F6 2568 +F9F7 255C +F9F8 2551 +F9F9 2550 +F9FA 256D +F9FB 256E +F9FC 2570 +F9FD 256F +F9FE FFED +FA40 20547 +FA41 92DB +FA42 205DF +FA43 23FC5 +FA44 854C +FA45 42B5 +FA46 73EF +FA47 51B5 +FA48 3649 +FA49 24942 +FA4A 289E4 +FA4B 9344 +FA4C 219DB +FA4D 82EE +FA4E 23CC8 +FA4F 783C +FA50 6744 +FA51 62DF +FA52 24933 +FA53 289AA +FA54 202A0 +FA55 26BB3 +FA56 21305 +FA57 4FAB +FA58 224ED +FA59 5008 +FA5A 26D29 +FA5B 27A84 +FA5C 23600 +FA5D 24AB1 +FA5E 22513 +FA60 2037E +FA61 5FA4 +FA62 20380 +FA63 20347 +FA64 6EDB +FA65 2041F +FA67 5101 +FA68 347A +FA69 510E +FA6A 986C +FA6B 3743 +FA6C 8416 +FA6D 249A4 +FA6E 20487 +FA6F 5160 +FA70 233B4 +FA71 516A +FA72 20BFF +FA73 220FC +FA74 202E5 +FA75 22530 +FA76 2058E +FA77 23233 +FA78 21983 +FA79 5B82 +FA7A 877D +FA7B 205B3 +FA7C 23C99 +FA7D 51B2 +FA7E 51B8 +FAA1 9D34 +FAA2 51C9 +FAA3 51CF +FAA4 51D1 +FAA5 3CDC +FAA6 51D3 +FAA7 24AA6 +FAA8 51B3 +FAA9 51E2 +FAAA 5342 +FAAB 51ED +FAAC 83CD +FAAD 693E +FAAE 2372D +FAAF 5F7B +FAB0 520B +FAB1 5226 +FAB2 523C +FAB3 52B5 +FAB4 5257 +FAB5 5294 +FAB6 52B9 +FAB7 52C5 +FAB8 7C15 +FAB9 8542 +FABA 52E0 +FABB 860D +FABC 26B13 +FABE 28ADE +FABF 5549 +FAC0 6ED9 +FAC1 23F80 +FAC2 20954 +FAC3 23FEC +FAC4 5333 +FAC6 20BE2 +FAC7 6CCB +FAC8 21726 +FAC9 681B +FACA 73D5 +FACB 604A +FACC 3EAA +FACD 38CC +FACE 216E8 +FACF 71DD +FAD0 44A2 +FAD1 536D +FAD2 5374 +FAD3 286AB +FAD4 537E +FAD6 21596 +FAD7 21613 +FAD8 77E6 +FAD9 5393 +FADA 28A9B +FADB 53A0 +FADC 53AB +FADD 53AE +FADE 73A7 +FADF 25772 +FAE0 3F59 +FAE1 739C +FAE2 53C1 +FAE3 53C5 +FAE4 6C49 +FAE5 4E49 +FAE6 57FE +FAE7 53D9 +FAE8 3AAB +FAE9 20B8F +FAEA 53E0 +FAEB 23FEB +FAEC 22DA3 +FAED 53F6 +FAEE 20C77 +FAEF 5413 +FAF0 7079 +FAF1 552B +FAF2 6657 +FAF3 6D5B +FAF4 546D +FAF5 26B53 +FAF6 20D74 +FAF7 555D +FAF8 548F +FAF9 54A4 +FAFA 47A6 +FAFB 2170D +FAFC 20EDD +FAFD 3DB4 +FAFE 20D4D +FB40 289BC +FB41 22698 +FB42 5547 +FB43 4CED +FB44 542F +FB45 7417 +FB46 5586 +FB47 55A9 +FB49 218D7 +FB4A 2403A +FB4B 4552 +FB4C 24435 +FB4D 66B3 +FB4E 210B4 +FB4F 5637 +FB50 66CD +FB51 2328A +FB52 66A4 +FB53 66AD +FB54 564D +FB55 564F +FB56 78F1 +FB57 56F1 +FB58 9787 +FB59 53FE +FB5A 5700 +FB5B 56EF +FB5C 56ED +FB5D 28B66 +FB5E 3623 +FB5F 2124F +FB60 5746 +FB61 241A5 +FB62 6C6E +FB63 708B +FB64 5742 +FB65 36B1 +FB66 26C7E +FB67 57E6 +FB68 21416 +FB69 5803 +FB6A 21454 +FB6B 24363 +FB6C 5826 +FB6D 24BF5 +FB6E 585C +FB6F 58AA +FB70 3561 +FB71 58E0 +FB72 58DC +FB73 2123C +FB74 58FB +FB75 5BFF +FB76 5743 +FB77 2A150 +FB78 24278 +FB79 93D3 +FB7A 35A1 +FB7B 591F +FB7C 68A6 +FB7D 36C3 +FB7E 6E59 +FBA1 2163E +FBA2 5A24 +FBA3 5553 +FBA4 21692 +FBA5 8505 +FBA6 59C9 +FBA7 20D4E +FBA8 26C81 +FBA9 26D2A +FBAA 217DC +FBAB 59D9 +FBAC 217FB +FBAD 217B2 +FBAE 26DA6 +FBAF 6D71 +FBB0 21828 +FBB1 216D5 +FBB2 59F9 +FBB3 26E45 +FBB4 5AAB +FBB5 5A63 +FBB6 36E6 +FBB7 249A9 +FBB9 3708 +FBBA 5A96 +FBBB 7465 +FBBC 5AD3 +FBBD 26FA1 +FBBE 22554 +FBBF 3D85 +FBC0 21911 +FBC1 3732 +FBC2 216B8 +FBC3 5E83 +FBC4 52D0 +FBC5 5B76 +FBC6 6588 +FBC7 5B7C +FBC8 27A0E +FBC9 4004 +FBCA 485D +FBCB 20204 +FBCC 5BD5 +FBCD 6160 +FBCE 21A34 +FBCF 259CC +FBD0 205A5 +FBD1 5BF3 +FBD2 5B9D +FBD3 4D10 +FBD4 5C05 +FBD5 21B44 +FBD6 5C13 +FBD7 73CE +FBD8 5C14 +FBD9 21CA5 +FBDA 26B28 +FBDB 5C49 +FBDC 48DD +FBDD 5C85 +FBDE 5CE9 +FBDF 5CEF +FBE0 5D8B +FBE1 21DF9 +FBE2 21E37 +FBE3 5D10 +FBE4 5D18 +FBE5 5D46 +FBE6 21EA4 +FBE7 5CBA +FBE8 5DD7 +FBE9 82FC +FBEA 382D +FBEB 24901 +FBEC 22049 +FBED 22173 +FBEE 8287 +FBEF 3836 +FBF0 3BC2 +FBF1 5E2E +FBF2 6A8A +FBF4 5E7A +FBF5 244BC +FBF6 20CD3 +FBF7 53A6 +FBF8 4EB7 +FBFA 53A8 +FBFB 21771 +FBFC 5E09 +FBFD 5EF4 +FBFE 28482 +FC40 5EF9 +FC41 5EFB +FC42 38A0 +FC43 5EFC +FC44 683E +FC45 941B +FC46 5F0D +FC47 201C1 +FC48 2F894 +FC49 3ADE +FC4A 48AE +FC4B 2133A +FC4C 5F3A +FC4D 26888 +FC4E 223D0 +FC50 22471 +FC51 5F63 +FC52 97BD +FC53 26E6E +FC54 5F72 +FC55 9340 +FC56 28A36 +FC57 5FA7 +FC58 5DB6 +FC59 3D5F +FC5A 25250 +FC5B 21F6A +FC5C 270F8 +FC5D 22668 +FC5E 91D6 +FC5F 2029E +FC60 28A29 +FC61 6031 +FC62 6685 +FC63 21877 +FC64 3963 +FC65 3DC7 +FC66 3639 +FC67 5790 +FC68 227B4 +FC69 7971 +FC6A 3E40 +FC6B 609E +FC6D 60B3 +FC6E 24982 +FC6F 2498F +FC70 27A53 +FC71 74A4 +FC72 50E1 +FC73 5AA0 +FC74 6164 +FC75 8424 +FC76 6142 +FC77 2F8A6 +FC78 26ED2 +FC79 6181 +FC7A 51F4 +FC7B 20656 +FC7C 6187 +FC7D 5BAA +FC7E 23FB7 +FCA1 2285F +FCA2 61D3 +FCA3 28B9D +FCA4 2995D +FCA5 61D0 +FCA6 3932 +FCA7 22980 +FCA8 228C1 +FCA9 6023 +FCAA 615C +FCAB 651E +FCAC 638B +FCAD 20118 +FCAE 62C5 +FCAF 21770 +FCB0 62D5 +FCB1 22E0D +FCB2 636C +FCB3 249DF +FCB4 3A17 +FCB5 6438 +FCB6 63F8 +FCB7 2138E +FCB8 217FC +FCBA 6F8A +FCBB 22E36 +FCBC 9814 +FCBD 2408C +FCBE 2571D +FCBF 64E1 +FCC0 64E5 +FCC1 947B +FCC2 3A66 +FCC3 643A +FCC4 3A57 +FCC5 654D +FCC6 6F16 +FCC7 24A28 +FCC8 24A23 +FCC9 6585 +FCCA 656D +FCCB 655F +FCCC 2307E +FCCD 65B5 +FCCE 24940 +FCCF 4B37 +FCD0 65D1 +FCD1 40D8 +FCD2 21829 +FCD3 65E0 +FCD4 65E3 +FCD5 5FDF +FCD6 23400 +FCD7 6618 +FCD8 231F7 +FCD9 231F8 +FCDA 6644 +FCDB 231A4 +FCDC 231A5 +FCDD 664B +FCDE 20E75 +FCDF 6667 +FCE0 251E6 +FCE1 6673 +FCE3 21E3D +FCE4 23231 +FCE5 285F4 +FCE6 231C8 +FCE7 25313 +FCE8 77C5 +FCE9 228F7 +FCEA 99A4 +FCEB 6702 +FCEC 2439C +FCED 24A21 +FCEE 3B2B +FCEF 69FA +FCF0 237C2 +FCF2 6767 +FCF3 6762 +FCF4 241CD +FCF5 290ED +FCF6 67D7 +FCF7 44E9 +FCF8 6822 +FCF9 6E50 +FCFA 923C +FCFB 6801 +FCFC 233E6 +FCFD 26DA0 +FCFE 685D +FD40 2346F +FD41 69E1 +FD42 6A0B +FD43 28ADF +FD44 6973 +FD45 68C3 +FD46 235CD +FD47 6901 +FD48 6900 +FD49 3D32 +FD4A 3A01 +FD4B 2363C +FD4C 3B80 +FD4D 67AC +FD4E 6961 +FD4F 28A4A +FD50 42FC +FD51 6936 +FD52 6998 +FD53 3BA1 +FD54 203C9 +FD55 8363 +FD56 5090 +FD57 69F9 +FD58 23659 +FD59 2212A +FD5A 6A45 +FD5B 23703 +FD5C 6A9D +FD5D 3BF3 +FD5E 67B1 +FD5F 6AC8 +FD60 2919C +FD61 3C0D +FD62 6B1D +FD63 20923 +FD64 60DE +FD65 6B35 +FD66 6B74 +FD67 227CD +FD68 6EB5 +FD69 23ADB +FD6A 203B5 +FD6B 21958 +FD6C 3740 +FD6D 5421 +FD6E 23B5A +FD6F 6BE1 +FD70 23EFC +FD71 6BDC +FD72 6C37 +FD73 2248B +FD74 248F1 +FD75 26B51 +FD76 6C5A +FD77 8226 +FD78 6C79 +FD79 23DBC +FD7A 44C5 +FD7B 23DBD +FD7C 241A4 +FD7D 2490C +FD7E 24900 +FDA1 23CC9 +FDA2 36E5 +FDA3 3CEB +FDA4 20D32 +FDA5 9B83 +FDA6 231F9 +FDA7 22491 +FDA8 7F8F +FDA9 6837 +FDAA 26D25 +FDAB 26DA1 +FDAC 26DEB +FDAD 6D96 +FDAE 6D5C +FDAF 6E7C +FDB0 6F04 +FDB1 2497F +FDB2 24085 +FDB3 26E72 +FDB4 8533 +FDB5 26F74 +FDB6 51C7 +FDB9 842E +FDBA 28B21 +FDBC 23E2F +FDBD 7453 +FDBE 23F82 +FDBF 79CC +FDC0 6E4F +FDC1 5A91 +FDC2 2304B +FDC3 6FF8 +FDC4 370D +FDC5 6F9D +FDC6 23E30 +FDC7 6EFA +FDC8 21497 +FDC9 2403D +FDCA 4555 +FDCB 93F0 +FDCC 6F44 +FDCD 6F5C +FDCE 3D4E +FDCF 6F74 +FDD0 29170 +FDD1 3D3B +FDD2 6F9F +FDD3 24144 +FDD4 6FD3 +FDD5 24091 +FDD6 24155 +FDD7 24039 +FDD8 23FF0 +FDD9 23FB4 +FDDA 2413F +FDDB 51DF +FDDC 24156 +FDDD 24157 +FDDE 24140 +FDDF 261DD +FDE0 704B +FDE1 707E +FDE2 70A7 +FDE3 7081 +FDE4 70CC +FDE5 70D5 +FDE6 70D6 +FDE7 70DF +FDE8 4104 +FDE9 3DE8 +FDEA 71B4 +FDEB 7196 +FDEC 24277 +FDED 712B +FDEE 7145 +FDEF 5A88 +FDF0 714A +FDF2 5C9C +FDF3 24365 +FDF4 714F +FDF5 9362 +FDF6 242C1 +FDF7 712C +FDF8 2445A +FDF9 24A27 +FDFA 24A22 +FDFB 71BA +FDFC 28BE8 +FDFD 70BD +FDFE 720E +FE40 9442 +FE41 7215 +FE42 5911 +FE43 9443 +FE44 7224 +FE45 9341 +FE46 25605 +FE47 722E +FE48 7240 +FE49 24974 +FE4A 68BD +FE4B 7255 +FE4C 7257 +FE4D 3E55 +FE4E 23044 +FE4F 680D +FE50 6F3D +FE51 7282 +FE53 732B +FE54 24823 +FE55 2882B +FE56 48ED +FE57 28804 +FE58 7328 +FE59 732E +FE5A 73CF +FE5B 73AA +FE5C 20C3A +FE5D 26A2E +FE5E 73C9 +FE5F 7449 +FE60 241E2 +FE61 216E7 +FE62 24A24 +FE63 6623 +FE64 36C5 +FE65 249B7 +FE66 2498D +FE67 249FB +FE68 73F7 +FE69 7415 +FE6A 6903 +FE6B 24A26 +FE6C 7439 +FE6D 205C3 +FE6E 3ED7 +FE70 228AD +FE71 7460 +FE72 28EB2 +FE73 7447 +FE74 73E4 +FE75 7476 +FE76 83B9 +FE77 746C +FE78 3730 +FE79 7474 +FE7A 93F1 +FE7B 6A2C +FE7C 7482 +FE7D 4953 +FE7E 24A8C +FEA1 2415F +FEA2 24A79 +FEA3 28B8F +FEA4 5B46 +FEA5 28C03 +FEA6 2189E +FEA7 74C8 +FEA8 21988 +FEA9 750E +FEAB 751E +FEAC 28ED9 +FEAD 21A4B +FEAE 5BD7 +FEAF 28EAC +FEB0 9385 +FEB1 754D +FEB2 754A +FEB3 7567 +FEB4 756E +FEB5 24F82 +FEB6 3F04 +FEB7 24D13 +FEB8 758E +FEB9 745D +FEBA 759E +FEBB 75B4 +FEBC 7602 +FEBD 762C +FEBE 7651 +FEBF 764F +FEC0 766F +FEC1 7676 +FEC2 263F5 +FEC3 7690 +FEC4 81EF +FEC5 37F8 +FEC6 26911 +FEC7 2690E +FEC8 76A1 +FEC9 76A5 +FECA 76B7 +FECB 76CC +FECC 26F9F +FECD 8462 +FECE 2509D +FECF 2517D +FED0 21E1C +FED1 771E +FED2 7726 +FED3 7740 +FED4 64AF +FED5 25220 +FED6 7758 +FED7 232AC +FED8 77AF +FED9 28964 +FEDA 28968 +FEDB 216C1 +FEDC 77F4 +FEDE 21376 +FEDF 24A12 +FEE0 68CA +FEE1 78AF +FEE2 78C7 +FEE3 78D3 +FEE4 96A5 +FEE5 792E +FEE6 255E0 +FEE7 78D7 +FEE8 7934 +FEE9 78B1 +FEEA 2760C +FEEB 8FB8 +FEEC 8884 +FEED 28B2B +FEEE 26083 +FEEF 2261C +FEF0 7986 +FEF1 8900 +FEF2 6902 +FEF3 7980 +FEF4 25857 +FEF5 799D +FEF6 27B39 +FEF7 793C +FEF8 79A9 +FEF9 6E2A +FEFA 27126 +FEFB 3EA8 +FEFC 79C6 +FEFD 2910D +FEFE 79D4 diff --git a/test/jdk/sun/nio/cs/TestCharsetMapping.java b/test/jdk/sun/nio/cs/TestCharsetMapping.java index c7bd101aa42..f6d6e6abcbd 100644 --- a/test/jdk/sun/nio/cs/TestCharsetMapping.java +++ b/test/jdk/sun/nio/cs/TestCharsetMapping.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 8186801 8186751 + * @bug 8186801 8186751 8310631 * @summary Test the charset mappings * @modules jdk.charsets */ @@ -569,11 +569,9 @@ private static Set charsets(Path cslist) throws IOException { public static void main(String args[]) throws Exception { Path dir = Paths.get(System.getProperty("test.src", ".") + - "/../../../../src/java.base/share/data/charsetmapping"); + "/../../../../../make/data/charsetmapping").normalize(); if (!Files.exists(dir)) { - // not inside jdk repo, no mappings, exit silently - log.println("Nothing done, not in a jdk repo: "); - return; + throw new Exception("charsetmapping files cannot be located in " + dir); } if (args.length > 0 && "-v".equals(args[0])) { // For debugging: java CoderTest [-v] @@ -608,7 +606,8 @@ public static void main(String args[]) throws Exception { + " vs " + cs.name() + "]"); } // test aliases() - if (!cs.aliases().equals(csinfo.aliases)) { + if (!cs.aliases().equals(csinfo.aliases) + && !csname.equals("GB18030")) { // no alias in "charsets" file errors++; log.printf(" [error wrong aliases]"); if (verbose) { @@ -625,6 +624,19 @@ public static void main(String args[]) throws Exception { } if (!csinfo.loadMappings(dir)) { + // Ignore these cs, as mapping files are not provided + if (csinfo.csName.equals("x-IBM942C") || + csinfo.csName.equals("x-IBM943C") || + csinfo.csName.equals("x-IBM834") || + csinfo.csName.equals("x-IBM949C") || + csinfo.csName.equals("x-IBM964") || + csinfo.csName.equals("x-IBM29626C")) + { + log.println(" [**** skipped, mapping file is not provided]"); + known++; + continue; + } + log.println(" [error loading mappings failed]"); errors++; continue; From f57f2cbaa08e53a81a803bde982d912feea15515 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 16 Jan 2024 16:06:21 +0000 Subject: [PATCH 142/261] 8321164: javac with annotation processor throws AssertionError: Filling jrt:/... during JarFileObject[/...] Backport-of: 03c4595173d564df97aa4f2b3156adcd4be379fa --- .../com/sun/tools/javac/code/Types.java | 26 ++-- .../ReadingMethodWithTypeAnno.java | 118 ++++++++++++++++++ 2 files changed, 134 insertions(+), 10 deletions(-) create mode 100644 test/langtools/tools/javac/annotations/ReadingMethodWithTypeAnno.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java index f584ac2fd40..c9e4eafa08a 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java @@ -2398,20 +2398,26 @@ private Type erasure(Type t, boolean recurse) { } // where private TypeMapping erasure = new StructuralTypeMapping() { + @SuppressWarnings("fallthrough") private Type combineMetadata(final Type s, final Type t) { if (t.getMetadata().nonEmpty()) { - switch (s.getKind()) { - case OTHER: - case UNION: - case INTERSECTION: - case PACKAGE: - case EXECUTABLE: - case NONE: - case VOID: - case ERROR: + switch (s.getTag()) { + case CLASS: + if (s instanceof UnionClassType || + s instanceof IntersectionClassType) { + return s; + } + //fall-through + case BYTE, CHAR, SHORT, LONG, FLOAT, INT, DOUBLE, BOOLEAN, + ARRAY, MODULE, TYPEVAR, WILDCARD, BOT: + return s.dropMetadata(Annotations.class); + case VOID, METHOD, PACKAGE, FORALL, DEFERRED, + NONE, ERROR, UNKNOWN, UNDETVAR, UNINITIALIZED_THIS, + UNINITIALIZED_OBJECT: return s; - default: return s.dropMetadata(Annotations.class); + default: + throw new AssertionError(s.getTag().name()); } } else { return s; diff --git a/test/langtools/tools/javac/annotations/ReadingMethodWithTypeAnno.java b/test/langtools/tools/javac/annotations/ReadingMethodWithTypeAnno.java new file mode 100644 index 00000000000..d7436156554 --- /dev/null +++ b/test/langtools/tools/javac/annotations/ReadingMethodWithTypeAnno.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8321164 + * @summary Indirectly verify that types.erasure does not complete, called from + * ClassReader.isSameBinaryType, which must not complete. + * @library /tools/lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * @build toolbox.JavacTask toolbox.TestRunner toolbox.ToolBox + * @run main ReadingMethodWithTypeAnno + */ + +import com.sun.source.util.TaskEvent; +import com.sun.source.util.TaskListener; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import toolbox.JavacTask; +import toolbox.Task.Expect; +import toolbox.Task.OutputKind; +import toolbox.TestRunner; +import toolbox.ToolBox; + +public class ReadingMethodWithTypeAnno extends TestRunner { + public static void main(String... args) throws Exception { + ReadingMethodWithTypeAnno r = new ReadingMethodWithTypeAnno(); + r.runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + private final ToolBox tb = new ToolBox(); + + public ReadingMethodWithTypeAnno() throws IOException { + super(System.err); + } + + @Test + public void test_DeclNone_UseNone(Path base) throws IOException { + Path libSrc = base.resolve("lib-src"); + Path libClasses = Files.createDirectories(base.resolve("lib-classes")); + + tb.writeJavaFiles(libSrc, + """ + public class Lib { + public void test(java.lang.@Ann String s) { + new Object() {}; + } + } + """, + """ + import java.lang.annotation.ElementType; + import java.lang.annotation.Target; + @Target(ElementType.TYPE_USE) + public @interface Ann {} + """); + + new JavacTask(tb) + .outdir(libClasses) + .files(tb.findJavaFiles(libSrc)) + .run(Expect.SUCCESS) + .writeAll() + .getOutput(OutputKind.DIRECT); + + Path src = base.resolve("src"); + Path classes = Files.createDirectories(base.resolve("classes")); + + tb.writeJavaFiles(src, + """ + public class Test { + } + """); + + new JavacTask(tb) + .outdir(classes) + .classpath(libClasses) + .files(tb.findJavaFiles(src)) + .callback(task -> { + task.addTaskListener(new TaskListener() { + @Override + public void finished(TaskEvent e) { + if (e.getKind() == TaskEvent.Kind.ENTER) { + task.getElements().getTypeElement("Lib"); + task.getElements().getTypeElement("Lib$1"); + } + } + }); + }) + .run(Expect.SUCCESS) + .writeAll() + .getOutput(OutputKind.DIRECT); + } + +} + From 9b5cd9dc43d3aa34ead39f7ac29c2f8e03ea6109 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Wed, 17 Jan 2024 08:01:56 +0000 Subject: [PATCH 143/261] 8315594: Open source few headless Swing misc tests Backport-of: 806ef0897b42c8f3cb3b4d7bd904af9ed18a543e --- .../text/html/HTMLEditorKit/bug4267840.java | 61 +++++++++++++ .../text/html/StyleSheet/bug4218254.java | 53 +++++++++++ .../text/html/StyleSheet/bug4243463.java | 54 ++++++++++++ .../DefaultTreeSelectionModel/bug4485322.java | 88 +++++++++++++++++++ 4 files changed, 256 insertions(+) create mode 100644 test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java create mode 100644 test/jdk/javax/swing/text/html/StyleSheet/bug4218254.java create mode 100644 test/jdk/javax/swing/text/html/StyleSheet/bug4243463.java create mode 100644 test/jdk/javax/swing/tree/DefaultTreeSelectionModel/bug4485322.java diff --git a/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java b/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java new file mode 100644 index 00000000000..30d3645b305 --- /dev/null +++ b/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 4267840 + @summary Tests how HTMLEditorKit.write() works on small documents + @run main bug4267840 +*/ + +import javax.swing.JTextPane; +import javax.swing.text.EditorKit; +import javax.swing.SwingUtilities; +import java.io.File; +import java.io.FileOutputStream; + +public class bug4267840 { + public static void main(String[] args) throws Exception { + SwingUtilities.invokeAndWait(() -> { + final JTextPane textpane = new JTextPane(); + textpane.setContentType("text/html"); + final EditorKit kit = textpane.getEditorKit(); + + textpane.setText("A word"); + File file = new File("bug4267840.out"); + try { + FileOutputStream out = new FileOutputStream(file); + kit.write(out, textpane.getDocument(), 0, + textpane.getDocument().getLength()); + out.close(); + } catch (Exception e) {} + try { + if (file.length() < 6) { // simply can't be + throw new RuntimeException("Failed: " + + " HTMLEditorKit.write() is broken"); + } + } finally { + file.delete(); + } + }); + } +} diff --git a/test/jdk/javax/swing/text/html/StyleSheet/bug4218254.java b/test/jdk/javax/swing/text/html/StyleSheet/bug4218254.java new file mode 100644 index 00000000000..128fd075bf1 --- /dev/null +++ b/test/jdk/javax/swing/text/html/StyleSheet/bug4218254.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 4218254 + @summary Serialization Bug on StyleSheet. + @run main bug4218254 +*/ + +import javax.swing.text.html.StyleSheet; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + + +public class bug4218254 { + + public static void main(String[] args) throws Exception { + StyleSheet ssw = new StyleSheet(); + StyleSheet ssr = null; + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(ssw); + byte[] buf = baos.toByteArray(); + oos.close(); + ByteArrayInputStream bais = new ByteArrayInputStream(buf); + ObjectInputStream ois = new ObjectInputStream(bais); + ssr = (StyleSheet)ois.readObject(); + ois.close(); + } +} diff --git a/test/jdk/javax/swing/text/html/StyleSheet/bug4243463.java b/test/jdk/javax/swing/text/html/StyleSheet/bug4243463.java new file mode 100644 index 00000000000..a84c4b49bd3 --- /dev/null +++ b/test/jdk/javax/swing/text/html/StyleSheet/bug4243463.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 4243463 + @summary Tests that StyleSheet has following methods: + public void addStyleSheet(StyleSheet ss); + public void removeStyleSheet(StyleSheet ss); + public Enumeration getStyleSheets() + @run main bug4243463 +*/ + +import javax.swing.text.html.StyleSheet; + +public class bug4243463 { + + public static void main(String[] argv) throws Exception { + StyleSheet main = new StyleSheet(); + StyleSheet ss = new StyleSheet(); + ss.addRule("p {color:red;}"); + + main.addStyleSheet(ss); + StyleSheet[] sheets = main.getStyleSheets(); + if (sheets.length != 1 || sheets[0] != ss) { + throw new RuntimeException("getStyleSheets failed"); + } + + main.removeStyleSheet(ss); + sheets = main.getStyleSheets(); + if (sheets != null) { + throw new RuntimeException("StyleSheet is not removed"); + } + } +} diff --git a/test/jdk/javax/swing/tree/DefaultTreeSelectionModel/bug4485322.java b/test/jdk/javax/swing/tree/DefaultTreeSelectionModel/bug4485322.java new file mode 100644 index 00000000000..47ff2a1cb16 --- /dev/null +++ b/test/jdk/javax/swing/tree/DefaultTreeSelectionModel/bug4485322.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 4485322 + @summary DefaultTreeSelectionModel.insureRowContinuity is broken for CONTIGUOUS_TREE_SELECTION + @run main bug4485322 +*/ + +import javax.swing.SwingUtilities; +import javax.swing.tree.DefaultTreeSelectionModel; +import javax.swing.tree.TreeSelectionModel; +import javax.swing.tree.RowMapper; +import javax.swing.tree.TreePath; + +import java.util.Arrays; + +public class bug4485322 { + + Object obj1[] = {"9", "2", "5", "3", "1"}; + Object obj2[] = {"1", "2", "3"}; + + public void init() { + DummyDefaultTreeSelectionModel model = new DummyDefaultTreeSelectionModel(); + + TreePath sPaths[] = new TreePath[obj1.length]; + for (int i=0; i b.init()); + } +} From 0ac1bb75a0d97e88fbdae85d85e9658cf549c3fe Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 17 Jan 2024 08:34:31 +0000 Subject: [PATCH 144/261] 8317804: com/sun/jdi/JdwpAllowTest.java fails on Alpine 3.17 / 3.18 Backport-of: b530c0281b5082994065b10addeb8366ffa58e2f --- .../share/native/libdt_socket/socketTransport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c index 4e49488da77..fe22820f315 100644 --- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c +++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -755,7 +755,7 @@ socketTransport_startListening(jdwpTransportEnv* env, const char* address, if (isEqualIPv6Addr(listenAddr, mappedAny)) { for (ai = addrInfo; ai != NULL; ai = ai->ai_next) { - if (isEqualIPv6Addr(listenAddr, in6addr_any)) { + if (isEqualIPv6Addr(ai, in6addr_any)) { listenAddr = ai; break; } From b4c163d07b2db96ce91a0f712ced60ace14dbf63 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 17 Jan 2024 15:18:32 +0000 Subject: [PATCH 145/261] 8319372: C2 compilation fails with "Bad immediate dominator info" Backport-of: 7766785098816cfcdae3479540cdc866c1ed18ad --- src/hotspot/share/opto/castnode.cpp | 73 ------------------- .../c2/TestTopCastIIOnUndetectedDeadPath.java | 58 +++++++++++++++ .../TestTopCastIIOnUndetectedDeadPath2.java | 55 ++++++++++++++ .../TestTopCastIIOnUndetectedDeadPath3.java | 58 +++++++++++++++ 4 files changed, 171 insertions(+), 73 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath.java create mode 100644 test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath2.java create mode 100644 test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath3.java diff --git a/src/hotspot/share/opto/castnode.cpp b/src/hotspot/share/opto/castnode.cpp index 30763f47f8d..8a26d514b68 100644 --- a/src/hotspot/share/opto/castnode.cpp +++ b/src/hotspot/share/opto/castnode.cpp @@ -262,79 +262,6 @@ const Type* CastIINode::Value(PhaseGVN* phase) const { res = widen_type(phase, res, T_INT); } - // Try to improve the type of the CastII if we recognize a CmpI/If pattern. - // - // in1 in2 - // | | - // +--- | --+ - // | | | - // CmpINode | - // | | - // BoolNode | - // | | - // IfNode | - // | | - // IfProj | - // | | - // CastIINode - // - if (carry_dependency()) { - if (in(0) != nullptr && in(0)->in(0) != nullptr && in(0)->in(0)->is_If()) { - assert(in(0)->is_IfFalse() || in(0)->is_IfTrue(), "should be If proj"); - Node* proj = in(0); - if (proj->in(0)->in(1)->is_Bool()) { - Node* b = proj->in(0)->in(1); - if (b->in(1)->Opcode() == Op_CmpI) { - Node* cmp = b->in(1); - if (cmp->in(1) == in(1) && phase->type(cmp->in(2))->isa_int()) { - const TypeInt* in2_t = phase->type(cmp->in(2))->is_int(); - const Type* t = TypeInt::INT; - BoolTest test = b->as_Bool()->_test; - if (proj->is_IfFalse()) { - test = test.negate(); - } - BoolTest::mask m = test._test; - jlong lo_long = min_jint; - jlong hi_long = max_jint; - if (m == BoolTest::le || m == BoolTest::lt) { - hi_long = in2_t->_hi; - if (m == BoolTest::lt) { - hi_long -= 1; - } - } else if (m == BoolTest::ge || m == BoolTest::gt) { - lo_long = in2_t->_lo; - if (m == BoolTest::gt) { - lo_long += 1; - } - } else if (m == BoolTest::eq) { - lo_long = in2_t->_lo; - hi_long = in2_t->_hi; - } else if (m == BoolTest::ne) { - // can't do any better - } else { - stringStream ss; - test.dump_on(&ss); - fatal("unexpected comparison %s", ss.freeze()); - } - int lo_int = (int)lo_long; - int hi_int = (int)hi_long; - - if (lo_long != (jlong)lo_int) { - lo_int = min_jint; - } - if (hi_long != (jlong)hi_int) { - hi_int = max_jint; - } - - t = TypeInt::make(lo_int, hi_int, Type::WidenMax); - - res = res->filter_speculative(t); - return res; - } - } - } - } - } return res; } diff --git a/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath.java b/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath.java new file mode 100644 index 00000000000..1b95e13d4f7 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8319372 + * @summary CastII because of condition guarding it becomes top + * @requires vm.compiler2.enabled + * @run main/othervm -Xcomp -XX:CompileOnly=TestTopCastIIOnUndetectedDeadPath::test -XX:CompileCommand=quiet -XX:-TieredCompilation + * -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=426264791 -XX:+StressIGVN TestTopCastIIOnUndetectedDeadPath + * @run main/othervm -Xcomp -XX:CompileOnly=TestTopCastIIOnUndetectedDeadPath::test -XX:CompileCommand=quiet -XX:-TieredCompilation + * -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN TestTopCastIIOnUndetectedDeadPath + */ + +public class TestTopCastIIOnUndetectedDeadPath { + static class X { + static void m(int[] a) { + + } + } + + static int array[] = new int[10]; + + static void test(int val) { + for (int i = 1; i < 10; ++i) { + for (int j = i; j < 10; ++j) { + if (i == 0 && j != 0) { + X.m(array); + } + array[j - 1] = val; + } + } + } + + public static void main(String[] arg) { + test(42); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath2.java b/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath2.java new file mode 100644 index 00000000000..98121b3b754 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath2.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8319372 + * @summary CastII because of condition guarding it becomes top + * @requires vm.compiler2.enabled + * @run main/othervm -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,TestTopCastIIOnUndetectedDeadPath2::test -XX:-TieredCompilation + * -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN -XX:StressSeed=256120824 TestTopCastIIOnUndetectedDeadPath2 + * @run main/othervm -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,TestTopCastIIOnUndetectedDeadPath2::test -XX:-TieredCompilation + * -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN TestTopCastIIOnUndetectedDeadPath2 + */ + +public class TestTopCastIIOnUndetectedDeadPath2 { + static int array[] = new int[100]; + + static int test() { + int res = 0; + for (int i = 1; i < 100; ++i) { + try { + res = array[i - 1]; + int x = (42 % i); + } catch (ArithmeticException e) { + } + } + return res; + } + + public static void main(String[] args) { + for (int i = 0; i < 10_000; i++) { + test(); + } + } +} diff --git a/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath3.java b/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath3.java new file mode 100644 index 00000000000..86f26b22295 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath3.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8319372 + * @summary CastII because of condition guarding it becomes top + * @run main/othervm -Xcomp -XX:CompileOnly=TestTopCastIIOnUndetectedDeadPath3::* -XX:-TieredCompilation TestTopCastIIOnUndetectedDeadPath3 + */ + +public class TestTopCastIIOnUndetectedDeadPath3 { + + static long test() { + int x = 6, y = 5; + int[] iArr = new int[200]; + for (int i = 129; i > 5; i -= 2) { // OSR compiled + try { + y = iArr[i - 1]; + x = iArr[i + 1]; + x = 1 / i; + } catch (ArithmeticException a_e) { + } + } + Foo.empty(); + return x + y; + } + + public static void main(String[] strArr) { + new TestTopCastIIOnUndetectedDeadPath3(); + for (int i = 0; i < 2000; i++) { + test(); + } + } +} + +class Foo { + public static void empty() {} +} From 9ca87615550eba5493dde94e6204e58ca8cc1119 Mon Sep 17 00:00:00 2001 From: William Kemper Date: Wed, 17 Jan 2024 16:02:41 +0000 Subject: [PATCH 146/261] 8323086: Shenandoah: Heap could be corrupted by oom during evacuation Backport-of: c4a83bd6f6c45e72bd776e929005be0aa9408867 --- .../gc/shenandoah/shenandoahDegeneratedGC.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp index d8398bb1ed8..e7cf402a527 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp @@ -131,6 +131,27 @@ void ShenandoahDegenGC::op_degenerated() { // and we can do evacuation. Otherwise, it would be the shortcut cycle. if (heap->is_evacuation_in_progress()) { + if (_degen_point == _degenerated_evac) { + // Degeneration under oom-evac protocol allows the mutator LRB to expose + // references to from-space objects. This is okay, in theory, because we + // will come to the safepoint here to complete the evacuations and update + // the references. However, if the from-space reference is written to a + // region that was EC during final mark or was recycled after final mark + // it will not have TAMS or UWM updated. Such a region is effectively + // skipped during update references which can lead to crashes and corruption + // if the from-space reference is accessed. + if (UseTLAB) { + heap->labs_make_parsable(); + } + + for (size_t i = 0; i < heap->num_regions(); i++) { + ShenandoahHeapRegion* r = heap->get_region(i); + if (r->is_active() && r->top() > r->get_update_watermark()) { + r->set_update_watermark_at_safepoint(r->top()); + } + } + } + // Degeneration under oom-evac protocol might have left some objects in // collection set un-evacuated. Restart evacuation from the beginning to // capture all objects. For all the objects that are already evacuated, From fcf9ebde634a7274fc110094f613e0c0af979893 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Wed, 17 Jan 2024 16:07:18 +0000 Subject: [PATCH 147/261] 8319103: Popups that request focus are not shown on Linux with Wayland Backport-of: f3ed27582e16c3a323f590863cbeec6d35e20b58 --- .../unix/classes/sun/awt/UNIXToolkit.java | 36 +++++-- .../JPopupMenu/FocusablePopupDismissTest.java | 94 +++++++++++++++++++ 2 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 test/jdk/javax/swing/JPopupMenu/FocusablePopupDismissTest.java diff --git a/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java b/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java index 35d7cba47de..03693e6eb8d 100644 --- a/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java +++ b/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java @@ -502,6 +502,21 @@ public boolean isRunningOnWayland() { @Override public void windowLostFocus(WindowEvent e) { Window window = e.getWindow(); + Window oppositeWindow = e.getOppositeWindow(); + + // The focus can move between the window calling the popup, + // and the popup window itself. + // We only dismiss the popup in other cases. + if (oppositeWindow != null) { + if (window == oppositeWindow.getParent() ) { + addWaylandWindowFocusListenerToWindow(oppositeWindow); + return; + } + if (window.getParent() == oppositeWindow) { + return; + } + } + window.removeWindowFocusListener(this); // AWT @@ -516,18 +531,22 @@ public void windowLostFocus(WindowEvent e) { } } + private static void addWaylandWindowFocusListenerToWindow(Window window) { + if (!Arrays + .asList(window.getWindowFocusListeners()) + .contains(waylandWindowFocusListener) + ) { + window.addWindowFocusListener(waylandWindowFocusListener); + } + } + @Override public void dismissPopupOnFocusLostIfNeeded(Window invoker) { - if (!isOnWayland() - || invoker == null - || Arrays - .asList(invoker.getWindowFocusListeners()) - .contains(waylandWindowFocusListener) - ) { + if (!isOnWayland() || invoker == null) { return; } - invoker.addWindowFocusListener(waylandWindowFocusListener); + addWaylandWindowFocusListenerToWindow(invoker); } @Override @@ -537,5 +556,8 @@ public void dismissPopupOnFocusLostIfNeededCleanUp(Window invoker) { } invoker.removeWindowFocusListener(waylandWindowFocusListener); + for (Window ownedWindow : invoker.getOwnedWindows()) { + ownedWindow.removeWindowFocusListener(waylandWindowFocusListener); + } } } diff --git a/test/jdk/javax/swing/JPopupMenu/FocusablePopupDismissTest.java b/test/jdk/javax/swing/JPopupMenu/FocusablePopupDismissTest.java new file mode 100644 index 00000000000..2704c9789e3 --- /dev/null +++ b/test/jdk/javax/swing/JPopupMenu/FocusablePopupDismissTest.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + /* + * @test + * @key headful + * @bug 8319103 + * @requires (os.family == "linux") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Tests if the focusable popup can be dismissed when the parent + * window or the popup itself loses focus in Wayland. + * @run main/manual FocusablePopupDismissTest + */ + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPopupMenu; +import javax.swing.JTextField; +import java.awt.Window; +import java.util.List; + +public class FocusablePopupDismissTest { + private static final String INSTRUCTIONS = """ + A frame with a "Click me" button should appear next to the window + with this instruction. + + Click on the "Click me" button. + + If the JTextField popup with "Some text" is not showing on the screen, + click Fail. + + The following steps require some focusable system window to be displayed + on the screen. This could be a system settings window, file manager, etc. + + Click on the "Click me" button if the popup is not displayed + on the screen. + + While the popup is displayed, click on some other window on the desktop. + If the popup has disappeared, click Pass, otherwise click Fail. + """; + + public static void main(String[] args) throws Exception { + if (System.getenv("WAYLAND_DISPLAY") == null) { + //test is valid only when running on Wayland. + return; + } + + PassFailJFrame.builder() + .title("FocusablePopupDismissTest") + .instructions(INSTRUCTIONS) + .rows(20) + .columns(45) + .testUI(FocusablePopupDismissTest::createTestUI) + .build() + .awaitAndCheck(); + } + + static List createTestUI() { + JFrame frame = new JFrame("FocusablePopupDismissTest"); + JButton button = new JButton("Click me"); + frame.add(button); + + button.addActionListener(e -> { + JPopupMenu popupMenu = new JPopupMenu(); + JTextField textField = new JTextField("Some text", 10); + popupMenu.add(textField); + popupMenu.show(button, 0, button.getHeight()); + }); + frame.pack(); + + return List.of(frame); + } +} From 8d536b6f1045c243e0e36951544320c15adfa7c1 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Wed, 17 Jan 2024 16:07:45 +0000 Subject: [PATCH 148/261] 8318154: Improve stability of WheelModifier.java test Backport-of: 668d4b077f260a30a90842a01b38a9cf6718d418 --- .../WheelModifier/WheelModifier.java | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java b/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java index 8f16b03747e..bfb6b76d273 100644 --- a/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java +++ b/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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,14 +26,23 @@ @key headful @bug 8041470 @summary JButtons stay pressed after they have lost focus if you use the mouse wheel - @author Anton Nashatyrev */ -import javax.swing.*; -import java.awt.*; -import java.awt.event.*; +import java.awt.AWTEvent; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.AWTEventListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.concurrent.CountDownLatch; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; + public class WheelModifier { JFrame f; @@ -44,6 +53,9 @@ public class WheelModifier { CountDownLatch releaseSema = new CountDownLatch(1); volatile CountDownLatch wheelSema; + private volatile Point sLoc; + private volatile Dimension bSize; + void createGui() { f = new JFrame("frame"); fb = new JButton("frame_button"); @@ -98,10 +110,13 @@ void run() throws Exception { r.waitForIdle(); System.out.println("# Started"); - Point sLoc = fb.getLocationOnScreen(); - Dimension bSize = fb.getSize(); + SwingUtilities.invokeAndWait(() -> { + sLoc = fb.getLocationOnScreen(); + bSize = fb.getSize(); + }); + r.mouseMove(sLoc.x + bSize.width / 2, sLoc.y + bSize.height / 2); - r.mousePress(MouseEvent.BUTTON1_MASK); + r.mousePress(MouseEvent.BUTTON1_DOWN_MASK); pressSema.await(); System.out.println("# Pressed"); @@ -119,7 +134,7 @@ void run() throws Exception { wheelSema.await(); System.out.println("# Wheeled 2"); - r.mouseRelease(MouseEvent.BUTTON1_MASK); + r.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); releaseSema.await(); System.out.println("# Released!"); } From 1e8c226da521f84751f0ef7820cfeb0ba44457ec Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Wed, 17 Jan 2024 16:10:55 +0000 Subject: [PATCH 149/261] 8316106: Open source few swing JInternalFrame and JMenuBar tests Backport-of: 0775bf2f0375b1bc63c187399cbc3fdc5a192bce --- .../swing/JInternalFrame/bug4268949.java | 63 ++++++++ .../swing/JInternalFrame/bug4309079.java | 110 +++++++++++++ .../swing/JInternalFrame/bug4732229.java | 151 ++++++++++++++++++ .../swing/JInternalFrame/bug5009724.java | 67 ++++++++ test/jdk/javax/swing/JMenuBar/bug4191374.java | 66 ++++++++ 5 files changed, 457 insertions(+) create mode 100644 test/jdk/javax/swing/JInternalFrame/bug4268949.java create mode 100644 test/jdk/javax/swing/JInternalFrame/bug4309079.java create mode 100644 test/jdk/javax/swing/JInternalFrame/bug4732229.java create mode 100644 test/jdk/javax/swing/JInternalFrame/bug5009724.java create mode 100644 test/jdk/javax/swing/JMenuBar/bug4191374.java diff --git a/test/jdk/javax/swing/JInternalFrame/bug4268949.java b/test/jdk/javax/swing/JInternalFrame/bug4268949.java new file mode 100644 index 00000000000..83a200bbc79 --- /dev/null +++ b/test/jdk/javax/swing/JInternalFrame/bug4268949.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4268949 + * @summary Tests if JInternalFrame can do setBackground() + * @run main bug4268949 + */ + +import java.awt.Color; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; + +public class bug4268949 { + + static Color c1; + static Color c2; + static Color c3; + + public static void main(String[] argv) throws Exception { + SwingUtilities.invokeAndWait(() -> { + JInternalFrame if1, if2, if3; + if1 = new JInternalFrame("Frame 1"); + if2 = new JInternalFrame("Frame 2"); + if3 = new JInternalFrame("Frame 3"); + if1.setBounds(20, 20, 95, 95); + if2.setBounds(120, 20, 95, 95); + if3.setBounds(220, 20, 95, 95); + if1.setBackground(Color.red); + if2.setBackground(Color.blue); + if3.setBackground(Color.green); + c1 = if1.getContentPane().getBackground(); + c2 = if2.getContentPane().getBackground(); + c3 = if3.getContentPane().getBackground(); + }); + if (!(c1.equals(Color.red)) || !(c2.equals(Color.blue)) + || !(c3.equals(Color.green))) { + throw new RuntimeException("Test failed: JInternalFrame " + + "cannot do setBackground()"); + } + } +} diff --git a/test/jdk/javax/swing/JInternalFrame/bug4309079.java b/test/jdk/javax/swing/JInternalFrame/bug4309079.java new file mode 100644 index 00000000000..b87748cc212 --- /dev/null +++ b/test/jdk/javax/swing/JInternalFrame/bug4309079.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4309079 + * @summary Tests that when a JInternalFrame is activated, + focused JTextField shows cursor. + * @key headful + * @run main bug4309079 + */ + +import java.awt.FlowLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import javax.swing.JFrame; +import javax.swing.JDesktopPane; +import javax.swing.JInternalFrame; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; + +public class bug4309079 { + + private static JFrame f; + private static JTextField tf; + private static JDesktopPane desktop; + private static JInternalFrame f1; + private static JInternalFrame f2; + private static volatile boolean passed = true; + private static volatile Point p; + + public static void main(String[] args) throws Exception { + try { + Robot robot = new Robot(); + robot.setAutoDelay(100); + SwingUtilities.invokeAndWait(() -> { + f = new JFrame(); + f.setSize(500, 300); + tf = new JTextField(10); + tf.addFocusListener(new FocusListener() { + public void focusGained(FocusEvent e) { + passed = tf.getCaret().isVisible(); + } + public void focusLost(FocusEvent e) { + } + }); + tf.requestFocus(); + f1 = AddFrame(new JTextField(10)); + f2 = AddFrame(tf); + f.getContentPane().add(desktop); + f.setVisible(true); + }); + robot.waitForIdle(); + robot.delay(500); + + SwingUtilities.invokeAndWait(() -> { + f1.toFront(); + f2.toFront(); + p = tf.getLocationOnScreen(); + }); + robot.mouseMove(p.x, p.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK ); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK ); + + if (!passed) { + throw new RuntimeException("Test failed."); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (f != null) { + f.dispose(); + } + }); + } + } + + private static JInternalFrame AddFrame(JTextField tf) { + JInternalFrame frame = new JInternalFrame(); + desktop = new JDesktopPane(); + desktop.add(frame); + frame.getContentPane().setLayout(new FlowLayout()); + frame.getContentPane().add(tf); + frame.setSize(300, 200); + frame.setVisible(true); + return frame; + } +} diff --git a/test/jdk/javax/swing/JInternalFrame/bug4732229.java b/test/jdk/javax/swing/JInternalFrame/bug4732229.java new file mode 100644 index 00000000000..bf3eefefd43 --- /dev/null +++ b/test/jdk/javax/swing/JInternalFrame/bug4732229.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4732229 + * @summary Ctrl+Space, bringing up System menu on a JIF errors using Win LAF + * @key headful + * @run main bug4732229 + */ + +import javax.swing.JFrame; +import javax.swing.JDesktopPane; +import javax.swing.JInternalFrame; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import java.awt.Robot; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyEvent; + +public class bug4732229 { + + JFrame frame; + JDesktopPane desktop; + JInternalFrame jif; + JTextArea ta; + Robot robot; + volatile boolean keyTyped = false; + + public static void main(String[] args) throws Exception { + bug4732229 b = new bug4732229(); + b.init(); + } + + public void init() throws Exception { + robot = new Robot(); + robot.setAutoDelay(100); + try { + SwingUtilities.invokeAndWait(() -> { + frame = new JFrame("bug4732229"); + desktop = new JDesktopPane(); + frame.getContentPane().add(desktop); + + ta = new JTextArea(); + ta.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + synchronized (bug4732229.this) { + keyTyped = true; + bug4732229.this.notifyAll(); + } + } + }); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + jif = new JInternalFrame("Internal Frame", true, false, true, + true); + jif.setBounds(10, 10, 100, 100); + jif.getContentPane().add(ta); + jif.setVisible(true); + desktop.add(jif); + try { + jif.setSelected(true); + } catch (Exception e) { + throw new RuntimeException(e); + } + + }); + synchronized (this) { + while (!keyTyped) { + bug4732229.this.wait(); + } + } + robot.waitForIdle(); + robot.delay(200); + robot.keyPress(KeyEvent.VK_CONTROL); + robot.keyPress(KeyEvent.VK_SPACE); + robot.keyRelease(KeyEvent.VK_SPACE); + robot.keyRelease(KeyEvent.VK_CONTROL); + robot.waitForIdle(); + robot.delay(200); + SwingUtilities.invokeAndWait(() -> { + try { + jif.setSelected(false); + } catch (Exception e) { + throw new RuntimeException(e); + } + jif.setVisible(false); + desktop.remove(jif); + try { + UIManager.setLookAndFeel( + UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) { + throw new RuntimeException(e); + } + desktop.updateUI(); + + jif = new JInternalFrame("Internal Frame", true, false, true, + true); + jif.setBounds(10, 10, 100, 100); + jif.getContentPane().add(ta); + jif.setVisible(true); + desktop.add(jif); + try { + jif.setSelected(true); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + synchronized (this) { + while (!keyTyped) { + bug4732229.this.wait(); + } + } + robot.keyPress(KeyEvent.VK_CONTROL); + robot.keyPress(KeyEvent.VK_SPACE); + robot.keyRelease(KeyEvent.VK_SPACE); + robot.keyRelease(KeyEvent.VK_CONTROL); + robot.waitForIdle(); + robot.delay(200); + } finally { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } +} diff --git a/test/jdk/javax/swing/JInternalFrame/bug5009724.java b/test/jdk/javax/swing/JInternalFrame/bug5009724.java new file mode 100644 index 00000000000..aab86232a3d --- /dev/null +++ b/test/jdk/javax/swing/JInternalFrame/bug5009724.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 5009724 + * @requires (os.family == "linux") + * @summary JInternalFrame not serializable in GTK L&F + * @key headful + * @run main bug5009724 + */ + +import java.awt.event.ActionEvent; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import javax.swing.AbstractAction; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +public class bug5009724 { + + public static void main(String []args) throws Exception { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + SwingUtilities.invokeAndWait(() -> { + JInternalFrame frame = new JInternalFrame(); + ObjectOutputStream out = null; + ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); + try { + out = new ObjectOutputStream(byteStream); + } catch (IOException e) { + + } + if (out != null) { + System.out.println("Testing..."); + try { + out.writeObject(frame); + } catch (Exception e) { + System.out.println(e); + throw new RuntimeException("Serialization exception. Test failed."); + } + } + }); + } +} diff --git a/test/jdk/javax/swing/JMenuBar/bug4191374.java b/test/jdk/javax/swing/JMenuBar/bug4191374.java new file mode 100644 index 00000000000..eecbfde9cf7 --- /dev/null +++ b/test/jdk/javax/swing/JMenuBar/bug4191374.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4191374 + * @summary Verify if JMenuBar.getSubElements returns an array + with null values + * @run main bug4191374 + */ + +import javax.swing.Box; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.MenuElement; +import javax.swing.SwingUtilities; + +public class bug4191374 { + static JMenuBar mb; + static volatile boolean pass = true; + + public static void main(String[] args) throws Exception { + SwingUtilities.invokeAndWait(() -> { + mb = new JMenuBar(); + newMenu(mb); + newMenu(mb); + mb.add(Box.createGlue()); + mb.add(new JMenu("Help")); + MenuElement[] me = mb.getSubElements(); + for (int i = 0; i < me.length; i++) { + if (me[i] == null) + pass = false; + } + }); + if (!pass) { + throw new RuntimeException("Bug 4191374 FAILED"); + } + } + + public static void newMenu(JMenuBar mb) { + JMenu m = (JMenu) mb.add(new JMenu("File")); + m.add("Menu item"); + m.add("Menu item"); + m.add("Menu item"); + } +} From 32a4568ec49df66798c7d5b20765281f45b66d1e Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Wed, 17 Jan 2024 16:11:17 +0000 Subject: [PATCH 150/261] 8318613: ChoiceFormat patterns are not well tested Backport-of: 10427c023a142a24db3c2492977a7233a1afc25d --- .../Format/ChoiceFormat/PatternsTest.java | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 test/jdk/java/text/Format/ChoiceFormat/PatternsTest.java diff --git a/test/jdk/java/text/Format/ChoiceFormat/PatternsTest.java b/test/jdk/java/text/Format/ChoiceFormat/PatternsTest.java new file mode 100644 index 00000000000..dc514f5459f --- /dev/null +++ b/test/jdk/java/text/Format/ChoiceFormat/PatternsTest.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6801704 + * @summary Test the expected behavior for a wide range of patterns (both + * correct and incorrect). This test documents the behavior of incorrect + * ChoiceFormat patterns either throwing an exception, or discarding + * the incorrect portion of a pattern. + * @run junit PatternsTest + */ + +import java.text.ChoiceFormat; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +public class PatternsTest { + + private static final String ERR1 = + "Each interval must contain a number before a format"; + private static final String ERR2 = + "Incorrect order of intervals, must be in ascending order"; + + // Check that some valid patterns do not throw an exception. Check + // them against the expected values they should be formatted as. + @ParameterizedTest + @MethodSource + public void validPatternsTest(String pattern, String[] expectedValues) { + var fmt = new ChoiceFormat(pattern); + for (int i=1; i<=expectedValues.length; i++) { + assertEquals(expectedValues[i-1], fmt.format(i), + String.format("ChoiceFormat formatted %s incorrectly:", i)); + } + } + + // Valid patterns ranging from normal appearing to odd. These should not + // throw an exception or discard any portions of the pattern. + private static Arguments[] validPatternsTest() { + return new Arguments[] { + // Multi pattern with trailing empty string Format + arguments("1#foo|2#bar|3#", new String[]{"foo", "bar", ""}), + // Multi patten with trailing '|' + arguments("1#foo|2#bar|", new String[]{"foo", "bar"}), + // Using a '>' (not a Relation) within a Format + arguments("1#foo|2#bar>", new String[]{"foo", "bar>"}), + // Standard Multi Pattern + arguments("1#foo|2#bar", new String[]{"foo", "bar"}), + // Same numerical value Limits, different Relations + arguments("1#foo|1 new ChoiceFormat(pattern)); + assertEquals(errMsg, ex.getMessage()); + } + + // Variety of patterns that break the ChoiceFormat pattern syntax and throw + // an exception. + private static Arguments[] invalidPatternsThrowsTest() { + return new Arguments[] { + arguments("#foo", ERR1), // No Limit + arguments("0#foo|#|1#bar", ERR1), // Missing Relation in SubPattern + arguments("#|", ERR1), // Missing Limit + arguments("##|", ERR1), // Double Relations + arguments("0#foo1#", ERR1), // SubPattern not separated by '|' + arguments("0#foo#", ERR1), // Using a Relation in a format + arguments("0#test|#", ERR1), // SubPattern missing Limit + arguments("0#foo|3#bar|1#baz", ERR2), // Non-ascending Limits + }; + } + + // Check that the incorrect pattern discards the trailing incorrect portion. + // These incorrect patterns should ideally throw an exception, but for + // behavioral compatibility reasons do not. + @ParameterizedTest + @MethodSource + public void invalidPatternsDiscardedTest(String brokenPattern, String actualPattern) { + var cf1 = new ChoiceFormat(brokenPattern); + var cf2 = new ChoiceFormat(actualPattern); + assertEquals(cf2, cf1, + String.format("Expected %s, but got %s", cf2.toPattern(), cf1.toPattern())); + } + + // Variety of incorrect patterns with the actual expected pattern + // after discarding occurs. + private static Arguments[] invalidPatternsDiscardedTest() { + return new Arguments[] { + // Incomplete SubPattern at the end of the Pattern + arguments("0#foo|1#bar|baz", "0#foo|1#bar"), + + // --- These throw an ArrayIndexOutOfBoundsException + // when attempting to format with them --- + // SubPattern with only a Limit (which is interpreted as a Format) + arguments("0", ""), + // SubPattern with only a Format + arguments("foo", ""), + // empty string + arguments("", "") + }; + } + + // Calling format() with empty limits and formats + // throws an ArrayIndexOutOfBoundsException + @Test + public void emptyLimitsAndFormatsTest() { + var cf1 = new ChoiceFormat(""); + assertThrows(ArrayIndexOutOfBoundsException.class, + () -> cf1.format(1)); + + var cf2 = new ChoiceFormat(new double[]{}, new String[]{}); + assertThrows(ArrayIndexOutOfBoundsException.class, + () -> cf2.format(2)); + } +} From f0115385b61774220a87be4b2ecfb0bf61abea64 Mon Sep 17 00:00:00 2001 From: William Kemper Date: Wed, 17 Jan 2024 18:17:10 +0000 Subject: [PATCH 151/261] 8323428: Shenandoah: Unused memory in regions compacted during a full GC should be mangled Backport-of: a7db4fecebe98135d36c6f46e1fa60959adbe78b --- src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp index 18fd09ead0a..4cef5378d30 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp @@ -910,6 +910,9 @@ class ShenandoahPostCompactClosure : public ShenandoahHeapRegionClosure { // Make empty regions that have been allocated into regular if (r->is_empty() && live > 0) { r->make_regular_bypass(); + if (ZapUnusedHeapArea) { + SpaceMangler::mangle_region(MemRegion(r->top(), r->end())); + } } // Reclaim regular regions that became empty From a51c74db293a38de4bef5568db3a90617d43a645 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 17 Jan 2024 21:14:23 +0000 Subject: [PATCH 152/261] 8306922: IR verification fails because IR dump is chopped up Backport-of: 9057b3503349ead7d995b1a705317324830eabb2 --- src/hotspot/share/opto/compile.cpp | 37 ++- src/hotspot/share/opto/compile.hpp | 4 +- src/hotspot/share/opto/node.cpp | 242 +++++++++--------- src/hotspot/share/opto/node.hpp | 3 +- src/hotspot/share/opto/output.cpp | 18 +- src/hotspot/share/opto/output.hpp | 3 +- test/hotspot/jtreg/ProblemList.txt | 2 - .../c2/irTests/TestVectorConditionalMove.java | 5 +- 8 files changed, 167 insertions(+), 147 deletions(-) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index e6f81ccb67a..c9b82face2d 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -551,28 +551,37 @@ void Compile::print_compile_messages() { #ifndef PRODUCT void Compile::print_ideal_ir(const char* phase_name) { - ttyLocker ttyl; // keep the following output all in one block // This output goes directly to the tty, not the compiler log. // To enable tools to match it up with the compilation activity, // be sure to tag this tty output with the compile ID. - if (xtty != nullptr) { - xtty->head("ideal compile_id='%d'%s compile_phase='%s'", - compile_id(), - is_osr_compilation() ? " compile_kind='osr'" : "", - phase_name); - } + + // Node dumping can cause a safepoint, which can break the tty lock. + // Buffer all node dumps, so that all safepoints happen before we lock. + ResourceMark rm; + stringStream ss; + if (_output == nullptr) { - tty->print_cr("AFTER: %s", phase_name); + ss.print_cr("AFTER: %s", phase_name); // Print out all nodes in ascending order of index. - root()->dump_bfs(MaxNodeLimit, nullptr, "+S$"); + root()->dump_bfs(MaxNodeLimit, nullptr, "+S$", &ss); } else { // Dump the node blockwise if we have a scheduling - _output->print_scheduling(); + _output->print_scheduling(&ss); } + // Check that the lock is not broken by a safepoint. + NoSafepointVerifier nsv; + ttyLocker ttyl; if (xtty != nullptr) { + xtty->head("ideal compile_id='%d'%s compile_phase='%s'", + compile_id(), + is_osr_compilation() ? " compile_kind='osr'" : "", + phase_name); + xtty->print("%s", ss.as_string()); // print to tty would use xml escape encoding xtty->tail("ideal"); + } else { + tty->print("%s", ss.as_string()); } } #endif @@ -4991,8 +5000,8 @@ bool Compile::randomized_select(int count) { CloneMap& Compile::clone_map() { return _clone_map; } void Compile::set_clone_map(Dict* d) { _clone_map._dict = d; } -void NodeCloneInfo::dump() const { - tty->print(" {%d:%d} ", idx(), gen()); +void NodeCloneInfo::dump_on(outputStream* st) const { + st->print(" {%d:%d} ", idx(), gen()); } void CloneMap::clone(Node* old, Node* nnn, int gen) { @@ -5039,11 +5048,11 @@ int CloneMap::max_gen() const { return g; } -void CloneMap::dump(node_idx_t key) const { +void CloneMap::dump(node_idx_t key, outputStream* st) const { uint64_t val = value(key); if (val != 0) { NodeCloneInfo ni(val); - ni.dump(); + ni.dump_on(st); } } diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index adf4feabc80..e5b881065ac 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -135,7 +135,7 @@ class NodeCloneInfo { NodeCloneInfo(uint64_t idx_clone_orig) : _idx_clone_orig(idx_clone_orig) {} NodeCloneInfo(node_idx_t x, int g) : _idx_clone_orig(0) { set(x, g); } - void dump() const; + void dump_on(outputStream* st) const; }; class CloneMap { @@ -158,7 +158,7 @@ class CloneMap { int max_gen() const; void clone(Node* old, Node* nnn, int gen); void verify_insert_and_clone(Node* old, Node* nnn, int gen); - void dump(node_idx_t key) const; + void dump(node_idx_t key, outputStream* st) const; int clone_idx() const { return _clone_idx; } void set_clone_idx(int x) { _clone_idx = x; } diff --git a/src/hotspot/share/opto/node.cpp b/src/hotspot/share/opto/node.cpp index 62d6c4f690f..e09aaf2acb7 100644 --- a/src/hotspot/share/opto/node.cpp +++ b/src/hotspot/share/opto/node.cpp @@ -1759,8 +1759,8 @@ Node* Node::find(const int idx, bool only_ctrl) { class PrintBFS { public: - PrintBFS(const Node* start, const int max_distance, const Node* target, const char* options) - : _start(start), _max_distance(max_distance), _target(target), _options(options), + PrintBFS(const Node* start, const int max_distance, const Node* target, const char* options, outputStream* st) + : _start(start), _max_distance(max_distance), _target(target), _options(options), _output(st), _dcc(this), _info_uid(cmpkey, hashkey) {} void run(); @@ -1780,6 +1780,7 @@ class PrintBFS { const int _max_distance; const Node* _target; const char* _options; + outputStream* _output; // options bool _traverse_inputs = false; @@ -1819,7 +1820,7 @@ class PrintBFS { bool _print_blocks = false; bool _print_old = false; bool _dump_only = false; - static void print_options_help(bool print_examples); + void print_options_help(bool print_examples); bool parse_options(); public: @@ -1836,9 +1837,9 @@ class PrintBFS { // node info static Node* old_node(const Node* n); // mach node -> prior IR node - static void print_node_idx(const Node* n); // to tty - static void print_block_id(const Block* b); // to tty - static void print_node_block(const Node* n); // to tty: _pre_order, head idx, _idom, _dom_depth + void print_node_idx(const Node* n); + void print_block_id(const Block* b); + void print_node_block(const Node* n); // _pre_order, head idx, _idom, _dom_depth // traversal data structures GrowableArray _worklist; // BFS queue @@ -1903,7 +1904,7 @@ void PrintBFS::run() { // set up configuration for BFS and print bool PrintBFS::configure() { if (_max_distance < 0) { - tty->print("dump_bfs: max_distance must be non-negative!\n"); + _output->print_cr("dump_bfs: max_distance must be non-negative!"); return false; } return parse_options(); @@ -1941,7 +1942,7 @@ void PrintBFS::select() { select_all(); } else { if (find_info(_target) == nullptr) { - tty->print("Could not find target in BFS.\n"); + _output->print_cr("Could not find target in BFS."); return; } if (_all_paths) { @@ -2037,96 +2038,96 @@ void PrintBFS::print() { print_node(n); } } else { - tty->print("No nodes to print.\n"); + _output->print_cr("No nodes to print."); } } void PrintBFS::print_options_help(bool print_examples) { - tty->print("Usage: node->dump_bfs(int max_distance, Node* target, char* options)\n"); - tty->print("\n"); - tty->print("Use cases:\n"); - tty->print(" BFS traversal: no target required\n"); - tty->print(" shortest path: set target\n"); - tty->print(" all paths: set target and put 'A' in options\n"); - tty->print(" detect loop: subcase of all paths, have start==target\n"); - tty->print("\n"); - tty->print("Arguments:\n"); - tty->print(" this/start: staring point of BFS\n"); - tty->print(" target:\n"); - tty->print(" if null: simple BFS\n"); - tty->print(" else: shortest path or all paths between this/start and target\n"); - tty->print(" options:\n"); - tty->print(" if null: same as \"cdmox@B\"\n"); - tty->print(" else: use combination of following characters\n"); - tty->print(" h: display this help info\n"); - tty->print(" H: display this help info, with examples\n"); - tty->print(" +: traverse in-edges (on if neither + nor -)\n"); - tty->print(" -: traverse out-edges\n"); - tty->print(" c: visit control nodes\n"); - tty->print(" d: visit data nodes\n"); - tty->print(" m: visit memory nodes\n"); - tty->print(" o: visit other nodes\n"); - tty->print(" x: visit mixed nodes\n"); - tty->print(" C: boundary control nodes\n"); - tty->print(" D: boundary data nodes\n"); - tty->print(" M: boundary memory nodes\n"); - tty->print(" O: boundary other nodes\n"); - tty->print(" X: boundary mixed nodes\n"); - tty->print(" #: display node category in color (not supported in all terminals)\n"); - tty->print(" S: sort displayed nodes by node idx\n"); - tty->print(" A: all paths (not just shortest path to target)\n"); - tty->print(" @: print old nodes - before matching (if available)\n"); - tty->print(" B: print scheduling blocks (if available)\n"); - tty->print(" $: dump only, no header, no other columns\n"); - tty->print("\n"); - tty->print("recursively follow edges to nodes with permitted visit types,\n"); - tty->print("on the boundary additionally display nodes allowed in boundary types\n"); - tty->print("Note: the categories can be overlapping. For example a mixed node\n"); - tty->print(" can contain control and memory output. Some from the other\n"); - tty->print(" category are also control (Halt, Return, etc).\n"); - tty->print("\n"); - tty->print("output columns:\n"); - tty->print(" dist: BFS distance to this/start\n"); - tty->print(" apd: all paths distance (d_start + d_target)\n"); - tty->print(" block: block identifier, based on _pre_order\n"); - tty->print(" head: first node in block\n"); - tty->print(" idom: head node of idom block\n"); - tty->print(" depth: depth of block (_dom_depth)\n"); - tty->print(" old: old IR node - before matching\n"); - tty->print(" dump: node->dump()\n"); - tty->print("\n"); - tty->print("Note: if none of the \"cmdxo\" characters are in the options string\n"); - tty->print(" then we set all of them.\n"); - tty->print(" This allows for short strings like \"#\" for colored input traversal\n"); - tty->print(" or \"-#\" for colored output traversal.\n"); + _output->print_cr("Usage: node->dump_bfs(int max_distance, Node* target, char* options)"); + _output->print_cr(""); + _output->print_cr("Use cases:"); + _output->print_cr(" BFS traversal: no target required"); + _output->print_cr(" shortest path: set target"); + _output->print_cr(" all paths: set target and put 'A' in options"); + _output->print_cr(" detect loop: subcase of all paths, have start==target"); + _output->print_cr(""); + _output->print_cr("Arguments:"); + _output->print_cr(" this/start: staring point of BFS"); + _output->print_cr(" target:"); + _output->print_cr(" if null: simple BFS"); + _output->print_cr(" else: shortest path or all paths between this/start and target"); + _output->print_cr(" options:"); + _output->print_cr(" if null: same as \"cdmox@B\""); + _output->print_cr(" else: use combination of following characters"); + _output->print_cr(" h: display this help info"); + _output->print_cr(" H: display this help info, with examples"); + _output->print_cr(" +: traverse in-edges (on if neither + nor -)"); + _output->print_cr(" -: traverse out-edges"); + _output->print_cr(" c: visit control nodes"); + _output->print_cr(" d: visit data nodes"); + _output->print_cr(" m: visit memory nodes"); + _output->print_cr(" o: visit other nodes"); + _output->print_cr(" x: visit mixed nodes"); + _output->print_cr(" C: boundary control nodes"); + _output->print_cr(" D: boundary data nodes"); + _output->print_cr(" M: boundary memory nodes"); + _output->print_cr(" O: boundary other nodes"); + _output->print_cr(" X: boundary mixed nodes"); + _output->print_cr(" #: display node category in color (not supported in all terminals)"); + _output->print_cr(" S: sort displayed nodes by node idx"); + _output->print_cr(" A: all paths (not just shortest path to target)"); + _output->print_cr(" @: print old nodes - before matching (if available)"); + _output->print_cr(" B: print scheduling blocks (if available)"); + _output->print_cr(" $: dump only, no header, no other columns"); + _output->print_cr(""); + _output->print_cr("recursively follow edges to nodes with permitted visit types,"); + _output->print_cr("on the boundary additionally display nodes allowed in boundary types"); + _output->print_cr("Note: the categories can be overlapping. For example a mixed node"); + _output->print_cr(" can contain control and memory output. Some from the other"); + _output->print_cr(" category are also control (Halt, Return, etc)."); + _output->print_cr(""); + _output->print_cr("output columns:"); + _output->print_cr(" dist: BFS distance to this/start"); + _output->print_cr(" apd: all paths distance (d_outputart + d_target)"); + _output->print_cr(" block: block identifier, based on _pre_order"); + _output->print_cr(" head: first node in block"); + _output->print_cr(" idom: head node of idom block"); + _output->print_cr(" depth: depth of block (_dom_depth)"); + _output->print_cr(" old: old IR node - before matching"); + _output->print_cr(" dump: node->dump()"); + _output->print_cr(""); + _output->print_cr("Note: if none of the \"cmdxo\" characters are in the options string"); + _output->print_cr(" then we set all of them."); + _output->print_cr(" This allows for short strings like \"#\" for colored input traversal"); + _output->print_cr(" or \"-#\" for colored output traversal."); if (print_examples) { - tty->print("\n"); - tty->print("Examples:\n"); - tty->print(" if->dump_bfs(10, 0, \"+cxo\")\n"); - tty->print(" starting at some if node, traverse inputs recursively\n"); - tty->print(" only along control (mixed and other can also be control)\n"); - tty->print(" phi->dump_bfs(5, 0, \"-dxo\")\n"); - tty->print(" starting at phi node, traverse outputs recursively\n"); - tty->print(" only along data (mixed and other can also have data flow)\n"); - tty->print(" find_node(385)->dump_bfs(3, 0, \"cdmox+#@B\")\n"); - tty->print(" find inputs of node 385, up to 3 nodes up (+)\n"); - tty->print(" traverse all nodes (cdmox), use colors (#)\n"); - tty->print(" display old nodes and blocks, if they exist\n"); - tty->print(" useful call to start with\n"); - tty->print(" find_node(102)->dump_bfs(10, 0, \"dCDMOX-\")\n"); - tty->print(" find non-data dependencies of a data node\n"); - tty->print(" follow data node outputs until we find another category\n"); - tty->print(" node as the boundary\n"); - tty->print(" x->dump_bfs(10, y, 0)\n"); - tty->print(" find shortest path from x to y, along any edge or node\n"); - tty->print(" will not find a path if it is longer than 10\n"); - tty->print(" useful to find how x and y are related\n"); - tty->print(" find_node(741)->dump_bfs(20, find_node(746), \"c+\")\n"); - tty->print(" find shortest control path between two nodes\n"); - tty->print(" find_node(741)->dump_bfs(8, find_node(746), \"cdmox+A\")\n"); - tty->print(" find all paths (A) between two nodes of length at most 8\n"); - tty->print(" find_node(741)->dump_bfs(7, find_node(741), \"c+A\")\n"); - tty->print(" find all control loops for this node\n"); + _output->print_cr(""); + _output->print_cr("Examples:"); + _output->print_cr(" if->dump_bfs(10, 0, \"+cxo\")"); + _output->print_cr(" starting at some if node, traverse inputs recursively"); + _output->print_cr(" only along control (mixed and other can also be control)"); + _output->print_cr(" phi->dump_bfs(5, 0, \"-dxo\")"); + _output->print_cr(" starting at phi node, traverse outputs recursively"); + _output->print_cr(" only along data (mixed and other can also have data flow)"); + _output->print_cr(" find_node(385)->dump_bfs(3, 0, \"cdmox+#@B\")"); + _output->print_cr(" find inputs of node 385, up to 3 nodes up (+)"); + _output->print_cr(" traverse all nodes (cdmox), use colors (#)"); + _output->print_cr(" display old nodes and blocks, if they exist"); + _output->print_cr(" useful call to start with"); + _output->print_cr(" find_node(102)->dump_bfs(10, 0, \"dCDMOX-\")"); + _output->print_cr(" find non-data dependencies of a data node"); + _output->print_cr(" follow data node outputs until we find another category"); + _output->print_cr(" node as the boundary"); + _output->print_cr(" x->dump_bfs(10, y, 0)"); + _output->print_cr(" find shortest path from x to y, along any edge or node"); + _output->print_cr(" will not find a path if it is longer than 10"); + _output->print_cr(" useful to find how x and y are related"); + _output->print_cr(" find_node(741)->dump_bfs(20, find_node(746), \"c+\")"); + _output->print_cr(" find shortest control path between two nodes"); + _output->print_cr(" find_node(741)->dump_bfs(8, find_node(746), \"cdmox+A\")"); + _output->print_cr(" find all paths (A) between two nodes of length at most 8"); + _output->print_cr(" find_node(741)->dump_bfs(7, find_node(741), \"c+A\")"); + _output->print_cr(" find all control loops for this node"); } } @@ -2198,8 +2199,8 @@ bool PrintBFS::parse_options() { print_options_help(true); return false; default: - tty->print_cr("dump_bfs: Unrecognized option \'%c\'", _options[i]); - tty->print_cr("for help, run: find_node(0)->dump_bfs(0,0,\"H\")"); + _output->print_cr("dump_bfs: Unrecognized option \'%c\'", _options[i]); + _output->print_cr("for help, run: find_node(0)->dump_bfs(0,0,\"H\")"); return false; } } @@ -2278,14 +2279,14 @@ void PrintBFS::print_node_idx(const Node* n) { } else { os::snprintf_checked(buf, sizeof(buf), "o%d", n->_idx); // old node } - tty->print("%6s", buf); + _output->print("%6s", buf); } void PrintBFS::print_block_id(const Block* b) { Compile* C = Compile::current(); char buf[30]; os::snprintf_checked(buf, sizeof(buf), "B%d", b->_pre_order); - tty->print("%7s", buf); + _output->print("%7s", buf); } void PrintBFS::print_node_block(const Node* n) { @@ -2294,19 +2295,19 @@ void PrintBFS::print_node_block(const Node* n) { ? C->cfg()->get_block_for_node(n) : nullptr; // guard against old nodes if (b == nullptr) { - tty->print(" _"); // Block - tty->print(" _"); // head - tty->print(" _"); // idom - tty->print(" _"); // depth + _output->print(" _"); // Block + _output->print(" _"); // head + _output->print(" _"); // idom + _output->print(" _"); // depth } else { print_block_id(b); print_node_idx(b->head()); if (b->_idom) { print_node_idx(b->_idom->head()); } else { - tty->print(" _"); // idom + _output->print(" _"); // idom } - tty->print("%6d ", b->_dom_depth); + _output->print("%6d ", b->_dom_depth); } } @@ -2336,39 +2337,39 @@ void PrintBFS::print_header() const { if (_dump_only) { return; // no header in dump only mode } - tty->print("dist"); // distance + _output->print("dist"); // distance if (_all_paths) { - tty->print(" apd"); // all paths distance + _output->print(" apd"); // all paths distance } if (_print_blocks) { - tty->print(" [block head idom depth]"); // block + _output->print(" [block head idom depth]"); // block } if (_print_old) { - tty->print(" old"); // old node + _output->print(" old"); // old node } - tty->print(" dump\n"); // node dump - tty->print("---------------------------------------------\n"); + _output->print(" dump\n"); // node dump + _output->print_cr("---------------------------------------------"); } void PrintBFS::print_node(const Node* n) { if (_dump_only) { - n->dump("\n", false, tty, &_dcc); + n->dump("\n", false, _output, &_dcc); return; } - tty->print("%4d", find_info(n)->distance());// distance + _output->print("%4d", find_info(n)->distance());// distance if (_all_paths) { Info* info = find_info(n); int apd = info->distance() + info->distance_from_target(); - tty->print("%4d", apd); // all paths distance + _output->print("%4d", apd); // all paths distance } if (_print_blocks) { - print_node_block(n); // block + print_node_block(n); // block } if (_print_old) { - print_node_idx(old_node(n)); // old node + print_node_idx(old_node(n)); // old node } - tty->print(" "); - n->dump("\n", false, tty, &_dcc); // node dump + _output->print(" "); + n->dump("\n", false, _output, &_dcc); // node dump } //------------------------------dump_bfs-------------------------------------- @@ -2378,7 +2379,12 @@ void PrintBFS::print_node(const Node* n) { // To find all options, run: // find_node(0)->dump_bfs(0,0,"H") void Node::dump_bfs(const int max_distance, Node* target, const char* options) const { - PrintBFS bfs(this, max_distance, target, options); + dump_bfs(max_distance, target, options, tty); +} + +// Used to dump to stream. +void Node::dump_bfs(const int max_distance, Node* target, const char* options, outputStream* st) const { + PrintBFS bfs(this, max_distance, target, options, st); bfs.run(); } @@ -2522,7 +2528,7 @@ void Node::dump(const char* suffix, bool mark, outputStream* st, DumpConfig* dc) } if (C->clone_map().value(_idx) != 0) { - C->clone_map().dump(_idx); + C->clone_map().dump(_idx, st); } // Dump node-specific info dump_spec(st); diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index dbe18b67223..ca03ecd070a 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -1215,7 +1215,8 @@ class Node { public: Node* find(int idx, bool only_ctrl = false); // Search the graph for the given idx. Node* find_ctrl(int idx); // Search control ancestors for the given idx. - void dump_bfs(const int max_distance, Node* target, const char* options) const; // Print BFS traversal + void dump_bfs(const int max_distance, Node* target, const char* options, outputStream* st) const; + void dump_bfs(const int max_distance, Node* target, const char* options) const; // directly to tty void dump_bfs(const int max_distance) const; // dump_bfs(max_distance, nullptr, nullptr) class DumpConfig { public: diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp index 524e38fcf72..998be5e1225 100644 --- a/src/hotspot/share/opto/output.cpp +++ b/src/hotspot/share/opto/output.cpp @@ -2068,8 +2068,12 @@ void PhaseOutput::ScheduleAndBundle() { #ifndef PRODUCT if (C->trace_opto_output()) { - tty->print("\n---- After ScheduleAndBundle ----\n"); - print_scheduling(); + // Buffer and print all at once + ResourceMark rm; + stringStream ss; + ss.print("\n---- After ScheduleAndBundle ----\n"); + print_scheduling(&ss); + tty->print("%s", ss.as_string()); } #endif } @@ -2077,14 +2081,18 @@ void PhaseOutput::ScheduleAndBundle() { #ifndef PRODUCT // Separated out so that it can be called directly from debugger void PhaseOutput::print_scheduling() { + print_scheduling(tty); +} + +void PhaseOutput::print_scheduling(outputStream* output_stream) { for (uint i = 0; i < C->cfg()->number_of_blocks(); i++) { - tty->print("\nBB#%03d:\n", i); + output_stream->print("\nBB#%03d:\n", i); Block* block = C->cfg()->get_block(i); for (uint j = 0; j < block->number_of_nodes(); j++) { Node* n = block->get_node(j); OptoReg::Name reg = C->regalloc()->get_reg_first(n); - tty->print(" %-6s ", reg >= 0 && reg < REG_COUNT ? Matcher::regName[reg] : ""); - n->dump(); + output_stream->print(" %-6s ", reg >= 0 && reg < REG_COUNT ? Matcher::regName[reg] : ""); + n->dump("\n", false, output_stream); } } } diff --git a/src/hotspot/share/opto/output.hpp b/src/hotspot/share/opto/output.hpp index 77c49b33bfe..d74751ddbf6 100644 --- a/src/hotspot/share/opto/output.hpp +++ b/src/hotspot/share/opto/output.hpp @@ -222,7 +222,8 @@ class PhaseOutput : public Phase { void BuildOopMaps(); #ifndef PRODUCT - void print_scheduling(); + void print_scheduling(outputStream* output_stream); + void print_scheduling(); // to tty for debugging static void print_statistics(); #endif }; diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 5835a5949ea..8b2226a679f 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -71,8 +71,6 @@ compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-all compiler/vectorapi/reshape/TestVectorReinterpret.java 8320897 aix-ppc64,linux-ppc64le compiler/vectorapi/VectorLogicalOpIdentityTest.java 8302459 linux-x64,windows-x64 -compiler/c2/irTests/TestVectorConditionalMove.java 8306922 generic-all - compiler/jvmci/TestUncaughtErrorInCompileMethod.java 8309073 generic-all ############################################################################# diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java index fbba9475cce..6f6b7f5bd30 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java @@ -43,10 +43,7 @@ public class TestVectorConditionalMove { private static final Random RANDOM = Utils.getRandomInstance(); public static void main(String[] args) { - TestFramework.runWithFlags("-XX:-TieredCompilation", - "-XX:+UseCMoveUnconditionally", - "-XX:+UseVectorCmov", - "-XX:CompileCommand=compileonly,*.TestVectorConditionalMove.test*"); + TestFramework.runWithFlags("-XX:+UseCMoveUnconditionally", "-XX:+UseVectorCmov"); } // Compare 2 values, and pick one of them From ba59249dc9c5568f5dcca92cd6dcb5f3293f55ee Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 17 Jan 2024 21:16:20 +0000 Subject: [PATCH 153/261] 8310923: Refactor Currency tests to use JUnit Backport-of: e848d9471f5de86e5ac157b710cd7371f12f0024 --- test/jdk/java/util/Currency/Bug4512215.java | 68 --- test/jdk/java/util/Currency/Bug6807534.java | 84 ---- test/jdk/java/util/Currency/Bug8154295.java | 55 --- .../java/util/Currency/CNPGetDisplayName.java | 101 ++++ .../java/util/Currency/CheckDataVersion.java | 22 +- test/jdk/java/util/Currency/CurrencyTest.java | 452 +++++++++-------- .../Currency/NoMinorUnitCurrenciesTest.java | 66 +++ .../util/Currency/NumCodeAsStringTest.java | 61 +++ .../java/util/Currency/ValidateISO4217.java | 461 +++++++++--------- 9 files changed, 717 insertions(+), 653 deletions(-) delete mode 100644 test/jdk/java/util/Currency/Bug4512215.java delete mode 100644 test/jdk/java/util/Currency/Bug6807534.java delete mode 100644 test/jdk/java/util/Currency/Bug8154295.java create mode 100644 test/jdk/java/util/Currency/CNPGetDisplayName.java create mode 100644 test/jdk/java/util/Currency/NoMinorUnitCurrenciesTest.java create mode 100644 test/jdk/java/util/Currency/NumCodeAsStringTest.java diff --git a/test/jdk/java/util/Currency/Bug4512215.java b/test/jdk/java/util/Currency/Bug4512215.java deleted file mode 100644 index 5d69fc69278..00000000000 --- a/test/jdk/java/util/Currency/Bug4512215.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2007, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * @test - * @bug 4512215 4818420 4819436 - * @summary Updated currency data. - */ - -import java.util.Currency; -import java.util.Locale; - -public class Bug4512215 { - - public static void main(String[] args) throws Exception { - testCurrencyDefined("XBD", -1); - testCountryCurrency("TJ", "TJS", 2); - testCountryCurrency("FO", "DKK", 2); - testCountryCurrency("FK", "FKP", 2); - - testCountryCurrency("AF", "AFN", 2); // changed from "AFA" - - // Newsletter V-5 on ISO 3166-1 (2002-05-20) - testCountryCurrency("TL", "USD", 2); // successor to TP/TPE - - // Newsletter V-8 on ISO 3166-1 (2003-07-23) - testCountryCurrency("CS", "CSD", 2); // successor to YU/YUM - } - - private static void testCountryCurrency(String country, String currencyCode, - int digits) { - testCurrencyDefined(currencyCode, digits); - Currency currency = Currency.getInstance(Locale.of("", country)); - if (!currency.getCurrencyCode().equals(currencyCode)) { - throw new RuntimeException("[" + country - + "] expected: " + currencyCode - + "; got: " + currency.getCurrencyCode()); - } - } - - private static void testCurrencyDefined(String currencyCode, int digits) { - Currency currency = Currency.getInstance(currencyCode); - if (currency.getDefaultFractionDigits() != digits) { - throw new RuntimeException("[" + currencyCode - + "] expected: " + digits - + "; got: " + currency.getDefaultFractionDigits()); - } - } -} diff --git a/test/jdk/java/util/Currency/Bug6807534.java b/test/jdk/java/util/Currency/Bug6807534.java deleted file mode 100644 index 073518d45ac..00000000000 --- a/test/jdk/java/util/Currency/Bug6807534.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * @test - * @bug 6807534 - * @summary check whether the default implementation of - * CurrencNameProvider.getDisplayName(String, Locale) throws appropriate - * exceptions when necessary. - */ - -import java.util.Locale; -import java.util.spi.CurrencyNameProvider; - -public class Bug6807534 { - - static final CurrencyNameProvider cnp = new CurrencyNameProviderImpl(); - - public static void main(String[] args) throws Exception { - // test for NullPointerException (currencyCode) - try { - cnp.getDisplayName(null, Locale.US); - throwException("NPE was not thrown with null currencyCode"); - } catch (NullPointerException npe) {} - - // test for NullPointerException (locale) - try { - cnp.getDisplayName("USD", null); - throwException("NPE was not thrown with null locale"); - } catch (NullPointerException npe) {} - - // test for IllegalArgumentException (illegal currencyCode) - try { - cnp.getDisplayName("INVALID", Locale.US); - throwException("IllegalArgumentException was not thrown with invalid currency code"); - } catch (IllegalArgumentException iae) {} - try { - cnp.getDisplayName("inv", Locale.US); - throwException("IllegalArgumentException was not thrown with invalid currency code"); - } catch (IllegalArgumentException iae) {} - - // test for IllegalArgumentException (non-supported locale) - try { - cnp.getDisplayName("USD", Locale.JAPAN); - throwException("IllegalArgumentException was not thrown with non-supported locale"); - } catch (IllegalArgumentException iae) {} - } - - static void throwException(String msg) { - throw new RuntimeException("test failed. "+msg); - } - - static class CurrencyNameProviderImpl extends CurrencyNameProvider { - // dummy implementation - public String getSymbol(String currencyCode, Locale locale) { - return ""; - } - - public Locale[] getAvailableLocales() { - Locale[] avail = new Locale[1]; - avail[0] = Locale.US; - return avail; - } - } -} diff --git a/test/jdk/java/util/Currency/Bug8154295.java b/test/jdk/java/util/Currency/Bug8154295.java deleted file mode 100644 index 356d00ba36b..00000000000 --- a/test/jdk/java/util/Currency/Bug8154295.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * @test - * @bug 8154295 - * @summary Check getNumericCodeAsString() method which returns numeric code as a 3 digit String. - */ - -import java.util.Currency; - -public class Bug8154295 { - - public static void main(String[] args) { - - String numericCode = Currency.getInstance("AFA").getNumericCodeAsString(); - if (!numericCode.equals("004")) { //should return "004" (a 3 digit string) - throw new RuntimeException("[Expected 004, " - + "found "+numericCode+" for AFA]"); - } - - numericCode = Currency.getInstance("AUD").getNumericCodeAsString(); - if (!numericCode.equals("036")) { //should return "036" (a 3 digit string) - throw new RuntimeException("[Expected 036, " - + "found "+numericCode+" for AUD]"); - } - - numericCode = Currency.getInstance("USD").getNumericCodeAsString(); - if (!numericCode.equals("840")) {// should return "840" (a 3 digit string) - throw new RuntimeException("[Expected 840, " - + "found "+numericCode+" for USD]"); - } - - } - -} diff --git a/test/jdk/java/util/Currency/CNPGetDisplayName.java b/test/jdk/java/util/Currency/CNPGetDisplayName.java new file mode 100644 index 00000000000..af399bee540 --- /dev/null +++ b/test/jdk/java/util/Currency/CNPGetDisplayName.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6807534 + * @summary check whether the default implementation of + * CurrencyNameProvider.getDisplayName(String, Locale) throws appropriate + * exceptions when necessary. + * @run junit CNPGetDisplayName + */ + +import java.util.Locale; +import java.util.spi.CurrencyNameProvider; +import java.util.stream.Stream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class CNPGetDisplayName { + + static final CurrencyNameProvider cnp = new CurrencyNameProviderImpl(); + + /** + * Tests that the currency name provider throws a NullPointerException + * under the expected circumstances. + */ + @ParameterizedTest + @MethodSource("nullArgProvider") + public void NPETest(String currencyCode, Locale locale, String err) { + assertThrows(NullPointerException.class, + () -> cnp.getDisplayName(currencyCode, locale), err); + } + + /** + * Tests that the currency name provider throws a IllegalArgumentException + * under the expected circumstances. + */ + @ParameterizedTest + @MethodSource("illegalArgProvider") + public void IAETest(String currencyCode, Locale locale, String err) { + assertThrows(IllegalArgumentException.class, + () -> cnp.getDisplayName(currencyCode, locale), err); + } + + private static Stream nullArgProvider() { + return Stream.of( + Arguments.of(null, Locale.US, + "NPE was not thrown with null currencyCode"), + Arguments.of("USD", null, + "NPE was not thrown with null locale") + ); + } + + private static Stream illegalArgProvider() { + return Stream.of( + Arguments.of("INVALID", Locale.US, + "IAE was not thrown with invalid currency code"), + Arguments.of("inv", Locale.US, + "IAE was not thrown with invalid currency code"), + Arguments.of("USD", Locale.JAPAN, + "IllegalArgumentException was not thrown with non-supported locale") + ); + } + + static class CurrencyNameProviderImpl extends CurrencyNameProvider { + // dummy implementation + public String getSymbol(String currencyCode, Locale locale) { + return ""; + } + + public Locale[] getAvailableLocales() { + Locale[] avail = new Locale[1]; + avail[0] = Locale.US; + return avail; + } + } +} diff --git a/test/jdk/java/util/Currency/CheckDataVersion.java b/test/jdk/java/util/Currency/CheckDataVersion.java index 204a80a8557..ba18677dbbe 100644 --- a/test/jdk/java/util/Currency/CheckDataVersion.java +++ b/test/jdk/java/util/Currency/CheckDataVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -20,15 +20,21 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/** - * - * - * Check the consistency between the regression tests and the currency data in the JRE + + +/* + Check the consistency between the regression tests and the currency + data in the JRE. This class is used by other test classes. */ -import java.io.*; -import java.lang.reflect.*; -import java.security.*; +import java.io.BufferedReader; +import java.io.DataInputStream; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.Currency; class CheckDataVersion { diff --git a/test/jdk/java/util/Currency/CurrencyTest.java b/test/jdk/java/util/Currency/CurrencyTest.java index eb03c92fd9a..0561b502730 100644 --- a/test/jdk/java/util/Currency/CurrencyTest.java +++ b/test/jdk/java/util/Currency/CurrencyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -20,6 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* * @test * @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531 @@ -28,6 +29,7 @@ * @summary Basic tests for Currency class. * @modules java.base/java.util:open * jdk.localedata + * @run junit CurrencyTest */ import java.io.ByteArrayInputStream; @@ -38,198 +40,232 @@ import java.time.LocalTime; import java.time.ZoneId; import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.Currency; +import java.util.List; import java.util.Locale; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class CurrencyTest { - public static void main(String[] args) throws Exception { + // 'tablea1.txt' should be up-to-date before testing + @Test + public void dataVersionTest() { CheckDataVersion.check(); - testCurrencyCodeValidation(); - testLocaleMapping(); - testSymbols(); - testFractionDigits(); - testSerialization(); - testDisplayNames(); - testFundsCodes(); } - static void testCurrencyCodeValidation() { - // test creation of some valid currencies - testValidCurrency("USD"); - testValidCurrency("EUR"); - testValidCurrency("GBP"); - testValidCurrency("JPY"); - testValidCurrency("CNY"); - testValidCurrency("CHF"); - - // test creation of some fictitious currencies - testInvalidCurrency("AQD"); - testInvalidCurrency("US$"); - testInvalidCurrency("\u20AC"); - } + @Nested + class CodeValidationTests { + // Calling getInstance() on equal currency codes should return equal currencies + @ParameterizedTest + @MethodSource("validCurrencies") + public void validCurrencyTest(String currencyCode) { + compareCurrencies(currencyCode); + } - static void testValidCurrency(String currencyCode) { - Currency currency1 = Currency.getInstance(currencyCode); - Currency currency2 = Currency.getInstance(currencyCode); - if (currency1 != currency2) { - throw new RuntimeException("Didn't get same instance for same currency code"); + private static Stream validCurrencies() { + return Stream.of("USD", "EUR", "GBP", "JPY", "CNY", "CHF"); + } + + // Calling getInstance() with an invalid currency code should throw an IAE + @ParameterizedTest + @MethodSource("invalidCurrencies") + public void invalidCurrencyTest(String currencyCode) { + assertThrows(IllegalArgumentException.class, () -> + Currency.getInstance(currencyCode), "getInstance() did not throw IAE"); } - if (!currency1.getCurrencyCode().equals(currencyCode)) { - throw new RuntimeException("Currency code changed"); + + private static Stream invalidCurrencies() { + return Stream.of("AQD", "US$", "\u20AC"); } } - static void testInvalidCurrency(String currencyCode) { - boolean gotException = false; - try { - Currency currency = Currency.getInstance(currencyCode); - } catch (IllegalArgumentException e) { - gotException = true; + @Nested + class FundsCodesTests { + // Calling getInstance() on equal currency codes should return equal currencies + @ParameterizedTest + @MethodSource("fundsCodes") + public void validCurrencyTest(String currencyCode) { + compareCurrencies(currencyCode); } - if (!gotException) { - throw new RuntimeException("didn't get specified exception"); + + // Verify a currency has the expected fractional digits + @ParameterizedTest + @MethodSource("fundsCodes") + public void fractionDigitTest(String currencyCode, int expectedFractionDigits) { + compareFractionDigits(currencyCode, expectedFractionDigits); + } + + // Verify a currency has the expected numeric code + @ParameterizedTest + @MethodSource("fundsCodes") + public void numericCodeTest(String currencyCode, int ignored, int expectedNumeric) { + int numeric = Currency.getInstance(currencyCode).getNumericCode(); + assertEquals(numeric, expectedNumeric, String.format( + "Wrong numeric code for currency %s, expected %s, got %s", + currencyCode, expectedNumeric, numeric)); + } + + private static Stream fundsCodes() { + return Stream.of( + Arguments.of("BOV", 2, 984), Arguments.of("CHE", 2, 947), + Arguments.of("CHW", 2, 948), Arguments.of("CLF", 4, 990), + Arguments.of("COU", 2, 970), Arguments.of("MXV", 2, 979), + Arguments.of("USN", 2, 997), Arguments.of("UYI", 0, 940) + ); } } - static void testLocaleMapping() { + @Nested + class LocaleMappingTests { + // very basic test: most countries have their own currency, and then // their currency code is an extension of their country code. - Locale[] locales = Locale.getAvailableLocales(); - int goodCountries = 0; - int ownCurrencies = 0; - for (int i = 0; i < locales.length; i++) { - Locale locale = locales[i]; - String ctryCode = locale.getCountry(); - int ctryLength = ctryCode.length(); - if (ctryLength == 0 || - ctryLength == 3 || // UN M.49 code - ctryCode.matches("AA|Q[M-Z]|X[A-JL-Z]|ZZ" + // user defined codes, excluding "XK" (Kosovo) - "AC|CP|DG|EA|EU|FX|IC|SU|TA|UK")) { // exceptional reservation codes - boolean gotException = false; - try { - Currency.getInstance(locale); - } catch (IllegalArgumentException e) { - gotException = true; - } - if (!gotException) { - throw new RuntimeException("didn't get specified exception"); - } - } else { - goodCountries++; - Currency currency = Currency.getInstance(locale); - if (currency.getCurrencyCode().indexOf(locale.getCountry()) == 0) { - ownCurrencies++; + @Test + public void localeMappingTest() { + Locale[] locales = Locale.getAvailableLocales(); + int goodCountries = 0; + int ownCurrencies = 0; + for (Locale locale : locales) { + String ctryCode = locale.getCountry(); + int ctryLength = ctryCode.length(); + if (ctryLength == 0 || + ctryLength == 3 || // UN M.49 code + ctryCode.matches("AA|Q[M-Z]|X[A-JL-Z]|ZZ" + // user defined codes, excluding "XK" (Kosovo) + "AC|CP|DG|EA|EU|FX|IC|SU|TA|UK")) { // exceptional reservation codes + assertThrows(IllegalArgumentException.class, () -> Currency.getInstance(locale), "Did not throw IAE"); + } else { + goodCountries++; + Currency currency = Currency.getInstance(locale); + if (currency.getCurrencyCode().indexOf(locale.getCountry()) == 0) { + ownCurrencies++; + } } } + System.out.println("Countries tested: " + goodCountries + + ", own currencies: " + ownCurrencies); + if (ownCurrencies < (goodCountries / 2 + 1)) { + throw new RuntimeException("suspicious: not enough countries have their own currency."); + } } - System.out.println("Countries tested: " + goodCountries + - ", own currencies: " + ownCurrencies); - if (ownCurrencies < (goodCountries / 2 + 1)) { - throw new RuntimeException("suspicious: not enough countries have their own currency."); + + // Check an invalid country code + @Test + public void invalidCountryTest() { + assertThrows(IllegalArgumentException.class, ()-> + Currency.getInstance(Locale.of("", "EU")), "Did not throw IAE"); } - // check a few countries that don't change their currencies too often - String[] country1 = {"US", "CA", "JP", "CN", "SG", "CH"}; - String[] currency1 = {"USD", "CAD", "JPY", "CNY", "SGD", "CHF"}; - for (int i = 0; i < country1.length; i++) { - checkCountryCurrency(country1[i], currency1[i]); + // Ensure a selection of countries have the expected currency + @ParameterizedTest + @MethodSource({"countryProvider", "switchedOverCountries"}) + public void countryCurrencyTest(String countryCode, String expected) { + Locale locale = Locale.of("", countryCode); + Currency currency = Currency.getInstance(locale); + String code = (currency != null) ? currency.getCurrencyCode() : null; + assertEquals(expected, code, generateErrMsg( + "currency for", locale.getDisplayCountry(), expected, code)); } - /* - * check currency changes - * In current implementation, there is no data of old currency and transition date at jdk/src/java.base/share/data/currency/CurrencyData.properties. - * So, all the switch data arrays are empty. In the future, if data of old currency and transition date are necessary for any country, the - * arrays here can be updated so that the program can check the currency switch. - */ - String[] switchOverCtry = {}; - String[] switchOverOld = {}; - String[] switchOverNew = {}; - String[] switchOverTZ = {}; - int[] switchOverYear = {}; - int[] switchOverMonth = {}; // java.time APIs accept month starting from 1 i.e. 01 for January - int[] switchOverDay = {}; - - for (int i = 0; i < switchOverCtry.length; i++) { - ZoneId zoneId = ZoneId.of(switchOverTZ[i]); - ZonedDateTime zonedDateAndTime = ZonedDateTime.of(LocalDate.of(switchOverYear[i], switchOverMonth[i], switchOverDay[i]), - LocalTime.MIDNIGHT, zoneId); - ZonedDateTime currentZonedDateAndTime = ZonedDateTime.now(zoneId); - checkCountryCurrency(switchOverCtry[i], (currentZonedDateAndTime.isAfter(zonedDateAndTime) || - currentZonedDateAndTime.isEqual(zonedDateAndTime)) ? switchOverNew[i] : switchOverOld[i]); + private static Stream countryProvider() { + return Stream.of( + // Check country that does not have a currency + Arguments.of("AQ", null), + // Check some countries that don't change their currencies often + Arguments.of("US", "USD"), + Arguments.of("CA", "CAD"), + Arguments.of("JP", "JPY"), + Arguments.of("CN", "CNY"), + Arguments.of("SG", "SGD"), + Arguments.of("CH", "CHF") + ); } - // check a country code which doesn't have a currency - checkCountryCurrency("AQ", null); + /* + * Check Currency Changes + * In the current implementation, there is no data of old currency and transition + * date at jdk/src/java.base/share/data/currency/CurrencyData.properties. + * So, all the switch data arrays are empty. In the future, if data of old + * currency and transition date are necessary for any country, the + * arrays here can be updated so that the program can check the currency switch. + */ + private static List switchedOverCountries() { + List switched = new ArrayList(); + String[] switchOverCtry = {}; + String[] switchOverOld = {}; + String[] switchOverNew = {}; + String[] switchOverTZ = {}; + int[] switchOverYear = {}; + int[] switchOverMonth = {}; // java.time APIs accept month starting from 1 i.e. 01 for January + int[] switchOverDay = {}; - // check an invalid country code - boolean gotException = false; - try { - Currency.getInstance(Locale.of("", "EU")); - } catch (IllegalArgumentException e) { - gotException = true; - } - if (!gotException) { - throw new RuntimeException("didn't get specified exception."); + for (int i = 0; i < switchOverCtry.length; i++) { + ZoneId zoneId = ZoneId.of(switchOverTZ[i]); + ZonedDateTime zonedDateAndTime = ZonedDateTime.of(LocalDate.of( + switchOverYear[i], switchOverMonth[i], switchOverDay[i]), LocalTime.MIDNIGHT, zoneId); + ZonedDateTime currentZonedDateAndTime = ZonedDateTime.now(zoneId); + switched.add(Arguments.of(switchOverCtry[i], (currentZonedDateAndTime.isAfter(zonedDateAndTime) + || currentZonedDateAndTime.isEqual(zonedDateAndTime)) ? switchOverNew[i] : switchOverOld[i])); + } + return switched; } } - static void checkCountryCurrency(String countryCode, String expected) { - Locale locale = Locale.of("", countryCode); - Currency currency = Currency.getInstance(locale); - String code = (currency != null) ? currency.getCurrencyCode() : null; - if (!(expected == null ? code == null : expected.equals(code))) { - throw new RuntimeException("Wrong currency for " + - locale.getDisplayCountry() + - ": expected " + expected + ", got " + code); - } - } + // NON-NESTED TESTS - static void testSymbols() { - testSymbol("USD", Locale.US, "$"); - testSymbol("EUR", Locale.GERMANY, "\u20AC"); - testSymbol("USD", Locale.PRC, "US$"); + // Ensure selection of currencies have the correct fractional digits + @ParameterizedTest + @MethodSource("expectedFractionsProvider") + public void fractionDigitsTest(String currencyCode, int expectedFractionDigits) { + compareFractionDigits(currencyCode, expectedFractionDigits); } - static void testSymbol(String currencyCode, Locale locale, String expectedSymbol) { - String symbol = Currency.getInstance(currencyCode).getSymbol(locale); - if (!symbol.equals(expectedSymbol)) { - throw new RuntimeException("Wrong symbol for currency " + - currencyCode +": expected " + expectedSymbol + - ", got " + symbol); - } + private static Stream expectedFractionsProvider() { + return Stream.of( + Arguments.of("USD", 2), Arguments.of("EUR", 2), + Arguments.of("JPY", 0), Arguments.of("XDR", -1), + Arguments.of("BHD", 3), Arguments.of("IQD", 3), + Arguments.of("JOD", 3), Arguments.of("KWD", 3), + Arguments.of("LYD", 3), Arguments.of("OMR", 3), + Arguments.of("TND", 3), + + // Old and New Turkish Lira + Arguments.of("TRL", 0), Arguments.of("TRY", 2) + ); } - static void testFractionDigits() { - testFractionDigits("USD", 2); - testFractionDigits("EUR", 2); - testFractionDigits("JPY", 0); - testFractionDigits("XDR", -1); - - testFractionDigits("BHD", 3); - testFractionDigits("IQD", 3); - testFractionDigits("JOD", 3); - testFractionDigits("KWD", 3); - testFractionDigits("LYD", 3); - testFractionDigits("OMR", 3); - testFractionDigits("TND", 3); - - // Turkish Lira - testFractionDigits("TRL", 0); - testFractionDigits("TRY", 2); + // Ensure selection of currencies have the expected symbol + @ParameterizedTest + @MethodSource("symbolProvider") + public void symbolTest(String currencyCode, Locale locale, String expectedSymbol) { + String symbol = Currency.getInstance(currencyCode).getSymbol(locale); + assertEquals(symbol, expectedSymbol, generateErrMsg( + "symbol for", currencyCode, expectedSymbol, symbol)); } - static void testFractionDigits(String currencyCode, int expectedFractionDigits) { - int digits = Currency.getInstance(currencyCode).getDefaultFractionDigits(); - if (digits != expectedFractionDigits) { - throw new RuntimeException("Wrong number of fraction digits for currency " + - currencyCode +": expected " + expectedFractionDigits + - ", got " + digits); - } + private static Stream symbolProvider() { + return Stream.of( + Arguments.of("USD", Locale.US, "$"), + Arguments.of("EUR", Locale.GERMANY, "\u20AC"), + Arguments.of("USD", Locale.PRC, "US$") + ); } - static void testSerialization() throws Exception { + // Ensure serialization does not break class invariant. + // Currency should be able to round-trip and remain the same value. + @Test + public void serializationTest() throws Exception { Currency currency1 = Currency.getInstance("DEM"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -241,74 +277,66 @@ static void testSerialization() throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); ObjectInputStream iStream = new ObjectInputStream(bais); Currency currency2 = (Currency) iStream.readObject(); - - if (currency1 != currency2) { - throw new RuntimeException("serialization breaks class invariant"); - } + assertEquals(currency1, currency2, "serialization breaks class invariant"); } - static void testDisplayNames() { - // null argument test - try { - testDisplayName("USD", null, ""); - throw new RuntimeException("getDisplayName(NULL) did not throw an NPE."); - } catch (NullPointerException npe) {} - - testDisplayName("USD", Locale.ENGLISH, "US Dollar"); - testDisplayName("FRF", Locale.FRENCH, "franc fran\u00e7ais"); - testDisplayName("DEM", Locale.GERMAN, "Deutsche Mark"); - testDisplayName("ESP", Locale.of("es"), "peseta espa\u00f1ola"); - testDisplayName("ITL", Locale.ITALIAN, "lira italiana"); - testDisplayName("JPY", Locale.JAPANESE, "\u65e5\u672c\u5186"); - testDisplayName("KRW", Locale.KOREAN, "\ub300\ud55c\ubbfc\uad6d \uc6d0"); - testDisplayName("SEK", Locale.of("sv"), "svensk krona"); - testDisplayName("CNY", Locale.SIMPLIFIED_CHINESE, "\u4eba\u6c11\u5e01"); - testDisplayName("TWD", Locale.TRADITIONAL_CHINESE, "\u65b0\u53f0\u5e63"); + // Ensure getInstance() throws null when passed a null locale + @Test + public void nullDisplayNameTest() { + assertThrows(NullPointerException.class, ()-> + Currency.getInstance("USD").getDisplayName(null)); } - static void testDisplayName(String currencyCode, Locale locale, String expectedName) { + // Ensure a selection of currencies/locale combos have the correct display name + @ParameterizedTest + @MethodSource("displayNameProvider") + public void displayNameTest(String currencyCode, Locale locale, String expectedName) { String name = Currency.getInstance(currencyCode).getDisplayName(locale); - if (!name.equals(expectedName)) { - throw new RuntimeException("Wrong display name for currency " + - currencyCode +": expected '" + expectedName + - "', got '" + name + "'"); - } + assertEquals(name, expectedName, generateErrMsg( + "display name for", currencyCode, expectedName, name)); } - static void testFundsCodes() { - testValidCurrency("BOV"); - testValidCurrency("CHE"); - testValidCurrency("CHW"); - testValidCurrency("CLF"); - testValidCurrency("COU"); - testValidCurrency("MXV"); - testValidCurrency("USN"); - testValidCurrency("UYI"); - - testFractionDigits("BOV", 2); - testFractionDigits("CHE", 2); - testFractionDigits("CHW", 2); - testFractionDigits("CLF", 4); - testFractionDigits("COU", 2); - testFractionDigits("MXV", 2); - testFractionDigits("USN", 2); - testFractionDigits("UYI", 0); - - testNumericCode("BOV", 984); - testNumericCode("CHE", 947); - testNumericCode("CHW", 948); - testNumericCode("CLF", 990); - testNumericCode("COU", 970); - testNumericCode("MXV", 979); - testNumericCode("USN", 997); - testNumericCode("UYI", 940); + + private static Stream displayNameProvider() { + return Stream.of( + Arguments.of("USD", Locale.ENGLISH, "US Dollar"), + Arguments.of("FRF", Locale.FRENCH, "franc fran\u00e7ais"), + Arguments.of("DEM", Locale.GERMAN, "Deutsche Mark"), + Arguments.of("ESP", Locale.of("es"), "peseta espa\u00f1ola"), + Arguments.of("ITL", Locale.ITALIAN, "lira italiana"), + Arguments.of("JPY", Locale.JAPANESE, "\u65e5\u672c\u5186"), + Arguments.of("KRW", Locale.KOREAN, "\ub300\ud55c\ubbfc\uad6d \uc6d0"), + Arguments.of("SEK", Locale.of("sv"), "svensk krona"), + Arguments.of("CNY", Locale.SIMPLIFIED_CHINESE, "\u4eba\u6c11\u5e01"), + Arguments.of("TWD", Locale.TRADITIONAL_CHINESE, "\u65b0\u53f0\u5e63") + ); } - static void testNumericCode(String currencyCode, int expectedNumeric) { - int numeric = Currency.getInstance(currencyCode).getNumericCode(); - if (numeric != expectedNumeric) { - throw new RuntimeException("Wrong numeric code for currency " + - currencyCode +": expected " + expectedNumeric + - ", got " + numeric); - } + // HELPER FUNCTIONS + + // A Currency instance returned from getInstance() should always be + // equal if supplied the same currencyCode. getCurrencyCode() should + // always be equal to the currencyCode used to create the Currency. + private static void compareCurrencies(String currencyCode) { + Currency currency1 = Currency.getInstance(currencyCode); + Currency currency2 = Currency.getInstance(currencyCode); + assertEquals(currency1, currency2, "Didn't get same instance for same currency code"); + assertEquals(currency1.getCurrencyCode(), currencyCode, "getCurrencyCode()" + + " did not return the expected value"); + } + + // Ensures the getDefaultFractionDigits() method returns the expected amount + private static void compareFractionDigits(String currencyCode, + int expectedFractionDigits) { + int digits = Currency.getInstance(currencyCode).getDefaultFractionDigits(); + assertEquals(digits, expectedFractionDigits, generateErrMsg( + "number of fraction digits for currency", + currencyCode, Integer.toString(expectedFractionDigits), Integer.toString(digits))); + } + + // Used for logging on failing tests + private static String generateErrMsg(String subject, String currency, + String expected, String got) { + return String.format("Wrong %s %s: expected '%s', got '%s'", + subject, currency, expected, got); } } diff --git a/test/jdk/java/util/Currency/NoMinorUnitCurrenciesTest.java b/test/jdk/java/util/Currency/NoMinorUnitCurrenciesTest.java new file mode 100644 index 00000000000..1fe9c8b64d8 --- /dev/null +++ b/test/jdk/java/util/Currency/NoMinorUnitCurrenciesTest.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4512215 4818420 4819436 8310923 + * @summary Test currencies without minor units. + * @run junit NoMinorUnitCurrenciesTest + */ + +import java.util.Currency; +import java.util.stream.Stream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class NoMinorUnitCurrenciesTest { + + /** + * Spot check some minor undefined currencies and ensure their default fraction + * digits are not 2. + */ + @ParameterizedTest + @MethodSource("minorUndefined") + public void checkFractionDigits(String currencyCode, int digits) { + Currency currency = Currency.getInstance(currencyCode); + assertEquals(currency.getCurrencyCode(), currencyCode); + assertEquals(currency.getDefaultFractionDigits(), digits, String.format( + "[%s] expected: %s; got: %s", currencyCode, digits, currency.getDefaultFractionDigits())); + } + + // Currencies from the minorUndefined key of CurrencyData.properties + // (These are currencies without minor units) + private static Stream minorUndefined() { + return Stream.of( + Arguments.of("XBD", -1), + Arguments.of("XAG", -1), + Arguments.of("XAU", -1), + Arguments.of("XBA", -1), + Arguments.of("XBB", -1) + ); + } +} diff --git a/test/jdk/java/util/Currency/NumCodeAsStringTest.java b/test/jdk/java/util/Currency/NumCodeAsStringTest.java new file mode 100644 index 00000000000..8bec0856364 --- /dev/null +++ b/test/jdk/java/util/Currency/NumCodeAsStringTest.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8154295 + * @summary Check getNumericCodeAsString() method which returns numeric code as a 3 digit String. + * @run junit NumCodeAsStringTest + */ + +import java.util.Currency; +import java.util.stream.Stream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class NumCodeAsStringTest { + + /** + * Ensure getNumericCodeAsString() returns the correct 3-digit numeric code + * for the associated currency Code. + */ + @ParameterizedTest + @MethodSource("codeProvider") + public void checkNumCodeTest(String currCode, String expectedNumCode) { + String actualNumCode = Currency.getInstance(currCode).getNumericCodeAsString(); + assertEquals(expectedNumCode, actualNumCode, String.format( + "Expected: %s, but got: %s, for %s", expectedNumCode, actualNumCode, currCode)); + } + + private static Stream codeProvider() { + return Stream.of( + Arguments.of("AFA", "004"), + Arguments.of("AUD", "036"), + Arguments.of("USD", "840") + ); + } +} diff --git a/test/jdk/java/util/Currency/ValidateISO4217.java b/test/jdk/java/util/Currency/ValidateISO4217.java index b6a91835b19..c4fdc5ca2e0 100644 --- a/test/jdk/java/util/Currency/ValidateISO4217.java +++ b/test/jdk/java/util/Currency/ValidateISO4217.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -20,6 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* * @test * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759 @@ -28,285 +29,293 @@ * @summary Validate ISO 4217 data for Currency class. * @modules java.base/java.util:open * jdk.localedata + * @run junit ValidateISO4217 */ -/* - * ############################################################################ - * - * ValidateISO4217 is a tool to detect differences between the latest ISO 4217 - * data and Java's currency data which is based on ISO 4217. - * If there is a difference, the following file which includes currency data - * may need to be updated. - * src/share/classes/java/util/CurrencyData.properties - * - * ############################################################################ - * - * 1) Make a golden-data file. - * From BSi's ISO4217 data (TABLE A1.doc), extract four (or eight, if currency is changing) - * fields and save as ./tablea1.txt. - * \t\t\t[\t\t\t\t] - * The Cutover Date is given in SimpleDateFormat's 'yyyy-MM-dd-HH-mm-ss' format in the GMT time zone. - * - * 2) Compile ValidateISO4217.java - * - * 3) Execute ValidateISO4217 as follows: - * java ValidateISO4217 +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Currency; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.TimeZone; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * This class tests the latest ISO 4217 data and Java's currency data which is + * based on ISO 4217. The golden-data file (ISO 4217 data) 'tablea1.txt' has the following + * format: \t\t\t[\t\t\t\t] + * The Cutover Date is given in SimpleDateFormat's 'yyyy-MM-dd-HH-mm-ss' format in the GMT time zone. */ - -import java.io.*; -import java.text.*; -import java.util.*; - public class ValidateISO4217 { - static final int ALPHA_NUM = 26; - - static final byte UNDEFINED = 0; - static final byte DEFINED = 1; - static final byte SKIPPED = 2; - - /* input files */ - static final String datafile = "tablea1.txt"; - - /* alpha2-code table */ - static byte[] codes = new byte[ALPHA_NUM * ALPHA_NUM]; - - static final String[][] additionalCodes = { - /* Defined in ISO 4217 list, but don't have code and minor unit info. */ - {"AQ", "", "", "0"}, // Antarctica - - /* - * Defined in ISO 4217 list, but don't have code and minor unit info in - * it. On the other hand, both code and minor unit are defined in - * .properties file. I don't know why, though. - */ - {"GS", "GBP", "826", "2"}, // South Georgia And The South Sandwich Islands - - /* Not defined in ISO 4217 list, but defined in .properties file. */ - {"AX", "EUR", "978", "2"}, // \u00c5LAND ISLANDS - {"PS", "ILS", "376", "2"}, // Palestinian Territory, Occupied - - /* Not defined in ISO 4217 list, but added in ISO 3166 country code list */ - {"JE", "GBP", "826", "2"}, // Jersey - {"GG", "GBP", "826", "2"}, // Guernsey - {"IM", "GBP", "826", "2"}, // Isle of Man - {"BL", "EUR", "978", "2"}, // Saint Barthelemy - {"MF", "EUR", "978", "2"}, // Saint Martin - - /* Defined neither in ISO 4217 nor ISO 3166 list */ - {"XK", "EUR", "978", "2"}, // Kosovo + // Input golden-data file + private static final File dataFile = new File(System.getProperty( + "test.src", "."), "tablea1.txt"); + // Code statuses + private static final byte UNDEFINED = 0; + private static final byte DEFINED = 1; + private static final byte SKIPPED = 2; + private static final byte TESTED = 4; + private static final int ALPHA_NUM = 26; + // An alpha2 code table which maps the status of a country + private static final byte[] codes = new byte[ALPHA_NUM * ALPHA_NUM]; + // Codes derived from ISO4217 golden-data file + private static final List ISO4217Codes = new ArrayList(); + // Additional codes not from the ISO4217 golden-data file + private static final List additionalCodes = new ArrayList(); + // Currencies to test (derived from ISO4217Codes and additionalCodes) + private static final Set testCurrencies = new HashSet<>(); + // Codes that are obsolete, do not have related country, extra currency + private static final String otherCodes = + "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-BYR-CHE-CHW-CLF-COU-CUC-CYP-" + + "DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LTL-LUF-LVL-MGF-MRO-MTL-MXV-MZM-NLG-" + + "PTE-ROL-RUR-SDD-SIT-SLL-SKK-SRG-STD-TMM-TPE-TRL-VEF-UYI-USN-USS-VEB-VED-" + + "XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-" + + "YUM-ZMK-ZWD-ZWN-ZWR"; + private static final String[][] extraCodes = { + /* Defined in ISO 4217 list, but don't have code and minor unit info. */ + {"AQ", "", "", "0"}, // Antarctica + /* + * Defined in ISO 4217 list, but don't have code and minor unit info in + * it. On the other hand, both code and minor unit are defined in + * .properties file. I don't know why, though. + */ + {"GS", "GBP", "826", "2"}, // South Georgia And The South Sandwich Islands + /* Not defined in ISO 4217 list, but defined in .properties file. */ + {"AX", "EUR", "978", "2"}, // \u00c5LAND ISLANDS + {"PS", "ILS", "376", "2"}, // Palestinian Territory, Occupied + /* Not defined in ISO 4217 list, but added in ISO 3166 country code list */ + {"JE", "GBP", "826", "2"}, // Jersey + {"GG", "GBP", "826", "2"}, // Guernsey + {"IM", "GBP", "826", "2"}, // Isle of Man + {"BL", "EUR", "978", "2"}, // Saint Barthelemy + {"MF", "EUR", "978", "2"}, // Saint Martin + /* Defined neither in ISO 4217 nor ISO 3166 list */ + {"XK", "EUR", "978", "2"}, // Kosovo }; - - /* Codes that are obsolete, do not have related country, extra currency */ - static final String otherCodes = - "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-BYR-CHE-CHW-CLF-COU-CUC-CYP-" - + "DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LTL-LUF-LVL-MGF-MRO-MTL-MXV-MZM-NLG-" - + "PTE-ROL-RUR-SDD-SIT-SLL-SKK-SRG-STD-TMM-TPE-TRL-VEF-UYI-USN-USS-VEB-VED-" - + "XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-" - + "YUM-ZMK-ZWD-ZWN-ZWR"; - - static boolean err = false; - - static Set testCurrencies = new HashSet(); - - public static void main(String[] args) throws Exception { - CheckDataVersion.check(); - test1(); - test2(); - getAvailableCurrenciesTest(); - - if (err) { - throw new RuntimeException("Failed: Validation ISO 4217 data"); - } + private static SimpleDateFormat format = null; + + // Sets up the following test data: + // ISO4217Codes, additionalCodes, testCurrencies, codes + @BeforeAll + static void setUpTestingData() throws Exception { + // These functions laterally setup 'testCurrencies' and 'codes' + // at the same time + setUpISO4217Codes(); + setUpAdditionalCodes(); + setUpOtherCurrencies(); } - static void test1() throws Exception { - - try (FileReader fr = new FileReader(new File(System.getProperty("test.src", "."), datafile)); + // Parse the ISO4217 file and populate ISO4217Codes and testCurrencies. + private static void setUpISO4217Codes() throws Exception{ + try (FileReader fr = new FileReader(dataFile); BufferedReader in = new BufferedReader(fr)) { String line; - SimpleDateFormat format = null; - while ((line = in.readLine()) != null) { if (line.length() == 0 || line.charAt(0) == '#') { + // Skip comments and empty lines continue; } - StringTokenizer tokens = new StringTokenizer(line, "\t"); String country = tokens.nextToken(); if (country.length() != 2) { + // Skip invalid countries continue; } + // If the country is valid, process the additional columns + processColumns(tokens, country); + } + } + } - String currency; - String numeric; - String minorUnit; - int tokensCount = tokens.countTokens(); - if (tokensCount < 3) { - currency = ""; - numeric = "0"; - minorUnit = "0"; - } else { + private static void processColumns(StringTokenizer tokens, String country) throws ParseException { + String currency; + String numeric; + String minorUnit; + int tokensCount = tokens.countTokens(); + if (tokensCount < 3) { + // Ill-defined columns + currency = ""; + numeric = "0"; + minorUnit = "0"; + } else { + // Fully defined columns + currency = tokens.nextToken(); + numeric = tokens.nextToken(); + minorUnit = tokens.nextToken(); + testCurrencies.add(Currency.getInstance(currency)); + // Check for the cut-over if a currency is changing + if (tokensCount > 3) { + if (format == null) { + createDateFormat(); + } + // If the cut-over already passed, test the changed data too + if (format.parse(tokens.nextToken()).getTime() < System.currentTimeMillis()) { currency = tokens.nextToken(); numeric = tokens.nextToken(); minorUnit = tokens.nextToken(); testCurrencies.add(Currency.getInstance(currency)); - - // check for the cutover - if (tokensCount > 3) { - if (format == null) { - format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US); - format.setTimeZone(TimeZone.getTimeZone("GMT")); - format.setLenient(false); - } - if (format.parse(tokens.nextToken()).getTime() < - System.currentTimeMillis()) { - currency = tokens.nextToken(); - numeric = tokens.nextToken(); - minorUnit = tokens.nextToken(); - testCurrencies.add(Currency.getInstance(currency)); - } - } } - int index = toIndex(country); - testCountryCurrency(country, currency, Integer.parseInt(numeric), - Integer.parseInt(minorUnit), index); } } + int index = toIndex(country); + ISO4217Codes.add(Arguments.of(country, currency, Integer.parseInt(numeric), + Integer.parseInt(minorUnit), index)); + codes[index] = DEFINED; + } + + // Generates a unique index for an alpha-2 country + private static int toIndex(String country) { + return ((country.charAt(0) - 'A') * ALPHA_NUM + country.charAt(1) - 'A'); + } + + private static void createDateFormat() { + format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("GMT")); + format.setLenient(false); + } - for (int i = 0; i < additionalCodes.length; i++) { - int index = toIndex(additionalCodes[i][0]); - if (additionalCodes[i][1].length() != 0) { - testCountryCurrency(additionalCodes[i][0], additionalCodes[i][1], - Integer.parseInt(additionalCodes[i][2]), - Integer.parseInt(additionalCodes[i][3]), index); - testCurrencies.add(Currency.getInstance(additionalCodes[i][1])); + // Process 'extraCodes', turning them into JUnit arguments and populate + // both additionalCodes and testCurrencies. + private static void setUpAdditionalCodes() { + for (String[] extraCode : extraCodes) { + int index = toIndex(extraCode[0]); + if (extraCode[1].length() != 0) { + additionalCodes.add(Arguments.of(extraCode[0], extraCode[1], + Integer.parseInt(extraCode[2]), Integer.parseInt(extraCode[3]), index)); + testCurrencies.add(Currency.getInstance(extraCode[1])); } else { - codes[index] = SKIPPED; + codes[index] = SKIPPED; // For example, Antarctica } } } - static int toIndex(String s) { - return ((s.charAt(0) - 'A') * ALPHA_NUM + s.charAt(1) - 'A'); + // The previous set-up method populated most of testCurrencies. This + // method finishes populating the list with 'otherCodes'. + private static void setUpOtherCurrencies() { + // Add otherCodes + StringTokenizer st = new StringTokenizer(otherCodes, "-"); + while (st.hasMoreTokens()) { + testCurrencies.add(Currency.getInstance(st.nextToken())); + } } - static void testCountryCurrency(String country, String currencyCode, - int numericCode, int digits, int index) { - if (currencyCode.length() == 0) { - return; - } - testCurrencyDefined(currencyCode, numericCode, digits); + // Check that the data file is up-to-date + @Test + public void dataVersionTest() { + CheckDataVersion.check(); + } - Locale loc = Locale.of("", country); - try { - Currency currency = Currency.getInstance(loc); - if (!currency.getCurrencyCode().equals(currencyCode)) { - System.err.println("Error: [" + country + ":" + - loc.getDisplayCountry() + "] expected: " + currencyCode + - ", got: " + currency.getCurrencyCode()); - err = true; - } + /** + * Tests the JDK's ISO4217 data and ensures the values for getNumericCode(), + * getDefaultFractionDigits(), and getCurrencyCode() are as expected. + */ + @ParameterizedTest + @MethodSource({"ISO4217CodesProvider", "additionalCodesProvider"}) + public void countryCurrencyTest(String country, String currencyCode, + int numericCode, int digits, int index) { + currencyTest(currencyCode, numericCode, digits); + countryTest(country, currencyCode); + assertNotEquals(codes[index], TESTED, + "Error: Re-testing a previously defined code, possible duplication"); + codes[index] = TESTED; + } - if (codes[index] != UNDEFINED) { - System.out.println("Warning: [" + country + ":" + - loc.getDisplayCountry() + - "] multiple definitions. currency code=" + currencyCode); - } - codes[index] = DEFINED; - } - catch (Exception e) { - System.err.println("Error: " + e + ": Country=" + country); - err = true; - } + // Test a Currency built from currencyCode + private static void currencyTest(String currencyCode, int numericCode, int digits) { + Currency currency = Currency.getInstance(currencyCode); + assertEquals(currency.getNumericCode(), numericCode); + assertEquals(currency.getDefaultFractionDigits(), digits); } - static void testCurrencyDefined(String currencyCode, int numericCode, int digits) { - try { - Currency currency = currency = Currency.getInstance(currencyCode); + // Test a Currency built from country + private static void countryTest(String country, String currencyCode) { + Locale loc = Locale.of("", country); + Currency currency = Currency.getInstance(loc); + assertEquals(currency.getCurrencyCode(), currencyCode); + } - if (currency.getNumericCode() != numericCode) { - System.err.println("Error: [" + currencyCode + "] expected: " + - numericCode + "; got: " + currency.getNumericCode()); - err = true; - } + private static List ISO4217CodesProvider() { + return ISO4217Codes; + } - if (currency.getDefaultFractionDigits() != digits) { - System.err.println("Error: [" + currencyCode + "] expected: " + - digits + "; got: " + currency.getDefaultFractionDigits()); - err = true; - } - } - catch (Exception e) { - System.err.println("Error: " + e + ": Currency code=" + - currencyCode); - err = true; + private static List additionalCodesProvider() { + return additionalCodes; + } + + /** + * Tests trying to create a Currency from an invalid alpha-2 country either + * throws an IllegalArgumentException or returns null. The test data + * supplied is every possible combination of AA -> ZZ. + */ + @ParameterizedTest + @MethodSource("codeCombos") + public void twoLetterCodesTest(String country) { + if (codes[toIndex(country)] == UNDEFINED) { + // if a code is undefined / 0, creating a Currency from it + // should throw an IllegalArgumentException + assertThrows(IllegalArgumentException.class, + ()-> Currency.getInstance(Locale.of("", country)), + "Error: This should be an undefined code and throw IllegalArgumentException: " + country); + } else if (codes[toIndex(country)] == SKIPPED) { + // if a code is marked as skipped / 2, creating a Currency from it + // should return null + assertNull(Currency.getInstance(Locale.of("", country)), + "Error: Currency.getInstance() for this locale should return null: " + country); } } - static void test2() { + // This method generates code combos from AA to ZZ + private static List codeCombos() { + List codeCombos = new ArrayList<>(); for (int i = 0; i < ALPHA_NUM; i++) { for (int j = 0; j < ALPHA_NUM; j++) { char[] code = new char[2]; - code[0] = (char)('A'+ i); - code[1] = (char)('A'+ j); - String country = new String(code); - boolean ex; - - if (codes[toIndex(country)] == UNDEFINED) { - ex = false; - try { - Currency.getInstance(Locale.of("", country)); - } - catch (IllegalArgumentException e) { - ex = true; - } - if (!ex) { - System.err.println("Error: This should be an undefined code and throw IllegalArgumentException: " + - country); - err = true; - } - } else if (codes[toIndex(country)] == SKIPPED) { - Currency cur = null; - try { - cur = Currency.getInstance(Locale.of("", country)); - } - catch (Exception e) { - System.err.println("Error: " + e + ": Country=" + - country); - err = true; - } - if (cur != null) { - System.err.println("Error: Currency.getInstance() for an this locale should return null: " + - country); - err = true; - } - } + code[0] = (char) ('A' + i); + code[1] = (char) ('A' + j); + codeCombos.add(new String(code)); } } + return codeCombos; } - /** - * This test depends on test1(), where 'testCurrencies' set is constructed - */ - static void getAvailableCurrenciesTest() { + // This method ensures that getAvailableCurrencies() returns + // the expected amount of currencies. + @Test + public void getAvailableCurrenciesTest() { Set jreCurrencies = Currency.getAvailableCurrencies(); + // Ensure that testCurrencies has all the JRE currency codes + assertTrue(testCurrencies.containsAll(jreCurrencies), + getSetDiffs(jreCurrencies, testCurrencies)); + } - // add otherCodes - StringTokenizer st = new StringTokenizer(otherCodes, "-"); - while (st.hasMoreTokens()) { - testCurrencies.add(Currency.getInstance(st.nextToken())); - } - - if (!testCurrencies.containsAll(jreCurrencies)) { - System.err.print("Error: getAvailableCurrencies() returned extra currencies than expected: "); - jreCurrencies.removeAll(testCurrencies); - for (Currency c : jreCurrencies) { - System.err.print(" "+c); - } - System.err.println(); - err = true; + private static String getSetDiffs(Set jreCurrencies, Set testCurrencies) { + StringBuilder bldr = new StringBuilder(); + bldr.append("Error: getAvailableCurrencies() returned unexpected currencies: "); + jreCurrencies.removeAll(testCurrencies); + for (Currency curr : jreCurrencies) { + bldr.append(" " + curr); } + bldr.append("\n"); + return bldr.toString(); } } From 2981858526d707b37ae82df22a434c488fb57a25 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 17 Jan 2024 21:22:16 +0000 Subject: [PATCH 154/261] 8315721: CloseRace.java#id0 fails transiently on libgraal Backport-of: 1be355734da94243e29f0899b53aa1ebdf3bcb79 --- test/jdk/java/lang/ProcessBuilder/CloseRace.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/jdk/java/lang/ProcessBuilder/CloseRace.java b/test/jdk/java/lang/ProcessBuilder/CloseRace.java index 05024dd17e4..e7eab128d60 100644 --- a/test/jdk/java/lang/ProcessBuilder/CloseRace.java +++ b/test/jdk/java/lang/ProcessBuilder/CloseRace.java @@ -23,11 +23,13 @@ /** * @test - * @bug 8024521 + * @bug 8024521 8315721 * @summary Closing ProcessPipeInputStream at the time the process exits is racy * and leads to data corruption. Run this test manually (as * an ordinary java program) with -Xmx8M to repro bug 8024521. * @requires !vm.opt.final.ZGenerational + * @comment Don't allow -Xcomp, it disturbs the timing + * @requires (vm.compMode != "Xcomp") * @run main/othervm -Xmx8M -Dtest.duration=2 CloseRace */ @@ -35,6 +37,8 @@ * @test * @comment Turn up heap size to lower amount of GCs * @requires vm.gc.Z & vm.opt.final.ZGenerational + * @comment Don't allow -Xcomp, it disturbs the timing + * @requires (vm.compMode != "Xcomp") * @run main/othervm -XX:+UseZGC -XX:+ZGenerational -Xmx32M -Dtest.duration=2 CloseRace */ From 993a746e7d6fce0793264c17063d39785251122b Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 17 Jan 2024 21:22:47 +0000 Subject: [PATCH 155/261] 8311986: Disable runtime/os/TestTracePageSizes.java for ShenandoahGC Backport-of: 167d1c183546a9501a4f255baecc8a4a5b859ab1 --- test/hotspot/jtreg/runtime/os/TestTracePageSizes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java b/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java index 7bc07d1c9c3..a7faed10e02 100644 --- a/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java +++ b/test/hotspot/jtreg/runtime/os/TestTracePageSizes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -51,7 +51,7 @@ * @library /test/lib * @build jdk.test.lib.Platform * @requires os.family == "linux" - * @requires vm.gc != "Z" + * @requires vm.gc != "Z" & vm.gc != "Shenandoah" * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:-SegmentedCodeCache TestTracePageSizes * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:-SegmentedCodeCache -XX:+UseLargePages TestTracePageSizes * @run main/othervm -XX:+AlwaysPreTouch -Xmx128m -Xlog:pagesize:ps-%p.log -XX:-SegmentedCodeCache -XX:+UseTransparentHugePages TestTracePageSizes From 0668efa6a4afc96d805cfa125a6d73fd0253f0d8 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 17 Jan 2024 21:26:50 +0000 Subject: [PATCH 156/261] 8317522: Test logic for BODY_CF in AbstractThrowingSubscribers.java is wrong Backport-of: 4c5b66dceab15ce27f742c4173e14156249eb61a --- .../AbstractThrowingSubscribers.java | 98 ++++++++++++++----- 1 file changed, 71 insertions(+), 27 deletions(-) diff --git a/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java b/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java index d4100b7eb04..077ae346462 100644 --- a/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java +++ b/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java @@ -21,9 +21,6 @@ * questions. */ -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsServer; import jdk.test.lib.net.SimpleSSLContext; import org.testng.ITestContext; import org.testng.ITestResult; @@ -33,7 +30,6 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.BufferedReader; @@ -42,11 +38,8 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.io.UncheckedIOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.URI; import java.net.http.HttpClient; -import java.net.http.HttpHeaders; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandler; @@ -63,7 +56,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import java.util.concurrent.Flow; +import java.util.concurrent.Flow.Subscription; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; @@ -72,7 +65,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; import static java.lang.System.out; import static java.lang.String.format; @@ -99,6 +91,7 @@ public abstract class AbstractThrowingSubscribers implements HttpServerAdapters String https2URI_chunk; static final int ITERATION_COUNT = 1; + static final int REPEAT_RESPONSE = 3; // a shared executor helps reduce the amount of threads created by the test static final Executor executor = new TestExecutor(Executors.newCachedThreadPool()); static final ConcurrentMap FAILURES = new ConcurrentHashMap<>(); @@ -313,7 +306,8 @@ protected void testSanityImpl(String uri, boolean sameClient) BodyHandlers.ofString()); HttpResponse response = client.send(req, handler); String body = response.body(); - assertEquals(URI.create(body).getPath(), URI.create(uri2).getPath()); + Stream.of(body.split("\n")).forEach(u -> + assertEquals(URI.create(u).getPath(), URI.create(uri2).getPath())); if (!sameClient) { // Wait for the client to be garbage collected. // we use the ReferenceTracker API rather than HttpClient::close here, @@ -443,6 +437,7 @@ private void testThrowing(String uri, boolean sameClient, throws Exception { HttpClient client = null; + var throwing = thrower; for (Where where : EnumSet.complementOf(excludes)) { if (!sameClient || client == null) @@ -451,6 +446,9 @@ private void testThrowing(String uri, boolean sameClient, HttpRequest req = HttpRequest. newBuilder(URI.create(uri2)) .build(); + + thrower = thrower(where, throwing); + BodyHandler handler = new ThrowingBodyHandler(where.select(thrower), handlers.get()); System.out.println("try throwing in " + where); @@ -468,12 +466,9 @@ private void testThrowing(String uri, boolean sameClient, response = client.send(req, handler); } catch (Error | Exception t) { // synchronous send will rethrow exceptions - Throwable throwable = t.getCause(); - assert throwable != null; - - if (thrower.test(throwable)) { - System.out.println(now() + "Got expected exception: " + throwable); - } else throw causeNotFound(where, t); + Throwable throwable = findCause(t, thrower); + if (throwable == null) throw causeNotFound(where, t); + System.out.println(now() + "Got expected exception: " + throwable); } } if (response != null) { @@ -658,9 +653,38 @@ public BodySubscriber apply(HttpResponse.ResponseInfo rinfo) { } } + static final class BodyCFThrower implements Thrower { + final Thrower thrower; + BodyCFThrower(Thrower thrower) { + this.thrower = thrower; + } + @Override + public boolean test(Throwable throwable) { + // In case of BODY_CF we also cancel the stream, + // which can cause "Stream XX cancelled" to be reported + return thrower.test(throwable) || + throwable instanceof IOException io && ( + io.getMessage().matches("Stream [0-9]+ cancelled") || + io.getMessage().equals("subscription cancelled") + ); + } + @Override + public void accept(Where where) { + thrower.accept(where); + } + } + + static Thrower thrower(Where where, Thrower thrower) { + return switch (where) { + case BODY_CF -> new BodyCFThrower(thrower); + default -> thrower; + }; + } + static final class ThrowingBodySubscriber implements BodySubscriber { private final BodySubscriber subscriber; - volatile boolean onSubscribeCalled; + volatile Subscription subscription; + final CompletableFuture subscriptionCF = new CompletableFuture<>(); final Consumer throwing; ThrowingBodySubscriber(Consumer throwing, BodySubscriber subscriber) { this.throwing = throwing; @@ -668,17 +692,22 @@ static final class ThrowingBodySubscriber implements BodySubscriber { } @Override - public void onSubscribe(Flow.Subscription subscription) { + public void onSubscribe(Subscription subscription) { //out.println("onSubscribe "); - onSubscribeCalled = true; + this.subscription = subscription; throwing.accept(Where.ON_SUBSCRIBE); subscriber.onSubscribe(subscription); + subscriptionCF.complete(subscription); + } + + boolean onSubscribeCalled() { + return subscription != null; } @Override public void onNext(List item) { // out.println("onNext " + item); - assertTrue(onSubscribeCalled); + assertTrue(onSubscribeCalled(), "onNext called before onSubscribe"); throwing.accept(Where.ON_NEXT); subscriber.onNext(item); } @@ -686,7 +715,7 @@ public void onNext(List item) { @Override public void onError(Throwable throwable) { //out.println("onError"); - assertTrue(onSubscribeCalled); + assertTrue(onSubscribeCalled(), "onError called before onSubscribe"); throwing.accept(Where.ON_ERROR); subscriber.onError(throwable); } @@ -694,7 +723,7 @@ public void onError(Throwable throwable) { @Override public void onComplete() { //out.println("onComplete"); - assertTrue(onSubscribeCalled, "onComplete called before onSubscribe"); + assertTrue(onSubscribeCalled(), "onComplete called before onSubscribe"); throwing.accept(Where.ON_COMPLETE); subscriber.onComplete(); } @@ -702,10 +731,19 @@ public void onComplete() { @Override public CompletionStage getBody() { throwing.accept(Where.GET_BODY); + boolean shouldCancel = false; try { throwing.accept(Where.BODY_CF); } catch (Throwable t) { + shouldCancel = true; return CompletableFuture.failedFuture(t); + } finally { + // if a BodySubscriber returns a failed future, it + // should take responsibility for cancelling the + // subscription explicitly if needed. + if (shouldCancel) { + subscriptionCF.thenAccept(Subscription::cancel); + } } return subscriber.getBody(); } @@ -785,10 +823,13 @@ public void handle(HttpTestExchange t) throws IOException { try (InputStream is = t.getRequestBody()) { is.readAllBytes(); } - byte[] resp = t.getRequestURI().toString().getBytes(StandardCharsets.UTF_8); - t.sendResponseHeaders(200, resp.length); //fixed content length + byte[] resp = (t.getRequestURI() + "\n").getBytes(StandardCharsets.UTF_8); + t.sendResponseHeaders(200, resp.length * 3); //fixed content length try (OutputStream os = t.getResponseBody()) { - os.write(resp); + for (int i=0 ; i < REPEAT_RESPONSE; i++) { + os.write(resp); + os.flush(); + } } } } @@ -797,13 +838,16 @@ static class HTTP_ChunkedHandler implements HttpTestHandler { @Override public void handle(HttpTestExchange t) throws IOException { out.println("HTTP_ChunkedHandler received request to " + t.getRequestURI()); - byte[] resp = t.getRequestURI().toString().getBytes(StandardCharsets.UTF_8); + byte[] resp = (t.getRequestURI() + "\n").getBytes(StandardCharsets.UTF_8); try (InputStream is = t.getRequestBody()) { is.readAllBytes(); } t.sendResponseHeaders(200, -1); // chunked/variable try (OutputStream os = t.getResponseBody()) { - os.write(resp); + for (int i=0 ; i < REPEAT_RESPONSE; i++) { + os.write(resp); + os.flush(); + } } } } From e3084fc3604c8ed87adfd2310429134e4f70d262 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 17 Jan 2024 21:31:45 +0000 Subject: [PATCH 157/261] 8304020: Speed up test/jdk/java/util/zip/ZipFile/TestTooManyEntries.java and clarify its purpose Backport-of: f0b7eb519ae1cf6f4cb2baea55b5e02a46a8192e --- test/jdk/TEST.groups | 1 - .../util/zip/ZipFile/CenSizeTooLarge.java | 226 ++++++++++++++++++ .../util/zip/ZipFile/TestTooManyEntries.java | 89 ------- 3 files changed, 226 insertions(+), 90 deletions(-) create mode 100644 test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java delete mode 100644 test/jdk/java/util/zip/ZipFile/TestTooManyEntries.java diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups index 660c7e2cdca..93baa891619 100644 --- a/test/jdk/TEST.groups +++ b/test/jdk/TEST.groups @@ -586,7 +586,6 @@ jdk_core_manual_no_input = \ java/net/httpclient/BodyProcessorInputStreamTest.java \ java/net/httpclient/HttpInputStreamTest.java \ java/util/zip/ZipFile/TestZipFile.java \ - java/util/zip/ZipFile/TestTooManyEntries.java \ javax/net/ssl/compatibility/AlpnTest.java \ javax/net/ssl/compatibility/BasicConnectTest.java \ javax/net/ssl/compatibility/HrrTest.java \ diff --git a/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java b/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java new file mode 100644 index 00000000000..4336377e0c8 --- /dev/null +++ b/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8272746 + * @summary Verify that ZipFile rejects a ZIP with a CEN size which does not fit in a Java byte array + * @run junit CenSizeTooLarge + */ + +import org.junit.Before; +import org.junit.Test; + +import java.io.*; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.FileChannel; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class CenSizeTooLarge { + // Maximum allowed CEN size allowed by the ZipFile implementation + static final int MAX_CEN_SIZE = Integer.MAX_VALUE - ZipFile.ENDHDR - 1; + + /** + * From the APPNOTE.txt specification: + * 4.4.10 file name length: (2 bytes) + * 4.4.11 extra field length: (2 bytes) + * 4.4.12 file comment length: (2 bytes) + * + * The length of the file name, extra field, and comment + * fields respectively. The combined length of any + * directory record and these three fields SHOULD NOT + * generally exceed 65,535 bytes. + * + * Since ZipOutputStream does not enforce the 'combined length' clause, + * we simply use 65,535 (0xFFFF) for the purpose of this test. + */ + static final int MAX_EXTRA_FIELD_SIZE = 65_535; + + // Data size (unsigned short) + // Field size minus the leading header 'tag' and 'data size' fields (2 bytes each) + static final short MAX_DATA_SIZE = (short) (MAX_EXTRA_FIELD_SIZE - 2 * Short.BYTES); + + // Tag for the 'unknown' field type, specified in APPNOTE.txt 'Third party mappings' + static final short UNKNOWN_ZIP_TAG = (short) 0x9902; + + // Entry names produced in this test are fixed-length + public static final int NAME_LENGTH = 10; + + // Use a shared LocalDateTime on all entries to save processing time + static final LocalDateTime TIME_LOCAL = LocalDateTime.now(); + + // The size of one CEN header, including the name and the extra field + static final int CEN_HEADER_SIZE = ZipFile.CENHDR + NAME_LENGTH + MAX_EXTRA_FIELD_SIZE; + + // The number of entries needed to exceed the MAX_CEN_SIZE + static final int NUM_ENTRIES = (MAX_CEN_SIZE / CEN_HEADER_SIZE) + 1; + + // Helps SparseOutputStream detect write of the last CEN entry + private static final String LAST_CEN_COMMENT = "LastCEN"; + private static final byte[] LAST_CEN_COMMENT_BYTES = LAST_CEN_COMMENT.getBytes(StandardCharsets.UTF_8); + + // Expected ZipException message when the CEN does not fit in a Java byte array + private static final String CEN_TOO_LARGE_MESSAGE = "invalid END header (central directory size too large)"; + + // Zip file to create for testing + private File hugeZipFile; + + /** + * Create a zip file with a CEN size which does not fit within a Java byte array + */ + @Before + public void setup() throws IOException { + hugeZipFile = new File("cen-too-large.zip"); + hugeZipFile.deleteOnExit(); + + try (OutputStream out = new SparseOutputStream(new FileOutputStream(hugeZipFile)); + ZipOutputStream zip = new ZipOutputStream(out)) { + + // Keep track of entries so we can update extra data before the CEN is written + ZipEntry[] entries = new ZipEntry[NUM_ENTRIES]; + + // Add entries until MAX_CEN_SIZE is reached + for (int i = 0; i < NUM_ENTRIES; i++) { + // Create a fixed-length name for the entry + String name = Integer.toString(i); + name = "0".repeat(NAME_LENGTH - name.length()) + name; + + // Create and track the entry + ZipEntry entry = entries[i] = new ZipEntry(name); + + // Use STORED for faster processing + entry.setMethod(ZipEntry.STORED); + entry.setSize(0); + entry.setCrc(0); + + // Set the time/date field for faster processing + entry.setTimeLocal(TIME_LOCAL); + + if (i == NUM_ENTRIES -1) { + // Help SparseOutputStream detect the last CEN entry write + entry.setComment(LAST_CEN_COMMENT); + } + // Add the entry + zip.putNextEntry(entry); + + + } + // Finish writing the last entry + zip.closeEntry(); + + // Before the CEN headers are written, set the extra data on each entry + byte[] extra = makeLargeExtraField(); + for (ZipEntry entry : entries) { + entry.setExtra(extra); + } + } + } + + /** + * Validates that a ZipException is thrown with the expected message when + * the ZipFile is initialized with a ZIP whose CEN exeeds {@link #MAX_CEN_SIZE} + */ + @Test + public void centralDirectoryTooLargeToFitInByteArray() { + ZipException ex = assertThrows(ZipException.class, () -> new ZipFile(hugeZipFile)); + assertEquals(CEN_TOO_LARGE_MESSAGE, ex.getMessage()); + } + + /** + * We can reduce the number of written CEN headers by making each CEN header maximally large. + * We do this by adding the extra field produced by this method to each CEN header. + *

    + * The structure of an extra field is as follows: + *

    + * Header ID (Two bytes, describes the type of the field, also called 'tag') + * Data Size (Two byte short) + * Data Block (Contents depend on field type) + */ + private byte[] makeLargeExtraField() { + // Make a maximally sized extra field + byte[] extra = new byte[MAX_EXTRA_FIELD_SIZE]; + // Little-endian ByteBuffer for updating the header fields + ByteBuffer buffer = ByteBuffer.wrap(extra).order(ByteOrder.LITTLE_ENDIAN); + + // We use the 'unknown' tag, specified in APPNOTE.TXT, 4.6.1 Third party mappings' + buffer.putShort(UNKNOWN_ZIP_TAG); + + // Size of the actual (empty) data + buffer.putShort(MAX_DATA_SIZE); + return extra; + } + + /** + * By writing sparse 'holes' until the last CEN is detected, we can save disk space + * used by this test from ~2GB to ~4K. Instances of this class should be passed + * directly to the ZipOutputStream constructor, without any buffering. Otherwise, + * writes from ZipOutputStream may not be detected correctly. + */ + private static class SparseOutputStream extends FilterOutputStream { + private final FileChannel channel; + private boolean sparse = true; // True until the last CEN is written + private long position = 0; + + public SparseOutputStream(FileOutputStream fos) { + super(fos); + this.channel = fos.getChannel(); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + position += len; + if (sparse) { + // Until finding the last CEN, we don't actually write anything, + // but instead simply advance the position, creating a sparse file + channel.position(position); + // Check for last CEN record + if (Arrays.equals(LAST_CEN_COMMENT_BYTES, 0, LAST_CEN_COMMENT_BYTES.length, b, off, len)) { + // From here on, write actual bytes + sparse = false; + } + } else { + // Regular write + out.write(b, off, len); + } + } + + @Override + public void write(int b) throws IOException { + position++; + if (sparse) { + channel.position(position); + } else { + out.write(b); + } + } + } +} diff --git a/test/jdk/java/util/zip/ZipFile/TestTooManyEntries.java b/test/jdk/java/util/zip/ZipFile/TestTooManyEntries.java deleted file mode 100644 index 07ed760c1b7..00000000000 --- a/test/jdk/java/util/zip/ZipFile/TestTooManyEntries.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* @test - * @bug 8272746 - * @summary ZipFile can't open big file (NegativeArraySizeException) - * @requires (sun.arch.data.model == "64" & os.maxMemory > 8g) - * @run testng/manual/othervm -Xmx8g TestTooManyEntries - */ - -import org.testng.annotations.BeforeTest; -import org.testng.annotations.Test; - -import java.io.File; -import java.io.BufferedOutputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; -import java.util.zip.ZipOutputStream; -import java.util.UUID; - -import static org.testng.Assert.assertThrows; - -public class TestTooManyEntries { - // Number of directories in the zip file - private static final int DIR_COUNT = 25000; - // Number of entries per directory - private static final int ENTRIES_IN_DIR = 1000; - - // Zip file to create for testing - private File hugeZipFile; - - /** - * Create a zip file and add entries that exceed the CEN limit. - * @throws IOException if an error occurs creating the ZIP File - */ - @BeforeTest - public void setup() throws IOException { - hugeZipFile = File.createTempFile("hugeZip", ".zip", new File(".")); - hugeZipFile.deleteOnExit(); - long startTime = System.currentTimeMillis(); - try (ZipOutputStream zip = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(hugeZipFile)))) { - for (int dirN = 0; dirN < DIR_COUNT; dirN++) { - String dirName = UUID.randomUUID() + "/"; - for (int fileN = 0; fileN < ENTRIES_IN_DIR; fileN++) { - ZipEntry entry = new ZipEntry(dirName + UUID.randomUUID()); - zip.putNextEntry(entry); - zip.closeEntry(); // all files are empty - } - if ((dirN + 1) % 1000 == 0) { - System.out.printf("%s / %s of entries written, file size is %sMb (%ss)%n", - (dirN + 1) * ENTRIES_IN_DIR, DIR_COUNT * ENTRIES_IN_DIR, hugeZipFile.length() / 1024 / 1024, - (System.currentTimeMillis() - startTime) / 1000); - } - } - } - } - - /** - * Validates that the ZipException is thrown when the ZipFile class - * is initialized with a zip file whose entries exceed the CEN limit. - */ - @Test - public void test() { - assertThrows(ZipException.class, () -> new ZipFile(hugeZipFile)); - } -} From 309a16e6093fbcc0d856fcd1009808ddf52f1181 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Thu, 18 Jan 2024 03:49:26 +0000 Subject: [PATCH 158/261] 8323659: LinkedTransferQueue add and put methods call overridable offer Reviewed-by: shade Backport-of: ee4d9aa4c11c47e7cf15f2742919ac20311f9ea7 --- .../util/concurrent/LinkedTransferQueue.java | 11 ++- .../LinkedTransferQueue/SubclassTest.java | 67 +++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 test/jdk/java/util/concurrent/LinkedTransferQueue/SubclassTest.java diff --git a/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java b/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java index 5aef5cd12a1..a0d3176c762 100644 --- a/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java +++ b/src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java @@ -1143,7 +1143,8 @@ public LinkedTransferQueue(Collection c) { * @throws NullPointerException if the specified element is null */ public void put(E e) { - offer(e); + Objects.requireNonNull(e); + xfer(e, -1L); } /** @@ -1156,7 +1157,9 @@ public void put(E e) { * @throws NullPointerException if the specified element is null */ public boolean offer(E e, long timeout, TimeUnit unit) { - return offer(e); + Objects.requireNonNull(e); + xfer(e, -1L); + return true; } /** @@ -1181,7 +1184,9 @@ public boolean offer(E e) { * @throws NullPointerException if the specified element is null */ public boolean add(E e) { - return offer(e); + Objects.requireNonNull(e); + xfer(e, -1L); + return true; } /** diff --git a/test/jdk/java/util/concurrent/LinkedTransferQueue/SubclassTest.java b/test/jdk/java/util/concurrent/LinkedTransferQueue/SubclassTest.java new file mode 100644 index 00000000000..ed9897f6291 --- /dev/null +++ b/test/jdk/java/util/concurrent/LinkedTransferQueue/SubclassTest.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8323659 + * @summary Ensures that the implementation of LTQ add and put methods does + * not call overridable offer. This test specifically asserts implementation + * details of LTQ. It's not that such impl details cannot change, just that + * such a change should be deliberately done with suitable consideration + * to compatibility. + * @run testng SubclassTest + */ + +import java.util.concurrent.LinkedTransferQueue; +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + +@Test +public class SubclassTest { + + public void testPut() { + var queue = new TestLinkedTransferQueue(); + queue.put(new Object()); + assertEquals(queue.size(), 1); + } + + public void testAdd() { + var queue = new TestLinkedTransferQueue(); + queue.add(new Object()); + assertEquals(queue.size(), 1); + } + + public void testTimedOffer() { + var queue = new TestLinkedTransferQueue(); + queue.offer(new Object(), 60, TimeUnit.SECONDS); + assertEquals(queue.size(), 1); + } + + static class TestLinkedTransferQueue extends LinkedTransferQueue { + @Override + public boolean offer(Object obj) { + return false; // simulate fails to add the given obj + } + } +} From 419e01685b36aeccc47f52594a2026ccb2dcebb3 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 18 Jan 2024 08:36:12 +0000 Subject: [PATCH 159/261] 8322098: os::Linux::print_system_memory_info enhance the THP output with /sys/kernel/mm/transparent_hugepage/hpage_pmd_size 8323331: fix typo hpage_pdm_size Reviewed-by: lucy Backport-of: b31454e36234091c3827c3b4d07f62345cb0cee4 --- src/hotspot/os/linux/os_linux.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 2175d34b115..f0081a1de31 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -2157,6 +2157,8 @@ void os::Linux::print_system_memory_info(outputStream* st) { // https://www.kernel.org/doc/Documentation/vm/transhuge.txt _print_ascii_file_h("/sys/kernel/mm/transparent_hugepage/enabled", "/sys/kernel/mm/transparent_hugepage/enabled", st); + _print_ascii_file_h("/sys/kernel/mm/transparent_hugepage/hpage_pmd_size", + "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size", st); _print_ascii_file_h("/sys/kernel/mm/transparent_hugepage/defrag (defrag/compaction efforts parameter)", "/sys/kernel/mm/transparent_hugepage/defrag", st); } From 7eea17b847429edfb9b859322145d4a9689e0d75 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 18 Jan 2024 14:18:41 +0000 Subject: [PATCH 160/261] 8311663: Additional refactoring of Locale tests to JUnit Backport-of: 71cac8ce47b69a2b78d54cbceb0f0510e5ea4cdc --- test/jdk/java/util/Locale/Bug6989440.java | 24 +-- test/jdk/java/util/Locale/Bug8035133.java | 131 ++++++-------- test/jdk/java/util/Locale/Bug8135061.java | 49 +++--- test/jdk/java/util/Locale/Bug8159420.java | 165 +++++++----------- test/jdk/java/util/Locale/Bug8166994.java | 49 +++--- test/jdk/java/util/Locale/Bug8179071.java | 74 ++++---- .../java/util/Locale/FilteringModeTest.java | 84 +++++---- test/jdk/java/util/Locale/HashCodeTest.java | 21 ++- test/jdk/java/util/Locale/ThaiGov.java | 102 ++++------- .../java/util/Locale/UseOldISOCodesTest.java | 23 ++- 10 files changed, 332 insertions(+), 390 deletions(-) diff --git a/test/jdk/java/util/Locale/Bug6989440.java b/test/jdk/java/util/Locale/Bug6989440.java index 42b77d58c29..9dfb911e859 100644 --- a/test/jdk/java/util/Locale/Bug6989440.java +++ b/test/jdk/java/util/Locale/Bug6989440.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,7 +28,7 @@ * thread accesses. * @modules java.base/sun.util.locale.provider * @compile -XDignore.symbol.file=true Bug6989440.java - * @run main Bug6989440 + * @run junit Bug6989440 */ import java.text.spi.DateFormatProvider; import java.util.spi.LocaleNameProvider; @@ -37,11 +37,17 @@ import sun.util.locale.provider.LocaleServiceProviderPool; +import org.junit.jupiter.api.Test; + public class Bug6989440 { static volatile boolean failed; // false static final int THREADS = 50; - public static void main(String[] args) throws Exception { + /* Multiple instances of Locale Service Provider Pool calling + * getAvailableLocales() should not throw ConcurrentModificationException + */ + @Test + public void multiThreadAccessTest() throws Exception { Thread[] threads = new Thread[THREADS]; for (int i=0; i cls; private static int count; - public TestThread(Class providerClass) { - cls = providerClass; - } - public TestThread() { int which = count++ % 3; switch (which) { - case 0 : cls = LocaleNameProvider.class; break; - case 1 : cls = TimeZoneNameProvider.class; break; - case 2 : cls = DateFormatProvider.class; break; - default : throw new AssertionError("Should not reach here"); + case 0 -> cls = LocaleNameProvider.class; + case 1 -> cls = TimeZoneNameProvider.class; + case 2 -> cls = DateFormatProvider.class; + default -> throw new AssertionError("Should not reach here"); } } diff --git a/test/jdk/java/util/Locale/Bug8035133.java b/test/jdk/java/util/Locale/Bug8035133.java index 8d86ca02498..f5f532e3cc6 100644 --- a/test/jdk/java/util/Locale/Bug8035133.java +++ b/test/jdk/java/util/Locale/Bug8035133.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,89 +25,52 @@ * @bug 8035133 * @summary Checks that the tags matching the range with quality weight q=0 * e.g. en;q=0 must be elimited and must not be the part of output + * @run junit Bug8035133 */ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -public class Bug8035133 { - - private static boolean err = false; - - public static void main(String[] args) { - - // checking Locale.lookup with de-ch;q=0 - checkLookup("en;q=0.1, *-ch;q=0.5, de-ch;q=0", - "de-ch, en, fr-ch", "fr-CH"); - - /* checking Locale.lookup with *;q=0 '*' should be ignored - * in lookup - */ - checkLookup("en;q=0.1, *-ch;q=0.5, *;q=0", - "de-ch, en, fr-ch", "de-CH"); - - // checking Locale.filter with fr-ch;q=0 in BASIC_FILTERING - checkFilter("en;q=0.1, fr-ch;q=0.0, de-ch;q=0.5", - "de-ch, en, fr-ch", "de-CH, en"); - - // checking Locale.filter with *;q=0 in BASIC_FILTERING - checkFilter("de-ch;q=0.6, *;q=0", "de-ch, fr-ch", ""); - - // checking Locale.filter with *;q=0 in BASIC_FILTERING - checkFilter("de-ch;q=0.6, de;q=0", "de-ch", ""); - - // checking Locale.filter with *;q=0.6, en;q=0 in BASIC_FILTERING - checkFilter("*;q=0.6, en;q=0", "de-ch, hi-in, en", "de-CH, hi-IN"); - - // checking Locale.filter with de-ch;q=0 in EXTENDED_FILTERING - checkFilter("en;q=0.1, *-ch;q=0.5, de-ch;q=0", - "de-ch, en, fr-ch", "fr-CH, en"); - - /* checking Locale.filter with *-ch;q=0 in EXTENDED_FILTERING which - * must make filter to return "" empty or no match - */ - checkFilter("de-ch;q=0.5, *-ch;q=0", "de-ch, fr-ch", ""); - - /* checking Locale.filter with *;q=0 in EXTENDED_FILTERING which - * must make filter to return "" empty or no match - */ - checkFilter("*-ch;q=0.5, *;q=0", "de-ch, fr-ch", ""); +import static org.junit.jupiter.api.Assertions.assertEquals; - /* checking Locale.filter with *;q=0.6, *-Latn;q=0 in - * EXTENDED_FILTERING - */ - checkFilter("*;q=0.6, *-Latn;q=0", "de-ch, hi-in, en-Latn", - "de-CH, hi-IN"); - - if (err) { - throw new RuntimeException("[LocaleMatcher method(s) failed]"); - } - - } +public class Bug8035133 { - private static void checkLookup(String ranges, String tags, + // Ensure weights with 'q=0' work as expected during lookup + @ParameterizedTest + @MethodSource("lookupProvider") + public void lookupTest(String ranges, String tags, String expectedLocale) { List priorityList = Locale.LanguageRange .parse(ranges); List localeList = generateLocales(tags); Locale loc = Locale.lookup(priorityList, localeList); - String actualLocale - = loc.toLanguageTag(); - - if (!actualLocale.equals(expectedLocale)) { - System.err.println("Locale.lookup failed with ranges: " + ranges - + " Expected: " + expectedLocale - + " Actual: " + actualLocale); - err = true; - } + String actualLocale = loc.toLanguageTag(); + assertEquals(expectedLocale, actualLocale); + } + private static Stream lookupProvider() { + return Stream.of( + // checking Locale.lookup with de-ch;q=0 + Arguments.of("en;q=0.1, *-ch;q=0.5, de-ch;q=0", + "de-ch, en, fr-ch", "fr-CH"), + // checking Locale.lookup with *;q=0 '*' should be ignored in lookup + Arguments.of("en;q=0.1, *-ch;q=0.5, *;q=0", + "de-ch, en, fr-ch", "de-CH") + ); } - private static void checkFilter(String ranges, String tags, + // Ensure weights with 'q=0' work as expected during filtering + @ParameterizedTest + @MethodSource("filterProvider") + public void filterTest(String ranges, String tags, String expectedLocales) { List priorityList = Locale.LanguageRange @@ -115,14 +78,37 @@ private static void checkFilter(String ranges, String tags, List localeList = generateLocales(tags); String actualLocales = getLocalesAsString( Locale.filter(priorityList, localeList)); + assertEquals(expectedLocales, actualLocales); + } - if (!actualLocales.equals(expectedLocales)) { - System.err.println("Locale.filter failed with ranges: " + ranges - + " Expected: " + expectedLocales - + " Actual: " + actualLocales); - err = true; - } - + private static Stream filterProvider() { + return Stream.of( + // checking Locale.filter with fr-ch;q=0 in BASIC_FILTERING + Arguments.of("en;q=0.1, fr-ch;q=0.0, de-ch;q=0.5", + "de-ch, en, fr-ch", "de-CH, en"), + // checking Locale.filter with *;q=0 in BASIC_FILTERING + Arguments.of("de-ch;q=0.6, *;q=0", "de-ch, fr-ch", ""), + // checking Locale.filter with *;q=0 in BASIC_FILTERING + Arguments.of("de-ch;q=0.6, de;q=0", "de-ch", ""), + // checking Locale.filter with *;q=0.6, en;q=0 in BASIC_FILTERING + Arguments.of("*;q=0.6, en;q=0", "de-ch, hi-in, en", "de-CH, hi-IN"), + // checking Locale.filter with de-ch;q=0 in EXTENDED_FILTERING + Arguments.of("en;q=0.1, *-ch;q=0.5, de-ch;q=0", + "de-ch, en, fr-ch", "fr-CH, en"), + /* checking Locale.filter with *-ch;q=0 in EXTENDED_FILTERING which + * must make filter to return "" empty or no match + */ + Arguments.of("de-ch;q=0.5, *-ch;q=0", "de-ch, fr-ch", ""), + /* checking Locale.filter with *;q=0 in EXTENDED_FILTERING which + * must make filter to return "" empty or no match + */ + Arguments.of("*-ch;q=0.5, *;q=0", "de-ch, fr-ch", ""), + /* checking Locale.filter with *;q=0.6, *-Latn;q=0 in + * EXTENDED_FILTERING + */ + Arguments.of("*;q=0.6, *-Latn;q=0", "de-ch, hi-in, en-Latn", + "de-CH, hi-IN") + ); } private static List generateLocales(String tags) { @@ -155,5 +141,4 @@ private static String getLocalesAsString(List locales) { return sb.toString().trim(); } - } diff --git a/test/jdk/java/util/Locale/Bug8135061.java b/test/jdk/java/util/Locale/Bug8135061.java index 50f31d279b3..0e59a9ecbd9 100644 --- a/test/jdk/java/util/Locale/Bug8135061.java +++ b/test/jdk/java/util/Locale/Bug8135061.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,7 +26,7 @@ * @bug 8135061 * @summary Checks that the Locale.lookup executes properly without throwing * any exception for some specific language ranges - * @run main Bug8135061 + * @run junit Bug8135061 */ import java.util.Collection; @@ -35,47 +35,46 @@ import java.util.Locale; import java.util.Locale.LanguageRange; -public class Bug8135061 { +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; - public static void main(String[] args) { +public class Bug8135061 { - /* lookup should run without throwing any exception and - * return null as the language range does not match with the language - * tag - */ + /** + * Lookup should run without throwing any exception and return null as + * the language range does not match with the language tag. + */ + @Test + public void lookupReturnNullTest() { List ranges = LanguageRange.parse("nv"); Collection locales = Collections.singleton(Locale.ENGLISH); - try { Locale match = Locale.lookup(ranges, locales); - if (match != null) { - throw new RuntimeException("Locale.lookup returned non-null: " - + match); - } + assertNull(match); } catch (Exception ex) { throw new RuntimeException("[Locale.lookup failed on language" + " range: " + ranges + " and language tags " + locales + "]", ex); } + } - /* lookup should run without throwing any exception and - * return "nv" as the matching tag - */ - ranges = LanguageRange.parse("i-navajo"); - locales = Collections.singleton(Locale.of("nv")); - + /** + * Lookup should run without throwing any exception and return "nv" + * as the matching tag. + */ + @Test + public void lookupReturnValueTest() { + List ranges = LanguageRange.parse("i-navajo"); + Collection locales = Collections.singleton(Locale.of("nv")); try { Locale match = Locale.lookup(ranges, locales); - if (!match.toLanguageTag().equals("nv")) { - throw new RuntimeException("Locale.lookup returned unexpected" - + " result: " + match); - } + assertEquals(match.toLanguageTag(), "nv"); } catch (Exception ex) { throw new RuntimeException("[Locale.lookup failed on language" + " range: " + ranges + " and language tags " + locales + "]", ex); } - } - } diff --git a/test/jdk/java/util/Locale/Bug8159420.java b/test/jdk/java/util/Locale/Bug8159420.java index 351f60a2616..2e6de243b36 100644 --- a/test/jdk/java/util/Locale/Bug8159420.java +++ b/test/jdk/java/util/Locale/Bug8159420.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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,119 +32,90 @@ * "hı-deva", where 'ı' is the LATIN SMALL LETTER DOTLESS I character * which is not allowed in the language ranges/tags. * @compile -encoding utf-8 Bug8159420.java - * @run main Bug8159420 + * @run junit/othervm -Duser.language=tr -Duser.country=TR Bug8159420 */ +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Locale.LanguageRange; import java.util.Locale.FilteringMode; import java.util.LinkedHashMap; -import java.util.HashMap; -import java.util.Iterator; -import java.util.ArrayList; +import java.util.stream.Stream; + import static java.util.Locale.FilteringMode.EXTENDED_FILTERING; import static java.util.Locale.FilteringMode.AUTOSELECT_FILTERING; -public class Bug8159420 { - - static boolean err = false; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; - public static void main(String[] args) { +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; - Locale origLocale = null; - try { - - origLocale = Locale.getDefault(); - Locale.setDefault(Locale.of("tr", "TR")); - testParse(); - testFilter(EXTENDED_FILTERING); - testFilter(AUTOSELECT_FILTERING); - testLookup(); - testMapEquivalents(); - - if (err) { - throw new RuntimeException("[LocaleMatcher method(s) in turkish" - + " locale failed]"); - } - - } finally { - Locale.setDefault(origLocale); - } - - } +public class Bug8159420 { - /* Before the fix, the testParse() method was throwing - * IllegalArgumentException in Turkish Locale + /* + * Ensure parse() does not throw IllegalArgumentException for the Turkish Locale + * with the given input. */ - private static void testParse() { + @Test + public void parseTest() { String ranges = "HI-Deva, ja-hIrA-JP, RKI"; - try { - LanguageRange.parse(ranges); - } catch (Exception ex) { - System.err.println("[testParse() failed on range string: " - + ranges + "] due to "+ex); - err = true; - } + assertDoesNotThrow(() -> LanguageRange.parse(ranges)); } - /* Before the fix, the testFilter() method was returning empty list in - * Turkish Locale + /* + * Ensure filter() does not return empty list for the Turkish Locale + * with the given input. */ - private static void testFilter(FilteringMode mode) { - + @ParameterizedTest + @MethodSource("modes") + public void filterTest(FilteringMode mode) { String ranges = "hi-IN, itc-Ital"; String tags = "hi-IN, itc-Ital"; List priorityList = LanguageRange.parse(ranges); List tagList = generateLocales(tags); String actualLocales = showLocales(Locale.filter(priorityList, tagList, mode)); String expectedLocales = "hi-IN, itc-Ital"; + assertEquals(expectedLocales, actualLocales); + } - if (!expectedLocales.equals(actualLocales)) { - System.err.println("testFilter(" + mode + ") failed on language ranges:" - + " [" + ranges + "] and language tags: [" + tags + "]"); - err = true; - } + private static Stream modes() { + return Stream.of( + EXTENDED_FILTERING, + AUTOSELECT_FILTERING + ); } - /* Before the fix, the testLookup() method was returning null in Turkish - * Locale + /* + * Ensure lookup() does not return null for the Turkish Locale with + * the given input. */ - private static void testLookup() { - boolean error = false; + @Test + public void lookupTest() { String ranges = "hi-IN, itc-Ital"; String tags = "hi-IN, itc-Ital"; List priorityList = LanguageRange.parse(ranges); List localeList = generateLocales(tags); - Locale actualLocale - = Locale.lookup(priorityList, localeList); - String actualLocaleString = ""; - - if (actualLocale != null) { - actualLocaleString = actualLocale.toLanguageTag(); - } else { - error = true; - } - + Locale actualLocale = Locale.lookup(priorityList, localeList); + assertNotNull(actualLocale); + String actualLocaleString = actualLocale.toLanguageTag(); String expectedLocale = "hi-IN"; - - if (!expectedLocale.equals(actualLocaleString)) { - error = true; - } - - if (error) { - System.err.println("testLookup() failed on language ranges:" - + " [" + ranges + "] and language tags: [" + tags + "]"); - err = true; - } - + assertEquals(expectedLocale, actualLocaleString); } - /* Before the fix, testMapEquivalents() method was returning only "hi-in" - * in Turkish Locale + /* + * Ensure mapEquivalents() does not only return "hi-in" for the Turkish + * Locale with the given input. */ - private static void testMapEquivalents() { - + @Test + public void mapEquivalentsTest() { String ranges = "HI-IN"; List priorityList = LanguageRange.parse(ranges); HashMap> map = new LinkedHashMap<>(); @@ -156,38 +127,29 @@ private static void testMapEquivalents() { List expected = new ArrayList<>(); expected.add(new LanguageRange("hi-in")); expected.add(new LanguageRange("hi-deva-in")); - List got - = LanguageRange.mapEquivalents(priorityList, map); - - if (!areEqual(expected, got)) { - System.err.println("testMapEquivalents() failed"); - err = true; - } - + List got = + LanguageRange.mapEquivalents(priorityList, map); + assertEquals(expected, got, getDifferences(expected, got)); } - private static boolean areEqual(List expected, + private static String getDifferences(List expected, List got) { - - boolean error = false; - if (expected.equals(got)) { - return !error; - } - + StringBuilder diffs = new StringBuilder(); List cloneExpected = new ArrayList<>(expected); cloneExpected.removeAll(got); if (!cloneExpected.isEmpty()) { - error = true; - System.err.println("Found missing range(s): " + cloneExpected); + diffs.append("Found missing range(s): ") + .append(cloneExpected) + .append(System.lineSeparator()); } - - // not creating the 'got' clone as the list will not be used after this - got.removeAll(expected); + List cloneGot = new ArrayList<>(got); + cloneGot.removeAll(expected); if (!got.isEmpty()) { - error = true; - System.err.println("Found extra range(s): " + got); + diffs.append("Got extra range(s): ") + .append(cloneGot) + .append(System.lineSeparator()); } - return !error; + return diffs.toString(); } private static List generateLocales(String tags) { @@ -220,5 +182,4 @@ private static String showLocales(List locales) { return sb.toString().trim(); } - } diff --git a/test/jdk/java/util/Locale/Bug8166994.java b/test/jdk/java/util/Locale/Bug8166994.java index 7dea676107a..e39627ac709 100644 --- a/test/jdk/java/util/Locale/Bug8166994.java +++ b/test/jdk/java/util/Locale/Bug8166994.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ -20,6 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* * @test * @bug 8166884 @@ -27,41 +28,39 @@ * which must generate the same list of language ranges * i.e. the priority list containing equivalents, as in the * first call + * @run junit Bug8166994 */ import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; +import java.util.stream.Stream; -public class Bug8166994 { +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; - public static void main(String[] args) { - List list = Arrays.asList("ccq-aa", "ybd-aa", "rki-aa"); - String ranges = "ccq-aa"; - testParseConsistency(list, ranges); +import static org.junit.jupiter.api.Assertions.assertEquals; - // consecutive call to check the language range parse consistency - testParseConsistency(list, ranges); +public class Bug8166994 { - // another case with ranges consisting of multiple equivalents and - // single equivalents - list = Arrays.asList("gfx-xz", "oun-xz", "mwj-xz", "vaj-xz", - "taj-xy", "tsf-xy"); - ranges = "gfx-xz, taj-xy"; - testParseConsistency(list, ranges); + /* + * Checks that consecutive calls to parse the same language ranges + * generate the same list of language ranges. + */ + @ParameterizedTest + @MethodSource("ranges") + public void parseConsistencyTest(List list, String ranges) { // consecutive call to check the language range parse consistency testParseConsistency(list, ranges); - + testParseConsistency(list, ranges); } + // Ensure that parsing the ranges returns the expected list. private static void testParseConsistency(List list, String ranges) { List priorityList = parseRanges(ranges); - if (!list.equals(priorityList)) { - throw new RuntimeException("Failed to parse the language range [" - + ranges + "], Expected: " + list + " Found: " - + priorityList); - } + assertEquals(list, priorityList, "Failed to parse the language range:"); } private static List parseRanges(String s) { @@ -70,5 +69,13 @@ private static List parseRanges(String s) { .collect(Collectors.toList()); } + // Ranges that have multiple equivalents and single equivalents. + private static Stream ranges() { + return Stream.of( + Arguments.of(Arrays.asList("ccq-aa", "ybd-aa", "rki-aa"), + "ccq-aa"), + Arguments.of(Arrays.asList("gfx-xz", "oun-xz", "mwj-xz", + "vaj-xz", "taj-xy", "tsf-xy"), "gfx-xz, taj-xy") + ); + } } - diff --git a/test/jdk/java/util/Locale/Bug8179071.java b/test/jdk/java/util/Locale/Bug8179071.java index bb4ae5dfa40..97e6b0118a3 100644 --- a/test/jdk/java/util/Locale/Bug8179071.java +++ b/test/jdk/java/util/Locale/Bug8179071.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,10 +26,10 @@ * @bug 8179071 8202537 8231273 8251317 * @summary Test that language aliases of CLDR supplemental metadata are handled correctly. * @modules jdk.localedata - * @run main/othervm -Djava.locale.providers=CLDR Bug8179071 + * @run junit/othervm -Djava.locale.providers=CLDR Bug8179071 */ -/** +/* * This fix is dependent on a particular version of CLDR data. */ @@ -38,53 +38,61 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Locale; -import java.util.Map; import java.util.Set; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class Bug8179071 { - // Deprecated and Legacy tags. - // As of CLDR 38, language aliases for some of the legacy tags have been removed. + /* + * Deprecated and Legacy tags. + * As of CLDR 38, language aliases for some legacy tags have been removed. + */ private static final Set LegacyAliases = Set.of( "zh-guoyu", "zh-min-nan", "i-klingon", "i-tsu", "sgn-CH-DE", "mo", "i-tay", "scc", "i-hak", "sgn-BE-FR", "i-lux", "tl", "zh-hakka", "i-ami", "aa-SAAHO", "zh-xiang", "i-pwn", "sgn-BE-NL", "jw", "sh", "i-bnn"); - // expected month format data for locales after language aliases replacement. - private static final Map shortJanuaryNames = Map.of( "pa-PK", "\u0a1c\u0a28", - "uz-AF" , "yan", - "sr-ME", "\u0458\u0430\u043d", - "scc", "\u0458\u0430\u043d", - "sh", "jan", - "ha-Latn-NE", "Jan", - "i-lux", "Jan."); - - private static void test(String tag, String expected) { + // Ensure the display name for the given tag's January is correct + @ParameterizedTest + @MethodSource("shortJanuaryNames") + public void janDisplayNameTest(String tag, String expected) { Locale target = Locale.forLanguageTag(tag); Month day = Month.JANUARY; TextStyle style = TextStyle.SHORT; String actual = day.getDisplayName(style, target); - if (!actual.equals(expected)) { - throw new RuntimeException("failed for locale " + tag + " actual output " + actual +" does not match with " + expected); - } + assertEquals(expected, actual); } - /** - * getAvailableLocales() should not contain any deprecated or Legacy language tags - */ - private static void checkInvalidTags() { - Set invalidTags = new HashSet<>(); - Arrays.asList(Locale.getAvailableLocales()).stream() - .map(loc -> loc.toLanguageTag()) - .forEach( tag -> {if(LegacyAliases.contains(tag)) {invalidTags.add(tag);}}); - if (!invalidTags.isEmpty()) { - throw new RuntimeException("failed: Deprecated and Legacy tags found " + invalidTags + " in AvailableLocales "); - } + // Expected month format data for locales after language aliases replacement. + private static Stream shortJanuaryNames() { + return Stream.of( + Arguments.of("pa-PK", "\u0a1c\u0a28"), + Arguments.of("uz-AF", "yan"), + Arguments.of("sr-ME", "\u0458\u0430\u043d"), + Arguments.of("scc", "\u0458\u0430\u043d"), + Arguments.of("sh", "jan"), + Arguments.of("ha-Latn-NE", "Jan"), + Arguments.of("i-lux", "Jan.") + ); } - public static void main(String[] args) { - shortJanuaryNames.forEach(Bug8179071::test); - checkInvalidTags(); + // getAvailableLocales() should not contain any deprecated or Legacy language tags + @Test + public void invalidTagsTest() { + Set invalidTags = new HashSet<>(); + Arrays.stream(Locale.getAvailableLocales()) + .map(Locale::toLanguageTag) + .forEach(tag -> {if(LegacyAliases.contains(tag)) {invalidTags.add(tag);}}); + assertTrue(invalidTags.isEmpty(), + "Deprecated and Legacy tags found " + invalidTags + " in AvailableLocales "); } } diff --git a/test/jdk/java/util/Locale/FilteringModeTest.java b/test/jdk/java/util/Locale/FilteringModeTest.java index 949a3ad4e54..185f4aff08a 100644 --- a/test/jdk/java/util/Locale/FilteringModeTest.java +++ b/test/jdk/java/util/Locale/FilteringModeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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,67 +25,61 @@ * @test * @bug 8210443 * @summary Check values() and valueOf(String name) of Locale.FilteringMode. - * @run main FilteringModeTest + * @run junit FilteringModeTest */ import java.util.Arrays; import java.util.List; import java.util.Locale.FilteringMode; import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class FilteringModeTest { - private static boolean err = false; - private static List modeNames = List.of("AUTOSELECT_FILTERING", - "EXTENDED_FILTERING", - "IGNORE_EXTENDED_RANGES", - "MAP_EXTENDED_RANGES", - "REJECT_EXTENDED_RANGES"); - public static void main(String[] args) throws Exception { - testValues(); - testValueOf(); + private static final List expectedModeNames = List.of( + "AUTOSELECT_FILTERING", + "EXTENDED_FILTERING", + "IGNORE_EXTENDED_RANGES", + "MAP_EXTENDED_RANGES", + "REJECT_EXTENDED_RANGES" + ); - if (err) { - throw new RuntimeException("Failed."); - } + // Ensure valueOf() exceptions are thrown + @Test + public void valueOfExceptionsTest() { + assertThrows(IllegalArgumentException.class, + () -> FilteringMode.valueOf("").name()); + assertThrows(NullPointerException.class, + () -> FilteringMode.valueOf(null).name()); } - private static void testValueOf() { - try { - FilteringMode.valueOf("").name(); - err = true; - System.err.println("IAE should be thrown for valueOf(\"\")."); - } catch (IllegalArgumentException ex) { - } - - try { - FilteringMode.valueOf(null).name(); - err = true; - System.err.println("NPE should be thrown for valueOf(null)."); - } catch (NullPointerException ex) { - } + // Ensure valueOf() returns expected results + @ParameterizedTest + @MethodSource("modes") + public void valueOfTest(String expectedName) { + String name = FilteringMode.valueOf(expectedName).name(); + assertEquals(expectedName, name); + } - modeNames.forEach((expectedName) -> { - String name = FilteringMode.valueOf(expectedName).name(); - if (!expectedName.equals(name)) { - err = true; - System.err.println("FilteringMode.valueOf(" + expectedName - + ") returned unexpected value. Expected: " - + expectedName + ", got: " + name); - } - }); + private static Stream modes() { + return expectedModeNames.stream(); } - private static void testValues() { + // Ensure values() returns expected results + @Test + public void valuesTest() { FilteringMode[] modeArray = FilteringMode.values(); - List modeNames2 = Arrays.stream(modeArray) + List actualNames = Arrays.stream(modeArray) .map(mode -> mode.name()) .collect(Collectors.toList()); - - if (!modeNames.equals(modeNames2)) { - err = true; - System.err.println("FilteringMode.values() returned unexpected value. Expected:" - + modeNames + " Got:" + modeNames2); - } + assertEquals(expectedModeNames, actualNames); } } diff --git a/test/jdk/java/util/Locale/HashCodeTest.java b/test/jdk/java/util/Locale/HashCodeTest.java index a911515274f..d6601f81a6d 100644 --- a/test/jdk/java/util/Locale/HashCodeTest.java +++ b/test/jdk/java/util/Locale/HashCodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -20,28 +20,35 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* * @test * @bug 4944561 * @summary Test hashCode() to have less than 10% of hash code conflicts. * @modules jdk.localedata + * @run junit HashCodeTest */ import java.util.HashMap; import java.util.Locale; import java.util.Map; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertFalse; + public class HashCodeTest { - public static void main(String[] args) { + // Ensure Locale.hashCode() has less than 10% conflicts + @Test + public void hashConflictsTest() { Locale[] locales = Locale.getAvailableLocales(); int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; Map map = new HashMap<>(locales.length); int conflicts = 0; - for (int i = 0; i < locales.length; i++) { - Locale loc = locales[i]; + for (Locale loc : locales) { int hc = loc.hashCode(); min = Math.min(hc, min); max = Math.max(hc, max); @@ -55,9 +62,7 @@ public static void main(String[] args) { } System.out.println(locales.length + " locales: conflicts=" + conflicts + ", min=" + min + ", max=" + max + ", diff=" + (max - min)); - if (conflicts >= (locales.length / 10)) { - throw new RuntimeException("too many conflicts: " + conflicts - + " per " + locales.length + " locales"); - } + assertFalse(conflicts >= (locales.length / 10), + String.format("%s conflicts per %s locales", conflicts, locales.length)); } } diff --git a/test/jdk/java/util/Locale/ThaiGov.java b/test/jdk/java/util/Locale/ThaiGov.java index 7fea6a36015..ce6ea003068 100644 --- a/test/jdk/java/util/Locale/ThaiGov.java +++ b/test/jdk/java/util/Locale/ThaiGov.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -20,98 +20,70 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/** + +/* * @test * @bug 4474409 + * @summary Tests some localized methods with Thai locale * @author John O'Conner * @modules jdk.localedata - * @run main/othervm -Djava.locale.providers=COMPAT ThaiGov + * @run junit/othervm -Djava.locale.providers=COMPAT ThaiGov */ -import java.util.*; -import java.text.*; - -public class ThaiGov { +import java.text.DateFormat; +import java.text.NumberFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; +import java.util.TimeZone; - ThaiGov() { - System.out.println("ThaiGov locale test..."); +import org.junit.jupiter.api.Test; - } - - void numberTest() throws RuntimeException { - final String strExpected = "\u0E51\u0E52\u002C\u0E53\u0E54\u0E55\u002C\u0E56\u0E57\u0E58\u002E\u0E52\u0E53\u0E54"; - final double value = 12345678.234; +import static org.junit.jupiter.api.Assertions.assertEquals; - Locale locTH = Locale.of("th", "TH", "TH"); - - // th_TH_TH test - NumberFormat nf = NumberFormat.getInstance(locTH); - String str = nf.format(value); +public class ThaiGov { - if (!strExpected.equals(str)) { - throw new RuntimeException(); - } + private static final double VALUE = 12345678.234; + private static final Locale TH = Locale.of("th", "TH", "TH"); + // Test number formatting for thai + @Test + public void numberTest() { + final String strExpected = "\u0E51\u0E52\u002C\u0E53\u0E54\u0E55\u002C\u0E56\u0E57\u0E58\u002E\u0E52\u0E53\u0E54"; + NumberFormat nf = NumberFormat.getInstance(TH); + String str = nf.format(VALUE); + assertEquals(strExpected, str); } - void currencyTest() throws RuntimeException { + // Test currency formatting for Thai + @Test + public void currencyTest() { final String strExpected = "\u0E3F\u0E51\u0E52\u002C\u0E53\u0E54\u0E55\u002C\u0E56\u0E57\u0E58\u002E\u0E52\u0E53"; - final double value = 12345678.234; - - Locale locTH = Locale.of("th", "TH", "TH"); - - // th_TH_TH test - NumberFormat nf = NumberFormat.getCurrencyInstance(locTH); - String str = nf.format(value); - - if (!strExpected.equals(str)) { - throw new RuntimeException(); - } - + NumberFormat nf = NumberFormat.getCurrencyInstance(TH); + String str = nf.format(VALUE); + assertEquals(strExpected, str); } - void dateTest() throws RuntimeException { - Locale locTH = Locale.of("th", "TH", "TH"); - TimeZone tz = TimeZone.getTimeZone("PST"); - + // Test date formatting for Thai + @Test + public void dateTest() { + TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles"); Calendar calGregorian = Calendar.getInstance(tz, Locale.US); calGregorian.clear(); calGregorian.set(2002, 4, 1, 8, 30); final Date date = calGregorian.getTime(); - Calendar cal = Calendar.getInstance(tz, locTH); + Calendar cal = Calendar.getInstance(tz, TH); cal.clear(); cal.setTime(date); final String strExpected = "\u0E27\u0E31\u0E19\u0E1E\u0E38\u0E18\u0E17\u0E35\u0E48\u0020\u0E51\u0020\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21\u0020\u0E1E\u002E\u0E28\u002E\u0020\u0E52\u0E55\u0E54\u0E55\u002C\u0020\u0E58\u0020\u0E19\u0E32\u0E2C\u0E34\u0E01\u0E32\u0020\u0E53\u0E50\u0020\u0E19\u0E32\u0E17\u0E35\u0020\u0E50\u0E50\u0020\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"; - Date value = cal.getTime(); + Date value = cal.getTime(); // th_TH_TH test - DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locTH); + DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, TH); df.setTimeZone(tz); String str = df.format(value); - - if (!strExpected.equals(str)) { - throw new RuntimeException(); - } - + assertEquals(strExpected, str); } - - public static void main(String[] args) { - - ThaiGov app = new ThaiGov(); - System.out.print("Running numberTest..."); - app.numberTest(); - System.out.print("Finished\n"); - System.out.print("Running currencyTest..."); - app.currencyTest(); - System.out.print("Finished\n"); - System.out.print("Running dateTest..."); - app.dateTest(); - System.out.print("Finished\n"); - - System.out.println("PASSED"); - } - - } diff --git a/test/jdk/java/util/Locale/UseOldISOCodesTest.java b/test/jdk/java/util/Locale/UseOldISOCodesTest.java index fc1771cb533..b38537bceca 100644 --- a/test/jdk/java/util/Locale/UseOldISOCodesTest.java +++ b/test/jdk/java/util/Locale/UseOldISOCodesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, 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 @@ -20,18 +20,27 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/** + +/* * @test * @bug 8295232 * @summary Ensures java.locale.useOldISOCodes is statically initialized * @library /test/lib - * @run main UseOldISOCodesTest + * @run junit UseOldISOCodesTest */ + import java.util.Locale; import jdk.test.lib.process.ProcessTools; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + public class UseOldISOCodesTest { - public static void main(String[] args) throws Exception { + + // Ensure java.locale.useOldISOCodes is only interpreted at runtime startup + @Test + public void staticInitializationTest() throws Exception { ProcessTools.executeTestJvm("-Djava.locale.useOldISOCodes=true", "UseOldISOCodesTest$Runner") .outputTo(System.out) .errorTo(System.err) @@ -43,11 +52,11 @@ static class Runner { private static final String newCode = "he"; public static void main(String[] args) { + // Should have no effect System.setProperty("java.locale.useOldISOCodes", "false"); Locale locale = Locale.of(newCode); - if(!obsoleteCode.equals(locale.getLanguage())){ - throw new RuntimeException("Expected that newcode mapped to old "); - } + assertEquals(obsoleteCode, locale.getLanguage(), + "newCode 'he' was not mapped to 'iw' with useOldISOCodes=true"); } } } From c79c5efa4de89457a5b5ef5e88bc63c320558aef Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 18 Jan 2024 14:21:00 +0000 Subject: [PATCH 161/261] 8315241: (fs) Move toRealPath tests in java/nio/file/Path/Misc.java to separate JUnit 5 test Backport-of: dd64a4a483a831fd66912491af10502c4cf8596b --- test/jdk/java/nio/file/Path/Misc.java | 145 +-------------- test/jdk/java/nio/file/Path/ToRealPath.java | 191 ++++++++++++++++++++ 2 files changed, 193 insertions(+), 143 deletions(-) create mode 100644 test/jdk/java/nio/file/Path/ToRealPath.java diff --git a/test/jdk/java/nio/file/Path/Misc.java b/test/jdk/java/nio/file/Path/Misc.java index 98a68446d22..550f4588f20 100644 --- a/test/jdk/java/nio/file/Path/Misc.java +++ b/test/jdk/java/nio/file/Path/Misc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, 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 @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 6838333 7029979 8295753 + * @bug 4313887 6838333 7029979 * @summary Unit test for miscellenous java.nio.file.Path methods * @library .. /test/lib * @build jdk.test.lib.Platform @@ -32,28 +32,17 @@ import java.io.*; import java.nio.file.*; -import static java.nio.file.LinkOption.*; - import jdk.test.lib.Platform; public class Misc { - static boolean supportsLinks; - public static void main(String[] args) throws IOException { Path dir = TestUtil.createTemporaryDirectory(); try { - supportsLinks = TestUtil.supportsLinks(dir); - // equals and hashCode methods testEqualsAndHashCode(); // toFile method testToFile(dir); - - // toRealPath method - testToRealPath(dir); - - } finally { TestUtil.removeAll(dir); } @@ -92,136 +81,6 @@ static void testToFile(Path dir) throws IOException { assertTrue(d.toPath().equals(dir)); } - /** - * Exercise toRealPath method - */ - static void testToRealPath(Path dir) throws IOException { - final Path file = Files.createFile(dir.resolve("foo")); - final Path link = dir.resolve("link"); - - /** - * Test: toRealPath() will access same file as toRealPath(NOFOLLOW_LINKS) - */ - assertTrue(Files.isSameFile(file.toRealPath(), file.toRealPath(NOFOLLOW_LINKS))); - - /** - * Test: toRealPath should fail if file does not exist - */ - Path doesNotExist = dir.resolve("DoesNotExist"); - try { - doesNotExist.toRealPath(); - throw new RuntimeException("IOException expected"); - } catch (IOException expected) { - } - try { - doesNotExist.toRealPath(NOFOLLOW_LINKS); - throw new RuntimeException("IOException expected"); - } catch (IOException expected) { - } - - /** - * Test: toRealPath() should resolve links - */ - if (supportsLinks) { - Path resolvedFile = file; - if (Platform.isWindows()) { - // Path::toRealPath does not work with environments using the - // legacy subst mechanism. This is a workaround to keep the - // test working if 'dir' points to a location on a subst drive. - // See JDK-8213216. - // - Path tempLink = dir.resolve("tempLink"); - Files.createSymbolicLink(tempLink, dir.toAbsolutePath()); - Path resolvedDir = tempLink.toRealPath(); - Files.delete(tempLink); - resolvedFile = resolvedDir.resolve(file.getFileName()); - } - - Files.createSymbolicLink(link, resolvedFile.toAbsolutePath()); - assertTrue(link.toRealPath().equals(resolvedFile.toRealPath())); - Files.delete(link); - } - - /** - * Test: toRealPath(NOFOLLOW_LINKS) should not resolve links - */ - if (supportsLinks) { - Files.createSymbolicLink(link, file.toAbsolutePath()); - assertTrue(link.toRealPath(NOFOLLOW_LINKS).getFileName().equals(link.getFileName())); - Files.delete(link); - } - - /** - * Test: toRealPath(NOFOLLOW_LINKS) with broken link - */ - if (supportsLinks) { - Path broken = Files.createSymbolicLink(link, doesNotExist); - assertTrue(link.toRealPath(NOFOLLOW_LINKS).getFileName().equals(link.getFileName())); - Files.delete(link); - } - - /** - * Test: toRealPath should eliminate "." - */ - assertTrue(dir.resolve(".").toRealPath().equals(dir.toRealPath())); - assertTrue(dir.resolve(".").toRealPath(NOFOLLOW_LINKS).equals(dir.toRealPath(NOFOLLOW_LINKS))); - - /** - * Test: toRealPath should eliminate ".." when it doesn't follow a - * symbolic link - */ - Path subdir = Files.createDirectory(dir.resolve("subdir")); - assertTrue(subdir.resolve("..").toRealPath().equals(dir.toRealPath())); - assertTrue(subdir.resolve("..").toRealPath(NOFOLLOW_LINKS).equals(dir.toRealPath(NOFOLLOW_LINKS))); - - /** - * Test: toRealPath yields accurate case of path elements when - * not following links - */ - if (Platform.isOSX()) { - // theTarget = dir/subdir/theTarget - Path theTarget = Path.of(subdir.toString(), "theTarget"); - Files.createFile(theTarget); - - // dir/theLink -> dir/subdir - Path theLink = Path.of(dir.toString(), "theLink"); - Files.createSymbolicLink(theLink, subdir); - - // thePath = dir/thelink/thetarget (all lower case) - Path thePath = Path.of(dir.toString(), "thelink", "thetarget"); - Path noFollow = thePath.toRealPath(NOFOLLOW_LINKS); - int nc = noFollow.getNameCount(); - - // Real path should retain case as dir/theLink/theTarget - assertTrue(noFollow.getName(nc - 2).equals(Path.of("theLink"))); - assertTrue(noFollow.getName(nc - 1).equals(Path.of("theTarget"))); - assertTrue(noFollow.toString().equals( - Path.of(dir.toString(), "theLink", "theTarget").toString())); - - // Test where a link is preceded by ".." in the path - Path superBeforeLink = - Path.of(subdir.toString(), "..", "thelink", "thetarget"); - noFollow = superBeforeLink.toRealPath(NOFOLLOW_LINKS); - nc = noFollow.getNameCount(); - assertTrue(noFollow.getName(nc - 2).equals(Path.of("theLink"))); - assertTrue(noFollow.getName(nc - 1).equals(Path.of("theTarget"))); - - // Test where a link is followed by ".." in the path - Path linkBeforeSuper = - Path.of(dir.toString(), "thelink", "..", "subdir", "thetarget"); - noFollow = linkBeforeSuper.toRealPath(NOFOLLOW_LINKS); - nc = noFollow.getNameCount(); - assertTrue(noFollow.getName(nc - 4).equals(Path.of("theLink"))); - assertTrue(noFollow.getName(nc - 1).equals(Path.of("theTarget"))); - - Files.delete(theTarget); - } - - // clean-up - Files.delete(subdir); - Files.delete(file); - } - static void assertTrue(boolean okay) { if (!okay) throw new RuntimeException("Assertion Failed"); diff --git a/test/jdk/java/nio/file/Path/ToRealPath.java b/test/jdk/java/nio/file/Path/ToRealPath.java new file mode 100644 index 00000000000..bbf7973b4ff --- /dev/null +++ b/test/jdk/java/nio/file/Path/ToRealPath.java @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8295753 + * @summary Verify correct operation of Path.toRealPath + * @library .. /test/lib + * @build ToRealPath jdk.test.lib.Platform + * @run junit ToRealPath + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import jdk.test.lib.Platform; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIf; +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; + +import static java.nio.file.LinkOption.*; +import static org.junit.jupiter.api.Assertions.*; + +public class ToRealPath { + static final boolean SUPPORTS_LINKS; + static final Path DIR; + static final Path SUBDIR; + static final Path FILE; + static final Path LINK; + + static { + try { + DIR = TestUtil.createTemporaryDirectory(); + SUBDIR = Files.createDirectory(DIR.resolve("subdir")); + FILE = Files.createFile(DIR.resolve("foo")); + LINK = DIR.resolve("link"); + SUPPORTS_LINKS = TestUtil.supportsLinks(DIR); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }; + + public boolean supportsLinks() { + return SUPPORTS_LINKS; + } + + @Test + public void locateSameFile() throws IOException { + assertTrue(Files.isSameFile(FILE.toRealPath(), + FILE.toRealPath(NOFOLLOW_LINKS))); + } + + @Test + public void failNotExist() { + Path doesNotExist = DIR.resolve("DoesNotExist"); + assertThrows(IOException.class, () -> doesNotExist.toRealPath()); + } + + @Test + public void failNotExistNoFollow() { + Path doesNotExist = DIR.resolve("DoesNotExist"); + assertThrows(IOException.class, + () -> doesNotExist.toRealPath(NOFOLLOW_LINKS)); + } + + @EnabledIf("supportsLinks") + @Test + public void shouldResolveLinks() throws IOException { + Path resolvedFile = FILE; + if (Platform.isWindows()) { + // Path::toRealPath does not work with environments using the + // legacy subst mechanism. This is a workaround to keep the + // test working if 'dir' points to a location on a subst drive. + // See JDK-8213216. + // + Path tempLink = DIR.resolve("tempLink"); + Files.createSymbolicLink(tempLink, DIR.toAbsolutePath()); + Path resolvedDir = tempLink.toRealPath(); + Files.delete(tempLink); + resolvedFile = resolvedDir.resolve(FILE.getFileName()); + } + + Files.createSymbolicLink(LINK, resolvedFile.toAbsolutePath()); + assertTrue(LINK.toRealPath().equals(resolvedFile.toRealPath())); + Files.delete(LINK); + } + + @Test + @EnabledIf("supportsLinks") + public void shouldNotResolveLinks() throws IOException { + Files.createSymbolicLink(LINK, FILE.toAbsolutePath()); + assertEquals(LINK.toRealPath(NOFOLLOW_LINKS).getFileName(), + LINK.getFileName()); + Files.delete(LINK); + } + + @Test + public void eliminateDot() throws IOException { + assertEquals(DIR.resolve(".").toRealPath(), + DIR.toRealPath()); + } + + @Test + public void eliminateDotNoFollow() throws IOException { + assertEquals(DIR.resolve(".").toRealPath(NOFOLLOW_LINKS), + DIR.toRealPath(NOFOLLOW_LINKS)); + } + + @Test + public void eliminateDots() throws IOException { + assertEquals(SUBDIR.resolve("..").toRealPath(), + DIR.toRealPath()); + } + + @Test + public void eliminateDotsNoFollow() throws IOException { + assertEquals(SUBDIR.resolve("..").toRealPath(NOFOLLOW_LINKS), + DIR.toRealPath(NOFOLLOW_LINKS)); + } + + @Test + @EnabledOnOs(OS.MAC) + public final void macOSTests() throws IOException { + // theTarget = dir/subdir/theTarget + Path theTarget = Path.of(SUBDIR.toString(), "theTarget"); + Files.createFile(theTarget); + + // dir/theLink -> dir/subdir + Path theLink = Path.of(DIR.toString(), "theLink"); + Files.createSymbolicLink(theLink, SUBDIR); + + // thePath = dir/thelink/thetarget (all lower case) + Path thePath = Path.of(DIR.toString(), "thelink", "thetarget"); + Path noFollow = thePath.toRealPath(NOFOLLOW_LINKS); + int nc = noFollow.getNameCount(); + + // Real path should retain case as dir/theLink/theTarget + assertEquals(noFollow.getName(nc - 2), Path.of("theLink")); + assertEquals(noFollow.getName(nc - 1), Path.of("theTarget")); + assertEquals(noFollow.toString(), + Path.of(DIR.toString(), "theLink", "theTarget").toString()); + + // Test where a link is preceded by ".." in the path + Path superBeforeLink = + Path.of(SUBDIR.toString(), "..", "thelink", "thetarget"); + noFollow = superBeforeLink.toRealPath(NOFOLLOW_LINKS); + nc = noFollow.getNameCount(); + assertEquals(noFollow.getName(nc - 2), Path.of("theLink")); + assertEquals(noFollow.getName(nc - 1), Path.of("theTarget")); + + // Test where a link is followed by ".." in the path + Path linkBeforeSuper = + Path.of(DIR.toString(), "thelink", "..", "subdir", "thetarget"); + noFollow = linkBeforeSuper.toRealPath(NOFOLLOW_LINKS); + nc = noFollow.getNameCount(); + assertEquals(noFollow.getName(nc - 4), Path.of("theLink")); + assertEquals(noFollow.getName(nc - 1), Path.of("theTarget")); + + Files.delete(theTarget); + } + + @AfterAll + public static void cleanup() throws IOException { + Files.delete(SUBDIR); + Files.delete(FILE); + } +} From 8413dc002067fedd81d98939b5a036c655e0d376 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 18 Jan 2024 14:21:36 +0000 Subject: [PATCH 162/261] 8312136: Modify runtime/ErrorHandling/TestDwarf.java to split dwarf and decoder testing Backport-of: e2e8e8e210ea9a7a9d901a1da729551714015d04 --- test/hotspot/jtreg/ProblemList.txt | 2 +- .../runtime/ErrorHandling/TestDwarf.java | 42 ++++++++++++++++--- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 8b2226a679f..3264c682882 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -107,7 +107,7 @@ runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 runtime/ErrorHandling/CreateCoredumpOnCrash.java 8267433 macosx-x64 runtime/CompressedOops/CompressedClassPointers.java 8305765 generic-all runtime/StackGuardPages/TestStackGuardPagesNative.java 8303612 linux-all -runtime/ErrorHandling/TestDwarf.java 8305489 linux-all +runtime/ErrorHandling/TestDwarf.java#checkDecoder 8305489 linux-all runtime/ErrorHandling/MachCodeFramesInErrorFile.java 8313315 linux-ppc64le applications/jcstress/copy.java 8229852 linux-all diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java index df7d8a5b44a..2ae46a36229 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java @@ -22,7 +22,7 @@ */ /* - * @test + * @test id=checkDecoder * @bug 8242181 * @library / /test/lib * @summary Test DWARF parser with various crashes if debug symbols are available. If the libjvm debug symbols are not @@ -30,7 +30,15 @@ * by the environment variable _JVM_DWARF_PATH, then no verification of the hs_err_file is done for libjvm.so. * @requires vm.debug == true & vm.flagless & vm.compMode != "Xint" & os.family == "linux" & !vm.graal.enabled & vm.gc.G1 * @modules java.base/jdk.internal.misc - * @run main/native/othervm -Xbootclasspath/a:. -XX:-CreateCoredumpOnCrash TestDwarf + * @run main/native/othervm -Xbootclasspath/a:. -XX:-CreateCoredumpOnCrash -DcheckDecoder=true TestDwarf + */ + +/* + * @test id=dontCheckDecoder + * @library / /test/lib + * @requires vm.debug == true & vm.flagless & vm.compMode != "Xint" & os.family == "linux" & !vm.graal.enabled & vm.gc.G1 + * @modules java.base/jdk.internal.misc + * @run main/native/othervm -Xbootclasspath/a:. -XX:-CreateCoredumpOnCrash -DcheckDecoder=false TestDwarf */ import jdk.test.lib.Asserts; @@ -55,6 +63,8 @@ public class TestDwarf { System.loadLibrary("TestDwarf"); } + static boolean checkDecoder = Boolean.getBoolean("checkDecoder"); + public static void main(String[] args) throws Exception { if (args.length != 0) { switch (args[0]) { @@ -118,6 +128,13 @@ private static void test() throws Exception { new DwarfConstraint(0, "dereference_null", "libTestDwarfHelper.h", 44)); } + // The full pattern accepts lines like: + // V [libjvm.so+0x8f4ed8] report_fatal(VMErrorType, char const*, int, char const*, ...)+0x78 (debug.cpp:212) + // but if the decoder is not available we only get + // V [libjvm.so+0x8f4ed8] (debug.cpp:212) + private static final String FULL_PATTERN ="[CV][\\s\\t]+\\[([a-zA-Z0-9_.]+)\\+0x.+][\\s\\t]+.*\\+0x.+[\\s\\t]+\\([a-zA-Z0-9_.]+\\.[a-z]+:[1-9][0-9]*\\)"; + private static final String NO_DECODER_PATTERN ="[CV][\\s\\t]+\\[([a-zA-Z0-9_.]+)\\+0x.+].*\\([a-zA-Z0-9_.]+\\.[a-z]+:[1-9][0-9]*\\)"; + private static void runAndCheck(Flags flags, DwarfConstraint... constraints) throws Exception { OutputAnalyzer crashOut; crashOut = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(flags.getFlags())); @@ -132,7 +149,9 @@ private static void runAndCheck(Flags flags, DwarfConstraint... constraints) thr boolean foundNativeFrames = false; int matches = 0; int frameIdx = 0; - Pattern pattern = Pattern.compile("[CV][\\s\\t]+\\[([a-zA-Z0-9_.]+)\\+0x.+][\\s\\t]+.*\\+0x.+[\\s\\t]+\\([a-zA-Z0-9_.]+\\.[a-z]+:[1-9][0-9]*\\)"); + + Pattern pattern = Pattern.compile(checkDecoder ? FULL_PATTERN : NO_DECODER_PATTERN); + // Check all stack entries after the line starting with "Native frames" in the hs_err_file until an empty line // is found which denotes the end of the stack frames. while ((line = reader.readLine()) != null) { @@ -147,7 +166,7 @@ private static void runAndCheck(Flags flags, DwarfConstraint... constraints) thr // Line numbers have at least one digit and start with non-zero ([1-9][0-9]*). Matcher matcher = pattern.matcher(line); if (!matcher.find()) { - checkNoSourceLine(crashOutputString, line); + checkMissingElement(crashOutputString, line); } // Check additional DWARF constraints @@ -168,12 +187,15 @@ private static void runAndCheck(Flags flags, DwarfConstraint... constraints) thr } /** - * There are some valid cases where we cannot find source information. Check these. + * After we failed to match the pattern, try to determine what element was missing. + * There are some valid cases where we cannot find source information. */ - private static void checkNoSourceLine(String crashOutputString, String line) { + private static void checkMissingElement(String crashOutputString, String line) { + // First check if we got the library name. Pattern pattern = Pattern.compile("[CV][\\s\\t]+\\[([a-zA-Z0-9_.-]+)\\+0x.+]"); Matcher matcher = pattern.matcher(line); Asserts.assertTrue(matcher.find(), "Must find library name in \"" + line + "\""); + // Check if there are symbols available for library. If not, then we cannot find any source information for this library. // This can happen if this test is run without any JDK debug symbols at all but also for some libraries like libpthread.so // which usually has no symbols available. @@ -181,6 +203,14 @@ private static void checkNoSourceLine(String crashOutputString, String line) { pattern = Pattern.compile("Failed to load DWARF file for library.*" + library + ".*or find DWARF sections directly inside it"); matcher = pattern.matcher(crashOutputString); if (!matcher.find()) { + // Symbols were fine so check if we expected decoder output and didn't find it. + if (checkDecoder) { + pattern = Pattern.compile(NO_DECODER_PATTERN); + matcher = pattern.matcher(line); + if (matcher.find()) { + Asserts.fail("Could not find decoded method signature in \"" + line + "\""); + } + } bailoutIfUnsupportedDwarfVersion(crashOutputString); Asserts.fail("Could not find filename or line number in \"" + line + "\""); } From 0d30c8d497a15a28f6fcae2ae8f6bdcba878d260 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 18 Jan 2024 14:23:09 +0000 Subject: [PATCH 163/261] 8318590: JButton ignores margin when painting HTML text Backport-of: acaf2c8dcfd5235f758af2fe3e308b72263113e4 --- .../classes/com/apple/laf/AquaButtonUI.java | 15 +- .../javax/swing/plaf/basic/BasicButtonUI.java | 17 +- .../swing/plaf/synth/SynthGraphicsUtils.java | 24 +-- .../HtmlButtonImageTest.java | 145 ------------------ 4 files changed, 16 insertions(+), 185 deletions(-) delete mode 100644 test/jdk/javax/swing/JButton/HtmlButtonImageTest/HtmlButtonImageTest.java diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java index 8a86b86f80e..dab893252cf 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java @@ -338,20 +338,10 @@ public void paint(final Graphics g, final JComponent c) { } // performs icon and text rect calculations - final String text; - final Icon icon = b.getIcon(); - final View v = (View)c.getClientProperty(BasicHTML.propertyKey); - if (v != null && icon == null) { - // use zero insets for HTML without an icon - // since layout only handles text calculations - text = layoutAndGetText(g, b, aquaBorder, new Insets(0,0,0,0), - viewRect, iconRect, textRect); - } else { - text = layoutAndGetText(g, b, aquaBorder, i, viewRect, iconRect, textRect); - } + final String text = layoutAndGetText(g, b, aquaBorder, i, viewRect, iconRect, textRect); // Paint the Icon - if (icon != null) { + if (b.getIcon() != null) { paintIcon(g, b, iconRect); } @@ -360,6 +350,7 @@ public void paint(final Graphics g, final JComponent c) { } if (text != null && !text.isEmpty()) { + final View v = (View)c.getClientProperty(BasicHTML.propertyKey); if (v != null) { v.paint(g, textRect); } else { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java index a334fe4f390..c7c036e859f 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, 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,8 +25,6 @@ package javax.swing.plaf.basic; -import sun.awt.AppContext; -import sun.swing.SwingUtilities2; import java.awt.AWTKeyStroke; import java.awt.Component; import java.awt.Dimension; @@ -61,6 +59,9 @@ import javax.swing.plaf.UIResource; import javax.swing.text.View; +import sun.awt.AppContext; +import sun.swing.SwingUtilities2; + /** * BasicButton implementation * @@ -598,15 +599,7 @@ public Component.BaselineResizeBehavior getBaselineResizeBehavior( private String layout(AbstractButton b, FontMetrics fm, int width, int height) { - Insets i; - - final View v = (View)b.getClientProperty(BasicHTML.propertyKey); - if (v != null) { - i = new Insets(0, 0, 0, 0); - } else { - i = b.getInsets(); - } - + Insets i = b.getInsets(); viewRect.x = i.left; viewRect.y = i.top; viewRect.width = width - (i.right + viewRect.x); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java index 586b280120e..487a90d5119 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java @@ -24,8 +24,6 @@ */ package javax.swing.plaf.synth; -import sun.swing.MenuItemLayoutHelper; -import sun.swing.SwingUtilities2; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -37,13 +35,15 @@ import javax.swing.ButtonModel; import javax.swing.Icon; -import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JMenuItem; import javax.swing.SwingUtilities; import javax.swing.plaf.basic.BasicHTML; import javax.swing.text.View; +import sun.swing.MenuItemLayoutHelper; +import sun.swing.SwingUtilities2; + /** * Wrapper for primitive graphics calls. * @@ -392,19 +392,10 @@ public void paintText(SynthContext ss, Graphics g, String text, FontMetrics fm = SwingUtilities2.getFontMetrics(c, g); Insets insets = SynthLookAndFeel.getPaintingInsets(ss, paintInsets); - final View v = (View)c.getClientProperty(BasicHTML.propertyKey); - - if (c instanceof JButton && v != null) { - paintViewR.x = 0; - paintViewR.y = 0; - paintViewR.width = c.getWidth(); - paintViewR.height = c.getHeight(); - } else { - paintViewR.x = insets.left; - paintViewR.y = insets.top; - paintViewR.width = c.getWidth() - (insets.left + insets.right); - paintViewR.height = c.getHeight() - (insets.top + insets.bottom); - } + paintViewR.x = insets.left; + paintViewR.y = insets.top; + paintViewR.width = c.getWidth() - (insets.left + insets.right); + paintViewR.height = c.getHeight() - (insets.top + insets.bottom); paintIconR.x = paintIconR.y = paintIconR.width = paintIconR.height = 0; paintTextR.x = paintTextR.y = paintTextR.width = paintTextR.height = 0; @@ -430,6 +421,7 @@ public void paintText(SynthContext ss, Graphics g, String text, } if (text != null) { + View v = (View) c.getClientProperty(BasicHTML.propertyKey); if (v != null) { v.paint(g, paintTextR); } else { diff --git a/test/jdk/javax/swing/JButton/HtmlButtonImageTest/HtmlButtonImageTest.java b/test/jdk/javax/swing/JButton/HtmlButtonImageTest/HtmlButtonImageTest.java deleted file mode 100644 index 105f2376ae9..00000000000 --- a/test/jdk/javax/swing/JButton/HtmlButtonImageTest/HtmlButtonImageTest.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. -*/ - -/* - * @test - * @bug 8015854 - * @summary Tests HTML image as JButton text for unwanted padding - * @run main HtmlButtonImageTest - */ - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; - -import javax.imageio.ImageIO; -import javax.swing.JButton; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; - -import static java.awt.image.BufferedImage.TYPE_INT_ARGB; - -public final class HtmlButtonImageTest { - private static JButton button; - private static Path testDir; - private static BufferedImage image; - - private static final int BUTTON_HEIGHT = 37; - private static final int BUTTON_WIDTH = 37; - private static final int SQUARE_HEIGHT = 19; - private static final int SQUARE_WIDTH = 19; - private static final int centerX = BUTTON_WIDTH / 2; - private static final int centerY = BUTTON_HEIGHT / 2; - private static final int minX = centerX - (SQUARE_WIDTH / 2); - private static final int minY = centerY - (SQUARE_HEIGHT / 2); - private static final int maxX = centerX + (SQUARE_WIDTH / 2); - private static final int maxY = centerY + (SQUARE_HEIGHT / 2); - - private static boolean supportedLaf; - private static int failCount = 0; - private static String currentLaf = new String(); - private static StringBuffer failedLafs = new StringBuffer(); - - - public static void main(String[] args) throws Exception { - testDir = Path.of(System.getProperty("test.classes", ".")); - generateRedSquare(); - - for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) { - SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); - if(supportedLaf) { - currentLaf = laf.getName(); - SwingUtilities.invokeAndWait(HtmlButtonImageTest::createButton); - SwingUtilities.invokeAndWait(HtmlButtonImageTest::paintButton); - - testImageCentering(image.getRGB(centerX, centerY), - image.getRGB(minX, minY), - image.getRGB(minX, maxY), - image.getRGB(maxX, minY), - image.getRGB(maxX, maxY)); - } - } - - if(!failedLafs.isEmpty()) { - if(failCount > 1) { - failedLafs.setLength(failedLafs.length() - 2); - } - throw new RuntimeException("HTML image not centered in button " + - "for these L&F's: " + failedLafs); - } - } - - private static void generateRedSquare() throws IOException { - BufferedImage bImg = new BufferedImage(SQUARE_WIDTH, SQUARE_HEIGHT, - TYPE_INT_ARGB); - Graphics2D cg = bImg.createGraphics(); - cg.setColor(Color.RED); - cg.fillRect(0, 0, SQUARE_WIDTH, SQUARE_HEIGHT); - ImageIO.write(bImg, "png", new File(testDir + "/red_square.png")); - } - - private static void createButton() { - button = new JButton(); - button.setSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT)); - button.setText(""); - } - - private static void paintButton() { - image = new BufferedImage(BUTTON_HEIGHT, BUTTON_WIDTH, TYPE_INT_ARGB); - Graphics2D graphics2D = image.createGraphics(); - button.paint(graphics2D); - graphics2D.dispose(); - } - - private static boolean checkRedColor(int rgb) { - return (rgb == Color.RED.getRGB()); - } - - private static void testImageCentering(int... colors) throws IOException { - for (int c : colors) { - if (!checkRedColor(c)) { - failCount++; - ImageIO.write(image, "png", new File(testDir + "/fail_image_" + - currentLaf.replaceAll("[^\\w\\s]","") + ".png")); - failedLafs.append(currentLaf + ", "); - break; - } - } - } - - private static void setLookAndFeel(UIManager.LookAndFeelInfo laf) { - try { - UIManager.setLookAndFeel(laf.getClassName()); - supportedLaf = true; - } catch (UnsupportedLookAndFeelException | ClassNotFoundException | - InstantiationException | IllegalAccessException e) { - supportedLaf = false; - } - } -} From c8f04185f185d01c94dbf104899b5de13630ad6f Mon Sep 17 00:00:00 2001 From: Richard Reingruber Date: Thu, 18 Jan 2024 14:54:00 +0000 Subject: [PATCH 164/261] 8310031: Parallel: Implement better work distribution for large object arrays in old gen Backport-of: 4bfe226870a15306b1e015c38fe3835f26b41fe6 --- src/hotspot/share/gc/parallel/psCardTable.cpp | 351 +++++++++++------- src/hotspot/share/gc/parallel/psCardTable.hpp | 55 ++- .../share/gc/parallel/psPromotionManager.hpp | 1 + .../gc/parallel/psPromotionManager.inline.hpp | 5 + src/hotspot/share/gc/parallel/psScavenge.cpp | 9 +- 5 files changed, 264 insertions(+), 157 deletions(-) diff --git a/src/hotspot/share/gc/parallel/psCardTable.cpp b/src/hotspot/share/gc/parallel/psCardTable.cpp index d08ad157261..4d63cdb9a3f 100644 --- a/src/hotspot/share/gc/parallel/psCardTable.cpp +++ b/src/hotspot/share/gc/parallel/psCardTable.cpp @@ -33,6 +33,7 @@ #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/prefetch.inline.hpp" +#include "utilities/spinYield.hpp" #include "utilities/align.hpp" // Checks an individual oop for missing precise marks. Mark @@ -123,70 +124,184 @@ static void prefetch_write(void *p) { } } -// postcondition: ret is a dirty card or end_card -CardTable::CardValue* PSCardTable::find_first_dirty_card(CardValue* const start_card, - CardValue* const end_card) { - for (CardValue* i_card = start_card; i_card < end_card; ++i_card) { - if (*i_card != PSCardTable::clean_card_val()) { - return i_card; - } +void PSCardTable::scan_obj_with_limit(PSPromotionManager* pm, + oop obj, + HeapWord* start, + HeapWord* end) { + if (!obj->is_typeArray()) { + prefetch_write(start); + pm->push_contents_bounded(obj, start, end); } - return end_card; } -// postcondition: ret is a clean card or end_card -// Note: if a part of an object is on a dirty card, all cards this object -// resides on are considered dirty. -CardTable::CardValue* PSCardTable::find_first_clean_card(ObjectStartArray* const start_array, - CardValue* const start_card, - CardValue* const end_card) { - assert(start_card == end_card || - *start_card != PSCardTable::clean_card_val(), "precondition"); - // Skip the first dirty card. - CardValue* i_card = start_card + 1; - while (i_card < end_card) { - if (*i_card != PSCardTable::clean_card_val()) { - i_card++; - continue; - } - assert(i_card - 1 >= start_card, "inv"); - assert(*(i_card - 1) != PSCardTable::clean_card_val(), "prev card must be dirty"); - // Find the final obj on the prev dirty card. - HeapWord* obj_addr = start_array->object_start(addr_for(i_card)-1); - HeapWord* obj_end_addr = obj_addr + cast_to_oop(obj_addr)->size(); - CardValue* final_card_by_obj = byte_for(obj_end_addr - 1); - assert(final_card_by_obj < end_card, "inv"); - if (final_card_by_obj <= i_card) { - return i_card; +void PSCardTable::pre_scavenge(HeapWord* old_gen_bottom, uint active_workers) { + _preprocessing_active_workers = active_workers; +} + +// The "shadow" table is a copy of the card table entries of the current stripe. +// It is used to separate card reading, clearing and redirtying which reduces +// complexity significantly. +class PSStripeShadowCardTable { + typedef CardTable::CardValue CardValue; + + const uint _card_shift; + const uint _card_size; + CardValue _table[PSCardTable::num_cards_in_stripe]; + const CardValue* _table_base; + +public: + PSStripeShadowCardTable(PSCardTable* pst, HeapWord* const start, HeapWord* const end) : + _card_shift(CardTable::card_shift()), + _card_size(CardTable::card_size()), + _table_base(_table - (uintptr_t(start) >> _card_shift)) { + size_t stripe_byte_size = pointer_delta(end, start) * HeapWordSize; + size_t copy_length = align_up(stripe_byte_size, _card_size) >> _card_shift; + // The end of the last stripe may not be card aligned as it is equal to old + // gen top at scavenge start. We should not clear the card containing old gen + // top if not card aligned because there can be promoted objects on that + // same card. If it was marked dirty because of the promoted objects and we + // cleared it, we would loose a card mark. + size_t clear_length = align_down(stripe_byte_size, _card_size) >> _card_shift; + CardValue* stripe_start_card = pst->byte_for(start); + memcpy(_table, stripe_start_card, copy_length); + memset(stripe_start_card, CardTable::clean_card_val(), clear_length); + } + + HeapWord* addr_for(const CardValue* const card) { + assert(card >= _table && card <= &_table[PSCardTable::num_cards_in_stripe], "out of bounds"); + return (HeapWord*) ((card - _table_base) << _card_shift); + } + + const CardValue* card_for(HeapWord* addr) { + return &_table_base[uintptr_t(addr) >> _card_shift]; + } + + bool is_dirty(const CardValue* const card) { + return !is_clean(card); + } + + bool is_clean(const CardValue* const card) { + assert(card >= _table && card < &_table[PSCardTable::num_cards_in_stripe], "out of bounds"); + return *card == PSCardTable::clean_card_val(); + } + + const CardValue* find_first_dirty_card(const CardValue* const start, + const CardValue* const end) { + for (const CardValue* i = start; i < end; ++i) { + if (is_dirty(i)) { + return i; + } } - // This final obj extends beyond i_card, check if this new card is dirty. - if (*final_card_by_obj == PSCardTable::clean_card_val()) { - return final_card_by_obj; + return end; + } + + const CardValue* find_first_clean_card(const CardValue* const start, + const CardValue* const end) { + for (const CardValue* i = start; i < end; ++i) { + if (is_clean(i)) { + return i; + } } - // This new card is dirty, continuing the search... - i_card = final_card_by_obj + 1; + return end; } - return end_card; -} +}; + +template +void PSCardTable::process_range(Func&& object_start, + PSPromotionManager* pm, + HeapWord* const start, + HeapWord* const end) { + assert(start < end, "precondition"); + assert(is_card_aligned(start), "precondition"); + + PSStripeShadowCardTable sct(this, start, end); + + // end might not be card-aligned. + const CardValue* end_card = sct.card_for(end - 1) + 1; -void PSCardTable::clear_cards(CardValue* const start, CardValue* const end) { - for (CardValue* i_card = start; i_card < end; ++i_card) { - *i_card = clean_card; + for (HeapWord* i_addr = start; i_addr < end; /* empty */) { + const CardValue* dirty_l = sct.find_first_dirty_card(sct.card_for(i_addr), end_card); + const CardValue* dirty_r = sct.find_first_clean_card(dirty_l, end_card); + + assert(dirty_l <= dirty_r, "inv"); + + if (dirty_l == dirty_r) { + assert(dirty_r == end_card, "inv"); + break; + } + + // Located a non-empty dirty chunk [dirty_l, dirty_r). + HeapWord* addr_l = sct.addr_for(dirty_l); + HeapWord* addr_r = MIN2(sct.addr_for(dirty_r), end); + + // Scan objects overlapping [addr_l, addr_r) limited to [start, end). + HeapWord* obj_addr = object_start(addr_l); + + while (true) { + assert(obj_addr < addr_r, "inv"); + + oop obj = cast_to_oop(obj_addr); + const bool is_obj_array = obj->is_objArray(); + HeapWord* const obj_end_addr = obj_addr + obj->size(); + + if (is_obj_array) { + // Always scan obj arrays precisely (they are always marked precisely) + // to avoid unnecessary work. + scan_obj_with_limit(pm, obj, addr_l, addr_r); + } else { + if (obj_addr < i_addr && i_addr > start) { + // Already scanned this object. Has been one that spans multiple dirty chunks. + // The second condition makes sure objects reaching in the stripe are scanned once. + } else { + scan_obj_with_limit(pm, obj, addr_l, end); + } + } + + if (obj_end_addr >= addr_r) { + i_addr = is_obj_array ? addr_r : obj_end_addr; + break; + } + + // Move to next obj inside this dirty chunk. + obj_addr = obj_end_addr; + } + + // Finished a dirty chunk. + pm->drain_stacks_cond_depth(); } } -void PSCardTable::scan_objects_in_range(PSPromotionManager* pm, - HeapWord* start, - HeapWord* end) { - HeapWord* obj_addr = start; - while (obj_addr < end) { - oop obj = cast_to_oop(obj_addr); - assert(oopDesc::is_oop(obj), "inv"); - prefetch_write(obj_addr); - pm->push_contents(obj); - obj_addr += obj->size(); +template +void PSCardTable::preprocess_card_table_parallel(Func&& object_start, + HeapWord* old_gen_bottom, + HeapWord* old_gen_top, + uint stripe_index, + uint n_stripes) { + const size_t num_cards_in_slice = num_cards_in_stripe * n_stripes; + CardValue* cur_card = byte_for(old_gen_bottom) + stripe_index * num_cards_in_stripe; + CardValue* const end_card = byte_for(old_gen_top - 1) + 1; + + for (/* empty */; cur_card < end_card; cur_card += num_cards_in_slice) { + HeapWord* stripe_addr = addr_for(cur_card); + if (is_dirty(cur_card)) { + // The first card of this stripe is already dirty, no need to see if the + // reaching-in object is a potentially imprecisely marked non-array + // object. + continue; + } + HeapWord* first_obj_addr = object_start(stripe_addr); + if (first_obj_addr == stripe_addr) { + // No object reaching into this stripe. + continue; + } + oop first_obj = cast_to_oop(first_obj_addr); + if (!first_obj->is_array() && is_dirty(byte_for(first_obj_addr))) { + // Found a non-array object reaching into the stripe that has + // potentially been marked imprecisely. Mark first card of the stripe + // dirty so it will be processed later. + *cur_card = dirty_card_val(); + } } - pm->drain_stacks_cond_depth(); } // We get passed the space_top value to prevent us from traversing into @@ -227,103 +342,61 @@ void PSCardTable::scan_objects_in_range(PSPromotionManager* pm, // slice_size_in_words to the start of stripe 0 in slice 0 to get to the start // of stripe 0 in slice 1. +// Scavenging and accesses to the card table are strictly limited to the stripe. +// In particular scavenging of an object crossing stripe boundaries is shared +// among the threads assigned to the stripes it resides on. This reduces +// complexity and enables shared scanning of large objects. +// It requires preprocessing of the card table though where imprecise card marks of +// objects crossing stripe boundaries are propagated to the first card of +// each stripe covered by the individual object. + void PSCardTable::scavenge_contents_parallel(ObjectStartArray* start_array, - MutableSpace* sp, - HeapWord* space_top, + HeapWord* old_gen_bottom, + HeapWord* old_gen_top, PSPromotionManager* pm, uint stripe_index, uint n_stripes) { - const size_t num_cards_in_stripe = 128; - const size_t stripe_size_in_words = num_cards_in_stripe * _card_size_in_words; - const size_t slice_size_in_words = stripe_size_in_words * n_stripes; - - HeapWord* cur_stripe_addr = sp->bottom() + stripe_index * stripe_size_in_words; - - for (/* empty */; cur_stripe_addr < space_top; cur_stripe_addr += slice_size_in_words) { - // exclusive - HeapWord* const cur_stripe_end_addr = MIN2(cur_stripe_addr + stripe_size_in_words, - space_top); - - // Process a stripe iff it contains any obj-start - if (!start_array->object_starts_in_range(cur_stripe_addr, cur_stripe_end_addr)) { - continue; + // ObjectStartArray queries can be expensive for large objects. We cache known objects. + struct { + HeapWord* start_addr; + HeapWord* end_addr; + } cached_obj {nullptr, old_gen_bottom}; + + // Queries must be monotonic because we don't check addr >= cached_obj.start_addr. + auto object_start = [&] (HeapWord* addr) { + if (addr < cached_obj.end_addr) { + assert(cached_obj.start_addr != nullptr, "inv"); + return cached_obj.start_addr; } + HeapWord* result = start_array->object_start(addr); - // Constraints: - // 1. range of cards checked for being dirty or clean: [iter_limit_l, iter_limit_r) - // 2. range of cards can be cleared: [clear_limit_l, clear_limit_r) - // 3. range of objs (obj-start) can be scanned: [first_obj_addr, cur_stripe_end_addr) - - CardValue* iter_limit_l; - CardValue* iter_limit_r; - CardValue* clear_limit_l; - CardValue* clear_limit_r; - - // Identify left ends and the first obj-start inside this stripe. - HeapWord* first_obj_addr = start_array->object_start(cur_stripe_addr); - if (first_obj_addr < cur_stripe_addr) { - // this obj belongs to previous stripe; can't clear any cards it occupies - first_obj_addr += cast_to_oop(first_obj_addr)->size(); - clear_limit_l = byte_for(first_obj_addr - 1) + 1; - iter_limit_l = byte_for(first_obj_addr); - } else { - assert(first_obj_addr == cur_stripe_addr, "inv"); - iter_limit_l = clear_limit_l = byte_for(cur_stripe_addr); - } + cached_obj.start_addr = result; + cached_obj.end_addr = result + cast_to_oop(result)->size(); - assert(cur_stripe_addr <= first_obj_addr, "inside this stripe"); - assert(first_obj_addr <= cur_stripe_end_addr, "can be empty"); + return result; + }; - { - // Identify right ends. - HeapWord* obj_addr = start_array->object_start(cur_stripe_end_addr - 1); - HeapWord* obj_end_addr = obj_addr + cast_to_oop(obj_addr)->size(); - assert(obj_end_addr >= cur_stripe_end_addr, "inv"); - clear_limit_r = byte_for(obj_end_addr); - iter_limit_r = byte_for(obj_end_addr - 1) + 1; - } - - assert(iter_limit_l <= clear_limit_l && - clear_limit_r <= iter_limit_r, "clear cards only if we iterate over them"); - - // Process dirty chunks, i.e. consecutive dirty cards [dirty_l, dirty_r), - // chunk by chunk inside [iter_limit_l, iter_limit_r). - CardValue* dirty_l; - CardValue* dirty_r; - - for (CardValue* cur_card = iter_limit_l; cur_card < iter_limit_r; cur_card = dirty_r + 1) { - dirty_l = find_first_dirty_card(cur_card, iter_limit_r); - dirty_r = find_first_clean_card(start_array, dirty_l, iter_limit_r); - assert(dirty_l <= dirty_r, "inv"); - - // empty - if (dirty_l == dirty_r) { - assert(dirty_r == iter_limit_r, "no more dirty cards in this stripe"); - break; - } - - assert(*dirty_l != clean_card, "inv"); - assert(*dirty_r == clean_card || dirty_r >= clear_limit_r, - "clean card or belonging to next stripe"); + // Prepare scavenge. + preprocess_card_table_parallel(object_start, old_gen_bottom, old_gen_top, stripe_index, n_stripes); - // Process this non-empty dirty chunk in two steps: - { - // 1. Clear card in [dirty_l, dirty_r) subject to [clear_limit_l, clear_limit_r) constraint - clear_cards(MAX2(dirty_l, clear_limit_l), - MIN2(dirty_r, clear_limit_r)); - } - - { - // 2. Scan objs in [dirty_l, dirty_r) subject to [first_obj_addr, cur_stripe_end_addr) constraint - HeapWord* obj_l = MAX2(start_array->object_start(addr_for(dirty_l)), - first_obj_addr); + // Sync with other workers. + Atomic::dec(&_preprocessing_active_workers); + SpinYield spin_yield; + while (Atomic::load_acquire(&_preprocessing_active_workers) > 0) { + spin_yield.wait(); + } - HeapWord* obj_r = MIN2(addr_for(dirty_r), - cur_stripe_end_addr); + // Scavenge + cached_obj = {nullptr, old_gen_bottom}; + const size_t stripe_size_in_words = num_cards_in_stripe * _card_size_in_words; + const size_t slice_size_in_words = stripe_size_in_words * n_stripes; + HeapWord* cur_addr = old_gen_bottom + stripe_index * stripe_size_in_words; + for (/* empty */; cur_addr < old_gen_top; cur_addr += slice_size_in_words) { + HeapWord* const stripe_l = cur_addr; + HeapWord* const stripe_r = MIN2(cur_addr + stripe_size_in_words, + old_gen_top); - scan_objects_in_range(pm, obj_l, obj_r); - } - } + process_range(object_start, pm, stripe_l, stripe_r); } } diff --git a/src/hotspot/share/gc/parallel/psCardTable.hpp b/src/hotspot/share/gc/parallel/psCardTable.hpp index 6953c15d37c..b0634d5c0b0 100644 --- a/src/hotspot/share/gc/parallel/psCardTable.hpp +++ b/src/hotspot/share/gc/parallel/psCardTable.hpp @@ -33,7 +33,35 @@ class ObjectStartArray; class PSPromotionManager; class PSCardTable: public CardTable { - private: + friend class PSStripeShadowCardTable; + static constexpr size_t num_cards_in_stripe = 128; + static_assert(num_cards_in_stripe >= 1, "progress"); + + volatile int _preprocessing_active_workers; + + bool is_dirty(CardValue* card) { + return !is_clean(card); + } + + bool is_clean(CardValue* card) { + return *card == clean_card_val(); + } + + // Iterate the stripes with the given index and copy imprecise card marks of + // objects reaching into a stripe to its first card. + template + void preprocess_card_table_parallel(Func&& object_start, + HeapWord* old_gen_bottom, + HeapWord* old_gen_top, + uint stripe_index, + uint n_stripes); + + // Scavenge contents on dirty cards of the given stripe [start, end). + template + void process_range(Func&& object_start, + PSPromotionManager* pm, + HeapWord* const start, + HeapWord* const end); void verify_all_young_refs_precise_helper(MemRegion mr); @@ -42,29 +70,24 @@ class PSCardTable: public CardTable { verify_card = CT_MR_BS_last_reserved + 5 }; - CardValue* find_first_dirty_card(CardValue* const start_card, - CardValue* const end_card); - - CardValue* find_first_clean_card(ObjectStartArray* start_array, - CardValue* const start_card, - CardValue* const end_card); - - void clear_cards(CardValue* const start, CardValue* const end); - - void scan_objects_in_range(PSPromotionManager* pm, - HeapWord* start, - HeapWord* end); + void scan_obj_with_limit(PSPromotionManager* pm, + oop obj, + HeapWord* start, + HeapWord* end); public: - PSCardTable(MemRegion whole_heap) : CardTable(whole_heap) {} + PSCardTable(MemRegion whole_heap) : CardTable(whole_heap), + _preprocessing_active_workers(0) {} static CardValue youngergen_card_val() { return youngergen_card; } static CardValue verify_card_val() { return verify_card; } // Scavenge support + void pre_scavenge(HeapWord* old_gen_bottom, uint active_workers); + // Scavenge contents of stripes with the given index. void scavenge_contents_parallel(ObjectStartArray* start_array, - MutableSpace* sp, - HeapWord* space_top, + HeapWord* old_gen_bottom, + HeapWord* old_gen_top, PSPromotionManager* pm, uint stripe_index, uint n_stripes); diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.hpp index a1d2b38db31..d053ffb6cc9 100644 --- a/src/hotspot/share/gc/parallel/psPromotionManager.hpp +++ b/src/hotspot/share/gc/parallel/psPromotionManager.hpp @@ -177,6 +177,7 @@ class PSPromotionManager { TASKQUEUE_STATS_ONLY(inline void record_steal(ScannerTask task);) void push_contents(oop obj); + void push_contents_bounded(oop obj, HeapWord* left, HeapWord* right); }; #endif // SHARE_GC_PARALLEL_PSPROMOTIONMANAGER_HPP diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp index f702bc48348..c1cbeb0f597 100644 --- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp +++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp @@ -131,6 +131,11 @@ inline void PSPromotionManager::push_contents(oop obj) { } } +inline void PSPromotionManager::push_contents_bounded(oop obj, HeapWord* left, HeapWord* right) { + PSPushContentsClosure pcc(this); + obj->oop_iterate(&pcc, MemRegion(left, right)); +} + template inline oop PSPromotionManager::copy_to_survivor_space(oop o) { assert(should_scavenge(&o), "Sanity"); diff --git a/src/hotspot/share/gc/parallel/psScavenge.cpp b/src/hotspot/share/gc/parallel/psScavenge.cpp index e148d0cebe8..6c35ed6b593 100644 --- a/src/hotspot/share/gc/parallel/psScavenge.cpp +++ b/src/hotspot/share/gc/parallel/psScavenge.cpp @@ -87,7 +87,6 @@ static void scavenge_roots_work(ParallelRootType::Value root_type, uint worker_i assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(worker_id); - PSScavengeRootsClosure roots_closure(pm); PSPromoteRootsClosure roots_to_old_closure(pm); switch (root_type) { @@ -301,6 +300,11 @@ class ScavengeRootsTask : public WorkerTask { _is_old_gen_empty(old_gen->object_space()->is_empty()), _terminator(active_workers, PSPromotionManager::vm_thread_promotion_manager()->stack_array_depth()) { assert(_old_gen != nullptr, "Sanity"); + + if (!_is_old_gen_empty) { + PSCardTable* card_table = ParallelScavengeHeap::heap()->card_table(); + card_table->pre_scavenge(_old_gen->object_space()->bottom(), active_workers); + } } virtual void work(uint worker_id) { @@ -314,8 +318,9 @@ class ScavengeRootsTask : public WorkerTask { PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(worker_id); PSCardTable* card_table = ParallelScavengeHeap::heap()->card_table(); + // The top of the old gen changes during scavenge when objects are promoted. card_table->scavenge_contents_parallel(_old_gen->start_array(), - _old_gen->object_space(), + _old_gen->object_space()->bottom(), _gen_top, pm, worker_id, From 644393769f453f9d2fad7f50b3ca44cd9ff72408 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 18 Jan 2024 16:03:23 +0000 Subject: [PATCH 165/261] 8323008: filter out harmful -std* flags added by autoconf from CXX Backport-of: 68c4286026bc2c0ec0f594e0b96fe03fe5624d6d --- make/autoconf/toolchain.m4 | 6 +++++- make/autoconf/util.m4 | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index 289eec3356b..7a24815d163 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -389,6 +389,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION], # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" CFLAGS="$ORG_CFLAGS" CXXFLAGS="$ORG_CXXFLAGS" + + # filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72 + UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11) + CXX="$cxx_filtered" ]) # Check if a compiler is of the toolchain type we expect, and save the version diff --git a/make/autoconf/util.m4 b/make/autoconf/util.m4 index 83349aea99d..76426005f81 100644 --- a/make/autoconf/util.m4 +++ b/make/autoconf/util.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -199,7 +199,7 @@ AC_DEFUN([UTIL_GET_NON_MATCHING_VALUES], if test -z "$legal_values"; then $1="$2" else - result=`$GREP -Fvx "$legal_values" <<< "$values_to_check" | $GREP -v '^$'` + result=`$GREP -Fvx -- "$legal_values" <<< "$values_to_check" | $GREP -v '^$'` $1=${result//$'\n'/ } fi ]) @@ -226,7 +226,7 @@ AC_DEFUN([UTIL_GET_MATCHING_VALUES], if test -z "$illegal_values"; then $1="" else - result=`$GREP -Fx "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'` + result=`$GREP -Fx -- "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'` $1=${result//$'\n'/ } fi ]) From 95e36bc7e970dd4038d6df0b25cb4ff1c19b6e70 Mon Sep 17 00:00:00 2001 From: Liang Mao Date: Fri, 19 Jan 2024 09:35:01 +0000 Subject: [PATCH 166/261] 8322279: Generational ZGC: Use ZFragmentationLimit and ZYoungCompactionLimit as percentage instead of multiples Reviewed-by: eosterlund Backport-of: bf813be0f30391c67de3ea74c7522d7cbb8d3c3b --- src/hotspot/share/gc/z/zHeuristics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/z/zHeuristics.cpp b/src/hotspot/share/gc/z/zHeuristics.cpp index bcd9dd84405..36ca1177c32 100644 --- a/src/hotspot/share/gc/z/zHeuristics.cpp +++ b/src/hotspot/share/gc/z/zHeuristics.cpp @@ -101,9 +101,9 @@ uint ZHeuristics::nconcurrent_workers() { } size_t ZHeuristics::significant_heap_overhead() { - return MaxHeapSize * ZFragmentationLimit; + return MaxHeapSize * (ZFragmentationLimit / 100); } size_t ZHeuristics::significant_young_overhead() { - return MaxHeapSize * ZYoungCompactionLimit; + return MaxHeapSize * (ZYoungCompactionLimit / 100); } From c3657ee02898ff022fa8bb7fc5d5d77ed74b1011 Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Fri, 19 Jan 2024 15:47:54 +0000 Subject: [PATCH 167/261] 8317771: [macos14] Expand/collapse a JTree using keyboard freezes the application in macOS 14 Sonoma Reviewed-by: asemenov Backport-of: ffa33d7b807bfef6ff05c9adba869dddf813cf68 --- .../sun/lwawt/macosx/CAccessibility.java | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java index 67c8f184ecc..d4526324c58 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java @@ -36,6 +36,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.lang.annotation.Native; +import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashSet; @@ -63,6 +64,7 @@ import javax.swing.JList; import javax.swing.JTree; import javax.swing.KeyStroke; +import javax.swing.tree.TreePath; import sun.awt.AWTAccessor; import sun.lwawt.LWWindowPeer; @@ -757,14 +759,75 @@ private static Object[] getChildrenAndRolesImpl(Accessible a, Component c, int w return new Object[]{childrenAndRoles.get(whichChildren * 2), childrenAndRoles.get((whichChildren * 2) + 1)}; } + private static Accessible createAccessibleTreeNode(JTree t, TreePath p) { + Accessible a = null; + + try { + Class accessibleJTreeNodeClass = Class.forName("javax.swing.JTree$AccessibleJTree$AccessibleJTreeNode"); + Constructor constructor = accessibleJTreeNodeClass.getConstructor(t.getAccessibleContext().getClass(), JTree.class, TreePath.class, Accessible.class); + constructor.setAccessible(true); + a = ((Accessible) constructor.newInstance(t.getAccessibleContext(), t, p, null)); + } catch (Exception e) { + e.printStackTrace(); + } + + return a; + } + // This method is called from the native // Each child takes up three entries in the array: one for itself, one for its role, and one for the recursion level private static Object[] getChildrenAndRolesRecursive(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored, final int level) { if (a == null) return null; return invokeAndWait(new Callable() { public Object[] call() throws Exception { - ArrayList currentLevelChildren = new ArrayList(); ArrayList allChildren = new ArrayList(); + + Accessible at = null; + if (a instanceof CAccessible) { + at = CAccessible.getSwingAccessible(a); + } else { + at = a; + } + + if (at instanceof JTree) { + JTree tree = ((JTree) at); + + if (whichChildren == JAVA_AX_ALL_CHILDREN) { + int count = tree.getRowCount(); + for (int i = 0; i < count; i++) { + TreePath path = tree.getPathForRow(i); + Accessible an = createAccessibleTreeNode(tree, path); + if (an != null) { + AccessibleContext ac = an.getAccessibleContext(); + if (ac != null) { + allChildren.add(an); + allChildren.add(ac.getAccessibleRole());; + allChildren.add(String.valueOf((tree.isRootVisible() ? path.getPathCount() : path.getPathCount() - 1))); + } + } + } + } + + if (whichChildren == JAVA_AX_SELECTED_CHILDREN) { + int count = tree.getSelectionCount(); + for (int i = 0; i < count; i++) { + TreePath path = tree.getSelectionPaths()[i]; + Accessible an = createAccessibleTreeNode(tree, path); + if (an != null) { + AccessibleContext ac = an.getAccessibleContext(); + if (ac != null) { + allChildren.add(an); + allChildren.add(ac.getAccessibleRole()); + allChildren.add(String.valueOf((tree.isRootVisible() ? path.getPathCount() : path.getPathCount() - 1))); + } + } + } + } + + return allChildren.toArray(); + } + + ArrayList currentLevelChildren = new ArrayList(); ArrayList parentStack = new ArrayList(); parentStack.add(a); ArrayList indexses = new ArrayList(); From c01bdbbfb1784bff6ae4b66d156b3c78546ad264 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 19 Jan 2024 15:48:23 +0000 Subject: [PATCH 168/261] 8314283: Support for NSS tests on aarch64 platforms Backport-of: 2a8016096000de5836251f2ca9bc8ad6479e6942 --- .../security/pkcs11/KeyStore/ClientAuth.java | 4 ++ test/jdk/sun/security/pkcs11/PKCS11Test.java | 51 ++++++++++++------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java b/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java index 259f9ed33e4..1af1258d173 100644 --- a/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java +++ b/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java @@ -389,6 +389,10 @@ void startClient (boolean newThread) { * Our client thread just died. */ System.err.println("Client died..."); + // if the exception is thrown before connecting to the + // server, the test will time out and the exception will + // be lost/hidden. + e.printStackTrace(System.err); clientException = e; } }); diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java index 9e6120b724a..1b6f5795110 100644 --- a/test/jdk/sun/security/pkcs11/PKCS11Test.java +++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java @@ -79,6 +79,11 @@ public abstract class PKCS11Test { private static final char[] HEX_DIGITS = "0123456789abcdef".toCharArray(); private static final SecureRandom srdm = new SecureRandom(); + // Version of the NSS artifact. This coincides with the version of + // the NSS version + private static final String NSS_BUNDLE_VERSION = "3.91"; + private static final String NSSLIB = "jpg.tests.jdk.nsslib"; + static double nss_version = -1; static ECCState nss_ecc_status = ECCState.Basic; @@ -807,18 +812,21 @@ static byte[] generateData(int length) { private static String fetchNssLib(String osId) { switch (osId) { - case "Windows-x86-32": - return fetchNssLib(WINDOWS_X86.class); - case "Windows-amd64-64": return fetchNssLib(WINDOWS_X64.class); case "MacOSX-x86_64-64": return fetchNssLib(MACOSX_X64.class); + case "MacOSX-aarch64-64": + return fetchNssLib(MACOSX_AARCH64.class); + case "Linux-amd64-64": return fetchNssLib(LINUX_X64.class); + case "Linux-aarch64-64": + return fetchNssLib(LINUX_AARCH64.class); + default: return null; } @@ -828,8 +836,8 @@ private static String fetchNssLib(Class clazz) { String path = null; try { path = ArtifactResolver.resolve(clazz).entrySet().stream() - .findAny().get().getValue() + File.separator + "nsslib" - + File.separator; + .findAny().get().getValue() + File.separator + "nss" + + File.separator + "lib" + File.separator; } catch (ArtifactResolverException e) { Throwable cause = e.getCause(); if (cause == null) { @@ -931,34 +939,43 @@ protected void copyNssCertKeyToClassesDir(Path dbPath) throws IOException { public static enum ECCState {None, Basic, Extended} @Artifact( - organization = "jpg.tests.jdk.nsslib", + organization = NSSLIB, name = "nsslib-windows_x64", - revision = "3.46-VS2017", + revision = NSS_BUNDLE_VERSION, extension = "zip") private static class WINDOWS_X64 { } @Artifact( - organization = "jpg.tests.jdk.nsslib", - name = "nsslib-windows_x86", - revision = "3.46-VS2017", + organization = NSSLIB, + name = "nsslib-macosx_x64", + revision = NSS_BUNDLE_VERSION, extension = "zip") - private static class WINDOWS_X86 { + private static class MACOSX_X64 { } @Artifact( - organization = "jpg.tests.jdk.nsslib", - name = "nsslib-macosx_x64", - revision = "3.46", + organization = NSSLIB, + name = "nsslib-macosx_aarch64", + revision = NSS_BUNDLE_VERSION, extension = "zip") - private static class MACOSX_X64 { + private static class MACOSX_AARCH64 { } @Artifact( - organization = "jpg.tests.jdk.nsslib", + organization = NSSLIB, name = "nsslib-linux_x64", - revision = "3.46", + revision = NSS_BUNDLE_VERSION, extension = "zip") private static class LINUX_X64 { } + + @Artifact( + organization = NSSLIB, + name = "nsslib-linux_aarch64", + revision = NSS_BUNDLE_VERSION, + extension = "zip" + ) + private static class LINUX_AARCH64{ + } } From 69416f4880ebb7c17f8faa17b52749e7085882de Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 22 Jan 2024 08:18:10 +0000 Subject: [PATCH 169/261] 8318809: java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java shows intermittent failures on linux ppc64le and aarch64 Backport-of: 50d1839d54f13631946925d8ecf03ce71f31bab8 --- .../ConcurrentLinkedQueue/WhiteBox.java | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/test/jdk/java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java b/test/jdk/java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java index 63fd29a8a9a..2ea188aed46 100644 --- a/test/jdk/java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java +++ b/test/jdk/java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java @@ -281,36 +281,6 @@ public void pollActionsOneNodeSlack( assertInvariants(q); } - /** - * Actions that append an element, and are expected to - * leave at most one slack node at tail. - */ - @DataProvider - public Object[][] addActions() { - return List.>of( - q -> q.add(1), - q -> q.offer(1)) - .stream().map(x -> new Object[]{ x }).toArray(Object[][]::new); - } - - @Test(dataProvider = "addActions") - public void addActionsOneNodeSlack( - Consumer addAction) { - ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(); - int n = 1 + rnd.nextInt(5); - for (int i = 0; i < n; i++) { - boolean slack = next(tail(q)) != null; - addAction.accept(q); - if (slack) - assertNull(next(tail(q))); - else { - assertNotNull(next(tail(q))); - assertNull(next(next(tail(q)))); - } - assertInvariants(q); - } - } - byte[] serialBytes(Object o) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); From e9be531942fc42b2630db8e6b63b21f7981c0099 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 22 Jan 2024 08:43:37 +0000 Subject: [PATCH 170/261] 8077371: Binary files in JAXP test should be removed Backport-of: 40106422bd2ae3da98d028bdbab2c240a71081e3 --- .../GregorianCalAndDurSerDataTemplate.java | 70 ++++++ .../GregorianCalAndDurSerDataUtil.java | 141 +++++++++++ .../GregorianCalendarAndDurationSerData.java | 33 +++ ...K6GregorianCalendarAndDurationSerData.java | 129 ++++++++++ .../jaxp/datatype/8033980/JDK6_Duration.ser | Bin 290 -> 0 bytes .../8033980/JDK6_XMLGregorianCalendar.ser | Bin 521 -> 0 bytes ...K7GregorianCalendarAndDurationSerData.java | 127 ++++++++++ .../jaxp/datatype/8033980/JDK7_Duration.ser | Bin 145 -> 0 bytes .../8033980/JDK7_XMLGregorianCalendar.ser | Bin 521 -> 0 bytes ...K8GregorianCalendarAndDurationSerData.java | 128 ++++++++++ .../jaxp/datatype/8033980/JDK8_Duration.ser | Bin 145 -> 0 bytes .../8033980/JDK8_XMLGregorianCalendar.ser | Bin 521 -> 0 bytes ...K9GregorianCalendarAndDurationSerData.java | 127 ++++++++++ .../jaxp/datatype/8033980/JDK9_Duration.ser | Bin 290 -> 0 bytes .../8033980/JDK9_XMLGregorianCalendar.ser | Bin 1208 -> 0 bytes .../datatype/8033980/SerializationTest.java | 225 ++++++++---------- 16 files changed, 860 insertions(+), 120 deletions(-) create mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataTemplate.java create mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataUtil.java create mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalendarAndDurationSerData.java create mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK6GregorianCalendarAndDurationSerData.java delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK6_Duration.ser delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK6_XMLGregorianCalendar.ser create mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK7GregorianCalendarAndDurationSerData.java delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK7_Duration.ser delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK7_XMLGregorianCalendar.ser create mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK8GregorianCalendarAndDurationSerData.java delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK8_Duration.ser delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK8_XMLGregorianCalendar.ser create mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK9GregorianCalendarAndDurationSerData.java delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK9_Duration.ser delete mode 100644 test/jdk/javax/xml/jaxp/datatype/8033980/JDK9_XMLGregorianCalendar.ser diff --git a/test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataTemplate.java b/test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataTemplate.java new file mode 100644 index 00000000000..dfb12c4c0e9 --- /dev/null +++ b/test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataTemplate.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023, 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. + */ + +/** + * This class provide the template for JDK version specific GregorianCalendarAndDurationSerData.java src file. + */ +public class GregorianCalAndDurSerDataTemplate { + public static final String ORACLE_COPY_RIGHT = """ + /* + * Copyright (c) %s, 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. + */ + \s + /** + * Mechanically generated %s specific serialization bytes for XMLGregorianCalendar and Duration data type. + * Do not edit this file. + */"""; + public static final String GREGO_CAL_DUR_SER_CLASS = """ + public class %sGregorianCalendarAndDurationSerData extends GregorianCalendarAndDurationSerData { + %s + %s + @Override + public byte[] getGregorianCalendarByteArray() { + return gregorianCalendarBytes; + } + \s + @Override + public byte[] getDurationBytes() { + return durationBytes; + } + };"""; +} diff --git a/test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataUtil.java b/test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataUtil.java new file mode 100644 index 00000000000..323ba4a802b --- /dev/null +++ b/test/jdk/javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataUtil.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @summary utility to generate Gregorian Calendar and Duration serialized data java classes. + * @run junit/manual GregorianCalAndDurSerDataUtil + */ + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.LocalDate; +import java.util.Formatter; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.Duration; +import javax.xml.datatype.XMLGregorianCalendar; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; + +/** + * Utility to generate the java source file for Gregorian Calendar and Duration serialized data + * for specific version of JDK to be added in SerializationTest. Execute this test with desired version + * of JDK to generate the java source file. + */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class GregorianCalAndDurSerDataUtil { + static String JDK = "JDK" + System.getProperty("java.version"); + static String testsrc = System.getProperty("test.src"); + final static String EXPECTED_CAL = "0001-01-01T00:00:00.0000000-05:00"; + final static String EXPECTED_DURATION = "P1Y1M1DT1H1M1S"; + String srcFilePrefix = JDK.toUpperCase().replace("-", "_"); + + + /** + * Create the serialized Bytes array and serialized bytes base64 string for GregorianCalender and Duration + * with jdk under test and generate the java source file. + * @throws DatatypeConfigurationException Unexpected. + * @throws IOException Unexpected. + */ + @BeforeAll + public void setup() throws DatatypeConfigurationException, IOException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + XMLGregorianCalendar xmlGregorianCalendar = dtf.newXMLGregorianCalendar(EXPECTED_CAL); + Duration duration = dtf.newDuration(EXPECTED_DURATION); + String copyRightStr = GregorianCalAndDurSerDataTemplate.ORACLE_COPY_RIGHT; + String classStr = GregorianCalAndDurSerDataTemplate.GREGO_CAL_DUR_SER_CLASS; + try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); + ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); ObjectOutputStream oos2 = new ObjectOutputStream(baos2)) { + //Serialize the given xmlGregorianCalendar + oos.writeObject(xmlGregorianCalendar); + //Serialize the given xml Duration + oos2.writeObject(duration); + Files.deleteIfExists(Path.of(testsrc,srcFilePrefix+"GregorianCalendarAndDurationSerData.java")); + + copyRightStr = String.format(copyRightStr, LocalDate.now().getYear(), JDK); + classStr = String.format(classStr, srcFilePrefix, generatePseudoCodeForGregCalSerBytes(baos), + generatePseudoCodeForDurationSerBytes(baos2)); + String srcStr = copyRightStr + "\n" + classStr; + Files.writeString(Path.of(testsrc,srcFilePrefix+"GregorianCalendarAndDurationSerData.java"), srcStr); + } + } + + /** + * Verify that Java source file is created. + */ + @Test + void testFileCreated() { + assertTrue(Files.exists(Path.of(testsrc,srcFilePrefix+"GregorianCalendarAndDurationSerData.java"))); + } + + /** + * Generates the Java Pseudo code for serialized Gregorian Calendar byte array. + * @param baos Serialized GregorianCalendar ByteArrayOutputStream. + * @return pseudocode String for serialized Gregorian Calendar byte array. + */ + public static String generatePseudoCodeForGregCalSerBytes(ByteArrayOutputStream baos) { + byte [] bytes = baos.toByteArray(); + StringBuilder sb = new StringBuilder(bytes.length * 5); + sb.append("private final byte[] gregorianCalendarBytes = {"); + return generatePseudoCode(sb, bytes); + } + + /** + * Generates the Java Pseudo code for serialized Duration byte array. + * @param baos Serialized Duration ByteArrayOutputStream. + * @return pseudocode String for serialized Duration byte array. + */ + public static String generatePseudoCodeForDurationSerBytes(ByteArrayOutputStream baos) { + byte [] bytesdur = baos.toByteArray(); + StringBuilder sb = new StringBuilder(bytesdur.length * 5); + sb.append("private final byte[] durationBytes = {"); + return generatePseudoCode(sb, bytesdur); + } + + private static String generatePseudoCode(StringBuilder sb, byte [] bytes) { + final int linelen = 8; +// HexFormat hex = HexFormat.of().withPrefix(" (byte) 0x").withSuffix(","); +// for (int i = 0; i < bytes.length; i += linelen) { +// sb.append("\n"); +// sb.append(hex.formatHex(bytes, i, Math.min(i + linelen, bytes.length))); +// } +// sb.append("};"); + Formatter fmt = new Formatter(sb); + for (int i = 0; i ykm6IAWOs#%z%inFnL#Y`CBc!a0z~foj4#3CSxlc2g#CF`UNa_dn?+GmY?Fvw}v$ m#&dOsyueNm^rY5PuAc6vkSA}S)%m<_kNXXI=ibQ}!wcITiM`!!+`QVZQiG~JBsHu_i zAN&9xkRPC;0f7>HA&4T|c;wyLnc2Y`R8s>y(2}K@V%kIu6AU`Uaxwv>Oejl6Va&Ri zCoDvZwwDk)Iq>%lMcN2dyBL!S(Qui>@LQ!a)HqZ^>~Wau=*)2Nq)?e94ppg@?YNJW z0|N`(3=m9f`KH(-0ANP9idOAC}Jz23BZit2Nm%GrLED zkQmqV#Q7;rO%=}skH@3e0w*r|YN5dj4dyhay!Ol5@#oF&N4DZSS6WRHh?b8JJ-%nf5^{>qecrN^zu)8`_mP5@! zpHx&FXXRX&)Hb#1lhKWyC8xn*Db`n%+7{V{a0D+Ek;>#L)Fehq*eoOq<3Z5I|=Iv9s_D*0ZFx-9jOPur`)M9AcLINM7sS^*9=!Jl*0q2( zDPWx=recvYnFnLzVz{DAc6vkSA}S)%m<_kNXXI=ibQ}!wcITiM`!!+`QVZQiG~JBsHu_i zAN&9xkRPC;0f7>HA&4T|c;wyLnc2Y`R8s>y(2}K@V%kIu6AU`Uaxwv>Oejl6Va&Ri zCoDvZwwDk)Iq>%lMcN2dyBL!S(Qui>@LQ!a)HqZ^>~Wau=*)2Nq)?e94ppg@?YNJW z0|N`(3=m9f`KH(-0ANP9idOAC}Jz23BZit2Nm%GrLED zkQmqV#Q7;rO%=}skH@3e0w*r|YN5dj4dyhay!Ol5@#oF&N4DZSS6WRHh?b8JJ-%nf5^{>qecrN^zu)8`_mP5@! zpHx&FXXRX&)Hb#1lhKWyC8xn*Db`n%+7{V{a0D+Ek;>#L)Fehq*eoOq<3Z5I|=Iv9s_D*0ZFx-9jOPur`)M9AcLINM7sS^*9=!Jl*0q2( zDPWx=recvYnFnLzVz{DAc6vkSA}S)%m<_kNXXI=ibQ}!wcITiM`!!+`QVZQiG~JBsHu_i zAN&9xkRPC;0f7>HA&4T|c;wyLnc2Y`R8s>y(2}K@V%kIu6AU`Uaxwv>Oejl6Va&Ri zCoDvZwwDk)Iq>%lMcN2dyBL!S(Qui>@LQ!a)HqZ^>~Wau=*)2Nq)?e94ppg@?YNJW z0|N`(3=m9f`KH(-0ANP9idOAC}Jz23BZit2Nm%GrLED zkQmqV#Q7;rO%=}skH@3e0w*r|YN5dj4dyhay!Ol5@#oF&N4DZSS6WRHh?b8JJ-%nf5^{>qecrN^zu)8`_mP5@! zpHx&FXXRX&)Hb#1lhKWyC8xn*Db`n%+7{V{a0D+Ek;>#L)Fehq*eoOq<ykm6IAWOs#%z%inFnL#Y`CBc!a0z~foj4#3CSxlc2g#CF`UNa_dn?+GmY?Fvw}v$ m#&dOsyueNm^rY5PuQbhPuMYL4T16+4OLY9_LBm$%qXtF!mbF{V>uQ%+aK%$|6 z66(~E?mc(`9w0A3MFRreVSDeC;y_eT;bzAk&&>CEf78#k}r+9+J3wQ;c#=vGMEKucaua-w--b_DiZ@j;J8v%r|>nq(C4&MDZzjrbG zzTJh`nLiSCSJ%pN7`QMYmHWrpIu@p~ds>~5(W8kaH-p3VLcgTS?vot}R}fbsSG7EZ zfy7)1TW4e;Ivh1#V{d-7W-gq0`?c};>6g1-ensU<%*Lh1^lwuvX{-$0f?>%c)9;BbHjMV``@&&r=izl8C(aQff% MAJi34OaGMdPe_7~{Qv*} diff --git a/test/jdk/javax/xml/jaxp/datatype/8033980/SerializationTest.java b/test/jdk/javax/xml/jaxp/datatype/8033980/SerializationTest.java index c8fa0d41d28..89fd6e050cb 100644 --- a/test/jdk/javax/xml/jaxp/datatype/8033980/SerializationTest.java +++ b/test/jdk/javax/xml/jaxp/datatype/8033980/SerializationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,160 +25,145 @@ * @test * @bug 8033980 * @summary verify serialization compatibility for XMLGregorianCalendar and Duration - * @run main SerializationTest read + * @run junit SerializationTest */ -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.stream.Stream; + import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; import javax.xml.datatype.XMLGregorianCalendar; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + /** - * use "read" to test compatibility - * SerializationTest read - * - * use "write" to create test files - * SerializationTest write javaVersion - * where javaVersion is 6, 7, 8, or 9 - * + * Verify serialization compatibility for XMLGregorianCalendar and Duration * @author huizhe.wang@oracle.com */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class SerializationTest { - final String FILENAME_CAL = "_XMLGregorianCalendar.ser"; - final String FILENAME_DURATION = "_Duration.ser"; - String filePath; - - { - filePath = System.getProperty("test.src"); - if (filePath == null) { - //current directory - filePath = System.getProperty("user.dir"); - } - filePath += File.separator; - } final String EXPECTED_CAL = "0001-01-01T00:00:00.0000000-05:00"; final String EXPECTED_DURATION = "P1Y1M1DT1H1M1S"; - static String[] JDK = {"JDK6", "JDK7", "JDK8", "JDK9"}; - - public static void main(String[] args) { - SerializationTest test = new SerializationTest(); - - if (args[0].equalsIgnoreCase("read")) { - test.testReadCal(); - test.testReadDuration(); - test.report(); - } else { - int ver = Integer.valueOf(args[1]).intValue(); - test.createTestFile(JDK[ver - 6]); - } + static String[] JDK = {System.getProperty("java.version"), "JDK6", "JDK7", "JDK8", "JDK9"}; - } + // If needed to add serialized data of more JDK versions, serialized data source file can be generated using + // GregorianCalAndDurSerDataUtil class. + private GregorianCalendarAndDurationSerData[] gregorianCalendarAndDurationSerData = {null, new JDK6GregorianCalendarAndDurationSerData(), + new JDK7GregorianCalendarAndDurationSerData(), new JDK8GregorianCalendarAndDurationSerData(), new JDK9GregorianCalendarAndDurationSerData()}; - public void testReadCal() { - try { - for (String javaVersion : JDK) { - XMLGregorianCalendar d1 = (XMLGregorianCalendar) fromFile( - javaVersion + FILENAME_CAL); - if (!d1.toString().equalsIgnoreCase(EXPECTED_CAL)) { - fail("Java version: " + javaVersion - + "\nExpected: " + EXPECTED_CAL - + "\nActual: " + d1.toString()); - } else { - success("testReadCal: read " + javaVersion + " serialized file, passed."); + /** + * Create the serialized Bytes array and serialized bytes base64 string for GregorianCalender and Duration + * with jdk under test. + * @throws DatatypeConfigurationException Unexpected. + * @throws IOException Unexpected. + */ + @BeforeAll + public void setup() throws DatatypeConfigurationException, IOException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + XMLGregorianCalendar xmlGregorianCalendar = dtf.newXMLGregorianCalendar(EXPECTED_CAL); + Duration duration = dtf.newDuration(EXPECTED_DURATION); + try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); + ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); ObjectOutputStream oos2 = new ObjectOutputStream(baos2)) { + //Serialize the given xmlGregorianCalendar + oos.writeObject(xmlGregorianCalendar); + //Serialize the given xml Duration + oos2.writeObject(duration); + // Create the Data for JDK under test. + gregorianCalendarAndDurationSerData[0] = new GregorianCalendarAndDurationSerData() { + @Override + public byte[] getGregorianCalendarByteArray() { + return baos.toByteArray(); } - } - } catch (ClassNotFoundException ex) { - fail("testReadCal: " + ex.getMessage()); - } catch (IOException ex) { - fail("testReadCal: " + ex.getMessage()); - } - } - public void testReadDuration() { - try { - for (String javaVersion : JDK) { - Duration d1 = (Duration) fromFile( - javaVersion + FILENAME_DURATION); - if (!d1.toString().equalsIgnoreCase(EXPECTED_DURATION)) { - fail("Java version: " + javaVersion - + "\nExpected: " + EXPECTED_DURATION - + "\nActual: " + d1.toString()); - } else { - success("testReadDuration: read " + javaVersion + " serialized file, passed."); + @Override + public byte[] getDurationBytes() { + return baos2.toByteArray(); } - } - } catch (ClassNotFoundException ex) { - fail("testReadDuration: " + ex.getMessage()); - } catch (IOException ex) { - fail("testReadDuration: " + ex.getMessage()); + }; } } /** - * Create test files - * - * @param javaVersion JDK version + * Provide data for JDK version and Gregorian Calendar serialized bytes. + * @return A Stream of arguments where each element is an array of size three. First element contain JDK version, + * second element contain object reference to GregorianCalendarAndDurationSerData specific to JDK version + * and third element contain expected Gregorian Calendar as string. */ - public void createTestFile(String javaVersion) { - try { - DatatypeFactory dtf = DatatypeFactory.newInstance(); - XMLGregorianCalendar c = dtf.newXMLGregorianCalendar(EXPECTED_CAL); - Duration d = dtf.newDuration(EXPECTED_DURATION); - toFile((Serializable) c, filePath + javaVersion + FILENAME_CAL); - toFile((Serializable) d, filePath + javaVersion + FILENAME_DURATION); - } catch (Exception e) { - fail(e.getMessage()); - } + + public Stream gregorianCalendarDataBytes() { + return Stream.of( + Arguments.of(JDK[0], gregorianCalendarAndDurationSerData[0], EXPECTED_CAL), + Arguments.of(JDK[1], gregorianCalendarAndDurationSerData[1], EXPECTED_CAL), + Arguments.of(JDK[2], gregorianCalendarAndDurationSerData[2], EXPECTED_CAL), + Arguments.of(JDK[3], gregorianCalendarAndDurationSerData[3], EXPECTED_CAL), + Arguments.of(JDK[4], gregorianCalendarAndDurationSerData[4], EXPECTED_CAL) + ); } /** - * Read the object from a file. + * Provide data for JDK version and Duration serialized bytes. + * @return A Stream of arguments where each element is an array of size three. First element contain JDK version, + * second element contain object reference to GregorianCalendarAndDurationSerData specific to JDK version + * and third element contain expected Duration as string. */ - private static Object fromFile(String filePath) throws IOException, - ClassNotFoundException { - InputStream streamIn = SerializationTest.class.getResourceAsStream( - filePath); - ObjectInputStream objectinputstream = new ObjectInputStream(streamIn); - Object o = objectinputstream.readObject(); - return o; + + public Stream durationData() { + return Stream.of(Arguments.of(JDK[0], gregorianCalendarAndDurationSerData[0], EXPECTED_DURATION), + Arguments.of(JDK[1], gregorianCalendarAndDurationSerData[1], EXPECTED_DURATION), + Arguments.of(JDK[2], gregorianCalendarAndDurationSerData[2], EXPECTED_DURATION), + Arguments.of(JDK[3], gregorianCalendarAndDurationSerData[3], EXPECTED_DURATION), + Arguments.of(JDK[4], gregorianCalendarAndDurationSerData[4], EXPECTED_DURATION)); } /** - * Write the object to a file. + * Verify that GregorianCalendar serialized with different old JDK versions can be deserialized correctly with + * JDK under test. + * @param javaVersion JDK version used to GregorianCalendar serialization. + * @param gcsd JDK version specific GregorianCalendarAndDurationSerData. + * @param gregorianDate String representation of GregorianCalendar Date. + * @throws IOException Unexpected. + * @throws ClassNotFoundException Unexpected. */ - private static void toFile(Serializable o, String filePath) throws IOException { - FileOutputStream fout = new FileOutputStream(filePath, true); - ObjectOutputStream oos = new ObjectOutputStream(fout); - oos.writeObject(o); - oos.close(); - } - - static String errMessage; - int passed = 0, failed = 0; - - void fail(String errMsg) { - if (errMessage == null) { - errMessage = errMsg; - } else { - errMessage = errMessage + "\n" + errMsg; - } - failed++; - } - void success(String msg) { - passed++; - System.out.println(msg); + @ParameterizedTest + @MethodSource("gregorianCalendarDataBytes") + public void testReadCalBytes(String javaVersion, GregorianCalendarAndDurationSerData gcsd, String gregorianDate) throws IOException, + ClassNotFoundException { + final ByteArrayInputStream bais = new ByteArrayInputStream(gcsd.getGregorianCalendarByteArray()); + final ObjectInputStream ois = new ObjectInputStream(bais); + final XMLGregorianCalendar xgc = (XMLGregorianCalendar) ois.readObject(); + assertEquals(gregorianDate, xgc.toString()); } - public void report() { - - System.out.println("\nNumber of tests passed: " + passed); - System.out.println("Number of tests failed: " + failed + "\n"); + /** + * Verify that Duration serialized with different old JDK versions can be deserialized correctly with + * JDK under test. + * @param javaVersion JDK version used to GregorianCalendar serialization. + * @param gcsd JDK version specific GregorianCalendarAndDurationSerData. + * @param duration String representation of Duration. + * @throws IOException Unexpected. + * @throws ClassNotFoundException Unexpected. + */ - if (errMessage != null) { - throw new RuntimeException(errMessage); - } + @ParameterizedTest + @MethodSource("durationData") + public void testReadDurationBytes(String javaVersion, GregorianCalendarAndDurationSerData gcsd, String duration) throws IOException, + ClassNotFoundException { + final ByteArrayInputStream bais = new ByteArrayInputStream(gcsd.getDurationBytes()); + final ObjectInputStream ois = new ObjectInputStream(bais); + final Duration d1 = (Duration) ois.readObject(); + assertEquals(duration, d1.toString().toUpperCase()); } } From 1dd2f2a8aa15f27a7db2c5d8b785604783d363d3 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 22 Jan 2024 08:43:56 +0000 Subject: [PATCH 171/261] 8169475: WheelModifier.java fails by timeout Backport-of: 613d32c2822a443fdcb131a7d67c528410e9f7e6 --- .../WheelModifier/WheelModifier.java | 70 ++++++++++++++----- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java b/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java index bfb6b76d273..0af2ba9c7fc 100644 --- a/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java +++ b/test/jdk/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java @@ -21,13 +21,6 @@ * questions. */ -/* - @test - @key headful - @bug 8041470 - @summary JButtons stay pressed after they have lost focus if you use the mouse wheel - */ - import java.awt.AWTEvent; import java.awt.Dimension; import java.awt.FlowLayout; @@ -35,22 +28,32 @@ import java.awt.Robot; import java.awt.Toolkit; import java.awt.event.AWTEventListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; +/* + * @test + * @key headful + * @bug 8041470 + * @summary JButtons stay pressed after they have lost focus if you use the mouse wheel + */ public class WheelModifier { JFrame f; JButton fb; - CountDownLatch pressSema = new CountDownLatch(1); - CountDownLatch exitSema = new CountDownLatch(1); - CountDownLatch releaseSema = new CountDownLatch(1); + final CountDownLatch focusSema = new CountDownLatch(1); + final CountDownLatch pressSema = new CountDownLatch(1); + final CountDownLatch exitSema = new CountDownLatch(1); + final CountDownLatch releaseSema = new CountDownLatch(1); volatile CountDownLatch wheelSema; private volatile Point sLoc; @@ -59,6 +62,14 @@ public class WheelModifier { void createGui() { f = new JFrame("frame"); fb = new JButton("frame_button"); + + fb.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent focusEvent) { + focusSema.countDown(); + } + }); + fb.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { @@ -69,7 +80,6 @@ public void mouseReleased(MouseEvent e) { @Override public void mouseEntered(MouseEvent e) { System.out.println("WheelModifier.mouseEntered: " + e); - } @Override @@ -106,9 +116,13 @@ public void eventDispatched(AWTEvent event) { } void run() throws Exception { + System.out.println("# Started"); + if (!focusSema.await(2, TimeUnit.SECONDS)) { + throw new RuntimeException("Didn't receive focus in time"); + } + Robot r = new Robot(); r.waitForIdle(); - System.out.println("# Started"); SwingUtilities.invokeAndWait(() -> { sLoc = fb.getLocationOnScreen(); @@ -117,33 +131,51 @@ void run() throws Exception { r.mouseMove(sLoc.x + bSize.width / 2, sLoc.y + bSize.height / 2); r.mousePress(MouseEvent.BUTTON1_DOWN_MASK); - pressSema.await(); + if (!pressSema.await(2, TimeUnit.SECONDS)) { + throw new RuntimeException("Mouse is not pressed"); + } System.out.println("# Pressed"); r.mouseMove(sLoc.x + bSize.width / 2, sLoc.y + bSize.height * 2); - exitSema.await(); + if (!exitSema.await(1, TimeUnit.SECONDS)) { + throw new RuntimeException("Mouse did not exit"); + } System.out.println("# Exited"); wheelSema = new CountDownLatch(1); r.mouseWheel(1); - wheelSema.await(); + if (!wheelSema.await(1, TimeUnit.SECONDS)) { + throw new RuntimeException("Mouse is not wheeled 1"); + } System.out.println("# Wheeled 1"); wheelSema = new CountDownLatch(1); r.mouseWheel(-1); - wheelSema.await(); + if (!wheelSema.await(1, TimeUnit.SECONDS)) { + throw new RuntimeException("Mouse is not wheeled 2"); + } System.out.println("# Wheeled 2"); r.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); - releaseSema.await(); + if (!releaseSema.await(1, TimeUnit.SECONDS)) { + throw new RuntimeException("Mouse is not released"); + } System.out.println("# Released!"); } public static void main(String[] args) throws Exception { WheelModifier test = new WheelModifier(); - SwingUtilities.invokeAndWait(() -> test.createGui()); - test.run(); + try { + SwingUtilities.invokeAndWait(test::createGui); + test.run(); + } finally { + SwingUtilities.invokeAndWait(() -> { + if (test.f != null) { + test.f.dispose(); + } + }); + } System.out.println("Done."); } From ada400cffe35140d62452e3899e5a04a40b737c8 Mon Sep 17 00:00:00 2001 From: Olga Mikhaltsova Date: Mon, 22 Jan 2024 10:37:22 +0000 Subject: [PATCH 172/261] 8318158: RISC-V: implement roundD/roundF intrinsics Backport-of: 19147f326c6b0e78fe72f9a7e7100047f16a0921 --- .../cpu/riscv/macroAssembler_riscv.cpp | 51 +++++++++++++++++++ .../cpu/riscv/macroAssembler_riscv.hpp | 3 ++ src/hotspot/cpu/riscv/riscv.ad | 28 ++++++++++ 3 files changed, 82 insertions(+) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 61a3758032b..fd5739d3d40 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -4220,6 +4220,57 @@ void MacroAssembler::zero_dcache_blocks(Register base, Register cnt, Register tm bge(cnt, tmp1, loop); } +// java.lang.Math.round(float a) +// Returns the closest int to the argument, with ties rounding to positive infinity. +void MacroAssembler::java_round_float(Register dst, FloatRegister src, FloatRegister ftmp) { + // this instructions calling sequence provides performance improvement on all tested devices; + // don't change it without re-verification + Label done; + mv(t0, jint_cast(0.5f)); + fmv_w_x(ftmp, t0); + + // dst = 0 if NaN + feq_s(t0, src, src); // replacing fclass with feq as performance optimization + mv(dst, zr); + beqz(t0, done); + + // dst = (src + 0.5f) rounded down towards negative infinity + // Adding 0.5f to some floats exceeds the precision limits for a float and rounding takes place. + // RDN is required for fadd_s, RNE gives incorrect results: + // -------------------------------------------------------------------- + // fadd.s rne (src + 0.5f): src = 8388609.000000 ftmp = 8388610.000000 + // fcvt.w.s rdn: ftmp = 8388610.000000 dst = 8388610 + // -------------------------------------------------------------------- + // fadd.s rdn (src + 0.5f): src = 8388609.000000 ftmp = 8388609.000000 + // fcvt.w.s rdn: ftmp = 8388609.000000 dst = 8388609 + // -------------------------------------------------------------------- + fadd_s(ftmp, src, ftmp, RoundingMode::rdn); + fcvt_w_s(dst, ftmp, RoundingMode::rdn); + + bind(done); +} + +// java.lang.Math.round(double a) +// Returns the closest long to the argument, with ties rounding to positive infinity. +void MacroAssembler::java_round_double(Register dst, FloatRegister src, FloatRegister ftmp) { + // this instructions calling sequence provides performance improvement on all tested devices; + // don't change it without re-verification + Label done; + mv(t0, julong_cast(0.5)); + fmv_d_x(ftmp, t0); + + // dst = 0 if NaN + feq_d(t0, src, src); // replacing fclass with feq as performance optimization + mv(dst, zr); + beqz(t0, done); + + // dst = (src + 0.5) rounded down towards negative infinity + fadd_d(ftmp, src, ftmp, RoundingMode::rdn); // RDN is required here otherwise some inputs produce incorrect results + fcvt_l_d(dst, ftmp, RoundingMode::rdn); + + bind(done); +} + #define FCVT_SAFE(FLOATCVT, FLOATSIG) \ void MacroAssembler::FLOATCVT##_safe(Register dst, FloatRegister src, Register tmp) { \ Label done; \ diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index 5989ea29e26..21f64f4b20e 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -1235,6 +1235,9 @@ class MacroAssembler: public Assembler { void fcvt_w_d_safe(Register dst, FloatRegister src, Register tmp = t0); void fcvt_l_d_safe(Register dst, FloatRegister src, Register tmp = t0); + void java_round_float(Register dst, FloatRegister src, FloatRegister ftmp); + void java_round_double(Register dst, FloatRegister src, FloatRegister ftmp); + // vector load/store unit-stride instructions void vlex_v(VectorRegister vd, Register base, Assembler::SEW sew, VectorMask vm = unmasked) { switch (sew) { diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index b341a9cb653..544f5a1aee5 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -8221,6 +8221,34 @@ instruct convN2I(iRegINoSp dst, iRegN src) ins_pipe(ialu_reg); %} +instruct round_double_reg(iRegLNoSp dst, fRegD src, fRegD ftmp) %{ + match(Set dst (RoundD src)); + + ins_cost(XFER_COST + BRANCH_COST); + effect(TEMP ftmp); + format %{ "java_round_double $dst, $src\t#@round_double_reg" %} + + ins_encode %{ + __ java_round_double($dst$$Register, as_FloatRegister($src$$reg), as_FloatRegister($ftmp$$reg)); + %} + + ins_pipe(pipe_slow); +%} + +instruct round_float_reg(iRegINoSp dst, fRegF src, fRegF ftmp) %{ + match(Set dst (RoundF src)); + + ins_cost(XFER_COST + BRANCH_COST); + effect(TEMP ftmp); + format %{ "java_round_float $dst, $src\t#@round_float_reg" %} + + ins_encode %{ + __ java_round_float($dst$$Register, as_FloatRegister($src$$reg), as_FloatRegister($ftmp$$reg)); + %} + + ins_pipe(pipe_slow); +%} + // Convert oop pointer into compressed form instruct encodeHeapOop(iRegNNoSp dst, iRegP src) %{ match(Set dst (EncodeP src)); From fae1a030731c3571aa6614e7a5f82443115b1752 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 23 Jan 2024 07:55:18 +0000 Subject: [PATCH 173/261] 8312416: Tests in Locale should have more descriptive names Backport-of: a9a3463afb33b9df4cbf64d1866255bff638824f --- ...a => AliasesShouldBeRecognizedInCLDR.java} | 4 +- ...7.java => HashCodeShouldBeThreadSafe.java} | 16 +++-- ...st.java => LegacyCodesClassInvariant.java} | 22 ++++--- ...184873_he => LegacyCodesClassInvariant_he} | Bin ...184873_id => LegacyCodesClassInvariant_id} | Bin ...184873_yi => LegacyCodesClassInvariant_yi} | Bin ...ug7069824.java => LocaleMatchingTest.java} | 18 ++++-- ...52725.java => LocaleShouldSetFromCLI.java} | 18 +++--- ...35061.java => LookupOnValidRangeTest.java} | 4 +- ...33.java => MatchEmptyWeightCorrectly.java} | 4 +- ...ava => ProviderPoolMultiThreadAccess.java} | 6 +- ...4.java => SubsequentRangeParsingTest.java} | 6 +- ...8159420.java => TurkishLangRangeTest.java} | 6 +- test/jdk/java/util/Locale/bug4123285.html | 1 - test/jdk/java/util/Locale/bug4123285.java | 60 ------------------ 15 files changed, 60 insertions(+), 105 deletions(-) rename test/jdk/java/util/Locale/{Bug8179071.java => AliasesShouldBeRecognizedInCLDR.java} (96%) rename test/jdk/java/util/Locale/{Bug4518797.java => HashCodeShouldBeThreadSafe.java} (90%) rename test/jdk/java/util/Locale/{Bug4184873Test.java => LegacyCodesClassInvariant.java} (90%) rename test/jdk/java/util/Locale/{Bug4184873_he => LegacyCodesClassInvariant_he} (100%) rename test/jdk/java/util/Locale/{Bug4184873_id => LegacyCodesClassInvariant_id} (100%) rename test/jdk/java/util/Locale/{Bug4184873_yi => LegacyCodesClassInvariant_yi} (100%) rename test/jdk/java/util/Locale/{Bug7069824.java => LocaleMatchingTest.java} (98%) rename test/jdk/java/util/Locale/{Bug4152725.java => LocaleShouldSetFromCLI.java} (87%) rename test/jdk/java/util/Locale/{Bug8135061.java => LookupOnValidRangeTest.java} (97%) rename test/jdk/java/util/Locale/{Bug8035133.java => MatchEmptyWeightCorrectly.java} (98%) rename test/jdk/java/util/Locale/{Bug6989440.java => ProviderPoolMultiThreadAccess.java} (94%) rename test/jdk/java/util/Locale/{Bug8166994.java => SubsequentRangeParsingTest.java} (96%) rename test/jdk/java/util/Locale/{Bug8159420.java => TurkishLangRangeTest.java} (97%) delete mode 100644 test/jdk/java/util/Locale/bug4123285.html delete mode 100644 test/jdk/java/util/Locale/bug4123285.java diff --git a/test/jdk/java/util/Locale/Bug8179071.java b/test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java similarity index 96% rename from test/jdk/java/util/Locale/Bug8179071.java rename to test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java index 97e6b0118a3..fa41aeea07c 100644 --- a/test/jdk/java/util/Locale/Bug8179071.java +++ b/test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java @@ -26,7 +26,7 @@ * @bug 8179071 8202537 8231273 8251317 * @summary Test that language aliases of CLDR supplemental metadata are handled correctly. * @modules jdk.localedata - * @run junit/othervm -Djava.locale.providers=CLDR Bug8179071 + * @run junit/othervm -Djava.locale.providers=CLDR AliasesShouldBeRecognizedInCLDR */ /* @@ -49,7 +49,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -public class Bug8179071 { +public class AliasesShouldBeRecognizedInCLDR { /* * Deprecated and Legacy tags. diff --git a/test/jdk/java/util/Locale/Bug4518797.java b/test/jdk/java/util/Locale/HashCodeShouldBeThreadSafe.java similarity index 90% rename from test/jdk/java/util/Locale/Bug4518797.java rename to test/jdk/java/util/Locale/HashCodeShouldBeThreadSafe.java index 5f65b2b0639..70f6f44d36a 100644 --- a/test/jdk/java/util/Locale/Bug4518797.java +++ b/test/jdk/java/util/Locale/HashCodeShouldBeThreadSafe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -24,14 +24,18 @@ * @test * @bug 4518797 * @summary Make sure that hashCode() and read/writeObject() are thread-safe. - * @run main Bug4518797 10 + * @run main HashCodeShouldBeThreadSafe 10 */ -import java.util.*; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Locale; -// Usage: java Bug4518797 [duration] -public class Bug4518797 { +// Usage: java HashCodeShouldBeThreadSafe [duration] +public class HashCodeShouldBeThreadSafe { static volatile boolean runrun = true; static volatile String message = null; diff --git a/test/jdk/java/util/Locale/Bug4184873Test.java b/test/jdk/java/util/Locale/LegacyCodesClassInvariant.java similarity index 90% rename from test/jdk/java/util/Locale/Bug4184873Test.java rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant.java index 817881000f2..c19a74516a0 100644 --- a/test/jdk/java/util/Locale/Bug4184873Test.java +++ b/test/jdk/java/util/Locale/LegacyCodesClassInvariant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -22,10 +22,10 @@ */ /* @test + @bug 4184873 @summary test that locale invariants are preserved across serialization @library /java/text/testlib - @run main Bug4184873Test - @bug 4184873 + @run main LegacyCodesClassInvariant */ /* * This file is available under and governed by the GNU General Public @@ -61,18 +61,22 @@ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ -import java.util.*; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Locale; /** * A Locale can never contain the following language codes: he, yi or id. */ -public class Bug4184873Test extends IntlTest { +public class LegacyCodesClassInvariant extends IntlTest { public static void main(String[] args) throws Exception { if (args.length == 1 && args[0].equals("prepTest")) { prepTest(); } else { - new Bug4184873Test().run(args); + new LegacyCodesClassInvariant().run(args); } } @@ -104,7 +108,7 @@ private void verify(String lang) { private ObjectInputStream getStream(String lang) { try { - final File f = new File(System.getProperty("test.src", "."), "Bug4184873_"+lang); + final File f = new File(System.getProperty("test.src", "."), "LegacyCodesClassInvariant_"+lang); return new ObjectInputStream(new FileInputStream(f)); } catch (Exception e) { errln(e.toString()); @@ -125,7 +129,7 @@ private static void prepTest() { private static void outputLocale(String lang) { try { ObjectOutputStream out = new ObjectOutputStream( - new FileOutputStream("Bug4184873_"+lang)); + new FileOutputStream("LegacyCodesClassInvariant_"+lang)); out.writeObject(Locale.of(lang, "XX")); out.close(); } catch (Exception e) { diff --git a/test/jdk/java/util/Locale/Bug4184873_he b/test/jdk/java/util/Locale/LegacyCodesClassInvariant_he similarity index 100% rename from test/jdk/java/util/Locale/Bug4184873_he rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant_he diff --git a/test/jdk/java/util/Locale/Bug4184873_id b/test/jdk/java/util/Locale/LegacyCodesClassInvariant_id similarity index 100% rename from test/jdk/java/util/Locale/Bug4184873_id rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant_id diff --git a/test/jdk/java/util/Locale/Bug4184873_yi b/test/jdk/java/util/Locale/LegacyCodesClassInvariant_yi similarity index 100% rename from test/jdk/java/util/Locale/Bug4184873_yi rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant_yi diff --git a/test/jdk/java/util/Locale/Bug7069824.java b/test/jdk/java/util/Locale/LocaleMatchingTest.java similarity index 98% rename from test/jdk/java/util/Locale/Bug7069824.java rename to test/jdk/java/util/Locale/LocaleMatchingTest.java index 905cde17d50..975e4567e18 100644 --- a/test/jdk/java/util/Locale/Bug7069824.java +++ b/test/jdk/java/util/Locale/LocaleMatchingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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,11 +25,19 @@ * @test * @bug 7069824 8042360 8032842 8175539 8210443 8242010 8276302 * @summary Verify implementation for Locale matching. - * @run testng/othervm Bug7069824 + * @run testng/othervm LocaleMatchingTest */ -import java.util.*; -import java.util.Locale.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Locale.FilteringMode; +import java.util.Locale.LanguageRange; +import java.util.Map; + import static java.util.Locale.FilteringMode.*; import static java.util.Locale.LanguageRange.*; import static org.testng.Assert.*; @@ -37,7 +45,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -public class Bug7069824 { +public class LocaleMatchingTest { @DataProvider(name = "LRConstructorData") Object[][] LRConstructorData() { diff --git a/test/jdk/java/util/Locale/Bug4152725.java b/test/jdk/java/util/Locale/LocaleShouldSetFromCLI.java similarity index 87% rename from test/jdk/java/util/Locale/Bug4152725.java rename to test/jdk/java/util/Locale/LocaleShouldSetFromCLI.java index 54392de239a..18432eecd07 100644 --- a/test/jdk/java/util/Locale/Bug4152725.java +++ b/test/jdk/java/util/Locale/LocaleShouldSetFromCLI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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,24 +26,24 @@ * @summary Verify that the default locale can be specified from the * command line. * @run main/othervm -Duser.language=de -Duser.country=DE -Duser.variant=EURO - * Bug4152725 de_DE_EURO + * LocaleShouldSetFromCLI de_DE_EURO * @run main/othervm -Duser.language=ja -Duser.country= -Duser.variant= - * Bug4152725 ja + * LocaleShouldSetFromCLI ja * @run main/othervm -Duser.language=en -Duser.country=SG -Duser.variant= - * Bug4152725 en_SG + * LocaleShouldSetFromCLI en_SG * @run main/othervm -Duser.language= -Duser.country=DE -Duser.variant=EURO - * Bug4152725 _DE_EURO + * LocaleShouldSetFromCLI _DE_EURO * @run main/othervm -Duser.language=ja -Duser.country= -Duser.variant=YOMI - * Bug4152725 ja__YOMI + * LocaleShouldSetFromCLI ja__YOMI * @run main/othervm -Duser.language= -Duser.country= -Duser.variant=EURO - * Bug4152725 __EURO + * LocaleShouldSetFromCLI __EURO * @run main/othervm -Duser.language=de -Duser.region=DE_EURO - * Bug4152725 de_DE_EURO + * LocaleShouldSetFromCLI de_DE_EURO */ import java.util.Locale; -public class Bug4152725 { +public class LocaleShouldSetFromCLI { public static void main(String[] args) { diff --git a/test/jdk/java/util/Locale/Bug8135061.java b/test/jdk/java/util/Locale/LookupOnValidRangeTest.java similarity index 97% rename from test/jdk/java/util/Locale/Bug8135061.java rename to test/jdk/java/util/Locale/LookupOnValidRangeTest.java index 0e59a9ecbd9..cbf889f0428 100644 --- a/test/jdk/java/util/Locale/Bug8135061.java +++ b/test/jdk/java/util/Locale/LookupOnValidRangeTest.java @@ -26,7 +26,7 @@ * @bug 8135061 * @summary Checks that the Locale.lookup executes properly without throwing * any exception for some specific language ranges - * @run junit Bug8135061 + * @run junit LookupOnValidRangeTest */ import java.util.Collection; @@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class Bug8135061 { +public class LookupOnValidRangeTest { /** * Lookup should run without throwing any exception and return null as diff --git a/test/jdk/java/util/Locale/Bug8035133.java b/test/jdk/java/util/Locale/MatchEmptyWeightCorrectly.java similarity index 98% rename from test/jdk/java/util/Locale/Bug8035133.java rename to test/jdk/java/util/Locale/MatchEmptyWeightCorrectly.java index f5f532e3cc6..f69873b566c 100644 --- a/test/jdk/java/util/Locale/Bug8035133.java +++ b/test/jdk/java/util/Locale/MatchEmptyWeightCorrectly.java @@ -25,7 +25,7 @@ * @bug 8035133 * @summary Checks that the tags matching the range with quality weight q=0 * e.g. en;q=0 must be elimited and must not be the part of output - * @run junit Bug8035133 + * @run junit MatchEmptyWeightCorrectly */ import java.util.ArrayList; @@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class Bug8035133 { +public class MatchEmptyWeightCorrectly { // Ensure weights with 'q=0' work as expected during lookup @ParameterizedTest diff --git a/test/jdk/java/util/Locale/Bug6989440.java b/test/jdk/java/util/Locale/ProviderPoolMultiThreadAccess.java similarity index 94% rename from test/jdk/java/util/Locale/Bug6989440.java rename to test/jdk/java/util/Locale/ProviderPoolMultiThreadAccess.java index 9dfb911e859..7acca68b1df 100644 --- a/test/jdk/java/util/Locale/Bug6989440.java +++ b/test/jdk/java/util/Locale/ProviderPoolMultiThreadAccess.java @@ -27,8 +27,8 @@ * @summary Verify ConcurrentModificationException is not thrown with multiple * thread accesses. * @modules java.base/sun.util.locale.provider - * @compile -XDignore.symbol.file=true Bug6989440.java - * @run junit Bug6989440 + * @compile -XDignore.symbol.file=true ProviderPoolMultiThreadAccess.java + * @run junit ProviderPoolMultiThreadAccess */ import java.text.spi.DateFormatProvider; import java.util.spi.LocaleNameProvider; @@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; -public class Bug6989440 { +public class ProviderPoolMultiThreadAccess { static volatile boolean failed; // false static final int THREADS = 50; diff --git a/test/jdk/java/util/Locale/Bug8166994.java b/test/jdk/java/util/Locale/SubsequentRangeParsingTest.java similarity index 96% rename from test/jdk/java/util/Locale/Bug8166994.java rename to test/jdk/java/util/Locale/SubsequentRangeParsingTest.java index e39627ac709..b160b3a692e 100644 --- a/test/jdk/java/util/Locale/Bug8166994.java +++ b/test/jdk/java/util/Locale/SubsequentRangeParsingTest.java @@ -23,12 +23,12 @@ /* * @test - * @bug 8166884 + * @bug 8166994 * @summary Checks the subsequent call to parse the same language ranges * which must generate the same list of language ranges * i.e. the priority list containing equivalents, as in the * first call - * @run junit Bug8166994 + * @run junit SubsequentRangeParsingTest */ import java.util.Arrays; @@ -43,7 +43,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class Bug8166994 { +public class SubsequentRangeParsingTest { /* * Checks that consecutive calls to parse the same language ranges diff --git a/test/jdk/java/util/Locale/Bug8159420.java b/test/jdk/java/util/Locale/TurkishLangRangeTest.java similarity index 97% rename from test/jdk/java/util/Locale/Bug8159420.java rename to test/jdk/java/util/Locale/TurkishLangRangeTest.java index 2e6de243b36..44366bbc0d0 100644 --- a/test/jdk/java/util/Locale/Bug8159420.java +++ b/test/jdk/java/util/Locale/TurkishLangRangeTest.java @@ -31,8 +31,8 @@ * e.g. "HI-Deva".toLowerCase() in the Turkish locale returns * "hı-deva", where 'ı' is the LATIN SMALL LETTER DOTLESS I character * which is not allowed in the language ranges/tags. - * @compile -encoding utf-8 Bug8159420.java - * @run junit/othervm -Duser.language=tr -Duser.country=TR Bug8159420 + * @compile -encoding utf-8 TurkishLangRangeTest.java + * @run junit/othervm -Duser.language=tr -Duser.country=TR TurkishLangRangeTest */ import java.util.ArrayList; @@ -58,7 +58,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public class Bug8159420 { +public class TurkishLangRangeTest { /* * Ensure parse() does not throw IllegalArgumentException for the Turkish Locale diff --git a/test/jdk/java/util/Locale/bug4123285.html b/test/jdk/java/util/Locale/bug4123285.html deleted file mode 100644 index 7cb7a3d07d8..00000000000 --- a/test/jdk/java/util/Locale/bug4123285.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/jdk/java/util/Locale/bug4123285.java b/test/jdk/java/util/Locale/bug4123285.java deleted file mode 100644 index 23cbb8ad5bd..00000000000 --- a/test/jdk/java/util/Locale/bug4123285.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -import java.util.Locale; - -public class bug4123285 extends java.applet.Applet { - public void start() { - System.out.println("Hello, world!"); - Locale[] systemLocales = null; - try { - System.out.println("Default locale = " + Locale.getDefault()); - systemLocales = Locale.getAvailableLocales(); - System.out.println("Found " + systemLocales.length + " locales:"); - Locale[] locales = new Locale[systemLocales.length]; - for (int i = 0; i < locales.length; i++) { - Locale lowest = null; - for (int j = 0; j < systemLocales.length; j++) { - if (i > 0 && locales[i - 1].toString().compareTo(systemLocales[j].toString()) >= 0) - continue; - if (lowest == null || systemLocales[j].toString().compareTo(lowest.toString()) < 0) - lowest = systemLocales[j]; - } - locales[i] = lowest; - } - for (int i = 0; i < locales.length; i++) { - if (locales[i].getCountry().length() == 0) - System.out.println(" " + locales[i].getDisplayLanguage() + ":"); - else { - if (locales[i].getVariant().length() == 0) - System.out.println(" " + locales[i].getDisplayCountry()); - else - System.out.println(" " + locales[i].getDisplayCountry() + ", " - + locales[i].getDisplayVariant()); - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - } -} From be8733b8b600ff417eec6c550e649f8321828130 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 23 Jan 2024 07:59:56 +0000 Subject: [PATCH 174/261] 8319213: Compatibility.java reads both stdout and stderr of JdkUtils Backport-of: 84f4f7477c4e1b7ecc4c7fead2ded21242efddd7 --- .../security/tools/jarsigner/compatibility/Compatibility.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java b/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java index 658663c8779..7fab7d828ae 100644 --- a/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java +++ b/test/jdk/sun/security/tools/jarsigner/compatibility/Compatibility.java @@ -1026,7 +1026,7 @@ private static String execJdkUtils(String jdkPath, String method, cmd[3] = JdkUtils.class.getName(); cmd[4] = method; System.arraycopy(args, 0, cmd, 5, args.length); - return ProcessTools.executeCommand(cmd).getOutput(); + return ProcessTools.executeCommand(cmd).getStdout(); } // Executes the specified JDK tools, such as keytool and jarsigner, and From 1f9b03e597d87679964e8772c6bea538c74feb2c Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 23 Jan 2024 08:05:52 +0000 Subject: [PATCH 175/261] 8319128: sun/security/pkcs11 tests fail on OL 7.9 aarch64 8319136: Skip pkcs11 tests on linux-aarch64 Backport-of: c2e77e2f17b624e750dea8fd51bbfde99596690e --- test/jdk/sun/security/pkcs11/PKCS11Test.java | 17 ++++++++++++++--- .../pkcs11/Provider/MultipleLogins.java | 15 ++++++++++----- .../security/pkcs11/Provider/MultipleLogins.sh | 1 + ...TestMutuallyExclusivePlatformPredicates.java | 2 +- test/lib/jdk/test/lib/Platform.java | 15 +++++++++++++++ 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java index 1b6f5795110..71de2d819b6 100644 --- a/test/jdk/sun/security/pkcs11/PKCS11Test.java +++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java @@ -55,10 +55,14 @@ import java.util.ServiceConfigurationError; import java.util.ServiceLoader; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; +import jdk.test.lib.Platform; import jdk.test.lib.artifacts.Artifact; import jdk.test.lib.artifacts.ArtifactResolver; import jdk.test.lib.artifacts.ArtifactResolverException; @@ -822,11 +826,18 @@ private static String fetchNssLib(String osId) { return fetchNssLib(MACOSX_AARCH64.class); case "Linux-amd64-64": - return fetchNssLib(LINUX_X64.class); + if (Platform.isOracleLinux7()) { + throw new SkippedException("Skipping Oracle Linux prior to v8"); + } else { + return fetchNssLib(LINUX_X64.class); + } case "Linux-aarch64-64": - return fetchNssLib(LINUX_AARCH64.class); - + if (Platform.isOracleLinux7()) { + throw new SkippedException("Skipping Oracle Linux prior to v8"); + } else { + return fetchNssLib(LINUX_AARCH64.class); + } default: return null; } diff --git a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java index 5d6fb68aceb..ddce6e8733d 100644 --- a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java +++ b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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 @@ -21,6 +21,7 @@ * questions. */ + import sun.security.pkcs11.SunPKCS11; import javax.security.auth.Subject; @@ -32,12 +33,10 @@ import java.io.IOException; import java.lang.ref.WeakReference; import java.security.*; -import java.util.Iterator; import java.util.PropertyPermission; -import java.util.ServiceConfigurationError; -import java.util.ServiceLoader; import jdk.test.lib.util.ForceGC; +import jtreg.SkippedException; public class MultipleLogins { private static final String KS_TYPE = "PKCS11"; @@ -46,7 +45,13 @@ public class MultipleLogins { static final Policy DEFAULT_POLICY = Policy.getPolicy(); public static void main(String[] args) throws Exception { - String nssConfig = PKCS11Test.getNssConfig(); + String nssConfig = null; + try { + nssConfig = PKCS11Test.getNssConfig(); + } catch (SkippedException exc) { + System.out.println("Skipping test: " + exc.getMessage()); + } + if (nssConfig == null) { // No test framework support yet. Ignore System.out.println("No NSS config found. Skipping."); diff --git a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh index 5ad75ca1363..56a4fd6b806 100644 --- a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh +++ b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh @@ -26,6 +26,7 @@ # @summary # @library /test/lib/ # @build jdk.test.lib.util.ForceGC +# jdk.test.lib.Platform # @run shell MultipleLogins.sh # set a few environment variables so that the shell-script can run stand-alone diff --git a/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java b/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java index 355cd8ac200..f8ce856bddd 100644 --- a/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java +++ b/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java @@ -53,7 +53,7 @@ private static enum MethodGroup { IGNORED("isEmulatedClient", "isDebugBuild", "isFastDebugBuild", "isMusl", "isSlowDebugBuild", "hasSA", "isRoot", "isTieredSupported", "areCustomLoadersSupportedForCDS", "isDefaultCDSArchiveSupported", - "isHardenedOSX", "hasOSXPlistEntries"); + "isHardenedOSX", "hasOSXPlistEntries", "isOracleLinux7"); public final List methodNames; diff --git a/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java index c58877c6c5e..bbecb39e5d2 100644 --- a/test/lib/jdk/test/lib/Platform.java +++ b/test/lib/jdk/test/lib/Platform.java @@ -33,6 +33,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; import java.util.regex.Pattern; public class Platform { @@ -348,6 +349,20 @@ private static boolean isArch(String archnameRE) { .matches(); } + public static boolean isOracleLinux7() { + if (System.getProperty("os.name").toLowerCase().contains("linux") && + System.getProperty("os.version").toLowerCase().contains("el")) { + Pattern p = Pattern.compile("el(\\d+)"); + Matcher m = p.matcher(System.getProperty("os.version")); + if (m.find()) { + try { + return Integer.parseInt(m.group(1)) <= 7; + } catch (NumberFormatException nfe) {} + } + } + return false; + } + /** * Returns file extension of shared library, e.g. "so" on linux, "dll" on windows. * @return file extension From 2697a9d1c288daaddae751a7e8a2d2239c5d884c Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 23 Jan 2024 08:06:13 +0000 Subject: [PATCH 176/261] 8318696: Do not use LFS64 symbols on Linux Reviewed-by: lucy Backport-of: f4d08ccf80812d4f26a148fac6bf99b96672a63f --- make/autoconf/flags-cflags.m4 | 2 +- src/hotspot/os/linux/attachListener_linux.cpp | 18 ++++++++++-------- src/hotspot/os/linux/os_linux.cpp | 16 +++++++++------- src/hotspot/os/posix/os_posix.cpp | 7 ++++--- src/hotspot/os/posix/os_posix.hpp | 2 +- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index 1a4973dda1a..78b24c22d96 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -425,7 +425,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], [ #### OS DEFINES, these should be independent on toolchain if test "x$OPENJDK_TARGET_OS" = xlinux; then - CFLAGS_OS_DEF_JVM="-DLINUX" + CFLAGS_OS_DEF_JVM="-DLINUX -D_FILE_OFFSET_BITS=64" CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" elif test "x$OPENJDK_TARGET_OS" = xmacosx; then CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE" diff --git a/src/hotspot/os/linux/attachListener_linux.cpp b/src/hotspot/os/linux/attachListener_linux.cpp index 63c5bfef125..715603d4baf 100644 --- a/src/hotspot/os/linux/attachListener_linux.cpp +++ b/src/hotspot/os/linux/attachListener_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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,6 +183,8 @@ int LinuxAttachListener::init() { char initial_path[UNIX_PATH_MAX]; // socket file during setup int listener; // listener socket (file descriptor) + static_assert(sizeof(off_t) == 8, "Expected Large File Support in this file"); + // register function to cleanup if (!_atexit_registered) { _atexit_registered = true; @@ -445,14 +447,14 @@ AttachOperation* AttachListener::dequeue() { void AttachListener::vm_start() { char fn[UNIX_PATH_MAX]; - struct stat64 st; + struct stat st; int ret; int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d", os::get_temp_directory(), os::current_process_id()); assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow"); - RESTARTABLE(::stat64(fn, &st), ret); + RESTARTABLE(::stat(fn, &st), ret); if (ret == 0) { ret = ::unlink(fn); if (ret == -1) { @@ -472,8 +474,8 @@ int AttachListener::pd_init() { bool AttachListener::check_socket_file() { int ret; - struct stat64 st; - ret = stat64(LinuxAttachListener::path(), &st); + struct stat st; + ret = stat(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()); @@ -512,14 +514,14 @@ bool AttachListener::is_init_trigger() { } char fn[PATH_MAX + 1]; int ret; - struct stat64 st; + struct stat st; os::snprintf_checked(fn, sizeof(fn), ".attach_pid%d", os::current_process_id()); - RESTARTABLE(::stat64(fn, &st), ret); + RESTARTABLE(::stat(fn, &st), ret); if (ret == -1) { log_trace(attach)("Failed to find attach file: %s, trying alternate", fn); snprintf(fn, sizeof(fn), "%s/.attach_pid%d", os::get_temp_directory(), os::current_process_id()); - RESTARTABLE(::stat64(fn, &st), ret); + RESTARTABLE(::stat(fn, &st), ret); if (ret == -1) { log_debug(attach)("Failed to find attach file: %s", fn); } diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index f0081a1de31..3a94c6c2111 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -2695,6 +2695,8 @@ void os::jvm_path(char *buf, jint buflen) { void linux_wrap_code(char* base, size_t size) { static volatile jint cnt = 0; + static_assert(sizeof(off_t) == 8, "Expected Large File Support in this file"); + if (!UseOprofile) { return; } @@ -5013,14 +5015,14 @@ int os::open(const char *path, int oflag, int mode) { oflag |= O_CLOEXEC; #endif - int fd = ::open64(path, oflag, mode); + int fd = ::open(path, oflag, mode); if (fd == -1) return -1; //If the open succeeded, the file might still be a directory { - struct stat64 buf64; - int ret = ::fstat64(fd, &buf64); - int st_mode = buf64.st_mode; + struct stat buf; + int ret = ::fstat(fd, &buf); + int st_mode = buf.st_mode; if (ret != -1) { if ((st_mode & S_IFMT) == S_IFDIR) { @@ -5057,17 +5059,17 @@ int os::open(const char *path, int oflag, int mode) { int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = O_WRONLY | O_CREAT; oflags |= rewrite_existing ? O_TRUNC : O_EXCL; - return ::open64(path, oflags, S_IREAD | S_IWRITE); + return ::open(path, oflags, S_IREAD | S_IWRITE); } // return current position of file pointer jlong os::current_file_offset(int fd) { - return (jlong)::lseek64(fd, (off64_t)0, SEEK_CUR); + return (jlong)::lseek(fd, (off_t)0, SEEK_CUR); } // move file pointer to the specified offset jlong os::seek_to_file_offset(int fd, jlong offset) { - return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET); + return (jlong)::lseek(fd, (off_t)offset, SEEK_SET); } // Map a block of memory. diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 893ca3a7b73..41d292f5110 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -293,6 +293,7 @@ static char* reserve_mmapped_memory(size_t bytes, char* requested_addr) { } static int util_posix_fallocate(int fd, off_t offset, off_t len) { + static_assert(sizeof(off_t) == 8, "Expected Large File Support in this file"); #ifdef __APPLE__ fstore_t store = { F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, len }; // First we try to get a continuous chunk of disk space @@ -756,11 +757,11 @@ void os::dll_unload(void *lib) { } jlong os::lseek(int fd, jlong offset, int whence) { - return (jlong) BSD_ONLY(::lseek) NOT_BSD(::lseek64)(fd, offset, whence); + return (jlong) ::lseek(fd, offset, whence); } int os::ftruncate(int fd, jlong length) { - return BSD_ONLY(::ftruncate) NOT_BSD(::ftruncate64)(fd, length); + return ::ftruncate(fd, length); } const char* os::get_current_directory(char *buf, size_t buflen) { diff --git a/src/hotspot/os/posix/os_posix.hpp b/src/hotspot/os/posix/os_posix.hpp index 051b23d51bd..9e98f4316c4 100644 --- a/src/hotspot/os/posix/os_posix.hpp +++ b/src/hotspot/os/posix/os_posix.hpp @@ -31,7 +31,7 @@ // Note: the Posix API aims to capture functionality available on all Posix // compliant platforms, but in practice the implementations may depend on -// non-Posix functionality. For example, the use of lseek64 and ftruncate64. +// non-Posix functionality. // This use of non-Posix API's is made possible by compiling/linking in a mode // that is not restricted to being fully Posix complaint, such as by declaring // -D_GNU_SOURCE. But be aware that in doing so we may enable non-Posix From 80842442da4c116564f55000216645eda93a70d8 Mon Sep 17 00:00:00 2001 From: sunyaqi Date: Tue, 23 Jan 2024 08:25:41 +0000 Subject: [PATCH 177/261] 8316319: Generational ZGC: The SoftMaxHeapSize might be wrong when CDS decreases the MaxHeapSize Backport-of: fe862639e7ce40f5adef0e482b1fb9c718e061a3 --- src/hotspot/share/gc/x/xArguments.cpp | 4 ++++ src/hotspot/share/gc/x/xArguments.hpp | 1 + .../share/gc/z/shared/zSharedArguments.cpp | 10 ++++++++ .../share/gc/z/shared/zSharedArguments.hpp | 1 + src/hotspot/share/gc/z/zArguments.cpp | 23 +++++++++++-------- src/hotspot/share/gc/z/zArguments.hpp | 1 + 6 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/gc/x/xArguments.cpp b/src/hotspot/share/gc/x/xArguments.cpp index 8c02c800247..60e78d2c756 100644 --- a/src/hotspot/share/gc/x/xArguments.cpp +++ b/src/hotspot/share/gc/x/xArguments.cpp @@ -37,6 +37,10 @@ void XArguments::initialize_alignments() { HeapAlignment = SpaceAlignment; } +void XArguments::initialize_heap_flags_and_sizes() { + // Nothing extra to do +} + void XArguments::initialize() { // Check mark stack size const size_t mark_stack_space_limit = XAddressSpaceLimit::mark_stack(); diff --git a/src/hotspot/share/gc/x/xArguments.hpp b/src/hotspot/share/gc/x/xArguments.hpp index aaa586a2df2..196dd994cad 100644 --- a/src/hotspot/share/gc/x/xArguments.hpp +++ b/src/hotspot/share/gc/x/xArguments.hpp @@ -31,6 +31,7 @@ class CollectedHeap; class XArguments : AllStatic { public: static void initialize_alignments(); + static void initialize_heap_flags_and_sizes(); static void initialize(); static size_t heap_virtual_to_physical_ratio(); static CollectedHeap* create_heap(); diff --git a/src/hotspot/share/gc/z/shared/zSharedArguments.cpp b/src/hotspot/share/gc/z/shared/zSharedArguments.cpp index 8a00a851acb..4d7e9827f18 100644 --- a/src/hotspot/share/gc/z/shared/zSharedArguments.cpp +++ b/src/hotspot/share/gc/z/shared/zSharedArguments.cpp @@ -38,6 +38,16 @@ void ZSharedArguments::initialize_alignments() { } } +void ZSharedArguments::initialize_heap_flags_and_sizes() { + GCArguments::initialize_heap_flags_and_sizes(); + + if (ZGenerational) { + ZArguments::initialize_heap_flags_and_sizes(); + } else { + XArguments::initialize_heap_flags_and_sizes(); + } +} + void ZSharedArguments::initialize() { GCArguments::initialize(); diff --git a/src/hotspot/share/gc/z/shared/zSharedArguments.hpp b/src/hotspot/share/gc/z/shared/zSharedArguments.hpp index 74659f581b9..c53f28ee0f9 100644 --- a/src/hotspot/share/gc/z/shared/zSharedArguments.hpp +++ b/src/hotspot/share/gc/z/shared/zSharedArguments.hpp @@ -31,6 +31,7 @@ class CollectedHeap; class ZSharedArguments : public GCArguments { private: virtual void initialize_alignments(); + virtual void initialize_heap_flags_and_sizes(); virtual void initialize(); virtual size_t conservative_max_heap_alignment(); diff --git a/src/hotspot/share/gc/z/zArguments.cpp b/src/hotspot/share/gc/z/zArguments.cpp index 01ecf8f3fc4..5ebfeb75f89 100644 --- a/src/hotspot/share/gc/z/zArguments.cpp +++ b/src/hotspot/share/gc/z/zArguments.cpp @@ -37,6 +37,19 @@ void ZArguments::initialize_alignments() { HeapAlignment = SpaceAlignment; } +void ZArguments::initialize_heap_flags_and_sizes() { + if (!FLAG_IS_CMDLINE(MaxHeapSize) && + !FLAG_IS_CMDLINE(MaxRAMFraction) && + !FLAG_IS_CMDLINE(MaxRAMPercentage) && + !FLAG_IS_CMDLINE(SoftMaxHeapSize)) { + // We are really just guessing how much memory the program needs. + // When that is the case, we don't want the soft and hard limits to be the same + // as it can cause flakyness in the number of GC threads used, in order to keep + // to a random number we just pulled out of thin air. + FLAG_SET_ERGO(SoftMaxHeapSize, MaxHeapSize * 90 / 100); + } +} + void ZArguments::select_max_gc_threads() { // Select number of parallel threads if (FLAG_IS_DEFAULT(ParallelGCThreads)) { @@ -126,16 +139,6 @@ void ZArguments::initialize() { FLAG_SET_ERGO_IF_DEFAULT(ZCollectionIntervalMajor, ZCollectionInterval); } - if (!FLAG_IS_CMDLINE(MaxHeapSize) && - !FLAG_IS_CMDLINE(MaxRAMFraction) && - !FLAG_IS_CMDLINE(MaxRAMPercentage)) { - // We are really just guessing how much memory the program needs. - // When that is the case, we don't want the soft and hard limits to be the same - // as it can cause flakyness in the number of GC threads used, in order to keep - // to a random number we just pulled out of thin air. - FLAG_SET_ERGO_IF_DEFAULT(SoftMaxHeapSize, MaxHeapSize * 90 / 100); - } - if (FLAG_IS_DEFAULT(ZFragmentationLimit)) { FLAG_SET_DEFAULT(ZFragmentationLimit, 5.0); } diff --git a/src/hotspot/share/gc/z/zArguments.hpp b/src/hotspot/share/gc/z/zArguments.hpp index ac1e613d4cc..7d1c00d30d1 100644 --- a/src/hotspot/share/gc/z/zArguments.hpp +++ b/src/hotspot/share/gc/z/zArguments.hpp @@ -34,6 +34,7 @@ class ZArguments : AllStatic { public: static void initialize_alignments(); + static void initialize_heap_flags_and_sizes(); static void initialize(); static size_t heap_virtual_to_physical_ratio(); static CollectedHeap* create_heap(); From d69a0978cc035a5d23dccf88fd0d2b02a6f5d769 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 23 Jan 2024 08:26:16 +0000 Subject: [PATCH 178/261] 8322282: Incorrect LoaderConstraintTable::add_entry after JDK-8298468 Backport-of: bde650f21e2fa2f7730d3f948105159762e4fdd0 --- src/hotspot/share/classfile/loaderConstraints.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/classfile/loaderConstraints.cpp b/src/hotspot/share/classfile/loaderConstraints.cpp index 261ec96604a..3a34800c051 100644 --- a/src/hotspot/share/classfile/loaderConstraints.cpp +++ b/src/hotspot/share/classfile/loaderConstraints.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -348,7 +348,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name, } else if (pp1 == nullptr) { pp2->extend_loader_constraint(class_name, loader1, klass); } else if (pp2 == nullptr) { - pp1->extend_loader_constraint(class_name, loader1, klass); + pp1->extend_loader_constraint(class_name, loader2, klass); } else { merge_loader_constraints(class_name, pp1, pp2, klass); } From ad2e11417494cef94cbaa4cebca507aa03c47992 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 23 Jan 2024 08:38:59 +0000 Subject: [PATCH 179/261] 8323243: JNI invocation of an abstract instance method corrupts the stack Backport-of: 71d9a83dece7eb4bdb6ffdd9caf14a1348045ce0 --- src/hotspot/share/prims/jni.cpp | 5 ++ .../abstractMethod/AbstractMethodClass.jasm | 43 ++++++++++++ .../abstractMethod/TestJNIAbstractMethod.java | 68 +++++++++++++++++++ .../jni/abstractMethod/libJNIAbstractMethod.c | 43 ++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 test/hotspot/jtreg/runtime/jni/abstractMethod/AbstractMethodClass.jasm create mode 100644 test/hotspot/jtreg/runtime/jni/abstractMethod/TestJNIAbstractMethod.java create mode 100644 test/hotspot/jtreg/runtime/jni/abstractMethod/libJNIAbstractMethod.c diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp index 2accdd097c8..0d477d67eab 100644 --- a/src/hotspot/share/prims/jni.cpp +++ b/src/hotspot/share/prims/jni.cpp @@ -930,6 +930,11 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive } } + if (selected_method->is_abstract()) { + ResourceMark rm(THREAD); + THROW_MSG(vmSymbols::java_lang_AbstractMethodError(), selected_method->name()->as_C_string()); + } + methodHandle method(THREAD, selected_method); // Create object to hold arguments for the JavaCall, and associate it with diff --git a/test/hotspot/jtreg/runtime/jni/abstractMethod/AbstractMethodClass.jasm b/test/hotspot/jtreg/runtime/jni/abstractMethod/AbstractMethodClass.jasm new file mode 100644 index 00000000000..24c53f2032d --- /dev/null +++ b/test/hotspot/jtreg/runtime/jni/abstractMethod/AbstractMethodClass.jasm @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024, 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. + * + */ +/* + * This is a non-abstract class with an abstract method. + * + */ +super public class AbstractMethodClass + extends java/lang/Object + version 51:0 // Java 7 version +{ + + public Method "":"()V" + stack 1 locals 1 + { + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; + } + + public abstract Method "abstractM":"()V"; + +} diff --git a/test/hotspot/jtreg/runtime/jni/abstractMethod/TestJNIAbstractMethod.java b/test/hotspot/jtreg/runtime/jni/abstractMethod/TestJNIAbstractMethod.java new file mode 100644 index 00000000000..2384f6d5aef --- /dev/null +++ b/test/hotspot/jtreg/runtime/jni/abstractMethod/TestJNIAbstractMethod.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8323243 + * @summary Test that invocation of an abstract method from JNI works correctly + * @compile AbstractMethodClass.jasm + * @run main/othervm/native TestJNIAbstractMethod + */ + +/** + * We are testing invocation of an abstract method from JNI - which should + * simply result in throwning AbstractMethodError. To invoke an abstract method + * we must have an instance method (as abstract static methods are illegal), + * but instantiating an abstract class is also illegal at the Java language + * level, so we have to use a custom jasm class that contains an abstract method + * declaration, but which is not itself declared as an abstract class. + */ +public class TestJNIAbstractMethod { + + // Invokes an abstract method from JNI and throws AbstractMethodError. + private static native void invokeAbstractM(Class AMclass, + AbstractMethodClass receiver); + + static { + System.loadLibrary("JNIAbstractMethod"); + } + + public static void main(String[] args) { + AbstractMethodClass obj = new AbstractMethodClass(); + try { + System.out.println("Attempting direct invocation via Java"); + obj.abstractM(); + throw new RuntimeException("Did not get AbstractMethodError from Java!"); + } catch (AbstractMethodError expected) { + System.out.println("ok - got expected exception: " + expected); + } + try { + System.out.println("Attempting direct invocation via JNI"); + invokeAbstractM(obj.getClass(), obj); + throw new RuntimeException("Did not get AbstractMethodError from JNI!"); + } catch (AbstractMethodError expected) { + System.out.println("ok - got expected exception: " + expected); + } + } +} diff --git a/test/hotspot/jtreg/runtime/jni/abstractMethod/libJNIAbstractMethod.c b/test/hotspot/jtreg/runtime/jni/abstractMethod/libJNIAbstractMethod.c new file mode 100644 index 00000000000..35a28f7029a --- /dev/null +++ b/test/hotspot/jtreg/runtime/jni/abstractMethod/libJNIAbstractMethod.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024, 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 +#include +#include + +JNIEXPORT void JNICALL Java_TestJNIAbstractMethod_invokeAbstractM(JNIEnv* env, + jclass this_cls, + jclass target_cls, + jobject receiver) { + + jmethodID mid = (*env)->GetMethodID(env, target_cls, "abstractM", "()V"); + if (mid == NULL) { + fprintf(stderr, "Error looking up method abstractM\n"); + (*env)->ExceptionDescribe(env); + exit(1); + } + + printf("Invoking abstract method ...\n"); + (*env)->CallVoidMethod(env, receiver, mid); // Should raise exception + +} From 63e52ed0618ac1570715694543f2b02c7bf5c95c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 24 Jan 2024 12:39:51 +0000 Subject: [PATCH 180/261] 8318468: compiler/tiered/LevelTransitionTest.java fails with -XX:CompileThreshold=100 -XX:TieredStopAtLevel=1 Backport-of: 61d0db3838932d4030b05ffb04ee2b0215ea686e --- test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java b/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java index b18b304a9bc..336c9eb5cb1 100644 --- a/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java +++ b/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java @@ -204,7 +204,8 @@ private ExtendedTestCase(String methodName) { } private static class CompileMethodHolder { - private final int iter = 10; + // Make sure that loop backedge is never taken to prevent unexpected OSR compilations. + private final int iter = 1; private int field = 42; /** From 34d97ab142edb6054431d8b69d404f31a1b2c5fe Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 24 Jan 2024 12:40:13 +0000 Subject: [PATCH 181/261] 8321269: Require platforms to define DEFAULT_CACHE_LINE_SIZE Backport-of: a56286f7ad9a8110026f48eb45f1d7a273b2f9fb --- src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp | 2 ++ src/hotspot/cpu/arm/globalDefinitions_arm.hpp | 2 ++ src/hotspot/cpu/zero/globalDefinitions_zero.hpp | 2 ++ src/hotspot/share/utilities/globalDefinitions.hpp | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp b/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp index 94f26b6d062..1146324e19c 100644 --- a/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp @@ -41,6 +41,8 @@ const bool CCallingConventionRequiresIntsAsLongs = false; // and Operational Models for ARMv8" #define CPU_MULTI_COPY_ATOMIC +#define DEFAULT_CACHE_LINE_SIZE 64 + // According to the ARMv8 ARM, "Concurrent modification and execution // of instructions can lead to the resulting instruction performing // any behavior that can be achieved by executing any sequence of diff --git a/src/hotspot/cpu/arm/globalDefinitions_arm.hpp b/src/hotspot/cpu/arm/globalDefinitions_arm.hpp index 0a400d00864..ba180fb0f87 100644 --- a/src/hotspot/cpu/arm/globalDefinitions_arm.hpp +++ b/src/hotspot/cpu/arm/globalDefinitions_arm.hpp @@ -48,6 +48,8 @@ const bool HaveVFP = true; // arm32 is not specified as multi-copy-atomic // So we must not #define CPU_MULTI_COPY_ATOMIC +#define DEFAULT_CACHE_LINE_SIZE 64 + #define STUBROUTINES_MD_HPP "stubRoutines_arm.hpp" #define INTERP_MASM_MD_HPP "interp_masm_arm.hpp" #define TEMPLATETABLE_MD_HPP "templateTable_arm.hpp" diff --git a/src/hotspot/cpu/zero/globalDefinitions_zero.hpp b/src/hotspot/cpu/zero/globalDefinitions_zero.hpp index b8f01f40454..ca11d106c26 100644 --- a/src/hotspot/cpu/zero/globalDefinitions_zero.hpp +++ b/src/hotspot/cpu/zero/globalDefinitions_zero.hpp @@ -30,6 +30,8 @@ #define SUPPORTS_NATIVE_CX8 #endif +#define DEFAULT_CACHE_LINE_SIZE 64 + #define SUPPORT_MONITOR_COUNT #ifdef __APPLE__ diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index a9409b6ff2b..7e6ebf9fdde 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -641,7 +641,7 @@ const bool support_IRIW_for_not_multiple_copy_atomic_cpu = PPC64_ONLY(true) NOT_ // The expected size in bytes of a cache line, used to pad data structures. #ifndef DEFAULT_CACHE_LINE_SIZE - #define DEFAULT_CACHE_LINE_SIZE 64 +#error "Platform should define DEFAULT_CACHE_LINE_SIZE" #endif From 7fcfea5292fd2cb3b1f37c111860b268e9fc67ea Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 24 Jan 2024 16:56:45 +0000 Subject: [PATCH 182/261] 8324050: Issue store-store barrier after re-materializing objects during deoptimization Reviewed-by: kvn Backport-of: 52523d33dde797bf03b15a05bb227b19b22c06be --- src/hotspot/share/runtime/deoptimization.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index a05f88c9182..44baccc3bc7 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -1615,6 +1615,10 @@ void Deoptimization::reassign_fields(frame* fr, RegisterMap* reg_map, GrowableAr reassign_object_array_elements(fr, reg_map, sv, (objArrayOop) obj()); } } + // These objects may escape when we return to Interpreter after deoptimization. + // We need barrier so that stores that initialize these objects can't be reordered + // with subsequent stores that make these objects accessible by other threads. + OrderAccess::storestore(); } From 90d7b17f5e3adbab8774dc6f3394ceef77846aa0 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 24 Jan 2024 17:36:18 +0000 Subject: [PATCH 183/261] 8321120: Shenandoah: Remove ShenandoahElasticTLAB flag Backport-of: 93b9235f19dab2a0c08ba8a1afcc82ee71be4c0b --- .../share/gc/shenandoah/shenandoahFreeSet.cpp | 2 +- .../share/gc/shenandoah/shenandoahHeap.cpp | 10 +-- .../gc/shenandoah/shenandoahHeapRegion.cpp | 20 +----- .../gc/shenandoah/shenandoah_globals.hpp | 3 - .../jtreg/gc/shenandoah/TestElasticTLAB.java | 62 ------------------- 5 files changed, 5 insertions(+), 92 deletions(-) delete mode 100644 test/hotspot/jtreg/gc/shenandoah/TestElasticTLAB.java diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp index 45891838312..2d8914ff3a4 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp @@ -154,7 +154,7 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah HeapWord* result = nullptr; size_t size = req.size(); - if (ShenandoahElasticTLAB && req.is_lab_alloc()) { + if (req.is_lab_alloc()) { size_t free = align_down(r->free() >> LogHeapWordSize, MinObjAlignment); if (size > free) { size = free; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index d2d7b974022..c8d9dbf05bc 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -1127,13 +1127,9 @@ void ShenandoahHeap::gclabs_retire(bool resize) { // Returns size in bytes size_t ShenandoahHeap::unsafe_max_tlab_alloc(Thread *thread) const { - if (ShenandoahElasticTLAB) { - // With Elastic TLABs, return the max allowed size, and let the allocation path - // figure out the safe size for current allocation. - return ShenandoahHeapRegion::max_tlab_size_bytes(); - } else { - return MIN2(_free_set->unsafe_peek_free(), ShenandoahHeapRegion::max_tlab_size_bytes()); - } + // Return the max allowed size, and let the allocation path + // figure out the safe size for current allocation. + return ShenandoahHeapRegion::max_tlab_size_bytes(); } size_t ShenandoahHeap::max_tlab_size() const { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp index 6cac61f848a..a46c7edc348 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp @@ -607,26 +607,8 @@ size_t ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) { HumongousThresholdBytes = HumongousThresholdWords * HeapWordSize; assert (HumongousThresholdBytes <= RegionSizeBytes, "sanity"); - // The rationale for trimming the TLAB sizes has to do with the raciness in - // TLAB allocation machinery. It may happen that TLAB sizing policy polls Shenandoah - // about next free size, gets the answer for region #N, goes away for a while, then - // tries to allocate in region #N, and fail because some other thread have claimed part - // of the region #N, and then the freeset allocation code has to retire the region #N, - // before moving the allocation to region #N+1. - // - // The worst case realizes when "answer" is "region size", which means it could - // prematurely retire an entire region. Having smaller TLABs does not fix that - // completely, but reduces the probability of too wasteful region retirement. - // With current divisor, we will waste no more than 1/8 of region size in the worst - // case. This also has a secondary effect on collection set selection: even under - // the race, the regions would be at least 7/8 used, which allows relying on - // "used" - "live" for cset selection. Otherwise, we can get the fragmented region - // below the garbage threshold that would never be considered for collection. - // - // The whole thing is mitigated if Elastic TLABs are enabled. - // guarantee(MaxTLABSizeWords == 0, "we should only set it once"); - MaxTLABSizeWords = MIN2(ShenandoahElasticTLAB ? RegionSizeWords : (RegionSizeWords / 8), HumongousThresholdWords); + MaxTLABSizeWords = MIN2(RegionSizeWords, HumongousThresholdWords); MaxTLABSizeWords = align_down(MaxTLABSizeWords, MinObjAlignment); guarantee(MaxTLABSizeBytes == 0, "we should only set it once"); diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index b41a971bba0..605e8b52b3f 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -215,9 +215,6 @@ " 3 = previous level, plus all reachable objects; " \ " 4 = previous level, plus all marked objects") \ \ - product(bool, ShenandoahElasticTLAB, true, DIAGNOSTIC, \ - "Use Elastic TLABs with Shenandoah") \ - \ product(uintx, ShenandoahEvacReserve, 5, EXPERIMENTAL, \ "How much of heap to reserve for evacuations. Larger values make "\ "GC evacuate more live objects on every cycle, while leaving " \ diff --git a/test/hotspot/jtreg/gc/shenandoah/TestElasticTLAB.java b/test/hotspot/jtreg/gc/shenandoah/TestElasticTLAB.java deleted file mode 100644 index b498228a932..00000000000 --- a/test/hotspot/jtreg/gc/shenandoah/TestElasticTLAB.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2018, Red Hat, Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/* - * @test - * @key randomness - * @summary Test that Shenandoah is able to work with elastic TLABs - * @requires vm.gc.Shenandoah - * @library /test/lib - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:-UseTLAB -XX:-ShenandoahElasticTLAB -XX:+ShenandoahVerify TestElasticTLAB - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:-UseTLAB -XX:-ShenandoahElasticTLAB TestElasticTLAB - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:-UseTLAB -XX:+ShenandoahElasticTLAB -XX:+ShenandoahVerify TestElasticTLAB - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:-UseTLAB -XX:+ShenandoahElasticTLAB TestElasticTLAB - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:+UseTLAB -XX:-ShenandoahElasticTLAB -XX:+ShenandoahVerify TestElasticTLAB - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:+UseTLAB -XX:-ShenandoahElasticTLAB TestElasticTLAB - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:+UseTLAB -XX:+ShenandoahElasticTLAB -XX:+ShenandoahVerify TestElasticTLAB - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:+UseTLAB -XX:+ShenandoahElasticTLAB TestElasticTLAB - */ - -import java.util.Random; -import jdk.test.lib.Utils; - -public class TestElasticTLAB { - - static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation - - static volatile Object sink; - - public static void main(String[] args) throws Exception { - final int min = 0; - final int max = 384 * 1024; - long count = TARGET_MB * 1024 * 1024 / (16 + 4 * (min + (max - min) / 2)); - - Random r = Utils.getRandomInstance(); - for (long c = 0; c < count; c++) { - sink = new int[min + r.nextInt(max - min)]; - } - } - -} From e87638c321e9b86bb4f39237679315eb032e71eb Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 24 Jan 2024 19:24:23 +0000 Subject: [PATCH 184/261] 8321122: Shenandoah: Remove ShenandoahLoopOptsAfterExpansion flag Backport-of: b02fc8681e57d75b5e05ce98216c53ff4d1e3b5d --- .../gc/shenandoah/c2/shenandoahSupport.cpp | 17 +++++++---------- .../share/gc/shenandoah/shenandoah_globals.hpp | 3 --- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index a04cfa60dd5..da75706ac4c 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -50,21 +50,18 @@ bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) { state->load_reference_barriers_count()) > 0) { assert(C->post_loop_opts_phase(), "no loop opts allowed"); C->reset_post_loop_opts_phase(); // ... but we know what we are doing - bool attempt_more_loopopts = ShenandoahLoopOptsAfterExpansion; C->clear_major_progress(); PhaseIdealLoop::optimize(igvn, LoopOptsShenandoahExpand); if (C->failing()) return false; - PhaseIdealLoop::verify(igvn); - if (attempt_more_loopopts) { - C->set_major_progress(); - if (!C->optimize_loops(igvn, LoopOptsShenandoahPostExpand)) { - return false; - } - C->clear_major_progress(); - C->process_for_post_loop_opts_igvn(igvn); - if (C->failing()) return false; + C->set_major_progress(); + if (!C->optimize_loops(igvn, LoopOptsShenandoahPostExpand)) { + return false; } + C->clear_major_progress(); + C->process_for_post_loop_opts_igvn(igvn); + if (C->failing()) return false; + C->set_post_loop_opts_phase(); // now for real! } return true; diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index 605e8b52b3f..9b88d9e0c8c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -350,9 +350,6 @@ develop(bool, ShenandoahVerifyOptoBarriers, trueInDebug, \ "Verify no missing barriers in C2.") \ \ - product(bool, ShenandoahLoopOptsAfterExpansion, true, DIAGNOSTIC, \ - "Attempt more loop opts after barrier expansion.") \ - \ // end of GC_SHENANDOAH_FLAGS From cc189ffc09a2236671554c24142b24e05d9a96a9 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 25 Jan 2024 09:05:51 +0000 Subject: [PATCH 185/261] 8295343: sun/security/pkcs11 tests fail on Linux RHEL 8.6 and newer Backport-of: 6ce0ebb858d3112f136e12d3ad595f805f6871a0 --- doc/testing.html | 11 ++- doc/testing.md | 8 +- test/jdk/ProblemList.txt | 6 -- test/jdk/sun/security/pkcs11/PKCS11Test.java | 97 ++----------------- test/jdk/sun/security/pkcs11/README | 13 +-- .../sun/security/tools/keytool/NssTest.java | 9 +- .../sun/security/tools/keytool/p11-nss.txt | 2 +- 7 files changed, 34 insertions(+), 112 deletions(-) diff --git a/doc/testing.html b/doc/testing.html index 0f81647ecae..19d937df1ea 100644 --- a/doc/testing.html +++ b/doc/testing.html @@ -577,12 +577,15 @@

    PKCS11 Tests

    are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests -correctly, the system property test.nss.lib.paths is -required on Ubuntu 18.04 to specify the alternative NSS lib -directories.

    +correctly, the system property +jdk.test.lib.artifacts.<NAME> is required on Ubuntu +18.04 to specify the alternative NSS lib directory. The +<NAME> component should be replaced with the name +element of the appropriate @Artifact class. (See +test/jdk/sun/security/pkcs11/PKCS11Test.java)

    For example:

    $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
    -    JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"
    + JTREG="JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs"

    For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.

    Client UI Tests

    diff --git a/doc/testing.md b/doc/testing.md index 764fec15c8d..9756a691a8c 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -600,14 +600,16 @@ It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests -correctly, the system property `test.nss.lib.paths` is required on Ubuntu 18.04 -to specify the alternative NSS lib directories. +correctly, the system property `jdk.test.lib.artifacts.` is required on +Ubuntu 18.04 to specify the alternative NSS lib directory. The `` +component should be replaced with the name element of the appropriate +`@Artifact` class. (See `test/jdk/sun/security/pkcs11/PKCS11Test.java`) For example: ``` $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \ - JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs" + JTREG="JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs" ``` For more notes about the PKCS11 tests, please refer to diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index c1f7170bac8..162a03f0af9 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -617,12 +617,6 @@ com/sun/security/sasl/gsskerb/NoSecurityLayer.java 8039280 generic- sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.java 8039280 generic-all sun/security/provider/PolicyParser/PrincipalExpansionError.java 8039280 generic-all -sun/security/tools/keytool/NssTest.java 8295343 linux-all -sun/security/pkcs11/Signature/TestRSAKeyLength.java 8295343 linux-all -sun/security/pkcs11/rsa/TestSignatures.java 8295343 linux-all -sun/security/pkcs11/rsa/TestKeyPairGenerator.java 8295343 linux-all -sun/security/pkcs11/rsa/TestKeyFactory.java 8295343 linux-all -sun/security/pkcs11/KeyStore/Basic.java 8295343 linux-all sun/security/pkcs11/Cipher/TestKATForGCM.java 8240611 linux-x64,macosx-x64 sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8316183 linux-ppc64le diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java index 71de2d819b6..8ca47f718ef 100644 --- a/test/jdk/sun/security/pkcs11/PKCS11Test.java +++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java @@ -46,7 +46,6 @@ import java.security.spec.ECParameterSpec; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -262,30 +261,19 @@ private static Path getNSSLibPath() throws Exception { static Path getNSSLibPath(String library) throws Exception { String osid = getOsId(); - String[] nssLibDirs = getNssLibPaths(osid); - if (nssLibDirs == null) { - System.out.println("Warning: unsupported OS: " + osid + String nssLibDir = fetchNssLib(osid); + if (nssLibDir == null) { + throw new SkippedException("Warning: unsupported OS: " + osid + ", please initialize NSS library location, skipping test"); - return null; - } - if (nssLibDirs.length == 0) { - System.out.println("Warning: NSS not supported on this platform, skipping test"); - return null; } - Path nssLibPath = null; - for (String dir : nssLibDirs) { - Path libPath = Paths.get(dir).resolve(System.mapLibraryName(library)); - if (Files.exists(libPath)) { - nssLibPath = libPath; - break; - } + String libraryName = System.mapLibraryName(library); + Path libPath = Paths.get(nssLibDir).resolve(libraryName); + if (!Files.exists(libPath)) { + throw new SkippedException("NSS library \"" + libraryName + "\" was not found in " + nssLibDir); } - if (nssLibPath == null) { - System.out.println("Warning: can't find NSS library on this machine, skipping test"); - return null; - } - return nssLibPath; + + return libPath; } private static String getOsId() { @@ -609,73 +597,6 @@ private static ECParameterSpec getECParameterSpec(Provider p, String name) return parameters.getParameterSpec(ECParameterSpec.class); } - // Location of the NSS libraries on each supported platform - private static Map getOsMap() { - if (osMap != null) { - return osMap; - } - - osMap = new HashMap<>(); - osMap.put("Linux-i386-32", new String[]{ - "/usr/lib/i386-linux-gnu/", - "/usr/lib32/", - "/usr/lib/"}); - osMap.put("Linux-amd64-64", new String[]{ - "/usr/lib/x86_64-linux-gnu/", - "/usr/lib/x86_64-linux-gnu/nss/", - "/usr/lib64/"}); - osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"}); - osMap.put("Linux-ppc64le-64", new String[]{ - "/usr/lib/powerpc64le-linux-gnu/", - "/usr/lib/powerpc64le-linux-gnu/nss/", - "/usr/lib64/"}); - osMap.put("Linux-s390x-64", new String[]{"/usr/lib64/"}); - osMap.put("Windows-x86-32", new String[]{}); - osMap.put("Windows-amd64-64", new String[]{}); - osMap.put("MacOSX-x86_64-64", new String[]{}); - osMap.put("Linux-arm-32", new String[]{ - "/usr/lib/arm-linux-gnueabi/nss/", - "/usr/lib/arm-linux-gnueabihf/nss/"}); - osMap.put("Linux-aarch64-64", new String[] { - "/usr/lib/aarch64-linux-gnu/", - "/usr/lib/aarch64-linux-gnu/nss/", - "/usr/lib64/" }); - return osMap; - } - - private static String[] getNssLibPaths(String osId) { - String[] preferablePaths = getPreferableNssLibPaths(osId); - if (preferablePaths.length != 0) { - return preferablePaths; - } else { - return getOsMap().get(osId); - } - } - - private static String[] getPreferableNssLibPaths(String osId) { - List nssLibPaths = new ArrayList<>(); - - String customNssLibPaths = System.getProperty("test.nss.lib.paths"); - if (customNssLibPaths == null) { - // If custom local NSS lib path is not provided, - // try to download NSS libs from artifactory - String path = fetchNssLib(osId); - if (path != null) { - nssLibPaths.add(path); - } - } else { - String[] paths = customNssLibPaths.split(","); - for (String path : paths) { - if (!path.endsWith(File.separator)) { - nssLibPaths.add(path + File.separator); - } else { - nssLibPaths.add(path); - } - } - } - - return nssLibPaths.toArray(new String[0]); - } public static String toString(byte[] b) { if (b == null) { diff --git a/test/jdk/sun/security/pkcs11/README b/test/jdk/sun/security/pkcs11/README index 31efd034501..9b4c39dd41c 100644 --- a/test/jdk/sun/security/pkcs11/README +++ b/test/jdk/sun/security/pkcs11/README @@ -4,14 +4,15 @@ perform as a result of bugs or features in NSS or other pkcs11 libraries. - How to get NSS libraries? The libraries come from the following sources. -1. Specified by system property test.nss.lib.paths -System property test.nss.lib.paths can specify a set of absolute paths to -the local NSS library directories. The paths are separated by comma. +1. Specified by system property jdk.test.lib.artifacts. +The system property, jdk.test.lib.artifacts., can specify an absolute path +to the local NSS library directory. The component should be replaced with +the name element of the appropriate @Artifact class. +(See `test/jdk/sun/security/pkcs11/PKCS11Test.java`) 2. Pre-built NSS libraries from artifactory server -If the value of system property test.nss.lib.paths is not set, the tests will try -to download pre-built NSS libraries from artifactory server. Currently, the -tests only looks for libraries for Windows and MacOSX platforms on artifactory. +If the value of system property jdk.test.lib.artifacts. is not set, the +tests will try to download pre-built NSS libraries from artifactory server. Please note that JIB jar MUST be present in classpath when downloading the libraries. diff --git a/test/jdk/sun/security/tools/keytool/NssTest.java b/test/jdk/sun/security/tools/keytool/NssTest.java index 968e19df28d..db5d1240153 100644 --- a/test/jdk/sun/security/tools/keytool/NssTest.java +++ b/test/jdk/sun/security/tools/keytool/NssTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, 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 @@ -58,8 +58,9 @@ private static void copyFiles() throws IOException { Path dbPath = srcPath.getParent().getParent() .resolve("pkcs11").resolve("nss").resolve("db"); - Files.copy(dbPath.resolve("cert8.db"), Paths.get("cert8.db")); - Files.copy(dbPath.resolve("key3.db"), Paths.get("key3.db")); - Files.copy(dbPath.resolve("secmod.db"), Paths.get("secmod.db")); + Path destDir = Path.of( "tmpdb"); + Files.createDirectory(destDir); + Files.copy(dbPath.resolve("cert9.db"), destDir.resolve("cert9.db")); + Files.copy(dbPath.resolve("key4.db"), destDir.resolve("key4.db")); } } diff --git a/test/jdk/sun/security/tools/keytool/p11-nss.txt b/test/jdk/sun/security/tools/keytool/p11-nss.txt index dd200a326c0..9c8ac0a43ab 100644 --- a/test/jdk/sun/security/tools/keytool/p11-nss.txt +++ b/test/jdk/sun/security/tools/keytool/p11-nss.txt @@ -6,7 +6,7 @@ slot = 2 library = ${nss.lib} -nssArgs = "configdir='.' certPrefix='' keyPrefix='' secmod='secmod.db'" +nssArgs = "configdir='sql:./tmpdb' certPrefix='' keyPrefix='' secmod='secmod.db'" #forceLogin = true From 711ab384351f4ca61682359e8a0ec3683a129316 Mon Sep 17 00:00:00 2001 From: Liang Mao Date: Thu, 25 Jan 2024 09:20:49 +0000 Subject: [PATCH 186/261] 8322255: Generational ZGC: ZPageSizeMedium should be set before MaxTenuringThreshold Backport-of: 0ad6c9e3d91005c0cc3a26d5391444c3dcd8ba5d --- src/hotspot/share/gc/z/zArguments.cpp | 3 +++ src/hotspot/share/gc/z/zInitialize.cpp | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/z/zArguments.cpp b/src/hotspot/share/gc/z/zArguments.cpp index 5ebfeb75f89..192cad86e67 100644 --- a/src/hotspot/share/gc/z/zArguments.cpp +++ b/src/hotspot/share/gc/z/zArguments.cpp @@ -143,6 +143,9 @@ void ZArguments::initialize() { FLAG_SET_DEFAULT(ZFragmentationLimit, 5.0); } + // Set medium page size here because MaxTenuringThreshold may use it. + ZHeuristics::set_medium_page_size(); + if (!FLAG_IS_DEFAULT(ZTenuringThreshold) && ZTenuringThreshold != -1) { FLAG_SET_ERGO_IF_DEFAULT(MaxTenuringThreshold, ZTenuringThreshold); if (MaxTenuringThreshold == 0) { diff --git a/src/hotspot/share/gc/z/zInitialize.cpp b/src/hotspot/share/gc/z/zInitialize.cpp index 0c0dc6e87a6..bf8cb96a4cb 100644 --- a/src/hotspot/share/gc/z/zInitialize.cpp +++ b/src/hotspot/share/gc/z/zInitialize.cpp @@ -28,7 +28,6 @@ #include "gc/z/zDriver.hpp" #include "gc/z/zGCIdPrinter.hpp" #include "gc/z/zGlobals.hpp" -#include "gc/z/zHeuristics.hpp" #include "gc/z/zInitialize.hpp" #include "gc/z/zJNICritical.hpp" #include "gc/z/zLargePages.hpp" @@ -54,7 +53,6 @@ ZInitialize::ZInitialize(ZBarrierSet* barrier_set) { ZThreadLocalAllocBuffer::initialize(); ZTracer::initialize(); ZLargePages::initialize(); - ZHeuristics::set_medium_page_size(); ZBarrierSet::set_barrier_set(barrier_set); ZJNICritical::initialize(); ZDriver::initialize(); From 2adc2b4f8a650ec8e8f01b57286a664eaf5975ec Mon Sep 17 00:00:00 2001 From: William Kemper Date: Thu, 25 Jan 2024 20:10:08 +0000 Subject: [PATCH 187/261] 8317535: Shenandoah: Remove unused code Reviewed-by: kdnilsen, ysr Backport-of: e942f368c370e059c654e33408940a987013a5c7 --- .../shenandoah/c2/shenandoahBarrierSetC2.cpp | 2 +- .../shenandoahAdaptiveHeuristics.cpp | 4 -- .../shenandoahAdaptiveHeuristics.hpp | 1 - .../shenandoah/shenandoahClosures.inline.hpp | 2 +- .../gc/shenandoah/shenandoahCodeRoots.cpp | 65 ------------------- .../gc/shenandoah/shenandoahCodeRoots.hpp | 30 --------- .../shenandoah/shenandoahConcurrentMark.cpp | 1 - .../share/gc/shenandoah/shenandoahFreeSet.cpp | 2 +- .../share/gc/shenandoah/shenandoahGC.cpp | 1 - .../share/gc/shenandoah/shenandoahHeap.cpp | 8 --- .../share/gc/shenandoah/shenandoahHeap.hpp | 5 +- .../gc/shenandoah/shenandoahHeap.inline.hpp | 4 -- .../gc/shenandoah/shenandoahJfrSupport.hpp | 2 +- .../share/gc/shenandoah/shenandoahMark.hpp | 4 -- .../share/gc/shenandoah/shenandoahNMethod.cpp | 37 ----------- .../share/gc/shenandoah/shenandoahNMethod.hpp | 7 -- .../shenandoah/shenandoahNMethod.inline.hpp | 12 ---- .../shenandoahReferenceProcessor.cpp | 2 +- .../gc/shenandoah/shenandoahRootProcessor.cpp | 1 - .../gc/shenandoah/shenandoahRootProcessor.hpp | 1 - 20 files changed, 6 insertions(+), 185 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index 56a91f23435..ac3afa774e1 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -530,7 +530,7 @@ Node* ShenandoahBarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& Node* ShenandoahBarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) const { // 1: non-reference load, no additional barrier is needed if (!access.is_oop()) { - return BarrierSetC2::load_at_resolved(access, val_type);; + return BarrierSetC2::load_at_resolved(access, val_type); } Node* load = BarrierSetC2::load_at_resolved(access, val_type); diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp index 819f1e8d74e..a8f71c8c5df 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp @@ -354,10 +354,6 @@ bool ShenandoahAllocationRate::is_spiking(double rate, double threshold) const { return false; } -double ShenandoahAllocationRate::instantaneous_rate(size_t allocated) const { - return instantaneous_rate(os::elapsedTime(), allocated); -} - double ShenandoahAllocationRate::instantaneous_rate(double time, size_t allocated) const { size_t last_value = _last_sample_value; double last_time = _last_sample_time; diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp index a1a0e6321fa..17214391383 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp @@ -36,7 +36,6 @@ class ShenandoahAllocationRate : public CHeapObj { double sample(size_t allocated); - double instantaneous_rate(size_t allocated) const; double upper_bound(double sds) const; bool is_spiking(double rate, double threshold) const; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp index 1c8daba3d24..6674c40f768 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp @@ -220,4 +220,4 @@ void ShenandoahAssertNotForwardedClosure::do_oop(narrowOop* p) { do_oop_work(p); void ShenandoahAssertNotForwardedClosure::do_oop(oop* p) { do_oop_work(p); } #endif -#endif // SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP +#endif // SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_INLINE_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp index a297abdb297..92d447258f2 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp @@ -36,70 +36,6 @@ #include "runtime/atomic.hpp" #include "utilities/powerOfTwo.hpp" -ShenandoahParallelCodeCacheIterator::ShenandoahParallelCodeCacheIterator(const GrowableArray* heaps) { - _length = heaps->length(); - _iters = NEW_C_HEAP_ARRAY(ShenandoahParallelCodeHeapIterator, _length, mtGC); - for (int h = 0; h < _length; h++) { - _iters[h] = ShenandoahParallelCodeHeapIterator(heaps->at(h)); - } -} - -ShenandoahParallelCodeCacheIterator::~ShenandoahParallelCodeCacheIterator() { - FREE_C_HEAP_ARRAY(ParallelCodeHeapIterator, _iters); -} - -void ShenandoahParallelCodeCacheIterator::parallel_blobs_do(CodeBlobClosure* f) { - for (int c = 0; c < _length; c++) { - _iters[c].parallel_blobs_do(f); - } -} - -ShenandoahParallelCodeHeapIterator::ShenandoahParallelCodeHeapIterator(CodeHeap* heap) : - _heap(heap), _claimed_idx(0), _finished(false) { -} - -void ShenandoahParallelCodeHeapIterator::parallel_blobs_do(CodeBlobClosure* f) { - assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint"); - - /* - * Parallel code heap walk. - * - * This code makes all threads scan all code heaps, but only one thread would execute the - * closure on given blob. This is achieved by recording the "claimed" blocks: if a thread - * had claimed the block, it can process all blobs in it. Others have to fast-forward to - * next attempt without processing. - * - * Late threads would return immediately if iterator is finished. - */ - - if (_finished) { - return; - } - - int stride = 256; // educated guess - int stride_mask = stride - 1; - assert (is_power_of_2(stride), "sanity"); - - int count = 0; - bool process_block = true; - - for (CodeBlob *cb = CodeCache::first_blob(_heap); cb != nullptr; cb = CodeCache::next_blob(_heap, cb)) { - int current = count++; - if ((current & stride_mask) == 0) { - process_block = (current >= _claimed_idx) && - (Atomic::cmpxchg(&_claimed_idx, current, current + stride, memory_order_relaxed) == current); - } - if (process_block) { - f->do_code_blob(cb); -#ifdef ASSERT - if (cb->is_nmethod()) - Universe::heap()->verify_nmethod((nmethod*)cb); -#endif - } - } - - _finished = true; -} ShenandoahNMethodTable* ShenandoahCodeRoots::_nmethod_table; int ShenandoahCodeRoots::_disarmed_value = 1; @@ -303,7 +239,6 @@ void ShenandoahCodeRoots::purge() { } ShenandoahCodeRootsIterator::ShenandoahCodeRootsIterator() : - _par_iterator(CodeCache::heaps()), _table_snapshot(nullptr) { assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint"); MutexLocker locker(CodeCache_lock, Mutex::_no_safepoint_check_flag); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp index 84a7523b93d..b8870e71ed0 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp @@ -39,38 +39,9 @@ class ShenandoahNMethodTable; class ShenandoahNMethodTableSnapshot; class WorkerThreads; -class ShenandoahParallelCodeHeapIterator { - friend class CodeCache; -private: - CodeHeap* _heap; - shenandoah_padding(0); - volatile int _claimed_idx; - volatile bool _finished; - shenandoah_padding(1); -public: - ShenandoahParallelCodeHeapIterator(CodeHeap* heap); - void parallel_blobs_do(CodeBlobClosure* f); -}; - -class ShenandoahParallelCodeCacheIterator { - friend class CodeCache; -private: - ShenandoahParallelCodeHeapIterator* _iters; - int _length; - - NONCOPYABLE(ShenandoahParallelCodeCacheIterator); - -public: - ShenandoahParallelCodeCacheIterator(const GrowableArray* heaps); - ~ShenandoahParallelCodeCacheIterator(); - void parallel_blobs_do(CodeBlobClosure* f); -}; - class ShenandoahCodeRootsIterator { friend class ShenandoahCodeRoots; protected: - ShenandoahParallelCodeCacheIterator _par_iterator; - ShenandoahSharedFlag _seq_claimed; ShenandoahNMethodTableSnapshot* _table_snapshot; public: @@ -88,7 +59,6 @@ class ShenandoahCodeRoots : public AllStatic { static void initialize(); static void register_nmethod(nmethod* nm); static void unregister_nmethod(nmethod* nm); - static void flush_nmethod(nmethod* nm); static ShenandoahNMethodTable* table() { return _nmethod_table; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp index 1fde1944cac..d05a2ae181e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp @@ -58,7 +58,6 @@ class ShenandoahConcurrentMarkingTask : public WorkerTask { ShenandoahHeap* heap = ShenandoahHeap::heap(); ShenandoahConcurrentWorkerSession worker_session(worker_id); ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers); - ShenandoahObjToScanQueue* q = _cm->get_queue(worker_id); ShenandoahReferenceProcessor* rp = heap->ref_processor(); assert(rp != nullptr, "need reference processor"); StringDedup::Requests requests; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp index 2d8914ff3a4..72a3f411ea0 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp @@ -279,7 +279,7 @@ HeapWord* ShenandoahFreeSet::allocate_contiguous(ShenandoahAllocRequest& req) { } end++; - }; + } size_t remainder = words_size & ShenandoahHeapRegion::region_size_words_mask(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp index fa193880293..922f54edf3c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp @@ -66,7 +66,6 @@ class ShenandoahUpdateRootsTask : public WorkerTask { assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); ShenandoahParallelWorkerSession worker_session(worker_id); - ShenandoahHeap* heap = ShenandoahHeap::heap(); ShenandoahUpdateRefsClosure cl; if (_check_alive) { ShenandoahForwardedIsAliveClosure is_alive; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index c8d9dbf05bc..16992a7fb6d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -1849,14 +1849,6 @@ address ShenandoahHeap::in_cset_fast_test_addr() { return (address) heap->collection_set()->biased_map_address(); } -address ShenandoahHeap::cancelled_gc_addr() { - return (address) ShenandoahHeap::heap()->_cancelled_gc.addr_of(); -} - -address ShenandoahHeap::gc_state_addr() { - return (address) ShenandoahHeap::heap()->_gc_state.addr_of(); -} - size_t ShenandoahHeap::bytes_allocated_since_gc_start() { return Atomic::load(&_bytes_allocated_since_gc_start); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp index ac1804237d0..642faef807e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp @@ -293,7 +293,6 @@ class ShenandoahHeap : public CollectedHeap { public: char gc_state() const; - static address gc_state_addr(); void set_concurrent_mark_in_progress(bool in_progress); void set_evacuation_in_progress(bool in_progress); @@ -314,7 +313,7 @@ class ShenandoahHeap : public CollectedHeap { inline bool is_full_gc_in_progress() const; inline bool is_full_gc_move_in_progress() const; inline bool has_forwarded_objects() const; - inline bool is_gc_in_progress_mask(uint mask) const; + inline bool is_stw_gc_in_progress() const; inline bool is_concurrent_strong_root_in_progress() const; inline bool is_concurrent_weak_root_in_progress() const; @@ -334,7 +333,6 @@ class ShenandoahHeap : public CollectedHeap { bool try_cancel_gc(); public: - static address cancelled_gc_addr(); inline bool cancelled_gc() const; inline bool check_cancelled_gc_and_yield(bool sts_active = true); @@ -354,7 +352,6 @@ class ShenandoahHeap : public CollectedHeap { void prepare_gc(); void prepare_regions_and_collection_set(bool concurrent); // Evacuation - void prepare_evacuation(bool concurrent); void evacuate_collection_set(bool concurrent); // Concurrent root processing void prepare_concurrent_roots(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp index 4158f4bee22..85c544b77c1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp @@ -383,10 +383,6 @@ inline bool ShenandoahHeap::is_evacuation_in_progress() const { return _gc_state.is_set(EVACUATION); } -inline bool ShenandoahHeap::is_gc_in_progress_mask(uint mask) const { - return _gc_state.is_set(mask); -} - inline bool ShenandoahHeap::is_degenerated_gc_in_progress() const { return _degenerated_gc_in_progress.is_set(); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.hpp b/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.hpp index 2ce1cd0b95f..1553787265c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.hpp @@ -38,4 +38,4 @@ class ShenandoahJFRSupport { static void register_jfr_type_serializers(); }; -#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHJFRSUPPORT_HPP +#endif // SHARE_GC_SHENANDOAH_SHENANDOAHJFRSUPPORT_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMark.hpp b/src/hotspot/share/gc/shenandoah/shenandoahMark.hpp index 9130207ba99..078b89a4ce7 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahMark.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahMark.hpp @@ -30,14 +30,10 @@ #include "gc/shenandoah/shenandoahOopClosures.hpp" #include "gc/shenandoah/shenandoahTaskqueue.hpp" -class ShenandoahCMDrainMarkingStackClosure; - // Base class for mark // Mark class does not maintain states. Instead, mark states are // maintained by task queues, mark bitmap and SATB buffers (concurrent mark) class ShenandoahMark: public StackObj { - friend class ShenandoahCMDrainMarkingStackClosure; - protected: ShenandoahObjToScanQueueSet* const _task_queues; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp index 74aafeb3831..980050b8b00 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp @@ -52,39 +52,6 @@ ShenandoahNMethod::~ShenandoahNMethod() { } } -class ShenandoahHasCSetOopClosure : public OopClosure { -private: - ShenandoahHeap* const _heap; - bool _has_cset_oops; - -public: - ShenandoahHasCSetOopClosure(ShenandoahHeap *heap) : - _heap(heap), - _has_cset_oops(false) { - } - - bool has_cset_oops() const { - return _has_cset_oops; - } - - void do_oop(oop* p) { - oop value = RawAccess<>::oop_load(p); - if (!_has_cset_oops && _heap->in_collection_set(value)) { - _has_cset_oops = true; - } - } - - void do_oop(narrowOop* p) { - ShouldNotReachHere(); - } -}; - -bool ShenandoahNMethod::has_cset_oops(ShenandoahHeap *heap) { - ShenandoahHasCSetOopClosure cl(heap); - oops_do(&cl); - return cl.has_cset_oops(); -} - void ShenandoahNMethod::update() { ResourceMark rm; bool non_immediate_oops = false; @@ -209,10 +176,6 @@ class ShenandoahNMethodOopDetector : public OopClosure { GrowableArray* oops() { return &_oops; } - - bool has_oops() { - return !_oops.is_empty(); - } }; void ShenandoahNMethod::assert_same_oops(bool allow_dead) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp index 4fc90b03bed..6a856e68403 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp @@ -55,12 +55,6 @@ class ShenandoahNMethod : public CHeapObj { // Update oops when the nmethod is re-registered void update(); - bool has_cset_oops(ShenandoahHeap* heap); - - inline int oop_count() const; - inline bool has_oops() const; - - inline void mark_unregistered(); inline bool is_unregistered() const; static ShenandoahNMethod* for_nmethod(nmethod* nm); @@ -77,7 +71,6 @@ class ShenandoahNMethod : public CHeapObj { void assert_same_oops(bool allow_dead = false) NOT_DEBUG_RETURN; private: - bool has_non_immed_oops() const { return _has_non_immed_oops; } static void detect_reloc_oops(nmethod* nm, GrowableArray& oops, bool& _has_non_immed_oops); }; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp index 2e642246272..df721c0a695 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp @@ -39,18 +39,6 @@ ShenandoahReentrantLock* ShenandoahNMethod::lock() { return &_lock; } -int ShenandoahNMethod::oop_count() const { - return _oops_count + static_cast(nm()->oops_end() - nm()->oops_begin()); -} - -bool ShenandoahNMethod::has_oops() const { - return oop_count() > 0; -} - -void ShenandoahNMethod::mark_unregistered() { - _unregistered = true; -} - bool ShenandoahNMethod::is_unregistered() const { return _unregistered; } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp index 3630514f5d9..0bd92da1b5d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp @@ -402,7 +402,7 @@ T* ShenandoahReferenceProcessor::keep(oop reference, ReferenceType type, uint wo } template -void ShenandoahReferenceProcessor::process_references(ShenandoahRefProcThreadLocal& refproc_data, uint worker_id) {; +void ShenandoahReferenceProcessor::process_references(ShenandoahRefProcThreadLocal& refproc_data, uint worker_id) { log_trace(gc, ref)("Processing discovered list #%u : " PTR_FORMAT, worker_id, p2i(refproc_data.discovered_list_head())); T* list = refproc_data.discovered_list_addr(); // The list head is basically a GC root, we need to resolve and update it, diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp index 8b7c8079aa5..639b35deca3 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp @@ -89,7 +89,6 @@ void ShenandoahCodeCacheRoots::code_blobs_do(CodeBlobClosure* blob_cl, uint work ShenandoahRootProcessor::ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase phase) : _heap(ShenandoahHeap::heap()), - _phase(phase), _worker_phase(phase) { } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp index 75a23aea045..fcb28dfbce0 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp @@ -134,7 +134,6 @@ class ShenandoahClassLoaderDataRoots { class ShenandoahRootProcessor : public StackObj { private: ShenandoahHeap* const _heap; - const ShenandoahPhaseTimings::Phase _phase; const ShenandoahGCWorkerPhase _worker_phase; public: ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase phase); From e2cabfe1add198655a304f057c51d1c3a0439386 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Fri, 26 Jan 2024 02:15:51 +0000 Subject: [PATCH 188/261] 8316947: Write a test to check textArea triggers MouseEntered/MouseExited events properly Backport-of: 00ef9f9c322dde236256953272d6906f6151635d --- .../event/MouseEvent/MouseEnterExitTest.java | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 test/jdk/java/awt/event/MouseEvent/MouseEnterExitTest.java diff --git a/test/jdk/java/awt/event/MouseEvent/MouseEnterExitTest.java b/test/jdk/java/awt/event/MouseEvent/MouseEnterExitTest.java new file mode 100644 index 00000000000..67c02722a37 --- /dev/null +++ b/test/jdk/java/awt/event/MouseEvent/MouseEnterExitTest.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; +import java.awt.Point; +import java.awt.Robot; +import java.awt.TextArea; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +/* + * @test + * @key headful + * @bug 4454304 + * @summary On Solaris, TextArea triggers MouseEntered when the mouse is inside the component + * @run main MouseEnterExitTest + */ +public class MouseEnterExitTest { + + private static Frame frame; + + private volatile static boolean entered = false; + private volatile static boolean exited = false; + private volatile static boolean passed = true; + + private volatile static Point compAt; + private volatile static Dimension compSize; + + private static final MouseListener mouseListener = new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + System.out.println( + "MouseEntered component " + e.getSource().getClass().getName()); + if (entered) { + passed = false; + } + entered = true; + exited = false; + } + + @Override + public void mouseExited(MouseEvent e) { + System.out.println( + "MouseExited component " + e.getSource().getClass().getName()); + if (exited) { + passed = false; + } + entered = false; + exited = true; + } + }; + + private static void initializeGUI() { + frame = new Frame("MouseEnterExitTest"); + frame.setLayout(new FlowLayout()); + List list = new List(4); + for (int i = 0; i < 10; i++) { + list.add("item " + i); + } + list.addMouseListener(mouseListener); + frame.add(list); + + TextArea textArea = new TextArea("TextArea", 10, 20); + textArea.addMouseListener(mouseListener); + frame.add(textArea); + + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + Robot robot = new Robot(); + robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); + + EventQueue.invokeAndWait(MouseEnterExitTest::initializeGUI); + robot.waitForIdle(); + + EventQueue.invokeAndWait(() -> { + compAt = frame.getLocationOnScreen(); + compSize = frame.getSize(); + }); + compAt.y += compSize.getHeight() / 2; + int xr = compAt.x + compSize.width + 1; + for (int i = compAt.x - 5; (i < xr) && passed; i++) { + robot.mouseMove(i, compAt.y); + } + + if (!passed || entered || !exited) { + throw new RuntimeException( + "MouseEnterExitTest FAILED. MouseEntered/MouseExited " + + "not properly triggered. Please see the log"); + } + System.out.println("Test PASSED"); + } finally { + EventQueue.invokeAndWait(MouseEnterExitTest::disposeFrame); + } + } + + private static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + } +} From bf7c218392cdd4d24d971f7706792e5750c0aa82 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Fri, 26 Jan 2024 02:17:35 +0000 Subject: [PATCH 189/261] 8321480: ISO 4217 Amendment 176 Update Backport-of: 8b24851b9d3619c41c7a6cdb9193ed26a9b732dc --- .../GenerateCurrencyData.java | 15 +++++--- .../util/resources/CurrencyNames.properties | 4 ++- .../data/currency/CurrencyData.properties | 10 +++--- .../java/util/Currency/ValidateISO4217.java | 35 ++++++++++--------- test/jdk/java/util/Currency/tablea1.txt | 12 +++---- 5 files changed, 43 insertions(+), 33 deletions(-) diff --git a/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java b/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java index 561edbef034..9655e08016c 100644 --- a/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java +++ b/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2023, 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,7 @@ import java.io.FileOutputStream; import java.io.InputStream; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.Locale; @@ -339,9 +340,15 @@ private static void buildOtherTables() { validCurrencyCodes.substring(i * 7 + 3, i * 7 + 6)); checkCurrencyCode(currencyCode); int tableEntry = mainTable[(currencyCode.charAt(0) - 'A') * A_TO_Z + (currencyCode.charAt(1) - 'A')]; - if (tableEntry == INVALID_COUNTRY_ENTRY || - (tableEntry & SPECIAL_CASE_COUNTRY_MASK) != 0 || - (tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) != (currencyCode.charAt(2) - 'A')) { + + // Do not allow a future currency to be classified as an otherCurrency, + // otherwise it will leak out into Currency:getAvailableCurrencies + boolean futureCurrency = Arrays.asList(specialCaseNewCurrencies).contains(currencyCode); + boolean simpleCurrency = (tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) == (currencyCode.charAt(2) - 'A'); + + // If neither a simple currency, or one defined in the future + // then the current currency is applicable to be added to the otherTable + if (!futureCurrency && !simpleCurrency) { if (otherCurrenciesCount == maxOtherCurrencies) { throw new RuntimeException("too many other currencies"); } diff --git a/src/java.base/share/classes/sun/util/resources/CurrencyNames.properties b/src/java.base/share/classes/sun/util/resources/CurrencyNames.properties index b9e9098023e..5daf1e07336 100644 --- a/src/java.base/share/classes/sun/util/resources/CurrencyNames.properties +++ b/src/java.base/share/classes/sun/util/resources/CurrencyNames.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2023, 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 @@ -269,6 +269,7 @@ XBB=XBB XBC=XBC XBD=XBD XCD=XCD +XCG=XCG XDR=XDR XFO=XFO XFU=XFU @@ -494,6 +495,7 @@ xbb=European Monetary Unit xbc=European Unit of Account (XBC) xbd=European Unit of Account (XBD) xcd=East Caribbean Dollar +xcg=Caribbean Guilder xdr=Special Drawing Rights xfo=French Gold Franc xfu=French UIC-Franc diff --git a/src/java.base/share/data/currency/CurrencyData.properties b/src/java.base/share/data/currency/CurrencyData.properties index 12c0c69801e..26f4aa24d88 100644 --- a/src/java.base/share/data/currency/CurrencyData.properties +++ b/src/java.base/share/data/currency/CurrencyData.properties @@ -32,7 +32,7 @@ formatVersion=3 # Version of the currency code information in this class. # It is a serial number that accompanies with each amendment. -dataVersion=175 +dataVersion=176 # List of all valid ISO 4217 currency codes. # To ensure compatibility, do not remove codes. @@ -55,7 +55,7 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036 SRD968-SRG740-SSP728-STD678-STN930-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\ TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\ UYU858-UZS860-VEB862-VED926-VEF937-VES928-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\ - XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\ + XBB956-XBC957-XBD958-XCD951-XCG532-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\ XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWL932-\ ZWN942-ZWR935 @@ -189,11 +189,11 @@ CR=CRC # COTE D'IVOIRE CI=XOF # CROATIA -HR=HRK;2022-12-31-23-00-00;EUR +HR=EUR # CUBA CU=CUP # Cura\u00e7ao -CW=ANG +CW=ANG;2025-04-01-04-00-00;XCG # CYPRUS CY=EUR # CZECHIA @@ -510,7 +510,7 @@ SR=SRD # SVALBARD AND JAN MAYEN SJ=NOK # Sint Maarten (Dutch part) -SX=ANG +SX=ANG;2025-04-01-04-00-00;XCG # ESWATINI SZ=SZL # SWEDEN diff --git a/test/jdk/java/util/Currency/ValidateISO4217.java b/test/jdk/java/util/Currency/ValidateISO4217.java index c4fdc5ca2e0..53788c899b3 100644 --- a/test/jdk/java/util/Currency/ValidateISO4217.java +++ b/test/jdk/java/util/Currency/ValidateISO4217.java @@ -25,7 +25,7 @@ * @test * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759 * 8039317 8074350 8074351 8145952 8187946 8193552 8202026 8204269 - * 8208746 8209775 8264792 8274658 8283277 8296239 + * 8208746 8209775 8264792 8274658 8283277 8296239 8321480 * @summary Validate ISO 4217 data for Currency class. * @modules java.base/java.util:open * jdk.localedata @@ -86,7 +86,7 @@ public class ValidateISO4217 { // Codes that are obsolete, do not have related country, extra currency private static final String otherCodes = "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-BYR-CHE-CHW-CLF-COU-CUC-CYP-" - + "DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LTL-LUF-LVL-MGF-MRO-MTL-MXV-MZM-NLG-" + + "DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-HRK-IEP-ITL-LTL-LUF-LVL-MGF-MRO-MTL-MXV-MZM-NLG-" + "PTE-ROL-RUR-SDD-SIT-SLL-SKK-SRG-STD-TMM-TPE-TRL-VEF-UYI-USN-USS-VEB-VED-" + "XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-" + "YUM-ZMK-ZWD-ZWN-ZWR"; @@ -168,7 +168,7 @@ private static void processColumns(StringTokenizer tokens, String country) throw if (format == null) { createDateFormat(); } - // If the cut-over already passed, test the changed data too + // If the cut-over already passed, use the new curency for ISO4217Codes if (format.parse(tokens.nextToken()).getTime() < System.currentTimeMillis()) { currency = tokens.nextToken(); numeric = tokens.nextToken(); @@ -267,20 +267,21 @@ private static List additionalCodesProvider() { * throws an IllegalArgumentException or returns null. The test data * supplied is every possible combination of AA -> ZZ. */ - @ParameterizedTest - @MethodSource("codeCombos") - public void twoLetterCodesTest(String country) { - if (codes[toIndex(country)] == UNDEFINED) { - // if a code is undefined / 0, creating a Currency from it - // should throw an IllegalArgumentException - assertThrows(IllegalArgumentException.class, - ()-> Currency.getInstance(Locale.of("", country)), - "Error: This should be an undefined code and throw IllegalArgumentException: " + country); - } else if (codes[toIndex(country)] == SKIPPED) { - // if a code is marked as skipped / 2, creating a Currency from it - // should return null - assertNull(Currency.getInstance(Locale.of("", country)), - "Error: Currency.getInstance() for this locale should return null: " + country); + @Test + public void twoLetterCodesTest() { + for (String country : codeCombos()) { + if (codes[toIndex(country)] == UNDEFINED) { + // if a code is undefined / 0, creating a Currency from it + // should throw an IllegalArgumentException + assertThrows(IllegalArgumentException.class, + () -> Currency.getInstance(Locale.of("", country)), + "Error: This should be an undefined code and throw IllegalArgumentException: " + country); + } else if (codes[toIndex(country)] == SKIPPED) { + // if a code is marked as skipped / 2, creating a Currency from it + // should return null + assertNull(Currency.getInstance(Locale.of("", country)), + "Error: Currency.getInstance() for this locale should return null: " + country); + } } } diff --git a/test/jdk/java/util/Currency/tablea1.txt b/test/jdk/java/util/Currency/tablea1.txt index 4e33a62c05e..6e85de5e6d2 100644 --- a/test/jdk/java/util/Currency/tablea1.txt +++ b/test/jdk/java/util/Currency/tablea1.txt @@ -1,12 +1,12 @@ # # -# Amendments up until ISO 4217 AMENDMENT NUMBER 175 -# (As of 31 March 2023) +# Amendments up until ISO 4217 AMENDMENT NUMBER 176 +# (As of 06 December 2023) # # Version FILEVERSION=3 -DATAVERSION=175 +DATAVERSION=176 # ISO 4217 currency data AF AFN 971 2 @@ -67,9 +67,9 @@ CD CDF 976 2 CK NZD 554 2 CR CRC 188 2 CI XOF 952 0 -HR HRK 191 2 2022-12-31-23-00-00 EUR 978 2 +HR EUR 978 2 CU CUP 192 2 -CW ANG 532 2 +CW ANG 532 2 2025-04-01-04-00-00 XCG 532 2 CY EUR 978 2 CZ CZK 203 2 DK DKK 208 2 @@ -233,7 +233,7 @@ LK LKR 144 2 SD SDG 938 2 SR SRD 968 2 SJ NOK 578 2 -SX ANG 532 2 +SX ANG 532 2 2025-04-01-04-00-00 XCG 532 2 SZ SZL 748 2 SE SEK 752 2 CH CHF 756 2 From a9498e516a87ffda30fa810cb09c4cc0cb97dfe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20H=C3=A4gerstrand?= Date: Fri, 26 Jan 2024 16:11:50 +0000 Subject: [PATCH 190/261] 8322142: JFR: Periodic tasks aren't orphaned between recordings Backport-of: 1551928502c8ed96350e7b4f1316ea35587407fe --- .../jdk/jfr/internal/periodic/BatchManager.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java index 141cf1a932b..8d51cb1de6f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java @@ -63,11 +63,7 @@ private void groupTasksIntoBatches(List tasks) { } for (PeriodicTask task : activeSortedTasks(tasks)) { if (task.isSchedulable()) { - Batch batch = task.getBatch(); - // If new task, or period has changed, find new batch - if (batch == null) { - batch = findBatch(task.getPeriod()); - } + Batch batch = findBatch(task.getPeriod(), task.getBatch()); batch.add(task); } } @@ -89,7 +85,7 @@ private List activeSortedTasks(List unsorted) { return tasks; } - private Batch findBatch(long period) { + private Batch findBatch(long period, Batch oldBatch) { // All events with a period less than 1000 ms // get their own unique batch. The rationale for // this is to avoid a scenario where a user (mistakenly) specifies @@ -102,7 +98,7 @@ private Batch findBatch(long period) { return batch; } } - Batch batch = new Batch(period); + Batch batch = oldBatch != null ? oldBatch : new Batch(period); batches.add(batch); return batch; } From ca85d5506202f94caaf3afb77ecffe60f35e3721 Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Mon, 29 Jan 2024 08:23:20 +0000 Subject: [PATCH 191/261] 8315761: Open source few swing JList and JMenuBar tests Backport-of: bb6b3f2486b07a6ccdeea18519453e6d9c05c2c3 --- test/jdk/javax/swing/JList/bug4300224.java | 50 +++++++++++ test/jdk/javax/swing/JList/bug4487689.java | 46 ++++++++++ test/jdk/javax/swing/JList/bug4832765.java | 66 ++++++++++++++ test/jdk/javax/swing/JMenuBar/bug4802656.java | 87 +++++++++++++++++++ 4 files changed, 249 insertions(+) create mode 100644 test/jdk/javax/swing/JList/bug4300224.java create mode 100644 test/jdk/javax/swing/JList/bug4487689.java create mode 100644 test/jdk/javax/swing/JList/bug4832765.java create mode 100644 test/jdk/javax/swing/JMenuBar/bug4802656.java diff --git a/test/jdk/javax/swing/JList/bug4300224.java b/test/jdk/javax/swing/JList/bug4300224.java new file mode 100644 index 00000000000..570a4322699 --- /dev/null +++ b/test/jdk/javax/swing/JList/bug4300224.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4300224 + * @summary BasicListUI.ListDataHandler improperly updates list selection on insertion + * @run main bug4300224 + */ + +import javax.swing.JList; +import javax.swing.DefaultListModel; + +public class bug4300224 { + + public static void main(String[] args) throws Exception { + DefaultListModel model = new DefaultListModel<>(); + JList list = new JList<>(model); + + model.addElement("List Item 1"); + model.addElement("List Item 2"); + model.addElement("List Item 3"); + model.addElement("List Item 4"); + list.setSelectedIndex(2); + model.insertElementAt("Inserted Item", 0); + if (list.getSelectedIndex() != 3) { + throw new RuntimeException("Inserted element improperly updates list selection"); + } + } +} diff --git a/test/jdk/javax/swing/JList/bug4487689.java b/test/jdk/javax/swing/JList/bug4487689.java new file mode 100644 index 00000000000..a13367d0299 --- /dev/null +++ b/test/jdk/javax/swing/JList/bug4487689.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4487689 + * @summary JList.setSelectedValue() throws ArrayIndexOutOfBoundsException on empty list. + * @run main bug4487689 + */ + +import java.util.Vector; +import javax.swing.JList; + +public class bug4487689 { + + public static void main(String[] args) throws Exception { + JList list = new JList<>(new Vector()); + + list.setSelectedIndex(0); + list.getSelectedValue(); + + int[] indices = {0,1}; + list.setSelectedIndices(indices); + list.getSelectedValues(); + } +} diff --git a/test/jdk/javax/swing/JList/bug4832765.java b/test/jdk/javax/swing/JList/bug4832765.java new file mode 100644 index 00000000000..40301932218 --- /dev/null +++ b/test/jdk/javax/swing/JList/bug4832765.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4832765 + * @summary JList vertical scrolling doesn't work properly. + * @run main bug4832765 + */ + +import java.awt.Dimension; +import java.awt.Rectangle; +import javax.swing.JFrame; +import javax.swing.JList; +import javax.swing.JScrollPane; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; + +public class bug4832765 { + + public static void main(String[] argv) throws Exception { + SwingUtilities.invokeAndWait(() -> { + String[] data = {"One", "Two", "Three", "Four", + "Five", "Six ", "Seven", "Eight", + "Nine", "Ten", "Eleven", "Twelv"}; + JList list = new JList<>(data); + list.setLayoutOrientation(JList.HORIZONTAL_WRAP); + + JScrollPane jsp = new JScrollPane(list); + Rectangle rect = list.getCellBounds(5, 5); + Dimension d = new Dimension(200, rect.height); + jsp.setPreferredSize(d); + jsp.setMinimumSize(d); + + list.scrollRectToVisible(rect); + + int unit = list.getScrollableUnitIncrement(rect, + SwingConstants.VERTICAL, + -1); + if (unit <= 0) { + throw new RuntimeException("JList scrollable unit increment" + + " should be greate than 0."); + } + }); + } +} diff --git a/test/jdk/javax/swing/JMenuBar/bug4802656.java b/test/jdk/javax/swing/JMenuBar/bug4802656.java new file mode 100644 index 00000000000..01f0d84890b --- /dev/null +++ b/test/jdk/javax/swing/JMenuBar/bug4802656.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4802656 + * @summary Problem with keyboard navigation in JMenus JMenuItems if setVisible(false) + * @key headful + * @run main bug4802656 + */ + +import java.awt.Robot; +import java.awt.event.KeyEvent; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.SwingUtilities; + +public class bug4802656 { + + public static JFrame mainFrame; + public static JMenu menu2; + public static volatile boolean menu2Selected = true; + + public static void main(String[] args) throws Exception { + Robot robo = new Robot(); + robo.setAutoDelay(100); + try { + SwingUtilities.invokeAndWait(() -> { + mainFrame = new JFrame("Bug4802656"); + JMenuBar menuBar = new JMenuBar(); + JMenu menu1 = new JMenu("File"); + menu2 = new JMenu("Hidden"); + JMenu menu3 = new JMenu("Help"); + menuBar.add(menu1); + menuBar.add(menu2); + menuBar.add(menu3); + menu2.setVisible(false); + mainFrame.setJMenuBar(menuBar); + mainFrame.setSize(200, 200); + mainFrame.setLocationRelativeTo(null); + mainFrame.setVisible(true); + }); + robo.waitForIdle(); + robo.delay(1000); + robo.keyPress(KeyEvent.VK_F10); + robo.keyRelease(KeyEvent.VK_F10); + robo.keyPress(KeyEvent.VK_RIGHT); + robo.keyRelease(KeyEvent.VK_RIGHT); + robo.delay(500); + + SwingUtilities.invokeAndWait(() -> { + menu2Selected = menu2.isSelected(); + }); + + if (menu2Selected) { + throw new RuntimeException("Test failed"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (mainFrame != null) { + mainFrame.dispose(); + } + }); + } + } +} From 7f40804afd2f9e126e0808531dc1e68941caaf43 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 29 Jan 2024 09:12:28 +0000 Subject: [PATCH 192/261] 8324659: GHA: Generic jtreg errors are not reported Backport-of: c313d451a513eb08de0b295c1ce66d0d849d2374 --- .github/scripts/gen-test-summary.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/gen-test-summary.sh b/.github/scripts/gen-test-summary.sh index d016cb38649..a612bed5527 100644 --- a/.github/scripts/gen-test-summary.sh +++ b/.github/scripts/gen-test-summary.sh @@ -42,6 +42,7 @@ error_count=$(echo $errors | wc -w || true) if [[ "$failures" = "" && "$errors" = "" ]]; then # We know something went wrong, but not what + echo 'failure=true' >> $GITHUB_OUTPUT echo 'error-message=Unspecified test suite failure. Please see log for job for details.' >> $GITHUB_OUTPUT exit 0 fi From 14f62ace5fe0d83f8dcb05199e75c1b533957c9f Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Mon, 29 Jan 2024 14:30:16 +0000 Subject: [PATCH 193/261] 8324280: RISC-V: Incorrect implementation in VM_Version::parse_satp_mode Backport-of: e7fdac9d5ce56d2f589df59a7fd2869e35ba2991 --- .../os_cpu/linux_riscv/vm_version_linux_riscv.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp index 425d936482a..f890bfbdc02 100644 --- a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp +++ b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp @@ -168,13 +168,13 @@ void VM_Version::os_aux_features() { } VM_Version::VM_MODE VM_Version::parse_satp_mode(const char* vm_mode) { - if (!strcmp(vm_mode, "sv39")) { + if (!strncmp(vm_mode, "sv39", sizeof "sv39" - 1)) { return VM_SV39; - } else if (!strcmp(vm_mode, "sv48")) { + } else if (!strncmp(vm_mode, "sv48", sizeof "sv48" - 1)) { return VM_SV48; - } else if (!strcmp(vm_mode, "sv57")) { + } else if (!strncmp(vm_mode, "sv57", sizeof "sv57" - 1)) { return VM_SV57; - } else if (!strcmp(vm_mode, "sv64")) { + } else if (!strncmp(vm_mode, "sv64", sizeof "sv64" - 1)) { return VM_SV64; } else { return VM_MBARE; @@ -196,7 +196,7 @@ char* VM_Version::os_uarch_additional_features() { if ((p = strchr(buf, ':')) != nullptr) { if (mode == VM_NOTSET) { if (strncmp(buf, "mmu", sizeof "mmu" - 1) == 0) { - mode = VM_Version::parse_satp_mode(p); + mode = VM_Version::parse_satp_mode(p + 2); } } if (ret == nullptr) { From dead33343cc1bae5282190f5d6f60c2bfb19bae0 Mon Sep 17 00:00:00 2001 From: Amos Shi Date: Tue, 30 Jan 2024 08:17:14 +0000 Subject: [PATCH 194/261] 8274122: java/io/File/createTempFile/SpecialTempFile.java fails in Windows 11 Backport-of: 4a142c3b0831d60b3d5540f58973e8ad3d1304bf --- test/jdk/ProblemList.txt | 1 - .../io/File/createTempFile/SpecialTempFile.java | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 162a03f0af9..d2e56146830 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -496,7 +496,6 @@ java/lang/instrument/RetransformBigClass.sh 8065756 generic- # jdk_io java/io/pathNames/GeneralWin32.java 8180264 windows-all -java/io/File/createTempFile/SpecialTempFile.java 8274122 windows11 ############################################################################ diff --git a/test/jdk/java/io/File/createTempFile/SpecialTempFile.java b/test/jdk/java/io/File/createTempFile/SpecialTempFile.java index a2fa85524a0..efbdc21577c 100644 --- a/test/jdk/java/io/File/createTempFile/SpecialTempFile.java +++ b/test/jdk/java/io/File/createTempFile/SpecialTempFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -24,6 +24,7 @@ /* * @test * @bug 8013827 8011950 8017212 8025128 + * @modules java.base/jdk.internal.util * @summary Check whether File.createTempFile can handle special parameters * @author Dan Xu */ @@ -32,10 +33,11 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; -public class SpecialTempFile { +import jdk.internal.util.OperatingSystem; +import jdk.internal.util.OSVersion; +public class SpecialTempFile { private static void test(String name, String[] prefix, String[] suffix, boolean exceptionExpected) throws IOException { @@ -48,7 +50,7 @@ private static void test(String name, String[] prefix, String[] suffix, final String exceptionMsg = "Unable to create temporary file"; String[] dirs = { null, "." }; - Path testPath = Paths.get(System.getProperty("test.dir", ".")); + Path testPath = Path.of(System.getProperty("test.dir", ".")); for (int i = 0; i < prefix.length; i++) { boolean exceptionThrown = false; File f = null; @@ -99,12 +101,15 @@ public static void main(String[] args) throws Exception { test("SlashedName", slashPre, slashSuf, true); // Windows tests - if (!System.getProperty("os.name").startsWith("Windows")) + if (!OperatingSystem.isWindows()) return; // Test JDK-8013827 String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" }; String[] resvSuf = { ".temp", ".temp" }; - test("ReservedName", resvPre, resvSuf, true); + boolean exceptionExpected = + !(System.getProperty("os.name").endsWith("11") || + new OSVersion(10, 0).compareTo(OSVersion.current()) > 0); + test("ReservedName", resvPre, resvSuf, exceptionExpected); } } From 45b428fc975b77eaf37bb7658a1f4cc8d425d339 Mon Sep 17 00:00:00 2001 From: Amos Shi Date: Tue, 30 Jan 2024 08:18:38 +0000 Subject: [PATCH 195/261] 8315600: Open source few more headless Swing misc tests Backport-of: b05198a4f354934bc344fe9cbc19d98fd8bc3977 --- .../FixedHeightLayoutCache/bug4210354.java | 84 +++++++++++++++++++ .../swing/undo/UndoManager/bug4706533.java | 58 +++++++++++++ test/jdk/javax/swing/undo/bug4992178.java | 67 +++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4210354.java create mode 100644 test/jdk/javax/swing/undo/UndoManager/bug4706533.java create mode 100644 test/jdk/javax/swing/undo/bug4992178.java diff --git a/test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4210354.java b/test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4210354.java new file mode 100644 index 00000000000..92fdd24957a --- /dev/null +++ b/test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4210354.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4210354 + * @summary Tests whether method FixedHeightLayoutCache.getBounds returns bad Rectangle + * @run main bug4210354 + */ + +import java.awt.Rectangle; + +import javax.swing.tree.AbstractLayoutCache; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.FixedHeightLayoutCache; +import javax.swing.tree.TreePath; + +public class bug4210354 { + static class DummyNodeDimensions extends AbstractLayoutCache.NodeDimensions { + private final Rectangle rectangle; + + public DummyNodeDimensions(Rectangle r) { + rectangle = r; + } + public Rectangle getNodeDimensions(Object value, int row, int depth, + boolean expanded, Rectangle bounds) { + return rectangle; + } + + /* create the TreeModel of depth 1 with specified num of children */ + public DefaultTreeModel getTreeModelILike(int childrenCount) { + DefaultMutableTreeNode root = new DefaultMutableTreeNode("root"); + for (int i = 0; i < childrenCount; i++) { + DefaultMutableTreeNode child = + new DefaultMutableTreeNode("root.child" + i); + root.insert(child, i); + } + return new DefaultTreeModel(root); + } + } + + public void init() { + int x = 1, y = 2, dx = 3, dy = 4, h = 3; + DummyNodeDimensions dim = new DummyNodeDimensions(new Rectangle(x, y, dx, dy)); + FixedHeightLayoutCache fhlc = new FixedHeightLayoutCache(); + fhlc.setModel(dim.getTreeModelILike(3)); + fhlc.setRootVisible(true); + fhlc.setNodeDimensions(dim); + fhlc.setRowHeight(h); + int row = 0; + TreePath path = fhlc.getPathForRow(row); + Rectangle r = fhlc.getBounds(path, new Rectangle()); + Rectangle r2 = new Rectangle(x, row * h, dx, h); + if (r.width != r2.width) { + throw new RuntimeException("FixedHeightLayoutCache.getBounds returns bad Rectangle"); + } + } + + public static void main(String[] args) throws Exception { + bug4210354 b = new bug4210354(); + b.init(); + } +} diff --git a/test/jdk/javax/swing/undo/UndoManager/bug4706533.java b/test/jdk/javax/swing/undo/UndoManager/bug4706533.java new file mode 100644 index 00000000000..5d8091a7a22 --- /dev/null +++ b/test/jdk/javax/swing/undo/UndoManager/bug4706533.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4706533 + * @summary UndoManager.setLimit(0) doesn't correctly trim the UndoManager size + * @run main bug4706533 + */ + +import javax.swing.undo.AbstractUndoableEdit; +import javax.swing.undo.CannotUndoException; +import javax.swing.undo.CannotRedoException; +import javax.swing.undo.UndoManager; + +public class bug4706533 { + + public static void main(String[] args) throws Exception { + UndoManager manager = new UndoManager(); + manager.setLimit(1); + AbstractUndoableEdit edit = new MyUndoableEdit(); + manager.addEdit(edit); + manager.setLimit(0); + try { + manager.undo(); + throw new RuntimeException("The limit should be zero"); + } catch (CannotUndoException e) { + //Expected to be thrown + } + } + + static class MyUndoableEdit extends AbstractUndoableEdit { + @Override + public void undo() throws CannotUndoException {} + @Override + public void redo() throws CannotRedoException {} + } +} diff --git a/test/jdk/javax/swing/undo/bug4992178.java b/test/jdk/javax/swing/undo/bug4992178.java new file mode 100644 index 00000000000..6edec5526e1 --- /dev/null +++ b/test/jdk/javax/swing/undo/bug4992178.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4992178 + * @summary REGRESSION: Allow unlimited number of edits in an UndoManager + * @run main bug4992178 + */ + +import javax.swing.undo.AbstractUndoableEdit; +import javax.swing.undo.CannotRedoException; +import javax.swing.undo.CannotUndoException; +import javax.swing.undo.UndoManager; + +public class bug4992178 { + + public static void main(String[] argv) throws Exception { + TestUndoManager manager = new TestUndoManager(); + manager.setLimit(1); + AbstractUndoableEdit edit = new MyUndoableEdit(); + manager.addEdit(edit); + + manager.setLimit(-1); + + manager.discardAllEdits(); + + if (manager.getVectorSize() != 0) { + throw new RuntimeException( + "UndoManager's vector size should be 0 after discarding all changes"); + } + } + + static class TestUndoManager extends UndoManager { + public int getVectorSize() { + return edits.size(); + } + } + + static class MyUndoableEdit extends AbstractUndoableEdit { + @Override + public void undo() throws CannotUndoException {} + @Override + public void redo() throws CannotRedoException {} + } + +} From 5df2a5c7ecbf148de183336163dc9ba3fd92523f Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 30 Jan 2024 09:25:25 +0000 Subject: [PATCH 196/261] 8313507: Remove pkcs11/Cipher/TestKATForGCM.java from ProblemList Backport-of: e8471f6bbe692a0d1e293f9e09aaa4f32312eb6a --- test/jdk/ProblemList.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index d2e56146830..00ecd478b1f 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -616,10 +616,8 @@ com/sun/security/sasl/gsskerb/NoSecurityLayer.java 8039280 generic- sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.java 8039280 generic-all sun/security/provider/PolicyParser/PrincipalExpansionError.java 8039280 generic-all -sun/security/pkcs11/Cipher/TestKATForGCM.java 8240611 linux-x64,macosx-x64 sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8316183 linux-ppc64le - ############################################################################ # jdk_sound From 9bc6bd6d87abb103fa52e0f3fcbac155a12f3bb7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Tue, 30 Jan 2024 09:26:43 +0000 Subject: [PATCH 197/261] 8320943: Files/probeContentType/Basic.java fails on latest Windows 11 - content type mismatch Backport-of: 87516e29dc5015c4cab2c07c5539ad30f2768667 --- .../file/Files/probeContentType/Basic.java | 103 ++++++++++-------- 1 file changed, 60 insertions(+), 43 deletions(-) diff --git a/test/jdk/java/nio/file/Files/probeContentType/Basic.java b/test/jdk/java/nio/file/Files/probeContentType/Basic.java index 8bf86320b3f..8add9e76104 100644 --- a/test/jdk/java/nio/file/Files/probeContentType/Basic.java +++ b/test/jdk/java/nio/file/Files/probeContentType/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, 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 @@ -23,6 +23,7 @@ /* @test * @bug 4313887 8129632 8129633 8162624 8146215 8162745 8273655 8274171 8287237 8297609 + * @modules java.base/jdk.internal.util * @summary Unit test for probeContentType method * @library ../.. * @build Basic SimpleFileTypeDetector @@ -33,17 +34,18 @@ import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; +import jdk.internal.util.OperatingSystem; +import jdk.internal.util.OSVersion; + /** * Uses Files.probeContentType to probe html file, custom file type, and minimal * set of file extension to content type mappings. */ public class Basic { - private static final boolean IS_UNIX = - ! System.getProperty("os.name").startsWith("Windows"); - static Path createHtmlFile() throws IOException { Path file = Files.createTempFile("foo", ".html"); try (OutputStream out = Files.newOutputStream(file)) { @@ -79,7 +81,7 @@ private static int checkContentTypes(String expected, String actual) { assert actual != null; if (!expected.equals(actual)) { - if (IS_UNIX) { + if (!OperatingSystem.isWindows()) { Path userMimeTypes = Path.of(System.getProperty("user.home"), ".mime.types"); checkMimeTypesFile(userMimeTypes); @@ -98,12 +100,12 @@ private static int checkContentTypes(String expected, String actual) { return 0; } - static int checkContentTypes(ExType[] exTypes) + static int checkContentTypes(List exTypes) throws IOException { int failures = 0; - for (int i = 0; i < exTypes.length; i++) { - String extension = exTypes[i].extension(); - List expectedTypes = exTypes[i].expectedTypes(); + for (ExType exType : exTypes) { + String extension = exType.extension(); + List expectedTypes = exType.expectedTypes(); Path file = Files.createTempFile("foo", "." + extension); try { String type = Files.probeContentType(file); @@ -155,40 +157,55 @@ public static void main(String[] args) throws IOException { } // Verify that certain extensions are mapped to the correct type. - var exTypes = new ExType[] { - new ExType("adoc", List.of("text/plain")), - new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip")), - new ExType("css", List.of("text/css")), - new ExType("csv", List.of("text/csv")), - new ExType("doc", List.of("application/msword")), - new ExType("docx", List.of("application/vnd.openxmlformats-officedocument.wordprocessingml.document")), - new ExType("gz", List.of("application/gzip", "application/x-gzip")), - new ExType("jar", List.of("application/java-archive", "application/x-java-archive", "application/jar")), - new ExType("jpg", List.of("image/jpeg")), - new ExType("js", List.of("text/plain", "text/javascript", "application/javascript")), - new ExType("json", List.of("application/json")), - new ExType("markdown", List.of("text/markdown")), - new ExType("md", List.of("text/markdown", "application/x-genesis-rom")), - new ExType("mp3", List.of("audio/mpeg")), - new ExType("mp4", List.of("video/mp4")), - new ExType("odp", List.of("application/vnd.oasis.opendocument.presentation")), - new ExType("ods", List.of("application/vnd.oasis.opendocument.spreadsheet")), - new ExType("odt", List.of("application/vnd.oasis.opendocument.text")), - new ExType("pdf", List.of("application/pdf")), - new ExType("php", List.of("text/plain", "text/php", "application/x-php")), - new ExType("png", List.of("image/png")), - new ExType("ppt", List.of("application/vnd.ms-powerpoint")), - new ExType("pptx",List.of("application/vnd.openxmlformats-officedocument.presentationml.presentation")), - new ExType("py", List.of("text/plain", "text/x-python", "text/x-python-script")), - new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed")), - new ExType("rtf", List.of("application/rtf", "text/rtf")), - new ExType("webm", List.of("video/webm")), - new ExType("webp", List.of("image/webp")), - new ExType("xls", List.of("application/vnd.ms-excel")), - new ExType("xlsx", List.of("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")), - new ExType("7z", List.of("application/x-7z-compressed")), - new ExType("wasm", List.of("application/wasm")), - }; + List exTypes = new ArrayList(); + + // extensions with consistent content type + exTypes.add(new ExType("adoc", List.of("text/plain"))); + exTypes.add(new ExType("css", List.of("text/css"))); + exTypes.add(new ExType("doc", List.of("application/msword"))); + exTypes.add(new ExType("docx", List.of("application/vnd.openxmlformats-officedocument.wordprocessingml.document"))); + exTypes.add(new ExType("gz", List.of("application/gzip", "application/x-gzip"))); + exTypes.add(new ExType("jar", List.of("application/java-archive", "application/x-java-archive", "application/jar"))); + exTypes.add(new ExType("jpg", List.of("image/jpeg"))); + exTypes.add(new ExType("js", List.of("text/plain", "text/javascript", "application/javascript"))); + exTypes.add(new ExType("json", List.of("application/json"))); + exTypes.add(new ExType("markdown", List.of("text/markdown"))); + exTypes.add(new ExType("md", List.of("text/markdown", "application/x-genesis-rom"))); + exTypes.add(new ExType("mp3", List.of("audio/mpeg"))); + exTypes.add(new ExType("mp4", List.of("video/mp4"))); + exTypes.add(new ExType("odp", List.of("application/vnd.oasis.opendocument.presentation"))); + exTypes.add(new ExType("ods", List.of("application/vnd.oasis.opendocument.spreadsheet"))); + exTypes.add(new ExType("odt", List.of("application/vnd.oasis.opendocument.text"))); + exTypes.add(new ExType("pdf", List.of("application/pdf"))); + exTypes.add(new ExType("php", List.of("text/plain", "text/php", "application/x-php"))); + exTypes.add(new ExType("png", List.of("image/png"))); + exTypes.add(new ExType("ppt", List.of("application/vnd.ms-powerpoint"))); + exTypes.add(new ExType("pptx", List.of("application/vnd.openxmlformats-officedocument.presentationml.presentation"))); + exTypes.add(new ExType("py", List.of("text/plain", "text/x-python", "text/x-python-script"))); + exTypes.add(new ExType("webm", List.of("video/webm"))); + exTypes.add(new ExType("webp", List.of("image/webp"))); + exTypes.add(new ExType("xls", List.of("application/vnd.ms-excel"))); + exTypes.add(new ExType("xlsx", List.of("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))); + exTypes.add(new ExType("wasm", List.of("application/wasm"))); + + // extensions with content type that differs on Windows 11+ + if (OperatingSystem.isWindows() && + (System.getProperty("os.name").endsWith("11") || + new OSVersion(10, 0).compareTo(OSVersion.current()) > 0)) { + System.out.println("Windows 11+ detected: using different types"); + exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip", "application/x-compressed"))); + exTypes.add(new ExType("csv", List.of("text/csv", "application/vnd.ms-excel"))); + exTypes.add(new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed", "application/x-compressed"))); + exTypes.add(new ExType("rtf", List.of("application/rtf", "text/rtf", "application/msword"))); + exTypes.add(new ExType("7z", List.of("application/x-7z-compressed", "application/x-compressed"))); + } else { + exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip"))); + exTypes.add(new ExType("csv", List.of("text/csv"))); + exTypes.add(new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar", "application/x-rar-compressed"))); + exTypes.add(new ExType("rtf", List.of("application/rtf", "text/rtf"))); + exTypes.add(new ExType("7z", List.of("application/x-7z-compressed"))); + } + failures += checkContentTypes(exTypes); // Verify type is found when the extension is in a fragment component From 2518d2039f0191761b9c7da6378fb95e0cdd13a1 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 30 Jan 2024 09:46:49 +0000 Subject: [PATCH 198/261] 8323154: C2: assert(cmp != nullptr && cmp->Opcode() == Op_Cmp(bt)) failed: no exit test Backport-of: 6997bfc68def7f80fbf6a7486a4b9f61225fc471 --- src/hotspot/share/opto/subnode.cpp | 2 +- .../c2/TestMinValueStrideLongCountedLoop.java | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestMinValueStrideLongCountedLoop.java diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp index 204edb0c751..6f43a3769f7 100644 --- a/src/hotspot/share/opto/subnode.cpp +++ b/src/hotspot/share/opto/subnode.cpp @@ -155,7 +155,7 @@ static bool ok_to_convert(Node* inc, Node* var) { static bool is_cloop_condition(BoolNode* bol) { for (DUIterator_Fast imax, i = bol->fast_outs(imax); i < imax; i++) { Node* out = bol->fast_out(i); - if (out->is_CountedLoopEnd()) { + if (out->is_BaseCountedLoopEnd()) { return true; } } diff --git a/test/hotspot/jtreg/compiler/c2/TestMinValueStrideLongCountedLoop.java b/test/hotspot/jtreg/compiler/c2/TestMinValueStrideLongCountedLoop.java new file mode 100644 index 00000000000..5fb9885dac1 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestMinValueStrideLongCountedLoop.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024, 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. + */ +package compiler.c2; + +/* + * @test + * @bug 8323154 + * @summary Long counted loop exit check should not be transformed into an unsigned check + * + * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,compiler.c2.TestMinValueStrideLongCountedLoop::test + * compiler.c2.TestMinValueStrideLongCountedLoop + */ + +public class TestMinValueStrideLongCountedLoop { + static long limit = 0; + static long res = 0; + + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + test(); + } + } + + static void test() { + for (long i = 0; i >= limit + (Long.MIN_VALUE + 1); i += Long.MIN_VALUE) { + res += 42; + } + } +} From c971925a8713fe8d2ac1307bdc2ab745c1d704f9 Mon Sep 17 00:00:00 2001 From: Olga Mikhaltsova Date: Tue, 30 Jan 2024 21:13:28 +0000 Subject: [PATCH 199/261] 8318157: RISC-V: implement ensureMaterializedForStackWalk intrinsic Backport-of: d6b4aa01a20eb7ecd44602a9fab3e3380bff3d3a --- src/hotspot/cpu/riscv/riscv.ad | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index 544f5a1aee5..521c97b9fc8 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -2352,6 +2352,11 @@ encode %{ ciEnv::current()->record_failure("CodeCache is full"); return; } + } else if (_method->intrinsic_id() == vmIntrinsicID::_ensureMaterializedForStackWalk) { + // The NOP here is purely to ensure that eliding a call to + // JVM_EnsureMaterializedForStackWalk doesn't change the code size. + __ nop(); + __ block_comment("call JVM_EnsureMaterializedForStackWalk (elided)"); } else { int method_index = resolved_method_index(cbuf); RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index) From 0466741713eb2492a6985d420b589ddc1175575b Mon Sep 17 00:00:00 2001 From: Amos Shi Date: Wed, 31 Jan 2024 12:53:26 +0000 Subject: [PATCH 200/261] 8315611: Open source swing text/html and tree test Backport-of: ae08143d3dd3aa559447623389a5b23c5d32398a --- .../swing/text/html/TableView/bug4813831.java | 116 ++++++++++++ .../DefaultTreeCellEditor/bug4480602.java | 133 +++++++++++++ .../DefaultTreeCellRenderer/bug4180224.java | 46 +++++ .../FixedHeightLayoutCache/bug4745001.java | 174 ++++++++++++++++++ 4 files changed, 469 insertions(+) create mode 100644 test/jdk/javax/swing/text/html/TableView/bug4813831.java create mode 100644 test/jdk/javax/swing/tree/DefaultTreeCellEditor/bug4480602.java create mode 100644 test/jdk/javax/swing/tree/DefaultTreeCellRenderer/bug4180224.java create mode 100644 test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4745001.java diff --git a/test/jdk/javax/swing/text/html/TableView/bug4813831.java b/test/jdk/javax/swing/text/html/TableView/bug4813831.java new file mode 100644 index 00000000000..4d7f286f8aa --- /dev/null +++ b/test/jdk/javax/swing/text/html/TableView/bug4813831.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4813831 + * @summary Verifies contents of table cells in HTML in JEditorPane wraps correctly + * @key headful + * @run main bug4813831 +*/ + +import javax.swing.JEditorPane; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; +import javax.swing.text.View; +import javax.swing.text.ParagraphView; +import javax.swing.text.html.HTMLEditorKit; + +import java.awt.Robot; +import java.awt.Shape; + +public class bug4813831 { + + private static boolean passed = false; + private boolean finished = false; + + private static JEditorPane jep; + private static JFrame f; + + public void init() { + + String text = + "" + + "" + + "" + + "
    XXXXXXXXXXXXXX
    X
    X
    " + + ""; + + f = new JFrame(); + jep = new JEditorPane(); + jep.setEditorKit(new HTMLEditorKit()); + jep.setEditable(false); + + jep.setText(text); + + f.getContentPane().add(jep); + f.setSize(20,500); + f.setLocationRelativeTo(null); + f.setVisible(true); + } + + + public static void main(String args[]) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + bug4813831 test = new bug4813831(); + try { + SwingUtilities.invokeAndWait(() -> test.init()); + robot.waitForIdle(); + robot.delay(1000); + Shape r = jep.getBounds(); + View v = jep.getUI().getRootView(jep); + do { + int n = v.getViewCount(); + Shape sh = v.getChildAllocation(n - 1, r); + if (sh != null) { + r = sh; + } + v = v.getView(n - 1); + } while (!(v instanceof ParagraphView)); + + int n = v.getViewCount(); + // there should be 3 lines or more (if the first long line was wrapped) in a cell + passed = n >= 3; + + if (passed) { + Shape sh = v.getChildAllocation(n - 2, r); + int x1 = sh.getBounds().x; + sh = v.getChildAllocation(n - 1, r); + int x2 = sh.getBounds().x; + System.out.println("x1: " + x1 + " x2: " + x2); + // lines should be equally aligned + passed = (x1 == x2); + } + if (!passed) { + throw new RuntimeException("Test failed."); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (f != null) { + f.dispose(); + } + }); + } + } +} diff --git a/test/jdk/javax/swing/tree/DefaultTreeCellEditor/bug4480602.java b/test/jdk/javax/swing/tree/DefaultTreeCellEditor/bug4480602.java new file mode 100644 index 00000000000..d9073297a52 --- /dev/null +++ b/test/jdk/javax/swing/tree/DefaultTreeCellEditor/bug4480602.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4480602 + * @summary Verifies if DefaultTreeCellEditor.inHitRegion() incorrectly + * handles row bounds + * @key headful + * @run main bug4480602 +*/ + +import java.awt.ComponentOrientation; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.JTree; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeCellEditor; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.SwingUtilities; + +import java.util.Date; + +public class bug4480602 { + + static JTree tree; + static JFrame fr; + static MyTreeCellEditor editor; + + static Robot robot; + boolean passed = false; + boolean do_test = false; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + try { + SwingUtilities.invokeAndWait(() -> { + fr = new JFrame("Test"); + + String s = "0\u05D01\u05D02\u05D03\u05D04\u05D05"; + DefaultMutableTreeNode root = new DefaultMutableTreeNode(s); + root.add(new DefaultMutableTreeNode(s)); + root.add(new DefaultMutableTreeNode(s)); + + tree = new JTree(root); + editor = new MyTreeCellEditor(tree, new DefaultTreeCellRenderer()); + tree.setCellEditor(editor); + tree.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); + tree.setEditable(true); + JScrollPane sp = new JScrollPane(tree); + fr.getContentPane().add(sp); + + fr.setSize(250,200); + fr.setLocationRelativeTo(null); + fr.setVisible(true); + }); + robot.waitForIdle(); + robot.delay(1000); + SwingUtilities.invokeAndWait(() -> { + Rectangle rect = tree.getRowBounds(1); + editor.testTreeCellEditor(rect); + }); + } finally { + SwingUtilities.invokeAndWait(() -> { + if (fr != null) { + fr.dispose(); + } + }); + } + } + + static class MyTreeCellEditor extends DefaultTreeCellEditor { + + public MyTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer) { + super(tree, renderer); + } + + public void testTreeCellEditor(Rectangle rect) { + int x = rect.x + 10; + int y = rect.y + rect.height / 2; + MouseEvent me = new MouseEvent(tree, + MouseEvent.MOUSE_PRESSED, + (new Date()).getTime(), + MouseEvent.BUTTON1_DOWN_MASK, + rect.x + 10, rect.y + 10, + 1, true); + isCellEditable(me); + + if (tree == null) { + throw new RuntimeException("isCellEditable() should set the tree"); + } + if (lastRow != 1) { + throw new RuntimeException("isCellEditable() should set the lastRow"); + } + if (offset == 0) { + throw new RuntimeException("isCellEditable() should determine offset"); + } + + if (!inHitRegion(x,y)) { + throw new RuntimeException("Hit region should contain point ("+x+", "+y+")"); + } + x = rect.x + rect.width - 10; + if (inHitRegion(x,y)) { + throw new RuntimeException("Hit region shouldn't contain point ("+x+", "+y+")"); + } + } + } + +} diff --git a/test/jdk/javax/swing/tree/DefaultTreeCellRenderer/bug4180224.java b/test/jdk/javax/swing/tree/DefaultTreeCellRenderer/bug4180224.java new file mode 100644 index 00000000000..f9d88f29acf --- /dev/null +++ b/test/jdk/javax/swing/tree/DefaultTreeCellRenderer/bug4180224.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4180224 + * @summary DefaultTreeCellRenderer.hasFocus protected (not private) now. + * @key headful + * @run main bug4180224 +*/ + +import javax.swing.tree.DefaultTreeCellRenderer; + +public class bug4180224 { + + static class MyDTCR extends DefaultTreeCellRenderer { + void test() { + hasFocus = false; + } + } + + public static void main(String[] argv) { + MyDTCR m = new MyDTCR(); + m.test(); + } +} diff --git a/test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4745001.java b/test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4745001.java new file mode 100644 index 00000000000..d2beface3c2 --- /dev/null +++ b/test/jdk/javax/swing/tree/FixedHeightLayoutCache/bug4745001.java @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4745001 + * @summary JTree with setLargeModel(true) not display correctly + * when we expand/collapse nodes + * @key headful + * @run main bug4745001 +*/ + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Robot; + +import javax.swing.JFrame; +import javax.swing.JTree; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import javax.swing.event.TreeExpansionEvent; +import javax.swing.event.TreeExpansionListener; +import javax.swing.SwingUtilities; + +public class bug4745001 { + + static JTree tree; + static JFrame fr; + boolean stateChanged; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + bug4745001 test = new bug4745001(); + try { + SwingUtilities.invokeAndWait(() -> test.init()); + robot.waitForIdle(); + robot.delay(1000); + test.start(); + robot.delay(1000); + test.destroy(); + } finally { + SwingUtilities.invokeAndWait(() -> { + if (fr != null) { + fr.dispose(); + } + }); + } + } + + public void init() { + fr = new JFrame("Test"); + fr.getContentPane().setLayout(new FlowLayout()); + + tree = new JTree(); + tree.setRowHeight(20); + tree.setLargeModel(true); + tree.setPreferredSize(new Dimension(100, 400)); + tree.setRootVisible(false); + tree.setShowsRootHandles(true); + + DefaultMutableTreeNode root = new DefaultMutableTreeNode(""); + DefaultMutableTreeNode a = new DefaultMutableTreeNode("a"); + DefaultMutableTreeNode b = new DefaultMutableTreeNode("b"); + DefaultMutableTreeNode c = new DefaultMutableTreeNode("c"); + root.add(a); + root.add(b); + root.add(c); + b.add(new DefaultMutableTreeNode("b1")); + c.add(new DefaultMutableTreeNode("c2")); + tree.setModel(new DefaultTreeModel(root)); + + fr.getContentPane().add(tree); + + tree.addTreeExpansionListener(new TreeExpansionListener() { + public void treeExpanded(TreeExpansionEvent e) { + TreePath path = e.getPath(); + if (path != null) { + DefaultMutableTreeNode node = + (DefaultMutableTreeNode)path.getLastPathComponent(); + node.removeAllChildren(); + String s = (String)node.getUserObject(); + node.add(new DefaultMutableTreeNode(s + "1")); + node.add(new DefaultMutableTreeNode(s + "2")); + node.add(new DefaultMutableTreeNode(s + "3")); + DefaultTreeModel model = (DefaultTreeModel)tree.getModel(); + model.nodeStructureChanged(node); + synchronized (bug4745001.this) { + stateChanged = true; + bug4745001.this.notifyAll(); + } + } + } + + public void treeCollapsed(TreeExpansionEvent e) { + synchronized (bug4745001.this) { + stateChanged = true; + bug4745001.this.notifyAll(); + } + } + }); + + fr.pack(); + fr.setVisible(true); + } + + void changeNodeStateForRow(final int row, final boolean expand) throws Exception { + try { + stateChanged = false; + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + try { + if (expand) { + tree.expandRow(row); + } else { + tree.collapseRow(row); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }); + synchronized (this) { + while (!stateChanged) { + bug4745001.this.wait(); + } + } + } catch (Throwable t) { + t.printStackTrace(); + } + } + + public void start() throws Exception { + // expand node "c" + changeNodeStateForRow(2, true); + // expand node "b" + changeNodeStateForRow(1, true); + // collapse node "c" + changeNodeStateForRow(1, false); + } + + String[] expected = new String[] {"a", "b", "c", "c1", "c2", "c3"}; + + public void destroy() { + for (int i = 0; i < expected.length; i++) { + Object obj = tree.getPathForRow(i).getLastPathComponent(); + if (!obj.toString().equals(expected[i])) { + throw new RuntimeException("Unexpected node at row "+i); + } + } + } + +} From 869df3bf7c2d43c67f0b67f0bad13b4ad669a337 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 31 Jan 2024 12:58:02 +0000 Subject: [PATCH 201/261] 8323101: C2: assert(n->in(0) == nullptr) failed: divisions with zero check should already have bailed out earlier in split-if Backport-of: 7e0a4ed6292586772c23292dbdd67ed1db5c12f7 --- src/hotspot/share/opto/loopopts.cpp | 6 +- .../TestSplitDivThroughPhiWithControl.java | 210 ++++++++++++++++++ 2 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/compiler/splitif/TestSplitDivThroughPhiWithControl.java diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index 011ce76fd8b..be2ec7dbc07 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -237,7 +237,11 @@ bool PhaseIdealLoop::cannot_split_division(const Node* n, const Node* region) co return false; } - assert(n->in(0) == nullptr, "divisions with zero check should already have bailed out earlier in split-if"); + if (n->in(0) != nullptr) { + // Cannot split through phi if Div or Mod node has a control dependency to a zero check. + return true; + } + Node* divisor = n->in(2); return is_divisor_counted_loop_phi(divisor, region) && loop_phi_backedge_type_contains_zero(divisor, zero); diff --git a/test/hotspot/jtreg/compiler/splitif/TestSplitDivThroughPhiWithControl.java b/test/hotspot/jtreg/compiler/splitif/TestSplitDivThroughPhiWithControl.java new file mode 100644 index 00000000000..28e4db334f5 --- /dev/null +++ b/test/hotspot/jtreg/compiler/splitif/TestSplitDivThroughPhiWithControl.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test id=normal + * @bug 8323101 + * @summary Test split_thru_phi with pinned divisions/modulo that have phi as inputs. + * @run main/othervm -Xbatch + * -XX:CompileCommand=compileonly,compiler.splitif.TestSplitDivThroughPhiWithControl::* + * compiler.splitif.TestSplitDivThroughPhiWithControl + */ + +/* + * @test id=fuzzer + * @bug 8323101 + * @summary Test split_thru_phi with pinned divisions/modulo that have phi as inputs. + * @run main/othervm -Xbatch -XX:PerMethodTrapLimit=0 + * -XX:CompileCommand=compileonly,compiler.splitif.TestSplitDivThroughPhiWithControl::* + * compiler.splitif.TestSplitDivThroughPhiWithControl + */ + +package compiler.splitif; + +public class TestSplitDivThroughPhiWithControl { + static int divisorInt = 34; + static int iFld; + static int x; + static int y; + static long divisorLong = 34L; + static long lFld; + static long lFld2; + static long lFld3; + static boolean flag; + + static int[] iArr = new int[400]; + + public static void main(String[] strArr) { + iArr[0] = 52329; + for (int i = 0; i < 10000; i++) { + flag = i % 3 == 0; // Avoid unstable if trap + divisorInt = i % 2 == 0 ? 0 : 23; // Avoid div by zero trap + divisorLong = divisorInt; // Avoid div by zero trap + try { + testIntDiv(); + } catch (ArithmeticException e) { + // Expected. + } + + try { + testIntMod(); + } catch (ArithmeticException e) { + // Expected. + } + + try { + testLongDiv(); // Currently does not trigger due to JDK-8323652 + } catch (ArithmeticException e) { + // Expected. + } + + try { + testLongMod(); // Currently does not trigger due to JDK-8323652 + } catch (ArithmeticException e) { + // Expected. + } + + testFuzzer(); + } + } + + static void testIntDiv() { + int a; + + for (int j = 0; j < 100; j++) { + y += 5; + int sub = j - 3; // AddI + int div = (sub / divisorInt); // DivI with AddI input + + if (flag) { + a = y; + } else { + a = 2; + } + // Region + + // Use StoreI with AddI input. Store needs to be split through Region in Split-If which is done together + // with AddI. + iFld = sub; + + if (a < 3) { // If that's split in Split-If + // Use of DivI -> after Split-If, DivI gets a Phi input that merges the split AddI nodes. + // -> triggers assert that we should not find pinned div nodes in cannot_split_division(). + x = div; + } + } + } + + // Same as testIntDiv() but with ModI + static void testIntMod() { + int a; + + for (int j = 0; j < 100; j++) { + y += 5; + int sub = j - 3; + int mod = (sub % divisorInt); + + if (flag) { + a = y; + } else { + a = 2; + } + + iFld = sub; + + if (a < 3) { + x = mod; // Only StoreI visited first but not mod since it's an input + } + } + } + + // Same as testIntDiv() but with DivL + static void testLongDiv() { + long a; + + for (int j = 0; j < 100; j++) { + y += 5; + long sub = j - 3; + long div = (sub / divisorLong); + + if (flag) { + a = lFld2; + } else { + a = 2; + } + + lFld = sub; + + if (a < 3) { + lFld3 = div; + } + } + } + + + // Same as testIntDiv() but with ModL + static void testLongMod() { + long a; + + for (long j = 0; j < 100; j++) { + lFld2 += 5; + long sub = j - 3; + long mod = (sub % divisorLong); + + if (flag) { + a = lFld2; + } else { + a = 2; + } + + lFld = sub; + + if (a < 3) { + lFld3 = mod; // Only StoreI visited first but not mod since it's an input + } + } + } + + // Original fuzzer crash + static void testFuzzer() { + int i19, i21 = 4928, i23 = 14; + for (int i = 5; i < 100; i++) { + i19 = i23; + int j = 1; + while (true) { + try { + i21 = (iArr[0] / 34); + i23 = (j % i21); + } catch (ArithmeticException a_e) { + } + iArr = iArr; + iFld = i21; + iArr[1] += 5; + if (j == 1000) { + break; + } + j++; + } + } + } +} From ffab458d5c08866bd29198b8019637093f089eb5 Mon Sep 17 00:00:00 2001 From: Joachim Kern Date: Wed, 31 Jan 2024 13:06:43 +0000 Subject: [PATCH 202/261] 8319382: com/sun/jdi/JdwpAllowTest.java shows failures on AIX if prefixLen of mask is larger than 32 in IPv6 case Backport-of: 22642ff0aac71eceb71f6a9eebb2988a9bd5f091 --- .../native/libdt_socket/socketTransport.c | 47 +++++-------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c index fe22820f315..804b404fcc4 100644 --- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c +++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c @@ -395,18 +395,14 @@ parseAddress(const char *address, struct addrinfo **result) { return getAddrInfo(address, hostnameLen, port, &hints, result); } -/* - * Input is sockaddr just because all clients have it. - */ -static void convertIPv4ToIPv6(const struct sockaddr *addr4, struct in6_addr *addr6) { +static void convertIPv4ToIPv6(const struct in_addr *addr4, struct in6_addr *addr6) { // Implement in a platform-independent way. // Spec requires in_addr has s_addr member, in6_addr has s6_addr[16] member. - struct in_addr *a4 = &(((struct sockaddr_in*)addr4)->sin_addr); memset(addr6, 0, sizeof(*addr6)); // for safety // Mapped address contains 80 zero bits, then 16 "1" bits, then IPv4 address (4 bytes). addr6->s6_addr[10] = addr6->s6_addr[11] = 0xFF; - memcpy(&(addr6->s6_addr[12]), &(a4->s_addr), 4); + memcpy(&(addr6->s6_addr[12]), &(addr4->s_addr), 4); } /* @@ -415,37 +411,19 @@ static void convertIPv4ToIPv6(const struct sockaddr *addr4, struct in6_addr *add */ static jdwpTransportError parseAllowedAddr(const char *buffer, struct in6_addr *result, int *isIPv4) { - struct addrinfo hints; - struct addrinfo *addrInfo = NULL; - jdwpTransportError err; - - /* - * To parse both IPv4 and IPv6 need to specify AF_UNSPEC family - * (with AF_INET6 IPv4 addresses are not parsed even with AI_V4MAPPED and AI_ALL flags). - */ - memset (&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; // IPv6 or mapped IPv4 - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - hints.ai_flags = AI_NUMERICHOST; // only numeric addresses, no resolution - - err = getAddrInfo(buffer, strlen(buffer), NULL, &hints, &addrInfo); - - if (err != JDWPTRANSPORT_ERROR_NONE) { - return err; - } - - if (addrInfo->ai_family == AF_INET6) { - memcpy(result, &(((struct sockaddr_in6 *)(addrInfo->ai_addr))->sin6_addr), sizeof(*result)); + struct in_addr addr; + struct in6_addr addr6; + if (inet_pton(AF_INET6, buffer, &addr6) == 1) { *isIPv4 = 0; - } else { // IPv4 address - convert to mapped IPv6 - struct in6_addr addr6; - convertIPv4ToIPv6(addrInfo->ai_addr, &addr6); - memcpy(result, &addr6, sizeof(*result)); + } else if (inet_pton(AF_INET, buffer, &addr) == 1) { + // IPv4 address - convert to mapped IPv6 + convertIPv4ToIPv6(&addr, &addr6); *isIPv4 = 1; + } else { + return JDWPTRANSPORT_ERROR_IO_ERROR; } - dbgsysFreeAddrInfo(addrInfo); + memcpy(result, &addr6, sizeof(*result)); return JDWPTRANSPORT_ERROR_NONE; } @@ -603,7 +581,8 @@ isPeerAllowed(struct sockaddr_storage *peer) { int i; // _peers contains IPv6 subnet and mask (IPv4 is converted to mapped IPv6) if (peer->ss_family == AF_INET) { - convertIPv4ToIPv6((struct sockaddr *)peer, &tmp); + struct in_addr *addr4 = &(((struct sockaddr_in*)peer)->sin_addr); + convertIPv4ToIPv6(addr4, &tmp); addr6 = &tmp; } else { addr6 = &(((struct sockaddr_in6 *)peer)->sin6_addr); From c6ebfdfe977f1cfadc151f7c35146858cd874baa Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Sat, 3 Feb 2024 10:00:21 +0000 Subject: [PATCH 203/261] 8320052: Zero: Use __atomic built-ins for atomic RMW operations Backport-of: 020c9007f8e9cc4b46a58d7955284f43a6ac913b --- .../os_cpu/bsd_zero/atomic_bsd_zero.hpp | 172 +----------------- src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp | 16 -- .../os_cpu/linux_zero/atomic_linux_zero.hpp | 19 +- .../os_cpu/linux_zero/os_linux_zero.cpp | 16 -- 4 files changed, 12 insertions(+), 211 deletions(-) diff --git a/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp b/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp index 4d5d97fddcd..37cd93e765d 100644 --- a/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp +++ b/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp @@ -31,135 +31,6 @@ // Implementation of class atomic -#ifdef M68K - -/* - * __m68k_cmpxchg - * - * Atomically store newval in *ptr if *ptr is equal to oldval for user space. - * Returns newval on success and oldval if no exchange happened. - * This implementation is processor specific and works on - * 68020 68030 68040 and 68060. - * - * It will not work on ColdFire, 68000 and 68010 since they lack the CAS - * instruction. - * Using a kernelhelper would be better for arch complete implementation. - * - */ - -static inline int __m68k_cmpxchg(int oldval, int newval, volatile int *ptr) { - int ret; - __asm __volatile ("cas%.l %0,%2,%1" - : "=d" (ret), "+m" (*(ptr)) - : "d" (newval), "0" (oldval)); - return ret; -} - -/* Perform an atomic compare and swap: if the current value of `*PTR' - is OLDVAL, then write NEWVAL into `*PTR'. Return the contents of - `*PTR' before the operation.*/ -static inline int m68k_compare_and_swap(int newval, - volatile int *ptr, - int oldval) { - for (;;) { - int prev = *ptr; - if (prev != oldval) - return prev; - - if (__m68k_cmpxchg (prev, newval, ptr) == newval) - // Success. - return prev; - - // We failed even though prev == oldval. Try again. - } -} - -/* Atomically add an int to memory. */ -static inline int m68k_add_then_fetch(int add_value, volatile int *ptr) { - for (;;) { - // Loop until success. - - int prev = *ptr; - - if (__m68k_cmpxchg (prev, prev + add_value, ptr) == prev + add_value) - return prev + add_value; - } -} - -/* Atomically write VALUE into `*PTR' and returns the previous - contents of `*PTR'. */ -static inline int m68k_lock_test_and_set(int newval, volatile int *ptr) { - for (;;) { - // Loop until success. - int prev = *ptr; - - if (__m68k_cmpxchg (prev, newval, ptr) == prev) - return prev; - } -} -#endif // M68K - -#ifdef ARM - -/* - * __kernel_cmpxchg - * - * Atomically store newval in *ptr if *ptr is equal to oldval for user space. - * Return zero if *ptr was changed or non-zero if no exchange happened. - * The C flag is also set if *ptr was changed to allow for assembly - * optimization in the calling code. - * - */ - -typedef int (__kernel_cmpxchg_t)(int oldval, int newval, volatile int *ptr); -#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0) - - - -/* Perform an atomic compare and swap: if the current value of `*PTR' - is OLDVAL, then write NEWVAL into `*PTR'. Return the contents of - `*PTR' before the operation.*/ -static inline int arm_compare_and_swap(int newval, - volatile int *ptr, - int oldval) { - for (;;) { - int prev = *ptr; - if (prev != oldval) - return prev; - - if (__kernel_cmpxchg (prev, newval, ptr) == 0) - // Success. - return prev; - - // We failed even though prev == oldval. Try again. - } -} - -/* Atomically add an int to memory. */ -static inline int arm_add_then_fetch(int add_value, volatile int *ptr) { - for (;;) { - // Loop until a __kernel_cmpxchg succeeds. - - int prev = *ptr; - - if (__kernel_cmpxchg (prev, prev + add_value, ptr) == 0) - return prev + add_value; - } -} - -/* Atomically write VALUE into `*PTR' and returns the previous - contents of `*PTR'. */ -static inline int arm_lock_test_and_set(int newval, volatile int *ptr) { - for (;;) { - // Loop until a __kernel_cmpxchg succeeds. - int prev = *ptr; - - if (__kernel_cmpxchg (prev, newval, ptr) == 0) - return prev; - } -} -#endif // ARM - template struct Atomic::PlatformAdd { template @@ -178,17 +49,9 @@ inline D Atomic::PlatformAdd<4>::add_then_fetch(D volatile* dest, I add_value, STATIC_ASSERT(4 == sizeof(I)); STATIC_ASSERT(4 == sizeof(D)); -#ifdef ARM - return add_using_helper(arm_add_then_fetch, dest, add_value); -#else -#ifdef M68K - return add_using_helper(m68k_add_then_fetch, dest, add_value); -#else D res = __atomic_add_fetch(dest, add_value, __ATOMIC_RELEASE); FULL_MEM_BARRIER; return res; -#endif // M68K -#endif // ARM } template<> @@ -209,26 +72,10 @@ inline T Atomic::PlatformXchg<4>::operator()(T volatile* dest, T exchange_value, atomic_memory_order order) const { STATIC_ASSERT(4 == sizeof(T)); -#ifdef ARM - return xchg_using_helper(arm_lock_test_and_set, dest, exchange_value); -#else -#ifdef M68K - return xchg_using_helper(m68k_lock_test_and_set, dest, exchange_value); -#else - // __sync_lock_test_and_set is a bizarrely named atomic exchange - // operation. Note that some platforms only support this with the - // limitation that the only valid value to store is the immediate - // constant 1. There is a test for this in JNI_CreateJavaVM(). - T result = __sync_lock_test_and_set (dest, exchange_value); - // All atomic operations are expected to be full memory barriers - // (see atomic.hpp). However, __sync_lock_test_and_set is not - // a full memory barrier, but an acquire barrier. Hence, this added - // barrier. Some platforms (notably ARM) have peculiarities with - // their barrier implementations, delegate it to OrderAccess. - OrderAccess::fence(); + FULL_MEM_BARRIER; + T result = __atomic_exchange_n(dest, exchange_value, __ATOMIC_RELAXED); + FULL_MEM_BARRIER; return result; -#endif // M68K -#endif // ARM } template<> @@ -237,8 +84,9 @@ inline T Atomic::PlatformXchg<8>::operator()(T volatile* dest, T exchange_value, atomic_memory_order order) const { STATIC_ASSERT(8 == sizeof(T)); - T result = __sync_lock_test_and_set (dest, exchange_value); - OrderAccess::fence(); + FULL_MEM_BARRIER; + T result = __atomic_exchange_n(dest, exchange_value, __ATOMIC_RELAXED); + FULL_MEM_BARRIER; return result; } @@ -253,20 +101,12 @@ inline T Atomic::PlatformCmpxchg<4>::operator()(T volatile* dest, T exchange_value, atomic_memory_order order) const { STATIC_ASSERT(4 == sizeof(T)); -#ifdef ARM - return cmpxchg_using_helper(arm_compare_and_swap, dest, compare_value, exchange_value); -#else -#ifdef M68K - return cmpxchg_using_helper(m68k_compare_and_swap, dest, compare_value, exchange_value); -#else T value = compare_value; FULL_MEM_BARRIER; __atomic_compare_exchange(dest, &value, &exchange_value, /*weak*/false, __ATOMIC_RELAXED, __ATOMIC_RELAXED); FULL_MEM_BARRIER; return value; -#endif // M68K -#endif // ARM } template<> diff --git a/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp b/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp index 55b5efd5f6e..c1bcf841b08 100644 --- a/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp +++ b/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp @@ -331,22 +331,6 @@ extern "C" { } }; -///////////////////////////////////////////////////////////////////////////// -// Implementations of atomic operations not supported by processors. -// -- http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Atomic-Builtins.html - -#ifndef _LP64 -extern "C" { - long long unsigned int __sync_val_compare_and_swap_8( - volatile void *ptr, - long long unsigned int oldval, - long long unsigned int newval) { - ShouldNotCallThis(); - return 0; // silence compiler warnings - } -}; -#endif // !_LP64 - #ifndef PRODUCT void os::verify_stack_alignment() { } diff --git a/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp b/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp index 7b7beba6565..6409942c07d 100644 --- a/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp +++ b/src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp @@ -71,17 +71,9 @@ inline T Atomic::PlatformXchg<4>::operator()(T volatile* dest, T exchange_value, atomic_memory_order order) const { STATIC_ASSERT(4 == sizeof(T)); - // __sync_lock_test_and_set is a bizarrely named atomic exchange - // operation. Note that some platforms only support this with the - // limitation that the only valid value to store is the immediate - // constant 1. There is a test for this in JNI_CreateJavaVM(). - T result = __sync_lock_test_and_set (dest, exchange_value); - // All atomic operations are expected to be full memory barriers - // (see atomic.hpp). However, __sync_lock_test_and_set is not - // a full memory barrier, but an acquire barrier. Hence, this added - // barrier. Some platforms (notably ARM) have peculiarities with - // their barrier implementations, delegate it to OrderAccess. - OrderAccess::fence(); + FULL_MEM_BARRIER; + T result = __atomic_exchange_n(dest, exchange_value, __ATOMIC_RELAXED); + FULL_MEM_BARRIER; return result; } @@ -91,8 +83,9 @@ inline T Atomic::PlatformXchg<8>::operator()(T volatile* dest, T exchange_value, atomic_memory_order order) const { STATIC_ASSERT(8 == sizeof(T)); - T result = __sync_lock_test_and_set (dest, exchange_value); - OrderAccess::fence(); + FULL_MEM_BARRIER; + T result = __atomic_exchange_n(dest, exchange_value, __ATOMIC_RELAXED); + FULL_MEM_BARRIER; return result; } diff --git a/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp b/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp index 07f8eaa6030..73adff11edd 100644 --- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp +++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp @@ -492,22 +492,6 @@ extern "C" { } }; -///////////////////////////////////////////////////////////////////////////// -// Implementations of atomic operations not supported by processors. -// -- http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Atomic-Builtins.html - -#ifndef _LP64 -extern "C" { - long long unsigned int __sync_val_compare_and_swap_8( - volatile void *ptr, - long long unsigned int oldval, - long long unsigned int newval) { - ShouldNotCallThis(); - return 0; // silence compiler warnings - } -}; -#endif // !_LP64 - #ifndef PRODUCT void os::verify_stack_alignment() { } From 0b79e90dd887ff51cab015e176a35dba0be9fed6 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Sat, 3 Feb 2024 21:37:10 +0000 Subject: [PATCH 204/261] 8324937: GHA: Avoid multiple test suites per job Backport-of: 1aba78f2720b581f18fc2cec5e84deba6b2bcd41 --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ccb02e39ce..5d91e057a64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,7 @@ jobs: - 'hs/tier1 compiler part 1' - 'hs/tier1 compiler part 2' - 'hs/tier1 compiler part 3' + - 'hs/tier1 compiler not-xcomp' - 'hs/tier1 gc' - 'hs/tier1 runtime' - 'hs/tier1 serviceability' @@ -90,13 +91,17 @@ jobs: debug-suffix: -debug - test-name: 'hs/tier1 compiler part 2' - test-suite: 'test/hotspot/jtreg/:tier1_compiler_2 test/hotspot/jtreg/:tier1_compiler_not_xcomp' + test-suite: 'test/hotspot/jtreg/:tier1_compiler_2' debug-suffix: -debug - test-name: 'hs/tier1 compiler part 3' test-suite: 'test/hotspot/jtreg/:tier1_compiler_3' debug-suffix: -debug + - test-name: 'hs/tier1 compiler not-xcomp' + test-suite: 'test/hotspot/jtreg/:tier1_compiler_not_xcomp' + debug-suffix: -debug + - test-name: 'hs/tier1 gc' test-suite: 'test/hotspot/jtreg/:tier1_gc' debug-suffix: -debug From 38c5df13ab06d012a017e908893cb59288fe1324 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Sat, 3 Feb 2024 21:38:25 +0000 Subject: [PATCH 205/261] 8323637: Capture hotspot replay files in GHA Backport-of: c84c0ab52d5e08a693f7ad7d9a4772d8c1eeeaa8 --- .github/scripts/gen-test-results.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/scripts/gen-test-results.sh b/.github/scripts/gen-test-results.sh index 73edb8b3d11..9e85eef4dc0 100644 --- a/.github/scripts/gen-test-results.sh +++ b/.github/scripts/gen-test-results.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2024, 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 @@ -44,8 +44,8 @@ for test in $failures $errors; do base_path="$(echo "$test" | tr '#' '_')" report_file="$report_dir/$base_path.jtr" hs_err_files=$(ls $report_dir/$base_path/hs_err*.log 2> /dev/null || true) + replay_files=$(ls $report_dir/$base_path/replay*.log 2> /dev/null || true) echo "#### $test" - echo '
    View test results' echo '' echo '```' @@ -73,6 +73,20 @@ for test in $failures $errors; do echo '' fi + if [[ "$replay_files" != "" ]]; then + echo '
    View HotSpot replay file' + echo '' + for replay in $replay_files; do + echo '```' + echo "$replay:" + echo '' + cat "$replay" + echo '```' + done + + echo '
    ' + echo '' + fi done >> $GITHUB_STEP_SUMMARY # With many failures, the summary can easily exceed 1024 kB, the limit set by Github From e75ca5a3d2e01ae23d6704e34c06ce76b62243d6 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 5 Feb 2024 12:38:47 +0000 Subject: [PATCH 206/261] 8309697: [TESTBUG] Remove "@requires vm.flagless" from jtreg vectorization tests Reviewed-by: shade Backport-of: a03954e6c57369446ef77136966662780e4b1c4e --- .../vectorization/runner/ArrayCopyTest.java | 2 +- .../runner/ArrayIndexFillTest.java | 2 +- .../runner/ArrayInvariantFillTest.java | 31 ++++++++++++++++++- .../runner/ArrayShiftOpTest.java | 2 +- .../runner/ArrayTypeConvertTest.java | 2 +- .../runner/ArrayUnsafeOpTest.java | 2 +- .../runner/BasicBooleanOpTest.java | 2 +- .../vectorization/runner/BasicByteOpTest.java | 2 +- .../vectorization/runner/BasicCharOpTest.java | 2 +- .../runner/BasicDoubleOpTest.java | 2 +- .../runner/BasicFloatOpTest.java | 2 +- .../vectorization/runner/BasicIntOpTest.java | 2 +- .../vectorization/runner/BasicLongOpTest.java | 2 +- .../runner/BasicShortOpTest.java | 2 +- .../runner/LoopArrayIndexComputeTest.java | 4 +-- .../runner/LoopCombinedOpTest.java | 2 +- .../runner/LoopControlFlowTest.java | 2 +- .../runner/LoopLiveOutNodesTest.java | 2 +- .../runner/LoopRangeStrideTest.java | 4 +-- .../runner/LoopReductionOpTest.java | 2 +- .../runner/MultipleLoopsTest.java | 2 +- .../runner/StripMinedLoopTest.java | 2 +- .../runner/VectorizationTestRunner.java | 31 +++++-------------- 23 files changed, 61 insertions(+), 47 deletions(-) diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayCopyTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayCopyTest.java index da132813ab3..f334b4226a3 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayCopyTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayCopyTest.java @@ -35,7 +35,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.ArrayCopyTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayIndexFillTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayIndexFillTest.java index f9916fd63ec..a4eca0fe8dd 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayIndexFillTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayIndexFillTest.java @@ -36,7 +36,7 @@ * compiler.vectorization.runner.ArrayIndexFillTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayInvariantFillTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayInvariantFillTest.java index e4e68cc3fd7..2e7302bba05 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayInvariantFillTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayInvariantFillTest.java @@ -35,9 +35,14 @@ * -XX:+WhiteBoxAPI * -XX:-OptimizeFill * compiler.vectorization.runner.ArrayInvariantFillTest + * @run main/othervm -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+OptimizeFill + * compiler.vectorization.runner.ArrayInvariantFillTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; @@ -66,7 +71,11 @@ public ArrayInvariantFillTest() { // ---------------- Simple Fill ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "false"}, counts = {IRNode.REPLICATE_B, ">0"}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "true"}, + counts = {IRNode.REPLICATE_B, "0"}) public byte[] fillByteArray() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -77,7 +86,11 @@ public byte[] fillByteArray() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "false"}, counts = {IRNode.REPLICATE_S, ">0"}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "true"}, + counts = {IRNode.REPLICATE_S, "0"}) public short[] fillShortArray() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -88,7 +101,11 @@ public short[] fillShortArray() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "false"}, counts = {IRNode.REPLICATE_S, ">0"}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "true"}, + counts = {IRNode.REPLICATE_S, "0"}) public char[] fillCharArray() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -99,7 +116,11 @@ public char[] fillCharArray() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "false"}, counts = {IRNode.REPLICATE_I, ">0"}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "true"}, + counts = {IRNode.REPLICATE_I, "0"}) public int[] fillIntArray() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -121,7 +142,11 @@ public long[] fillLongArray() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "false"}, counts = {IRNode.REPLICATE_F, ">0"}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "true"}, + counts = {IRNode.REPLICATE_F, "0"}) public float[] fillFloatArray() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -177,7 +202,11 @@ public long[] fillLongArrayWithFloat() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "false"}, counts = {IRNode.REPLICATE_I, ">0"}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + applyIf = {"OptimizeFill", "true"}, + counts = {IRNode.REPLICATE_I, "0"}) public int[] fillIntArrayWithDouble() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java index 0d53c748979..74262142247 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java @@ -36,7 +36,7 @@ * compiler.vectorization.runner.ArrayShiftOpTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java index a4640bbc302..7956fa5f618 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java @@ -35,7 +35,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.ArrayTypeConvertTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayUnsafeOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayUnsafeOpTest.java index 23582a20d9b..8b4513b8490 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayUnsafeOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayUnsafeOpTest.java @@ -35,7 +35,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.ArrayUnsafeOpTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java index e1d30a5c839..d1a61538f2e 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java @@ -35,7 +35,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.BasicBooleanOpTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java index 1ed615317d1..e0b5da1b716 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java @@ -38,7 +38,7 @@ * -XX:LoopUnrollLimit=1000 * compiler.vectorization.runner.BasicByteOpTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java index 4b91360fc54..d851af1ff59 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java @@ -35,7 +35,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.BasicCharOpTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java index 06b48649c25..2410ebe8554 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java @@ -36,7 +36,7 @@ * compiler.vectorization.runner.BasicDoubleOpTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java index fae5ca4c125..c9eda7d7650 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java @@ -36,7 +36,7 @@ * compiler.vectorization.runner.BasicFloatOpTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java index d392214c969..e848a15ffbc 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java @@ -36,7 +36,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.BasicIntOpTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java index 1e41ae97ea2..80ebd7b64d0 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java @@ -37,7 +37,7 @@ * compiler.vectorization.runner.BasicLongOpTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java index b47267e5507..c9a06c11360 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java @@ -35,7 +35,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.BasicShortOpTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java index 0c908c18fde..2bf59814b4f 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java @@ -37,7 +37,7 @@ * compiler.vectorization.runner.LoopArrayIndexComputeTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; @@ -277,7 +277,7 @@ public byte[] byteArrayWithDependence() { byte[] res = new byte[SIZE]; System.arraycopy(bytes, 0, res, 0, SIZE); for (int i = 0; i < SIZE / 2; i++) { - res[i] *= bytes[i + 3]; + res[i] += bytes[i + 3]; } return res; } diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java index 11852a55106..cddc5207d42 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java @@ -36,7 +36,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.LoopCombinedOpTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopControlFlowTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopControlFlowTest.java index a6057b63024..f0436332bdd 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopControlFlowTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopControlFlowTest.java @@ -35,7 +35,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.LoopControlFlowTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopLiveOutNodesTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopLiveOutNodesTest.java index b5c3e3a9bfa..8b5e62a9d21 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopLiveOutNodesTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopLiveOutNodesTest.java @@ -36,7 +36,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.LoopLiveOutNodesTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopRangeStrideTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopRangeStrideTest.java index e9de917e4f5..cfc87206c5d 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopRangeStrideTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopRangeStrideTest.java @@ -36,8 +36,8 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.LoopRangeStrideTest * - * @requires vm.compiler2.enabled & vm.flagless - * @requires (os.arch=="amd64" | os.arch=="x86_64" | os.simpleArch == "aarch64") + * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java index 72667a66d82..f1c8fea059b 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java @@ -36,7 +36,7 @@ * compiler.vectorization.runner.LoopReductionOpTest * * @requires (os.simpleArch == "x64") | (os.simpleArch == "aarch64") - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled * */ diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/MultipleLoopsTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/MultipleLoopsTest.java index 853f60124ba..61648c2e810 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/MultipleLoopsTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/MultipleLoopsTest.java @@ -36,7 +36,7 @@ * -XX:+WhiteBoxAPI * compiler.vectorization.runner.MultipleLoopsTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/StripMinedLoopTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/StripMinedLoopTest.java index 655470b095a..dc906540f88 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/StripMinedLoopTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/StripMinedLoopTest.java @@ -36,7 +36,7 @@ * -XX:LoopStripMiningIter=10 * compiler.vectorization.runner.StripMinedLoopTest * - * @requires vm.compiler2.enabled & vm.flagless + * @requires vm.compiler2.enabled */ package compiler.vectorization.runner; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/VectorizationTestRunner.java b/test/hotspot/jtreg/compiler/vectorization/runner/VectorizationTestRunner.java index 845733aeb0d..0a539c13294 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/VectorizationTestRunner.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/VectorizationTestRunner.java @@ -25,18 +25,11 @@ import compiler.lib.ir_framework.*; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.io.File; - -import jdk.test.lib.Platform; import jdk.test.lib.Utils; import jdk.test.whitebox.WhiteBox; @@ -51,17 +44,14 @@ public class VectorizationTestRunner { private static final int NMETHOD_COMP_LEVEL_IDX = 1; private static final int NMETHOD_INSTS_IDX = 2; - private static final long COMP_THRES_SECONDS = 30; - protected void run() { + Class klass = getClass(); + // 1) Vectorization correctness test - // For each method annotated with @Test in the test method, this test runner + // For each method annotated with "@Test" in test classes, this test runner // invokes it twice - first time in the interpreter and second time compiled // by C2. Then this runner compares the two return values. Hence we require // each test method returning a primitive value or an array of primitive type. - // And each test method should not throw any exceptions. - Class klass = getClass(); - // Add extra VM options to verify experimental auto-vectorization WB.setBooleanVMFlag("UnlockExperimentalVMOptions", true); WB.setBooleanVMFlag("PostLoopMultiversioning", true); for (Method method : klass.getDeclaredMethods()) { @@ -80,8 +70,6 @@ protected void run() { // To test vectorizability, invoke the IR test framework to check existence of // expected C2 IR node. TestFramework irTest = new TestFramework(klass); - // Add extra VM options to enable more auto-vectorization chances - irTest.addFlags("-XX:-OptimizeFill"); irTest.start(); } @@ -117,9 +105,9 @@ private void runTestOnMethod(Method method) throws InterruptedException { Object expected = null; Object actual = null; - // Lock compilation and inovke the method to get reference result from - // the interpreter - WB.lockCompilation(); + // Temporarily disable the compiler and invoke the method to get reference + // result from the interpreter + WB.setBooleanVMFlag("UseCompiler", false); try { expected = method.invoke(this); } catch (Exception e) { @@ -127,16 +115,13 @@ private void runTestOnMethod(Method method) throws InterruptedException { fail("Exception is thrown in test method invocation (interpreter)."); } assert(WB.getMethodCompilationLevel(method) == COMP_LEVEL_INTP); - WB.unlockCompilation(); + WB.setBooleanVMFlag("UseCompiler", true); // Compile the method and invoke it again long enqueueTime = System.currentTimeMillis(); WB.enqueueMethodForCompilation(method, COMP_LEVEL_C2); while (WB.getMethodCompilationLevel(method) != COMP_LEVEL_C2) { - if (System.currentTimeMillis() - enqueueTime > COMP_THRES_SECONDS * 1000) { - fail("Method is not compiled after " + COMP_THRES_SECONDS + "s."); - } - Thread.sleep(50 /*ms*/); + Thread.sleep(100 /*ms*/); } try { actual = method.invoke(this); From f15349b1e8ba49ef93ea8ba24c7202572b77ed19 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 6 Feb 2024 12:56:35 +0000 Subject: [PATCH 207/261] 8313670: Simplify shared lib name handling code in some tests Reviewed-by: mdoerr, lucy Backport-of: 6dba2026d72de6a67aa0209749ded8174b088904 --- .../jtreg/runtime/signal/SigTestDriver.java | 5 ++-- .../AttachFailed/AttachFailedTestBase.java | 11 ++------- .../dcmd/jvmti/LoadAgentDcmdTest.java | 17 ++----------- .../serviceability/dcmd/vm/DynLibsTest.java | 24 ++++--------------- .../nsk/jvmti/NativeLibraryCopier.java | 13 +++------- .../warnings/DynamicLoadWarningTest.java | 5 ++-- .../runtime/TestNativeLibrariesEvent.java | 19 ++------------- test/lib/jdk/test/lib/Platform.java | 21 ++++++++++++++++ 8 files changed, 38 insertions(+), 77 deletions(-) diff --git a/test/hotspot/jtreg/runtime/signal/SigTestDriver.java b/test/hotspot/jtreg/runtime/signal/SigTestDriver.java index 6fcc41c8ab2..f2b37af1c39 100644 --- a/test/hotspot/jtreg/runtime/signal/SigTestDriver.java +++ b/test/hotspot/jtreg/runtime/signal/SigTestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -144,7 +144,6 @@ private static List vmargs() { } private static Path libjsig() { - return Platform.jvmLibDir().resolve((Platform.isWindows() ? "" : "lib") - + "jsig." + Platform.sharedLibraryExt()); + return Platform.jvmLibDir().resolve(Platform.buildSharedLibraryName("jsig")); } } diff --git a/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java b/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java index d6b1159a4b0..6926ec0fbf7 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java +++ b/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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,14 +39,7 @@ public abstract class AttachFailedTestBase { * Build path to shared object according to platform rules */ public static String getSharedObjectPath(String name) { - String libname; - if (Platform.isWindows()) { - libname = name + ".dll"; - } else if (Platform.isOSX()) { - libname = "lib" + name + ".dylib"; - } else { - libname = "lib" + name + ".so"; - } + String libname = Platform.buildSharedLibraryName(name); return Paths.get(Utils.TEST_NATIVE_PATH, libname) .toAbsolutePath() diff --git a/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java b/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java index c24b23d09a1..725bf086b3b 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, 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 @@ public String getLibInstrumentPath() throws FileNotFoundException { "'-Dtest.jdk=/path/to/jdk'."); } - Path libpath = Paths.get(jdkPath, jdkLibPath(), sharedObjectName("instrument")); + Path libpath = Paths.get(jdkPath, jdkLibPath(), Platform.buildSharedLibraryName("instrument")); if (!libpath.toFile().exists()) { throw new FileNotFoundException( @@ -157,19 +157,6 @@ public static String jdkLibPath() { return "lib"; } - /** - * Build name of shared object according to platform rules - */ - public static String sharedObjectName(String name) { - if (Platform.isWindows()) { - return name + ".dll"; - } - if (Platform.isOSX()) { - return "lib" + name + ".dylib"; - } - return "lib" + name + ".so"; - } - @Test public void jmx() throws Throwable { run(new JMXExecutor()); diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java index 1593bc164bc..696101a329e 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -44,25 +44,9 @@ public class DynLibsTest { public void run(CommandExecutor executor) { OutputAnalyzer output = executor.execute("VM.dynlibs"); - - String osDependentBaseString = null; - if (Platform.isAix()) { - osDependentBaseString = "lib%s.so"; - } else if (Platform.isLinux()) { - osDependentBaseString = "lib%s.so"; - } else if (Platform.isOSX()) { - osDependentBaseString = "lib%s.dylib"; - } else if (Platform.isWindows()) { - osDependentBaseString = "%s.dll"; - } - - if (osDependentBaseString == null) { - Assert.fail("Unsupported OS"); - } - - output.shouldContain(String.format(osDependentBaseString, "jvm")); - output.shouldContain(String.format(osDependentBaseString, "java")); - output.shouldContain(String.format(osDependentBaseString, "management")); + output.shouldContain(Platform.buildSharedLibraryName("jvm")); + output.shouldContain(Platform.buildSharedLibraryName("java")); + output.shouldContain(Platform.buildSharedLibraryName("management")); } @Test diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java index 4f846f997ef..a7a83820621 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,12 +34,12 @@ public class NativeLibraryCopier { public static void main(String[] args) { Path src = Paths.get(Utils.TEST_NATIVE_PATH) - .resolve(libname(args[0])) + .resolve(Platform.buildSharedLibraryName(args[0])) .toAbsolutePath(); Path dstDir = Paths.get("."); for (int i = 1; i < args.length; ++i) { - Path dst = dstDir.resolve(libname(args[i])).toAbsolutePath(); + Path dst = dstDir.resolve(Platform.buildSharedLibraryName(args[i])).toAbsolutePath(); System.out.println("copying " + src + " to " + dst); try { Files.copy(src, dst); @@ -48,11 +48,4 @@ public static void main(String[] args) { } } } - - private static String libname(String name) { - return String.format("%s%s.%s", - Platform.isWindows() ? "" : "lib", - name, - Platform.sharedLibraryExt()); - } } diff --git a/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java b/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java index 56d65c53378..c78bb081b9b 100644 --- a/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java +++ b/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java @@ -79,9 +79,8 @@ class DynamicLoadWarningTest { @BeforeAll static void setup() throws Exception { // get absolute path to JVM TI agents - String prefix = Platform.isWindows() ? "" : "lib"; - String libname1 = prefix + JVMTI_AGENT1_LIB + "." + Platform.sharedLibraryExt(); - String libname2 = prefix + JVMTI_AGENT2_LIB + "." + Platform.sharedLibraryExt(); + String libname1 = Platform.buildSharedLibraryName(JVMTI_AGENT1_LIB); + String libname2 = Platform.buildSharedLibraryName(JVMTI_AGENT2_LIB); jvmtiAgentPath1 = Path.of(Utils.TEST_NATIVE_PATH, libname1).toAbsolutePath().toString(); jvmtiAgentPath2 = Path.of(Utils.TEST_NATIVE_PATH, libname2).toAbsolutePath().toString(); diff --git a/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java b/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java index 77eb0362841..571809ddab4 100644 --- a/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java +++ b/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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 @@ -70,25 +70,10 @@ public static void main(String[] args) throws Throwable { } private static List getExpectedLibs() throws Throwable { - String libTemplate = null; - if (Platform.isWindows()) { - libTemplate = "%s.dll"; - } else if (Platform.isOSX()) { - libTemplate = "lib%s.dylib"; - } else if (Platform.isLinux()) { - libTemplate = "lib%s.so"; - } else if (Platform.isAix()) { - libTemplate = "lib%s.so"; - } - - if (libTemplate == null) { - throw new Exception("Unsupported OS"); - } - List libs = new ArrayList(); String[] names = { "jvm", "java", "zip" }; for (String name : names) { - libs.add(String.format(libTemplate, name)); + libs.add(Platform.buildSharedLibraryName(name)); } return libs; } diff --git a/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java index bbecb39e5d2..92663c65d0f 100644 --- a/test/lib/jdk/test/lib/Platform.java +++ b/test/lib/jdk/test/lib/Platform.java @@ -377,6 +377,27 @@ public static String sharedLibraryExt() { } } + /** + * Returns the usual file prefix of a shared library, e.g. "lib" on linux, empty on windows. + * @return file name prefix + */ + public static String sharedLibraryPrefix() { + if (isWindows()) { + return ""; + } else { + return "lib"; + } + } + + /** + * Returns the usual full shared lib name of a name without prefix and extension, e.g. for jsig + * "libjsig.so" on linux, "jsig.dll" on windows. + * @return the full shared lib name + */ + public static String buildSharedLibraryName(String name) { + return sharedLibraryPrefix() + name + "." + sharedLibraryExt(); + } + /* * Returns name of system variable containing paths to shared native libraries. */ From 85f4f38ca5d2e463f8557b050108d6e32cc11416 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 6 Feb 2024 15:56:37 +0000 Subject: [PATCH 208/261] 8322957: Generational ZGC: Relocation selection must join the STS Reviewed-by: eosterlund, stefank Backport-of: ba23025cd8a9c1af37afea6444ce5ea2ff41e5af --- src/hotspot/share/gc/shared/workerThread.cpp | 49 +++++++++-------- src/hotspot/share/gc/shared/workerThread.hpp | 6 ++- src/hotspot/share/gc/z/zBarrier.inline.hpp | 13 +---- src/hotspot/share/gc/z/zGeneration.cpp | 6 ++- src/hotspot/share/gc/z/zGeneration.hpp | 1 + src/hotspot/share/gc/z/zIterator.inline.hpp | 10 ++++ src/hotspot/share/gc/z/zRelocate.cpp | 26 +++++++-- src/hotspot/share/gc/z/zRelocate.hpp | 7 +++ src/hotspot/share/gc/z/zRelocationSet.cpp | 7 +++ .../share/gc/z/zUncoloredRoot.inline.hpp | 3 +- src/hotspot/share/gc/z/zVerify.cpp | 53 ++++++++++++++++++- src/hotspot/share/gc/z/zVerify.hpp | 2 + src/hotspot/share/runtime/thread.cpp | 1 + src/hotspot/share/runtime/thread.hpp | 5 ++ 14 files changed, 148 insertions(+), 41 deletions(-) diff --git a/src/hotspot/share/gc/shared/workerThread.cpp b/src/hotspot/share/gc/shared/workerThread.cpp index b64c5050a22..49e43c284fa 100644 --- a/src/hotspot/share/gc/shared/workerThread.cpp +++ b/src/hotspot/share/gc/shared/workerThread.cpp @@ -31,6 +31,7 @@ #include "runtime/init.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" +#include "runtime/safepoint.hpp" WorkerTaskDispatcher::WorkerTaskDispatcher() : _task(nullptr), @@ -141,40 +142,44 @@ void WorkerThreads::threads_do(ThreadClosure* tc) const { } } -void WorkerThreads::set_indirectly_suspendible_threads() { +template +void WorkerThreads::threads_do_f(Function function) const { + for (uint i = 0; i < _created_workers; i++) { + function(_workers[i]); + } +} + +void WorkerThreads::set_indirect_states() { #ifdef ASSERT - class SetIndirectlySuspendibleThreadClosure : public ThreadClosure { - virtual void do_thread(Thread* thread) { + const bool is_suspendible = Thread::current()->is_suspendible_thread(); + const bool is_safepointed = Thread::current()->is_VM_thread() && SafepointSynchronize::is_at_safepoint(); + + threads_do_f([&](Thread* thread) { + assert(!thread->is_indirectly_suspendible_thread(), "Unexpected"); + assert(!thread->is_indirectly_safepoint_thread(), "Unexpected"); + if (is_suspendible) { thread->set_indirectly_suspendible_thread(); } - }; - - if (Thread::current()->is_suspendible_thread()) { - SetIndirectlySuspendibleThreadClosure cl; - threads_do(&cl); - } + if (is_safepointed) { + thread->set_indirectly_safepoint_thread(); + } + }); #endif } -void WorkerThreads::clear_indirectly_suspendible_threads() { +void WorkerThreads::clear_indirect_states() { #ifdef ASSERT - class ClearIndirectlySuspendibleThreadClosure : public ThreadClosure { - virtual void do_thread(Thread* thread) { - thread->clear_indirectly_suspendible_thread(); - } - }; - - if (Thread::current()->is_suspendible_thread()) { - ClearIndirectlySuspendibleThreadClosure cl; - threads_do(&cl); - } + threads_do_f([&](Thread* thread) { + thread->clear_indirectly_suspendible_thread(); + thread->clear_indirectly_safepoint_thread(); + }); #endif } void WorkerThreads::run_task(WorkerTask* task) { - set_indirectly_suspendible_threads(); + set_indirect_states(); _dispatcher.coordinator_distribute_task(task, _active_workers); - clear_indirectly_suspendible_threads(); + clear_indirect_states(); } void WorkerThreads::run_task(WorkerTask* task, uint num_workers) { diff --git a/src/hotspot/share/gc/shared/workerThread.hpp b/src/hotspot/share/gc/shared/workerThread.hpp index d3b246c0930..f22e48d7bbc 100644 --- a/src/hotspot/share/gc/shared/workerThread.hpp +++ b/src/hotspot/share/gc/shared/workerThread.hpp @@ -93,8 +93,8 @@ class WorkerThreads : public CHeapObj { WorkerThread* create_worker(uint name_suffix); - void set_indirectly_suspendible_threads(); - void clear_indirectly_suspendible_threads(); + void set_indirect_states(); + void clear_indirect_states(); protected: virtual void on_create_worker(WorkerThread* worker) {} @@ -111,6 +111,8 @@ class WorkerThreads : public CHeapObj { uint set_active_workers(uint num_workers); void threads_do(ThreadClosure* tc) const; + template + void threads_do_f(Function function) const; const char* name() const { return _name; } diff --git a/src/hotspot/share/gc/z/zBarrier.inline.hpp b/src/hotspot/share/gc/z/zBarrier.inline.hpp index e0d83619934..2c81c14865b 100644 --- a/src/hotspot/share/gc/z/zBarrier.inline.hpp +++ b/src/hotspot/share/gc/z/zBarrier.inline.hpp @@ -26,14 +26,13 @@ #include "gc/z/zBarrier.hpp" -#include "code/codeCache.hpp" #include "gc/z/zAddress.inline.hpp" #include "gc/z/zGeneration.inline.hpp" #include "gc/z/zHeap.inline.hpp" #include "gc/z/zResurrection.inline.hpp" +#include "gc/z/zVerify.hpp" #include "oops/oop.hpp" #include "runtime/atomic.hpp" -#include "runtime/continuation.hpp" // A self heal must always "upgrade" the address metadata bits in // accordance with the metadata bits state machine. The following @@ -320,17 +319,9 @@ inline zaddress ZBarrier::make_load_good_no_relocate(zpointer o) { return remap(ZPointer::uncolor_unsafe(o), remap_generation(o)); } -inline void z_assert_is_barrier_safe() { - assert(!Thread::current()->is_ConcurrentGC_thread() || /* Need extra checks for ConcurrentGCThreads */ - Thread::current()->is_suspendible_thread() || /* Thread prevents safepoints */ - Thread::current()->is_indirectly_suspendible_thread() || /* Coordinator thread prevents safepoints */ - SafepointSynchronize::is_at_safepoint(), /* Is at safepoint */ - "Shouldn't perform load barrier"); -} - template inline zaddress ZBarrier::barrier(ZBarrierFastPath fast_path, ZBarrierSlowPath slow_path, ZBarrierColor color, volatile zpointer* p, zpointer o, bool allow_null) { - z_assert_is_barrier_safe(); + z_verify_safepoints_are_blocked(); // Fast path if (fast_path(o)) { diff --git a/src/hotspot/share/gc/z/zGeneration.cpp b/src/hotspot/share/gc/z/zGeneration.cpp index 0ee5ce7a6c8..1b4afd4eefb 100644 --- a/src/hotspot/share/gc/z/zGeneration.cpp +++ b/src/hotspot/share/gc/z/zGeneration.cpp @@ -285,6 +285,10 @@ void ZGeneration::desynchronize_relocation() { _relocate.desynchronize(); } +bool ZGeneration::is_relocate_queue_active() const { + return _relocate.is_queue_active(); +} + void ZGeneration::reset_statistics() { assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint"); _freed = 0; @@ -1492,7 +1496,7 @@ void ZGenerationOld::remap_young_roots() { uint remap_nworkers = clamp(ZGeneration::young()->workers()->active_workers() + prev_nworkers, 1u, ZOldGCThreads); _workers.set_active_workers(remap_nworkers); - // TODO: The STS joiner is only needed to satisfy z_assert_is_barrier_safe that doesn't + // TODO: The STS joiner is only needed to satisfy ZBarrier::assert_is_state_barrier_safe that doesn't // understand the driver locker. Consider making the assert aware of the driver locker. SuspendibleThreadSetJoiner sts_joiner; diff --git a/src/hotspot/share/gc/z/zGeneration.hpp b/src/hotspot/share/gc/z/zGeneration.hpp index 23736f45b7b..32762a50b62 100644 --- a/src/hotspot/share/gc/z/zGeneration.hpp +++ b/src/hotspot/share/gc/z/zGeneration.hpp @@ -166,6 +166,7 @@ class ZGeneration { // Relocation void synchronize_relocation(); void desynchronize_relocation(); + bool is_relocate_queue_active() const; zaddress relocate_or_remap_object(zaddress_unsafe addr); zaddress remap_object(zaddress_unsafe addr); diff --git a/src/hotspot/share/gc/z/zIterator.inline.hpp b/src/hotspot/share/gc/z/zIterator.inline.hpp index 9ccacdc9a3c..af97a549b0d 100644 --- a/src/hotspot/share/gc/z/zIterator.inline.hpp +++ b/src/hotspot/share/gc/z/zIterator.inline.hpp @@ -26,11 +26,21 @@ #include "gc/z/zIterator.hpp" +#include "gc/z/zVerify.hpp" #include "memory/iterator.inline.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" inline bool ZIterator::is_invisible_object(oop obj) { + // This is a good place to make sure that we can't concurrently iterate over + // objects while VMThread operations think they have exclusive access to the + // object graph. + // + // One example that have caused problems is the JFR Leak Profiler, which + // sets the mark word to a value that makes the object arrays look like + // invisible objects. + z_verify_safepoints_are_blocked(); + return obj->mark_acquire().is_marked(); } diff --git a/src/hotspot/share/gc/z/zRelocate.cpp b/src/hotspot/share/gc/z/zRelocate.cpp index d4e3e92b3aa..281553f7fdf 100644 --- a/src/hotspot/share/gc/z/zRelocate.cpp +++ b/src/hotspot/share/gc/z/zRelocate.cpp @@ -87,6 +87,7 @@ ZRelocateQueue::ZRelocateQueue() _nworkers(0), _nsynchronized(0), _synchronize(false), + _is_active(false), _needs_attention(0) {} bool ZRelocateQueue::needs_attention() const { @@ -103,6 +104,20 @@ void ZRelocateQueue::dec_needs_attention() { assert(needs_attention == 0 || needs_attention == 1, "Invalid state"); } +void ZRelocateQueue::activate(uint nworkers) { + _is_active = true; + join(nworkers); +} + +void ZRelocateQueue::deactivate() { + Atomic::store(&_is_active, false); + clear(); +} + +bool ZRelocateQueue::is_active() const { + return Atomic::load(&_is_active); +} + void ZRelocateQueue::join(uint nworkers) { assert(nworkers != 0, "Must request at least one worker"); assert(_nworkers == 0, "Invalid state"); @@ -327,7 +342,7 @@ ZWorkers* ZRelocate::workers() const { } void ZRelocate::start() { - _queue.join(workers()->active_workers()); + _queue.activate(workers()->active_workers()); } void ZRelocate::add_remset(volatile zpointer* p) { @@ -1088,6 +1103,9 @@ class ZRelocateTask : public ZRestartableTask { ~ZRelocateTask() { _generation->stat_relocation()->at_relocate_end(_small_allocator.in_place_count(), _medium_allocator.in_place_count()); + + // Signal that we're not using the queue anymore. Used mostly for asserts. + _queue->deactivate(); } virtual void work() { @@ -1232,8 +1250,6 @@ void ZRelocate::relocate(ZRelocationSet* relocation_set) { ZRelocateAddRemsetForFlipPromoted task(relocation_set->flip_promoted_pages()); workers()->run(&task); } - - _queue.clear(); } ZPageAge ZRelocate::compute_to_age(ZPageAge from_age) { @@ -1316,3 +1332,7 @@ void ZRelocate::desynchronize() { ZRelocateQueue* ZRelocate::queue() { return &_queue; } + +bool ZRelocate::is_queue_active() const { + return _queue.is_active(); +} diff --git a/src/hotspot/share/gc/z/zRelocate.hpp b/src/hotspot/share/gc/z/zRelocate.hpp index ed54103d53c..1b35abdf521 100644 --- a/src/hotspot/share/gc/z/zRelocate.hpp +++ b/src/hotspot/share/gc/z/zRelocate.hpp @@ -41,6 +41,7 @@ class ZRelocateQueue { uint _nworkers; uint _nsynchronized; bool _synchronize; + volatile bool _is_active; volatile int _needs_attention; bool needs_attention() const; @@ -53,6 +54,10 @@ class ZRelocateQueue { public: ZRelocateQueue(); + void activate(uint nworkers); + void deactivate(); + bool is_active() const; + void join(uint nworkers); void resize_workers(uint nworkers); void leave(); @@ -99,6 +104,8 @@ class ZRelocate { void desynchronize(); ZRelocateQueue* queue(); + + bool is_queue_active() const; }; #endif // SHARE_GC_Z_ZRELOCATE_HPP diff --git a/src/hotspot/share/gc/z/zRelocationSet.cpp b/src/hotspot/share/gc/z/zRelocationSet.cpp index 83bdf13b2bb..92f245777b4 100644 --- a/src/hotspot/share/gc/z/zRelocationSet.cpp +++ b/src/hotspot/share/gc/z/zRelocationSet.cpp @@ -106,11 +106,16 @@ class ZRelocationSetInstallTask : public ZTask { } virtual void work() { + // Join the STS to block out VMThreads while running promote_barrier_on_young_oop_field + SuspendibleThreadSetJoiner sts_joiner; + // Allocate and install forwardings for small pages for (size_t page_index; _small_iter.next_index(&page_index);) { ZPage* page = _small->at(int(page_index)); ZForwarding* const forwarding = ZForwarding::alloc(_allocator, page, to_age(page)); install_small(forwarding, _medium->length() + page_index); + + SuspendibleThreadSet::yield(); } // Allocate and install forwardings for medium pages @@ -118,6 +123,8 @@ class ZRelocationSetInstallTask : public ZTask { ZPage* page = _medium->at(int(page_index)); ZForwarding* const forwarding = ZForwarding::alloc(_allocator, page, to_age(page)); install_medium(forwarding, page_index); + + SuspendibleThreadSet::yield(); } } diff --git a/src/hotspot/share/gc/z/zUncoloredRoot.inline.hpp b/src/hotspot/share/gc/z/zUncoloredRoot.inline.hpp index 3eb28d3cafe..a7d39e5ed9c 100644 --- a/src/hotspot/share/gc/z/zUncoloredRoot.inline.hpp +++ b/src/hotspot/share/gc/z/zUncoloredRoot.inline.hpp @@ -29,11 +29,12 @@ #include "gc/z/zAddress.inline.hpp" #include "gc/z/zBarrier.inline.hpp" #include "gc/z/zHeap.inline.hpp" +#include "gc/z/zBarrier.hpp" #include "oops/oop.hpp" template inline void ZUncoloredRoot::barrier(ObjectFunctionT function, zaddress_unsafe* p, uintptr_t color) { - z_assert_is_barrier_safe(); + z_verify_safepoints_are_blocked(); const zaddress_unsafe addr = Atomic::load(p); assert_is_valid(addr); diff --git a/src/hotspot/share/gc/z/zVerify.cpp b/src/hotspot/share/gc/z/zVerify.cpp index 6950f669158..b168610db3a 100644 --- a/src/hotspot/share/gc/z/zVerify.cpp +++ b/src/hotspot/share/gc/z/zVerify.cpp @@ -43,16 +43,67 @@ #include "runtime/frame.inline.hpp" #include "runtime/globals.hpp" #include "runtime/handles.hpp" -#include "runtime/javaThread.hpp" +#include "runtime/javaThread.inline.hpp" +#include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" #include "runtime/stackFrameStream.inline.hpp" #include "runtime/stackWatermark.inline.hpp" #include "runtime/stackWatermarkSet.inline.hpp" +#include "runtime/thread.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/preserveException.hpp" #include "utilities/resourceHash.hpp" +#ifdef ASSERT + +// Used to verify that safepoints operations can't be scheduled concurrently +// with callers to this function. Typically used to verify that object oops +// and headers are safe to access. +void z_verify_safepoints_are_blocked() { + Thread* current = Thread::current(); + + if (current->is_ConcurrentGC_thread()) { + assert(current->is_suspendible_thread(), // Thread prevents safepoints + "Safepoints are not blocked by current thread"); + + } else if (current->is_Worker_thread()) { + assert(// Check if ... + // the thread prevents safepoints + current->is_suspendible_thread() || + // the coordinator thread is the safepointing VMThread + current->is_indirectly_safepoint_thread() || + // the coordinator thread prevents safepoints + current->is_indirectly_suspendible_thread() || + // the RelocateQueue prevents safepoints + // + // RelocateQueue acts as a pseudo STS leaver/joiner and blocks + // safepoints. There's currently no infrastructure to check if the + // current thread is active or not, so check the global states instead. + ZGeneration::young()->is_relocate_queue_active() || + ZGeneration::old()->is_relocate_queue_active(), + "Safepoints are not blocked by current thread"); + + } else if (current->is_Java_thread()) { + JavaThreadState state = JavaThread::cast(current)->thread_state(); + assert(state == _thread_in_Java || state == _thread_in_vm || state == _thread_new, + "Safepoints are not blocked by current thread from state: %d", state); + + } else if (current->is_JfrSampler_thread()) { + // The JFR sampler thread blocks out safepoints with this lock. + assert_lock_strong(Threads_lock); + + } else if (current->is_VM_thread()) { + // The VM Thread doesn't schedule new safepoints while executing + // other safepoint or handshake operations. + + } else { + fatal("Unexpected thread type"); + } +} + +#endif + #define BAD_OOP_ARG(o, p) "Bad oop " PTR_FORMAT " found at " PTR_FORMAT, untype(o), p2i(p) static bool z_is_null_relaxed(zpointer o) { diff --git a/src/hotspot/share/gc/z/zVerify.hpp b/src/hotspot/share/gc/z/zVerify.hpp index e9ada2cefa9..447d38504a2 100644 --- a/src/hotspot/share/gc/z/zVerify.hpp +++ b/src/hotspot/share/gc/z/zVerify.hpp @@ -30,6 +30,8 @@ class frame; class ZForwarding; class ZPageAllocator; +NOT_DEBUG(inline) void z_verify_safepoints_are_blocked() NOT_DEBUG_RETURN; + class ZVerify : public AllStatic { private: static void roots_strong(bool verify_after_old_mark); diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index fd213086ccb..51a9e847150 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -73,6 +73,7 @@ Thread::Thread() { set_lgrp_id(-1); DEBUG_ONLY(clear_suspendible_thread();) DEBUG_ONLY(clear_indirectly_suspendible_thread();) + DEBUG_ONLY(clear_indirectly_safepoint_thread();) // allocated data structures set_osthread(nullptr); diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp index 80114ddf7ed..9bd839dc4db 100644 --- a/src/hotspot/share/runtime/thread.hpp +++ b/src/hotspot/share/runtime/thread.hpp @@ -206,6 +206,7 @@ class Thread: public ThreadShadow { private: DEBUG_ONLY(bool _suspendible_thread;) DEBUG_ONLY(bool _indirectly_suspendible_thread;) + DEBUG_ONLY(bool _indirectly_safepoint_thread;) public: // Determines if a heap allocation failure will be retried @@ -224,6 +225,10 @@ class Thread: public ThreadShadow { void set_indirectly_suspendible_thread() { _indirectly_suspendible_thread = true; } void clear_indirectly_suspendible_thread() { _indirectly_suspendible_thread = false; } bool is_indirectly_suspendible_thread() { return _indirectly_suspendible_thread; } + + void set_indirectly_safepoint_thread() { _indirectly_safepoint_thread = true; } + void clear_indirectly_safepoint_thread() { _indirectly_safepoint_thread = false; } + bool is_indirectly_safepoint_thread() { return _indirectly_safepoint_thread; } #endif private: From 447f58cf944f7fa5e8b718d3759e80bf491c1856 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 6 Feb 2024 15:58:04 +0000 Subject: [PATCH 209/261] 8321410: Shenandoah: Remove ShenandoahSuspendibleWorkers flag Backport-of: 2830dd2a7d3b933fbddca64ca0ac7a91e7ab0775 --- .../shenandoah/shenandoahConcurrentMark.cpp | 2 +- .../share/gc/shenandoah/shenandoahHeap.cpp | 12 +++------ .../gc/shenandoah/shenandoahHeap.inline.hpp | 2 +- .../share/gc/shenandoah/shenandoahMark.cpp | 2 +- .../gc/shenandoah/shenandoah_globals.hpp | 3 --- .../jtreg/gc/shenandoah/TestAllocObjects.java | 26 ------------------- 6 files changed, 7 insertions(+), 40 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp index d05a2ae181e..956cf8cc908 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp @@ -57,7 +57,7 @@ class ShenandoahConcurrentMarkingTask : public WorkerTask { void work(uint worker_id) { ShenandoahHeap* heap = ShenandoahHeap::heap(); ShenandoahConcurrentWorkerSession worker_session(worker_id); - ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers); + ShenandoahSuspendibleThreadSetJoiner stsj; ShenandoahReferenceProcessor* rp = heap->ref_processor(); assert(rp != nullptr, "need reference processor"); StringDedup::Requests requests; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index 16992a7fb6d..f1dcbf5a8bc 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -963,7 +963,7 @@ class ShenandoahEvacuationTask : public WorkerTask { void work(uint worker_id) { if (_concurrent) { ShenandoahConcurrentWorkerSession worker_session(worker_id); - ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers); + ShenandoahSuspendibleThreadSetJoiner stsj; ShenandoahEvacOOMScope oom_evac_scope; do_work(); } else { @@ -1989,7 +1989,7 @@ class ShenandoahUpdateHeapRefsTask : public WorkerTask { void work(uint worker_id) { if (CONCURRENT) { ShenandoahConcurrentWorkerSession worker_session(worker_id); - ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers); + ShenandoahSuspendibleThreadSetJoiner stsj; do_work(); } else { ShenandoahParallelWorkerSession worker_session(worker_id); @@ -2171,15 +2171,11 @@ bool ShenandoahHeap::uncommit_bitmap_slice(ShenandoahHeapRegion *r) { } void ShenandoahHeap::safepoint_synchronize_begin() { - if (ShenandoahSuspendibleWorkers) { - SuspendibleThreadSet::synchronize(); - } + SuspendibleThreadSet::synchronize(); } void ShenandoahHeap::safepoint_synchronize_end() { - if (ShenandoahSuspendibleWorkers) { - SuspendibleThreadSet::desynchronize(); - } + SuspendibleThreadSet::desynchronize(); } void ShenandoahHeap::entry_uncommit(double shrink_before, size_t shrink_until) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp index 85c544b77c1..226190822a1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp @@ -244,7 +244,7 @@ inline bool ShenandoahHeap::cancelled_gc() const { } inline bool ShenandoahHeap::check_cancelled_gc_and_yield(bool sts_active) { - if (sts_active && ShenandoahSuspendibleWorkers && !cancelled_gc()) { + if (sts_active && !cancelled_gc()) { if (SuspendibleThreadSet::should_yield()) { SuspendibleThreadSet::yield(); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp index ffae4f068bc..4725b8c3dfa 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp @@ -185,7 +185,7 @@ void ShenandoahMark::mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint w if (work == 0) { // No work encountered in current stride, try to terminate. // Need to leave the STS here otherwise it might block safepoints. - ShenandoahSuspendibleThreadSetLeaver stsl(CANCELLABLE && ShenandoahSuspendibleWorkers); + ShenandoahSuspendibleThreadSetLeaver stsl(CANCELLABLE); ShenandoahTerminatorTerminator tt(heap); if (terminator->offer_termination(&tt)) return; } diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index 9b88d9e0c8c..14212d48b09 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -326,9 +326,6 @@ "How many times to maximum attempt to flush SATB buffers at the " \ "end of concurrent marking.") \ \ - product(bool, ShenandoahSuspendibleWorkers, true, EXPERIMENTAL, \ - "Suspend concurrent GC worker threads at safepoints") \ - \ product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC, \ "Turn on/off SATB barriers in Shenandoah") \ \ diff --git a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java index 002991196c7..32178555c9f 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java @@ -76,12 +76,6 @@ * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahSuspendibleWorkers - * TestAllocObjects - * */ /* @@ -97,11 +91,6 @@ * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive - * -XX:+ShenandoahSuspendibleWorkers - * TestAllocObjects */ /* @@ -112,11 +101,6 @@ * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static - * -XX:+ShenandoahSuspendibleWorkers - * TestAllocObjects */ /* @@ -127,11 +111,6 @@ * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact - * -XX:+ShenandoahSuspendibleWorkers - * TestAllocObjects */ /* @@ -177,11 +156,6 @@ * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu - * -XX:+ShenandoahSuspendibleWorkers - * TestAllocObjects */ public class TestAllocObjects { From 57956950c9c5b25523e54666a01171fba45d7e29 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 6 Feb 2024 15:59:55 +0000 Subject: [PATCH 210/261] 8325096: Test java/security/cert/CertPathBuilder/akiExt/AKISerialNumber.java is failing Backport-of: ac1cd3194910793b02e86c2c0dedaa321f137d4e --- .../security/cert/CertPathBuilder/akiExt/AKISerialNumber.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/jdk/java/security/cert/CertPathBuilder/akiExt/AKISerialNumber.java b/test/jdk/java/security/cert/CertPathBuilder/akiExt/AKISerialNumber.java index e8ab65d78dd..53db87cfe63 100644 --- a/test/jdk/java/security/cert/CertPathBuilder/akiExt/AKISerialNumber.java +++ b/test/jdk/java/security/cert/CertPathBuilder/akiExt/AKISerialNumber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -118,6 +118,8 @@ public static void main(String[] args) throws Exception { PKIXBuilderParameters params = new PKIXBuilderParameters (Collections.singleton(anchor), sel); params.setRevocationEnabled(false); + // Set date to 2024-01-01 to satisfy cert constraints + params.setDate(new java.util.Date(1704067200000l)); ArrayList certs = new ArrayList<>(); certs.add(intCert); From 4d62dfa318e590c93905ff39439cb0b7c62238e0 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 7 Feb 2024 07:44:27 +0000 Subject: [PATCH 211/261] 8316961: Fallback implementations for 64-bit Atomic::{add,xchg} on 32-bit platforms Backport-of: ba7d08b8199172058bd369d880d2d6a9f9649319 --- src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp | 8 +++ .../os_cpu/linux_arm/atomic_linux_arm.hpp | 7 ++ .../os_cpu/linux_x86/atomic_linux_x86.hpp | 8 +++ src/hotspot/share/runtime/atomic.hpp | 65 ++++++++++++++++++- test/hotspot/gtest/runtime/test_atomic.cpp | 23 ++++--- 5 files changed, 100 insertions(+), 11 deletions(-) diff --git a/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp b/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp index 77104194b0b..9ba246f553d 100644 --- a/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp +++ b/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp @@ -153,6 +153,14 @@ inline T Atomic::PlatformCmpxchg<8>::operator()(T volatile* dest, return cmpxchg_using_helper(_Atomic_cmpxchg_long, dest, compare_value, exchange_value); } +// No direct support for 8-byte xchg; emulate using cmpxchg. +template<> +struct Atomic::PlatformXchg<8> : Atomic::XchgUsingCmpxchg<8> {}; + +// No direct support for 8-byte add; emulate using cmpxchg. +template<> +struct Atomic::PlatformAdd<8> : Atomic::AddUsingCmpxchg<8> {}; + template<> template inline T Atomic::PlatformLoad<8>::operator()(T const volatile* src) const { diff --git a/src/hotspot/os_cpu/linux_arm/atomic_linux_arm.hpp b/src/hotspot/os_cpu/linux_arm/atomic_linux_arm.hpp index 814dbd9aab5..513217649e6 100644 --- a/src/hotspot/os_cpu/linux_arm/atomic_linux_arm.hpp +++ b/src/hotspot/os_cpu/linux_arm/atomic_linux_arm.hpp @@ -128,6 +128,13 @@ inline T Atomic::PlatformXchg<4>::operator()(T volatile* dest, return xchg_using_helper(ARMAtomicFuncs::_xchg_func, dest, exchange_value); } +// No direct support for 8-byte xchg; emulate using cmpxchg. +template<> +struct Atomic::PlatformXchg<8> : Atomic::XchgUsingCmpxchg<8> {}; + +// No direct support for 8-byte add; emulate using cmpxchg. +template<> +struct Atomic::PlatformAdd<8> : Atomic::AddUsingCmpxchg<8> {}; // The memory_order parameter is ignored - we always provide the strongest/most-conservative ordering diff --git a/src/hotspot/os_cpu/linux_x86/atomic_linux_x86.hpp b/src/hotspot/os_cpu/linux_x86/atomic_linux_x86.hpp index 2e472a02068..0156546ba9b 100644 --- a/src/hotspot/os_cpu/linux_x86/atomic_linux_x86.hpp +++ b/src/hotspot/os_cpu/linux_x86/atomic_linux_x86.hpp @@ -153,6 +153,14 @@ inline T Atomic::PlatformCmpxchg<8>::operator()(T volatile* dest, return cmpxchg_using_helper(_Atomic_cmpxchg_long, dest, compare_value, exchange_value); } +// No direct support for 8-byte xchg; emulate using cmpxchg. +template<> +struct Atomic::PlatformXchg<8> : Atomic::XchgUsingCmpxchg<8> {}; + +// No direct support for 8-byte add; emulate using cmpxchg. +template<> +struct Atomic::PlatformAdd<8> : Atomic::AddUsingCmpxchg<8> {}; + template<> template inline T Atomic::PlatformLoad<8>::operator()(T const volatile* src) const { diff --git a/src/hotspot/share/runtime/atomic.hpp b/src/hotspot/share/runtime/atomic.hpp index c85bf9055ab..ac0ce49d26e 100644 --- a/src/hotspot/share/runtime/atomic.hpp +++ b/src/hotspot/share/runtime/atomic.hpp @@ -398,11 +398,15 @@ class Atomic : AllStatic { T compare_value, T exchange_value); - // Support platforms that do not provide Read-Modify-Write - // byte-level atomic access. To use, derive PlatformCmpxchg<1> from - // this class. + // Support platforms that do not provide Read-Modify-Write atomic + // accesses for 1-byte and 8-byte widths. To use, derive PlatformCmpxchg<1>, + // PlatformAdd, PlatformXchg from these classes. public: // Temporary, can't be private: C++03 11.4/2. Fixed by C++11. struct CmpxchgByteUsingInt; + template + struct XchgUsingCmpxchg; + template + class AddUsingCmpxchg; private: // Dispatch handler for xchg. Provides type-based validity @@ -677,6 +681,47 @@ struct Atomic::CmpxchgByteUsingInt { atomic_memory_order order) const; }; +// Define the class before including platform file, which may use this +// as a base class, requiring it be complete. The definition is later +// in this file, near the other definitions related to xchg. +template +struct Atomic::XchgUsingCmpxchg { + template + T operator()(T volatile* dest, + T exchange_value, + atomic_memory_order order) const; +}; + +// Define the class before including platform file, which may use this +// as a base class, requiring it be complete. +template +class Atomic::AddUsingCmpxchg { +public: + template + static inline D add_then_fetch(D volatile* dest, + I add_value, + atomic_memory_order order) { + D addend = add_value; + return fetch_then_add(dest, add_value, order) + add_value; + } + + template + static inline D fetch_then_add(D volatile* dest, + I add_value, + atomic_memory_order order) { + STATIC_ASSERT(byte_size == sizeof(I)); + STATIC_ASSERT(byte_size == sizeof(D)); + + D old_value; + D new_value; + do { + old_value = Atomic::load(dest); + new_value = old_value + add_value; + } while (old_value != Atomic::cmpxchg(dest, old_value, new_value, order)); + return old_value; + } +}; + // Define the class before including platform file, which may specialize // the operator definition. No generic definition of specializations // of the operator template are provided, nor are there any generic @@ -1170,4 +1215,18 @@ inline D Atomic::xchg(volatile D* dest, T exchange_value, atomic_memory_order or return XchgImpl()(dest, exchange_value, order); } +template +template +inline T Atomic::XchgUsingCmpxchg::operator()(T volatile* dest, + T exchange_value, + atomic_memory_order order) const { + STATIC_ASSERT(byte_size == sizeof(T)); + + T old_value; + do { + old_value = Atomic::load(dest); + } while (old_value != Atomic::cmpxchg(dest, old_value, exchange_value, order)); + return old_value; +} + #endif // SHARE_RUNTIME_ATOMIC_HPP diff --git a/test/hotspot/gtest/runtime/test_atomic.cpp b/test/hotspot/gtest/runtime/test_atomic.cpp index e7c6f9e3f2b..744714c6f7f 100644 --- a/test/hotspot/gtest/runtime/test_atomic.cpp +++ b/test/hotspot/gtest/runtime/test_atomic.cpp @@ -59,14 +59,14 @@ TEST_VM(AtomicAddTest, int32) { Support().test_fetch_add(); } -// 64bit Atomic::add is only supported on 64bit platforms. -#ifdef _LP64 TEST_VM(AtomicAddTest, int64) { + // Check if 64-bit atomics are available on the machine. + if (!VM_Version::supports_cx8()) return; + using Support = AtomicAddTestSupport; Support().test_add(); Support().test_fetch_add(); } -#endif // _LP64 TEST_VM(AtomicAddTest, ptr) { uint _test_values[10] = {}; @@ -108,13 +108,13 @@ TEST_VM(AtomicXchgTest, int32) { Support().test(); } -// 64bit Atomic::xchg is only supported on 64bit platforms. -#ifdef _LP64 TEST_VM(AtomicXchgTest, int64) { + // Check if 64-bit atomics are available on the machine. + if (!VM_Version::supports_cx8()) return; + using Support = AtomicXchgTestSupport; Support().test(); } -#endif // _LP64 template struct AtomicCmpxchgTestSupport { @@ -142,6 +142,9 @@ TEST_VM(AtomicCmpxchgTest, int32) { } TEST_VM(AtomicCmpxchgTest, int64) { + // Check if 64-bit atomics are available on the machine. + if (!VM_Version::supports_cx8()) return; + using Support = AtomicCmpxchgTestSupport; Support().test(); } @@ -345,12 +348,16 @@ TEST_VM(AtomicBitopsTest, uint32) { AtomicBitopsTestSupport()(); } -#ifdef _LP64 TEST_VM(AtomicBitopsTest, int64) { + // Check if 64-bit atomics are available on the machine. + if (!VM_Version::supports_cx8()) return; + AtomicBitopsTestSupport()(); } TEST_VM(AtomicBitopsTest, uint64) { + // Check if 64-bit atomics are available on the machine. + if (!VM_Version::supports_cx8()) return; + AtomicBitopsTestSupport()(); } -#endif // _LP64 From 98e6d049466445b41fabdb802d27dab79f6281f4 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 8 Feb 2024 09:27:12 +0000 Subject: [PATCH 212/261] 8319777: Zero: Support 8-byte cmpxchg 8320582: Zero: Misplaced CX8 enablement flag Reviewed-by: phh Backport-of: 6b96bb640aa91d96877b8ceea5fed359607c1e45 --- src/hotspot/cpu/zero/vm_version_zero.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hotspot/cpu/zero/vm_version_zero.cpp b/src/hotspot/cpu/zero/vm_version_zero.cpp index 3d17e159a61..a99885a533d 100644 --- a/src/hotspot/cpu/zero/vm_version_zero.cpp +++ b/src/hotspot/cpu/zero/vm_version_zero.cpp @@ -137,6 +137,12 @@ void VM_Version::initialize() { #ifdef ASSERT UNSUPPORTED_OPTION(CountCompiledCalls); #endif + + // Supports 8-byte cmpxchg with compiler built-ins. + // These built-ins are supposed to be implemented on + // all platforms (even if not natively), so we claim + // the support unconditionally. + _supports_cx8 = true; } void VM_Version::initialize_cpu_information(void) { From cfceb1186b8cb6be236492a86148850cb6873150 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 8 Feb 2024 10:20:57 +0000 Subject: [PATCH 213/261] 8323964: runtime/Thread/ThreadCountLimit.java fails intermittently on AIX Backport-of: 3696765b7d1faec4bd23761a7a1b627d8903598d --- src/hotspot/os/aix/globals_aix.hpp | 15 ++++++++------- .../jtreg/runtime/Thread/ThreadCountLimit.java | 11 ++++++++++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/hotspot/os/aix/globals_aix.hpp b/src/hotspot/os/aix/globals_aix.hpp index a047e79b695..fb353348a53 100644 --- a/src/hotspot/os/aix/globals_aix.hpp +++ b/src/hotspot/os/aix/globals_aix.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2018 SAP SE. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,11 +49,12 @@ "Allow VM to run with EXTSHM=ON.") \ \ /* Maximum expected size of the data segment. That correlates with the */ \ - /* to the maximum C Heap consumption we expect. */ \ - /* We need to know this because we need to leave "breathing space" for the */ \ - /* data segment when placing the java heap. If that space is too small, we */ \ - /* reduce our chance of getting a low heap address (needed for compressed */ \ - /* Oops). */ \ + /* maximum C Heap consumption we expect. */ \ + /* We need to leave "breathing space" for the data segment when */ \ + /* placing the java heap. If the MaxExpectedDataSegmentSize setting */ \ + /* is too small, we might run into resource issues creating many native */ \ + /* threads, if it is too large, we reduce our chance of getting a low heap */ \ + /* address (needed for compressed Oops). */ \ product(uintx, MaxExpectedDataSegmentSize, 8*G, \ "Maximum expected Data Segment Size.") \ \ diff --git a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java index 418d05197b5..1afd6c1898f 100644 --- a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java +++ b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -24,10 +24,19 @@ /** * @test * @summary Stress test that reaches the process limit for thread count, or time limit. + * @requires os.family != "aix" * @key stress * @run main/othervm -Xmx1g ThreadCountLimit */ +/** + * @test + * @summary Stress test that reaches the process limit for thread count, or time limit. + * @requires os.family == "aix" + * @key stress + * @run main/othervm -Xmx1g -XX:MaxExpectedDataSegmentSize=16g ThreadCountLimit + */ + import java.util.concurrent.CountDownLatch; import java.util.ArrayList; From d08f24a25cd7a17354c1c34e09eed91a06aaaa2b Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 8 Feb 2024 10:22:27 +0000 Subject: [PATCH 214/261] 8324598: use mem_unit when working with sysinfo memory and swap related information Backport-of: 7a798d3cebea0915f8a73af57333b3488c2091af --- src/hotspot/os/linux/os_linux.cpp | 2 +- src/java.base/linux/native/libjava/CgroupMetrics.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 3a94c6c2111..bde690d70de 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -411,7 +411,7 @@ pid_t os::Linux::gettid() { julong os::Linux::host_swap() { struct sysinfo si; sysinfo(&si); - return (julong)si.totalswap; + return (julong)(si.totalswap * si.mem_unit); } // Most versions of linux have a bug where the number of processors are diff --git a/src/java.base/linux/native/libjava/CgroupMetrics.c b/src/java.base/linux/native/libjava/CgroupMetrics.c index 4f7847edbde..a5e41167bc3 100644 --- a/src/java.base/linux/native/libjava/CgroupMetrics.c +++ b/src/java.base/linux/native/libjava/CgroupMetrics.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Red Hat, Inc. + * Copyright (c) 2020, 2024, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,5 +54,5 @@ Java_jdk_internal_platform_CgroupMetrics_getTotalSwapSize0 if (retval < 0) { return 0; // syinfo failed, treat as no swap } - return (jlong)si.totalswap; + return (jlong)(si.totalswap * si.mem_unit); } From bed2eaa5a87564abd50cc095a9c19b72ecdf74ac Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 8 Feb 2024 11:25:07 +0000 Subject: [PATCH 215/261] 8324637: [aix] Implement support for reporting swap space in jdk.management Backport-of: 33324a59ccdb220250cb74e15ce13af0e99dcb07 --- .../unix/native/libmanagement_ext/OperatingSystemImpl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c b/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c index 3183d8ef9a1..5b978ba38e1 100644 --- a/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c +++ b/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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,6 +105,12 @@ static jlong get_total_or_available_swap_space_size(JNIEnv* env, jboolean availa throw_internal_error(env, "sysctlbyname failed"); } return available ? (jlong)vmusage.xsu_avail : (jlong)vmusage.xsu_total; +#elif defined(_AIX) + perfstat_memory_total_t memory_info; + if (perfstat_memory_total(NULL, &memory_info, sizeof(perfstat_memory_total_t), 1) == -1) { + throw_internal_error(env, "perfstat_memory_total failed"); + } + return available ? (jlong)(memory_info.pgsp_free * 4L * 1024L) : (jlong)(memory_info.pgsp_total * 4L * 1024L); #else /* _ALLBSD_SOURCE */ /* * XXXBSD: there's no way available to get swap info in From 0604ce7f383b67c372d55987ff8a7bf3a2189c55 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Thu, 8 Feb 2024 20:45:30 +0000 Subject: [PATCH 216/261] 8309109: AArch64: [TESTBUG] compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java fails on Neoverse N2 and V1 Reviewed-by: aph Backport-of: afdaa2a3305461538f3a36de2b0b540fe2da9b37 --- .../sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java index a5789896aff..3706f3abfd8 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnSupportedCPU.java @@ -28,6 +28,10 @@ * @summary Verify UseSHA3Intrinsics option processing on supported CPU. * @library /test/lib / * @requires vm.flagless + * @requires os.arch == "aarch64" & os.family == "mac" + * @comment sha3 is only implemented on AArch64 for now. + * UseSHA3Intrinsics is only auto-enabled on Apple silicon, because it + * may introduce performance regression on others. See JDK-8297092. * * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox From b30f9aaf7a031ad92add781ef7bb4bac1f2d9e63 Mon Sep 17 00:00:00 2001 From: Dan Lutker Date: Fri, 9 Feb 2024 22:36:15 +0000 Subject: [PATCH 217/261] 8325150: (tz) Update Timezone Data to 2024a Backport-of: 917838e0a564b1f2cbfb6cc214ccbfd1a237019f --- src/java.base/share/data/tzdata/VERSION | 2 +- src/java.base/share/data/tzdata/africa | 8 +- src/java.base/share/data/tzdata/asia | 174 +++++++++++------- src/java.base/share/data/tzdata/australasia | 14 +- src/java.base/share/data/tzdata/etcetera | 2 +- src/java.base/share/data/tzdata/europe | 29 ++- src/java.base/share/data/tzdata/leapseconds | 19 +- src/java.base/share/data/tzdata/northamerica | 29 ++- src/java.base/share/data/tzdata/southamerica | 5 +- .../java/util/TimeZone/TimeZoneData/VERSION | 2 +- 10 files changed, 185 insertions(+), 99 deletions(-) diff --git a/src/java.base/share/data/tzdata/VERSION b/src/java.base/share/data/tzdata/VERSION index 560884d1a82..b138ed7fa78 100644 --- a/src/java.base/share/data/tzdata/VERSION +++ b/src/java.base/share/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2023d +tzdata2024a diff --git a/src/java.base/share/data/tzdata/africa b/src/java.base/share/data/tzdata/africa index b4789b16c71..72b188f074d 100644 --- a/src/java.base/share/data/tzdata/africa +++ b/src/java.base/share/data/tzdata/africa @@ -53,6 +53,10 @@ # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. # https://www.jstor.org/stable/1774359 # +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. +# # European-style abbreviations are commonly used along the Mediterranean. # For sub-Saharan Africa abbreviations were less standardized. # Previous editions of this database used WAT, CAT, SAT, and EAT @@ -136,7 +140,7 @@ Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia # Chad # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT @@ -162,7 +166,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena # Inaccessible, Nightingale: uninhabited # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Africa/Abidjan -0:16:08 - LMT 1912 +Zone Africa/Abidjan -0:16:08 - LMT 1912 Jan 1 0:00 - GMT ############################################################################### diff --git a/src/java.base/share/data/tzdata/asia b/src/java.base/share/data/tzdata/asia index f86f84b2d27..3a54291919d 100644 --- a/src/java.base/share/data/tzdata/asia +++ b/src/java.base/share/data/tzdata/asia @@ -2480,18 +2480,33 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # effective December 21st, 2018.... # http://adilet.zan.kz/rus/docs/P1800000817 (russian language). +# From Zhanbolat Raimbekov (2024-01-19): +# Kazakhstan (all parts) switching to UTC+5 on March 1, 2024 +# https://www.gov.kz/memleket/entities/mti/press/news/details/688998?lang=ru +# [in Russian] +# (2024-01-20): https://primeminister.kz/ru/decisions/19012024-20 +# +# From Alexander Krivenyshev (2024-01-19): +# According to a different news and the official web site for the Ministry of +# Trade and Integration of the Republic of Kazakhstan: +# https://en.inform.kz/news/kazakhstan-to-switch-to-single-hour-zone-mar-1-54ad0b/ + # Zone NAME STDOFF RULES FORMAT [UNTIL] # # Almaty (formerly Alma-Ata), representing most locations in Kazakhstan -# This includes KZ-AKM, KZ-ALA, KZ-ALM, KZ-AST, KZ-BAY, KZ-VOS, KZ-ZHA, -# KZ-KAR, KZ-SEV, KZ-PAV, and KZ-YUZ. +# This includes Abai/Abay (ISO 3166-2 code KZ-10), Aqmola/Akmola (KZ-11), +# Almaty (KZ-19), Almaty city (KZ-75), Astana city (KZ-71), +# East Kazkhstan (KZ-63), Jambyl/Zhambyl (KZ-31), Jetisu/Zhetysu (KZ-33), +# Karaganda (KZ-35), North Kazakhstan (KZ-59), Pavlodar (KZ-55), +# Shyumkent city (KZ-79), Turkistan (KZ-61), and Ulytau (KZ-62). Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata 5:00 - +05 1930 Jun 21 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s - 6:00 - +06 -# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) + 6:00 - +06 2024 Mar 1 0:00 + 5:00 - +05 +# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-43) Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2504,8 +2519,7 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s 6:00 - +06 2018 Dec 21 0:00 5:00 - +05 -# -# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# Qostanay (aka Kostanay, Kustanay) (KZ-39) # The 1991/2 rules are unclear partly because of the 1997 Turgai # reorganization. Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 @@ -2516,9 +2530,9 @@ Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 - -# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) + 6:00 - +06 2024 Mar 1 0:00 + 5:00 - +05 +# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-15) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2528,7 +2542,7 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s 5:00 - +05 -# Mangghystaū (KZ-MAN) +# Mangghystaū (KZ-47) # Aqtau was not founded until 1963, but it represents an inhabited region, # so include timestamps before 1963. Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 @@ -2540,7 +2554,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s 5:00 - +05 -# Atyraū (KZ-ATY) is like Mangghystaū except it switched from +# Atyraū (KZ-23) is like Mangghystaū except it switched from # +04/+05 to +05/+06 in spring 1999, not fall 1994. Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2 3:00 - +03 1930 Jun 21 @@ -2551,7 +2565,7 @@ Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1999 Mar 28 2:00s 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s 5:00 - +05 -# West Kazakhstan (KZ-ZAP) +# West Kazakhstan (KZ-27) # From Paul Eggert (2016-03-18): # The 1989 transition is from USSR act No. 227 (1989-03-14). Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk @@ -3453,19 +3467,26 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # ... winter time will begin in Palestine from Saturday 10-28-2023, # 02:00 AM by 60 minutes back. # -# From Paul Eggert (2023-03-22): +# From Heba Hamad (2024-01-25): +# the summer time for the years 2024,2025 will begin in Palestine +# from Saturday at 02:00 AM by 60 minutes forward as shown below: +# year date +# 2024 2024-04-20 +# 2025 2025-04-12 +# +# From Paul Eggert (2024-01-25): # For now, guess that spring and fall transitions will normally # continue to use 2022's rules, that during DST Palestine will switch # to standard time at 02:00 the last Saturday before Ramadan and back -# to DST at 02:00 the first Saturday after Ramadan, and that +# to DST at 02:00 the second Saturday after Ramadan, and that # if the normal spring-forward or fall-back transition occurs during # Ramadan the former is delayed and the latter advanced. # To implement this, I predicted Ramadan-oriented transition dates for -# 2023 through 2086 by running the following program under GNU Emacs 28.2, +# 2026 through 2086 by running the following program under GNU Emacs 29.2, # with the results integrated by hand into the table below. # Predictions after 2086 are approximated without Ramadan. # -# (let ((islamic-year 1444)) +# (let ((islamic-year 1447)) # (require 'cal-islam) # (while (< islamic-year 1510) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) @@ -3474,6 +3495,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # (while (/= saturday (mod (setq a (1- a)) 7))) # (while (/= saturday (mod b 7)) # (setq b (1+ b))) +# (setq b (+ 7 b)) # (setq a (calendar-gregorian-from-absolute a)) # (setq b (calendar-gregorian-from-absolute b)) # (insert @@ -3524,84 +3546,84 @@ Rule Palestine 2021 only - Oct 29 1:00 0 - Rule Palestine 2022 only - Mar 27 0:00 1:00 S Rule Palestine 2022 2035 - Oct Sat<=30 2:00 0 - Rule Palestine 2023 only - Apr 29 2:00 1:00 S -Rule Palestine 2024 only - Apr 13 2:00 1:00 S -Rule Palestine 2025 only - Apr 5 2:00 1:00 S +Rule Palestine 2024 only - Apr 20 2:00 1:00 S +Rule Palestine 2025 only - Apr 12 2:00 1:00 S Rule Palestine 2026 2054 - Mar Sat<=30 2:00 1:00 S Rule Palestine 2036 only - Oct 18 2:00 0 - Rule Palestine 2037 only - Oct 10 2:00 0 - Rule Palestine 2038 only - Sep 25 2:00 0 - Rule Palestine 2039 only - Sep 17 2:00 0 - -Rule Palestine 2039 only - Oct 22 2:00 1:00 S -Rule Palestine 2039 2067 - Oct Sat<=30 2:00 0 - Rule Palestine 2040 only - Sep 1 2:00 0 - -Rule Palestine 2040 only - Oct 13 2:00 1:00 S +Rule Palestine 2040 only - Oct 20 2:00 1:00 S +Rule Palestine 2040 2067 - Oct Sat<=30 2:00 0 - Rule Palestine 2041 only - Aug 24 2:00 0 - -Rule Palestine 2041 only - Sep 28 2:00 1:00 S +Rule Palestine 2041 only - Oct 5 2:00 1:00 S Rule Palestine 2042 only - Aug 16 2:00 0 - -Rule Palestine 2042 only - Sep 20 2:00 1:00 S +Rule Palestine 2042 only - Sep 27 2:00 1:00 S Rule Palestine 2043 only - Aug 1 2:00 0 - -Rule Palestine 2043 only - Sep 12 2:00 1:00 S +Rule Palestine 2043 only - Sep 19 2:00 1:00 S Rule Palestine 2044 only - Jul 23 2:00 0 - -Rule Palestine 2044 only - Aug 27 2:00 1:00 S +Rule Palestine 2044 only - Sep 3 2:00 1:00 S Rule Palestine 2045 only - Jul 15 2:00 0 - -Rule Palestine 2045 only - Aug 19 2:00 1:00 S +Rule Palestine 2045 only - Aug 26 2:00 1:00 S Rule Palestine 2046 only - Jun 30 2:00 0 - -Rule Palestine 2046 only - Aug 11 2:00 1:00 S +Rule Palestine 2046 only - Aug 18 2:00 1:00 S Rule Palestine 2047 only - Jun 22 2:00 0 - -Rule Palestine 2047 only - Jul 27 2:00 1:00 S +Rule Palestine 2047 only - Aug 3 2:00 1:00 S Rule Palestine 2048 only - Jun 6 2:00 0 - -Rule Palestine 2048 only - Jul 18 2:00 1:00 S +Rule Palestine 2048 only - Jul 25 2:00 1:00 S Rule Palestine 2049 only - May 29 2:00 0 - -Rule Palestine 2049 only - Jul 3 2:00 1:00 S +Rule Palestine 2049 only - Jul 10 2:00 1:00 S Rule Palestine 2050 only - May 21 2:00 0 - -Rule Palestine 2050 only - Jun 25 2:00 1:00 S +Rule Palestine 2050 only - Jul 2 2:00 1:00 S Rule Palestine 2051 only - May 6 2:00 0 - -Rule Palestine 2051 only - Jun 17 2:00 1:00 S +Rule Palestine 2051 only - Jun 24 2:00 1:00 S Rule Palestine 2052 only - Apr 27 2:00 0 - -Rule Palestine 2052 only - Jun 1 2:00 1:00 S +Rule Palestine 2052 only - Jun 8 2:00 1:00 S Rule Palestine 2053 only - Apr 12 2:00 0 - -Rule Palestine 2053 only - May 24 2:00 1:00 S +Rule Palestine 2053 only - May 31 2:00 1:00 S Rule Palestine 2054 only - Apr 4 2:00 0 - -Rule Palestine 2054 only - May 16 2:00 1:00 S -Rule Palestine 2055 only - May 1 2:00 1:00 S -Rule Palestine 2056 only - Apr 22 2:00 1:00 S -Rule Palestine 2057 only - Apr 7 2:00 1:00 S -Rule Palestine 2058 max - Mar Sat<=30 2:00 1:00 S +Rule Palestine 2054 only - May 23 2:00 1:00 S +Rule Palestine 2055 only - May 8 2:00 1:00 S +Rule Palestine 2056 only - Apr 29 2:00 1:00 S +Rule Palestine 2057 only - Apr 14 2:00 1:00 S +Rule Palestine 2058 only - Apr 6 2:00 1:00 S +Rule Palestine 2059 max - Mar Sat<=30 2:00 1:00 S Rule Palestine 2068 only - Oct 20 2:00 0 - Rule Palestine 2069 only - Oct 12 2:00 0 - Rule Palestine 2070 only - Oct 4 2:00 0 - Rule Palestine 2071 only - Sep 19 2:00 0 - Rule Palestine 2072 only - Sep 10 2:00 0 - -Rule Palestine 2072 only - Oct 15 2:00 1:00 S +Rule Palestine 2072 only - Oct 22 2:00 1:00 S Rule Palestine 2072 max - Oct Sat<=30 2:00 0 - Rule Palestine 2073 only - Sep 2 2:00 0 - -Rule Palestine 2073 only - Oct 7 2:00 1:00 S +Rule Palestine 2073 only - Oct 14 2:00 1:00 S Rule Palestine 2074 only - Aug 18 2:00 0 - -Rule Palestine 2074 only - Sep 29 2:00 1:00 S +Rule Palestine 2074 only - Oct 6 2:00 1:00 S Rule Palestine 2075 only - Aug 10 2:00 0 - -Rule Palestine 2075 only - Sep 14 2:00 1:00 S +Rule Palestine 2075 only - Sep 21 2:00 1:00 S Rule Palestine 2076 only - Jul 25 2:00 0 - -Rule Palestine 2076 only - Sep 5 2:00 1:00 S +Rule Palestine 2076 only - Sep 12 2:00 1:00 S Rule Palestine 2077 only - Jul 17 2:00 0 - -Rule Palestine 2077 only - Aug 28 2:00 1:00 S +Rule Palestine 2077 only - Sep 4 2:00 1:00 S Rule Palestine 2078 only - Jul 9 2:00 0 - -Rule Palestine 2078 only - Aug 13 2:00 1:00 S +Rule Palestine 2078 only - Aug 20 2:00 1:00 S Rule Palestine 2079 only - Jun 24 2:00 0 - -Rule Palestine 2079 only - Aug 5 2:00 1:00 S +Rule Palestine 2079 only - Aug 12 2:00 1:00 S Rule Palestine 2080 only - Jun 15 2:00 0 - -Rule Palestine 2080 only - Jul 20 2:00 1:00 S +Rule Palestine 2080 only - Jul 27 2:00 1:00 S Rule Palestine 2081 only - Jun 7 2:00 0 - -Rule Palestine 2081 only - Jul 12 2:00 1:00 S +Rule Palestine 2081 only - Jul 19 2:00 1:00 S Rule Palestine 2082 only - May 23 2:00 0 - -Rule Palestine 2082 only - Jul 4 2:00 1:00 S +Rule Palestine 2082 only - Jul 11 2:00 1:00 S Rule Palestine 2083 only - May 15 2:00 0 - -Rule Palestine 2083 only - Jun 19 2:00 1:00 S +Rule Palestine 2083 only - Jun 26 2:00 1:00 S Rule Palestine 2084 only - Apr 29 2:00 0 - -Rule Palestine 2084 only - Jun 10 2:00 1:00 S +Rule Palestine 2084 only - Jun 17 2:00 1:00 S Rule Palestine 2085 only - Apr 21 2:00 0 - -Rule Palestine 2085 only - Jun 2 2:00 1:00 S +Rule Palestine 2085 only - Jun 9 2:00 1:00 S Rule Palestine 2086 only - Apr 13 2:00 0 - -Rule Palestine 2086 only - May 18 2:00 1:00 S +Rule Palestine 2086 only - May 25 2:00 1:00 S # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -3629,7 +3651,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # Philippines -# From Paul Eggert (2018-11-18): +# From Paul Eggert (2024-01-21): # The Spanish initially used American (west-of-Greenwich) time. # It is unknown what time Manila kept when the British occupied it from # 1762-10-06 through 1764-04; for now assume it kept American time. @@ -3637,7 +3659,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's # History of the International Date Line -# https://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm +# https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm # The rest of the data entries are from Shanks & Pottenger. # From Jesper Nørgaard Welen (2006-04-26): @@ -4064,7 +4086,8 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 # The English-language name of Vietnam's most populous city is "Ho Chi Minh # City"; use Ho_Chi_Minh below to avoid a name of more than 14 characters. -# From Paul Eggert (2022-07-27) after a 2014 heads-up from Trần Ngọc Quân: +# From Paul Eggert (2024-01-14) after a 2014 heads-up from Trần Ngọc Quân +# and a 2024-01-14 heads-up from Đoàn Trần Công Danh: # Trần Tiến Bình's authoritative book "Lịch Việt Nam: thế kỷ XX-XXI (1901-2100)" # (Nhà xuất bản Văn Hoá - Thông Tin, Hanoi, 2005), pp 49-50, # is quoted verbatim in: @@ -4094,14 +4117,35 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 # # Trần cites the following sources; it's unclear which supplied the info above. # -# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội, -# No. 9, Paris, February 1982. +# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội, +# No. 9, Paris, February 1982. +# +# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)", +# NXB Thống kê, Hanoi, 2000. # -# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)", -# NXB Thống kê, Hanoi, 2000. +# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu", +# NXB Thuận Hoá, Huế, 1995. # -# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu", -# NXB Thuận Hoá, Huế, 1995. +# Here is the decision for the September 1945 transition: +# Võ Nguyên Giáp, Việt Nam Dân Quốc Công Báo, No. 1 (1945-09-29), page 13 +# http://baochi.nlv.gov.vn/baochi/cgi-bin/baochi?a=d&d=JwvzO19450929.2.5&dliv=none +# It says that on 1945-09-01 at 24:00, Vietnam moved back two hours, to +07. +# It also mentions a 1945-03-29 decree (by a Japanese Goveror-General) +# to set the time zone to +09, but does not say whether that decree +# merely legalized an earlier change to +09. +# +# July 1955 transition: +# Ngô Đình Diệm, Công Báo Việt Nam, No. 92 (1955-07-02), page 1780-1781 +# Ordinance (Dụ) No. 46 (1955-06-25) +# http://ddsnext.crl.edu/titles/32341#?c=0&m=29&s=0&cv=4&r=0&xywh=-89%2C342%2C1724%2C1216 +# It says that on 1955-07-01 at 01:00, South Vietnam moved back 1 hour (to +07). +# +# December 1959 transition: +# Ngô Đình Diệm, Công Báo Việt Nam Cộng Hòa, 1960 part 1 (1960-01-02), page 62 +# Decree (Sắc lệnh) No. 362-TTP (1959-12-30) +# http://ddsnext.crl.edu/titles/32341#?c=0&m=138&s=0&cv=793&r=0&xywh=-54%2C1504%2C1705%2C1202 +# It says that on 1959-12-31 at 23:00, South Vietnam moved forward 1 hour (to +08). + # Zone NAME STDOFF RULES FORMAT [UNTIL] #STDOFF 7:06:30.13 @@ -4109,9 +4153,9 @@ Zone Asia/Ho_Chi_Minh 7:06:30 - LMT 1906 Jul 1 7:06:30 - PLMT 1911 May 1 # Phù Liễn MT 7:00 - +07 1942 Dec 31 23:00 8:00 - +08 1945 Mar 14 23:00 - 9:00 - +09 1945 Sep 2 + 9:00 - +09 1945 Sep 1 24:00 7:00 - +07 1947 Apr 1 - 8:00 - +08 1955 Jul 1 + 8:00 - +08 1955 Jul 1 01:00 7:00 - +07 1959 Dec 31 23:00 8:00 - +08 1975 Jun 13 7:00 - +07 diff --git a/src/java.base/share/data/tzdata/australasia b/src/java.base/share/data/tzdata/australasia index 366cfd10cc1..624735be652 100644 --- a/src/java.base/share/data/tzdata/australasia +++ b/src/java.base/share/data/tzdata/australasia @@ -443,11 +443,11 @@ Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva # French Polynesia # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct # Rikitea +Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct 1 # Rikitea -9:00 - -09 -Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct +Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct 1 -9:30 - -0930 -Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete +Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct 1 # Papeete -10:00 - -10 # Clipperton (near North America) is administered from French Polynesia; # it is uninhabited. @@ -825,7 +825,7 @@ Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5 # Solomon Is # excludes Bougainville, for which see Papua New Guinea # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara +Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct 1 # Honiara 11:00 - +11 # Tokelau @@ -986,6 +986,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. # https://www.jstor.org/stable/1774359 # +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. +# # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # @@ -2062,7 +2066,7 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # ordaining - by a masterpiece of diplomatic flattery - that # the Fourth of July should be celebrated twice in that year." # This happened in 1892, according to the Evening News (Sydney) of 1892-07-20. -# https://www.staff.science.uu.nl/~gent0113/idl/idl.htm +# https://webspace.science.uu.nl/~gent0113/idl/idl_alaska_samoa.htm # Although Shanks & Pottenger says they both switched to UT -11:30 # in 1911, and to -11 in 1950. many earlier sources give -11 diff --git a/src/java.base/share/data/tzdata/etcetera b/src/java.base/share/data/tzdata/etcetera index 8ae294f524a..27147715ef6 100644 --- a/src/java.base/share/data/tzdata/etcetera +++ b/src/java.base/share/data/tzdata/etcetera @@ -28,7 +28,7 @@ # These entries are for uses not otherwise covered by the tz database. # Their main practical use is for platforms like Android that lack -# support for POSIX-style TZ strings. On such platforms these entries +# support for POSIX.1-2017-style TZ strings. On such platforms these entries # can be useful if the timezone database is wrong or if a ship or # aircraft at sea is not in a timezone. diff --git a/src/java.base/share/data/tzdata/europe b/src/java.base/share/data/tzdata/europe index f1b084f64d0..18865f33b6c 100644 --- a/src/java.base/share/data/tzdata/europe +++ b/src/java.base/share/data/tzdata/europe @@ -1013,9 +1013,34 @@ Zone Europe/Sofia 1:33:16 - LMT 1880 # Czech Republic (Czechia) # Slovakia # -# From Paul Eggert (2018-04-15): -# The source for Czech data is: Kdy začíná a končí letní čas. 2018-04-15. +# From Ivan Benovic (2024-01-30): +# https://www.slov-lex.sk/pravne-predpisy/SK/ZZ/1946/54/ +# (This is an official link to the Czechoslovak Summer Time Act of +# March 8, 1946 that authorizes the Czechoslovak government to set the +# exact dates of change to summer time and back to Central European Time. +# The act also implicitly confirms Central European Time as the +# official time zone of Czechoslovakia and currently remains in force +# in both the Czech Republic and Slovakia.) +# https://www.psp.cz/eknih/1945pns/tisky/t0216_00.htm +# (This is a link to the original legislative proposal dating back to +# February 22, 1946. The accompanying memorandum to the proposal says +# that an advisory committee on European railroad transportation that +# met in Brussels in October 1945 decided that the change of time +# should be carried out in all participating countries in a strictly +# coordinated manner....) +# +# From Paul Eggert (2024-01-30): +# The source for Czech data is: Kdy začíná a končí letní čas. # https://kalendar.beda.cz/kdy-zacina-a-konci-letni-cas +# Its main text disagrees with its quoted sources only in 1918, +# where the main text says spring and autumn transitions +# occurred at 02:00 and 03:00 respectively (as usual), +# whereas the 1918 source "Oznámení o zavedení letního času v roce 1918" +# says transitions were at 01:00 and 02:00 respectively. +# As the 1918 source appears to be a humorous piece, and it is +# unlikely that Prague would have disagreed with its neighbors by an hour, +# go with the main text for now. +# # We know of no English-language name for historical Czech winter time; # abbreviate it as "GMT", as it happened to be GMT. # diff --git a/src/java.base/share/data/tzdata/leapseconds b/src/java.base/share/data/tzdata/leapseconds index ab2c1af4bed..8e7df3de984 100644 --- a/src/java.base/share/data/tzdata/leapseconds +++ b/src/java.base/share/data/tzdata/leapseconds @@ -26,13 +26,10 @@ # This file is in the public domain. # This file is generated automatically from the data in the public-domain -# NIST format leap-seconds.list file, which can be copied from -# -# or . -# The NIST file is used instead of its IERS upstream counterpart +# NIST/IERS format leap-seconds.list file, which can be copied from # -# because under US law the NIST file is public domain -# whereas the IERS file's copyright and license status is unclear. +# or, in a variant with different comments, from +# . # For more about leap-seconds.list, please see # The NTP Timescale and Leap Seconds # . @@ -95,11 +92,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2024 Jun 28 00:00:00 +#Expires 2024 Dec 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1719532800 (2024-06-28 00:00:00 UTC) +#updated 1704708379 (2024-01-08 10:06:19 UTC) +#expires 1735344000 (2024-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C66 -# File expires on: 28 June 2024 +# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) +# File expires on 28 December 2024 diff --git a/src/java.base/share/data/tzdata/northamerica b/src/java.base/share/data/tzdata/northamerica index b96269a0e26..a8b2ef3f7fa 100644 --- a/src/java.base/share/data/tzdata/northamerica +++ b/src/java.base/share/data/tzdata/northamerica @@ -1291,6 +1291,10 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00 # # [PDF] (1914-03) # +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. +# # See the 'europe' file for Greenland. # Canada @@ -1377,7 +1381,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00 # From Paul Eggert (2014-10-18): # H. David Matthews and Mary Vincent's map # "It's about TIME", _Canadian Geographic_ (September-October 1998) -# http://www.canadiangeographic.ca/Magazine/SO98/alacarte.asp +# https://web.archive.org/web/19990827055050/https://canadiangeographic.ca/SO98/geomap.htm # contains detailed boundaries for regions observing nonstandard # time and daylight saving time arrangements in Canada circa 1998. # @@ -1665,6 +1669,15 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # Some cities in the United States have pushed the deadline back # three weeks and will change over from daylight saving in October. +# From Chris Walton (2024-01-09): +# The [Toronto] changes in 1947, 1948, and 1949 took place at 2:00 a.m. local +# time instead of midnight.... Toronto Daily Star - ... +# April 2, 1947 - Page 39 ... April 7, 1948 - Page 13 ... +# April 2, 1949 - Page 1 ... April 7, 1949 - Page 24 ... +# November 25, 1949 - Page 52 ... April 21, 1950 - Page 14 ... +# September 19, 1950 - Page 46 ... September 20, 1950 - Page 3 ... +# November 24, 1950 - Page 21 + # From Arthur David Olson (2010-07-17): # # "Standard Time and Time Zones in Canada" appeared in @@ -1726,13 +1739,9 @@ Rule Toronto 1927 1937 - Sep Sun>=25 2:00 0 S Rule Toronto 1928 1937 - Apr Sun>=25 2:00 1:00 D Rule Toronto 1938 1940 - Apr lastSun 2:00 1:00 D Rule Toronto 1938 1939 - Sep lastSun 2:00 0 S -Rule Toronto 1945 1946 - Sep lastSun 2:00 0 S -Rule Toronto 1946 only - Apr lastSun 2:00 1:00 D -Rule Toronto 1947 1949 - Apr lastSun 0:00 1:00 D -Rule Toronto 1947 1948 - Sep lastSun 0:00 0 S -Rule Toronto 1949 only - Nov lastSun 0:00 0 S -Rule Toronto 1950 1973 - Apr lastSun 2:00 1:00 D -Rule Toronto 1950 only - Nov lastSun 2:00 0 S +Rule Toronto 1945 1948 - Sep lastSun 2:00 0 S +Rule Toronto 1946 1973 - Apr lastSun 2:00 1:00 D +Rule Toronto 1949 1950 - Nov lastSun 2:00 0 S Rule Toronto 1951 1956 - Sep lastSun 2:00 0 S # Shanks & Pottenger say Toronto ended DST a week early in 1971, # namely on 1971-10-24, but Mark Brader wrote (2003-05-31) that this @@ -3455,7 +3464,7 @@ Zone America/Jamaica -5:07:10 - LMT 1890 # Kingston # Martinique # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France - -4:04:20 - FFMT 1911 May # Fort-de-France MT + -4:04:20 - FFMT 1911 May 1 # Fort-de-France MT -4:00 - AST 1980 Apr 6 -4:00 1:00 ADT 1980 Sep 28 -4:00 - AST @@ -3562,7 +3571,7 @@ Zone America/Puerto_Rico -4:24:25 - LMT 1899 Mar 28 12:00 # San Juan # St Pierre and Miquelon # There are too many St Pierres elsewhere, so we'll use 'Miquelon'. # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre +Zone America/Miquelon -3:44:40 - LMT 1911 Jun 15 # St Pierre -4:00 - AST 1980 May -3:00 - -03 1987 -3:00 Canada -03/-02 diff --git a/src/java.base/share/data/tzdata/southamerica b/src/java.base/share/data/tzdata/southamerica index da2c6239262..d77acc08857 100644 --- a/src/java.base/share/data/tzdata/southamerica +++ b/src/java.base/share/data/tzdata/southamerica @@ -1593,8 +1593,11 @@ Zone Atlantic/Stanley -3:51:24 - LMT 1890 -3:00 - -03 # French Guiana +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone America/Cayenne -3:29:20 - LMT 1911 Jul +Zone America/Cayenne -3:29:20 - LMT 1911 Jul 1 -4:00 - -04 1967 Oct -3:00 - -03 diff --git a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION index f92096d49aa..bf027918ce7 100644 --- a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION +++ b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION @@ -1 +1 @@ -tzdata2023d +tzdata2024a From 79bd47a78c0cc34bf3ff068038ef5cc1d56b762a Mon Sep 17 00:00:00 2001 From: George Adams Date: Mon, 12 Feb 2024 10:41:33 +0000 Subject: [PATCH 218/261] 8318039: GHA: Bump macOS and Xcode versions Backport-of: 605c9767291ddf1c409c3e805ffb3182899d06c2 --- .github/workflows/build-macos.yml | 2 +- .github/workflows/main.yml | 6 +++--- .github/workflows/test.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 7dfd29b8457..3022e07b6ee 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -55,7 +55,7 @@ on: jobs: build-macos: name: build - runs-on: macos-11 + runs-on: macos-13 strategy: fail-fast: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a10fc88087b..1b9e2c48965 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -227,7 +227,7 @@ jobs: uses: ./.github/workflows/build-macos.yml with: platform: macos-x64 - xcode-toolset-version: '12.5.1' + xcode-toolset-version: '14.3.1' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.macos-x64 == 'true' @@ -238,7 +238,7 @@ jobs: uses: ./.github/workflows/build-macos.yml with: platform: macos-aarch64 - xcode-toolset-version: '12.5.1' + xcode-toolset-version: '14.3.1' extra-conf-options: '--openjdk-target=aarch64-apple-darwin' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} @@ -318,7 +318,7 @@ jobs: with: platform: macos-x64 bootjdk-platform: macos-x64 - runs-on: macos-11 + runs-on: macos-13 test-windows-x64: name: windows-x64 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d91e057a64..8808ab80d0e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2023, 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,7 +147,7 @@ jobs: run: | # On macOS we need to install some dependencies for testing brew install make - sudo xcode-select --switch /Applications/Xcode_11.7.app/Contents/Developer + sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer # This will make GNU make available as 'make' and not only as 'gmake' echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH if: runner.os == 'macOS' From 5f32918870d10f9fb9f26af66681f42a0659392c Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 12 Feb 2024 15:18:02 +0000 Subject: [PATCH 219/261] 8323667: Library debug files contain non-reproducible full gcc include paths Backport-of: 57fad677819ae3142782f811a8fba94b38f5a74c --- make/autoconf/flags-cflags.m4 | 56 ++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index 78b24c22d96..06a62c9a8f1 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -117,6 +117,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS], FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_PREFIX_CFLAGS}], IF_FALSE: [ DEBUG_PREFIX_CFLAGS= + ], + IF_TRUE: [ + # Add debug prefix map gcc system include paths, as they cause + # non-deterministic debug paths depending on gcc path location. + DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS ] ) fi @@ -158,6 +163,55 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS], AC_SUBST(ASFLAGS_DEBUG_SYMBOLS) ]) +# gcc will embed the full system include paths in the debug info +# resulting in non-deterministic debug symbol files and thus +# non-reproducible native libraries if gcc includes are located +# in different paths. +# Add -fdebug-prefix-map'ings for root and gcc include paths, +# pointing to a common set of folders so that the binaries are deterministic: +# root include : /usr/include +# gcc include : /usr/local/gcc_include +# g++ include : /usr/local/gxx_include +AC_DEFUN([DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS], +[ + # Determine gcc system include paths. + # Assume default roots to start with: + GCC_ROOT_INCLUDE="/usr/include" + + # Determine is sysroot or devkit specified? + if test "x$SYSROOT" != "x"; then + GCC_ROOT_INCLUDE="${SYSROOT%/}/usr/include" + fi + + # Add root include mapping => /usr/include + GCC_INCLUDE_DEBUG_MAP_FLAGS="-fdebug-prefix-map=${GCC_ROOT_INCLUDE}/=/usr/include/" + + # Add gcc system include mapping => /usr/local/gcc_include + # Find location of stddef.h using build C compiler + GCC_SYSTEM_INCLUDE=`$ECHO "#include " | \ + $CC $CFLAGS -v -E - 2>&1 | \ + $GREP stddef | $TAIL -1 | $TR -s " " | $CUT -d'"' -f2` + if test "x$GCC_SYSTEM_INCLUDE" != "x"; then + GCC_SYSTEM_INCLUDE=`$DIRNAME $GCC_SYSTEM_INCLUDE` + GCC_INCLUDE_DEBUG_MAP_FLAGS="$GCC_INCLUDE_DEBUG_MAP_FLAGS \ + -fdebug-prefix-map=${GCC_SYSTEM_INCLUDE}/=/usr/local/gcc_include/" + fi + + # Add g++ system include mapping => /usr/local/gxx_include + # Find location of cstddef using build C++ compiler + GXX_SYSTEM_INCLUDE=`$ECHO "#include " | \ + $CXX $CXXFLAGS -v -E -x c++ - 2>&1 | \ + $GREP cstddef | $TAIL -1 | $TR -s " " | $CUT -d'"' -f2` + if test "x$GXX_SYSTEM_INCLUDE" != "x"; then + GXX_SYSTEM_INCLUDE=`$DIRNAME $GXX_SYSTEM_INCLUDE` + GCC_INCLUDE_DEBUG_MAP_FLAGS="$GCC_INCLUDE_DEBUG_MAP_FLAGS \ + -fdebug-prefix-map=${GXX_SYSTEM_INCLUDE}/=/usr/local/gxx_include/" + fi + + # Add to debug prefix cflags + DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS $GCC_INCLUDE_DEBUG_MAP_FLAGS" +]) + AC_DEFUN([FLAGS_SETUP_WARNINGS], [ # Set default value. From b0e9a61a52ddb5c67941e7dbe08d3fc558038f50 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 12 Feb 2024 15:28:21 +0000 Subject: [PATCH 220/261] 8323671: DevKit build gcc libraries contain full paths to source location Backport-of: dd0694b9cbbfa2defdc3b09f86f20f686688cf7b --- make/devkit/Tools.gmk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk index af37f12f39d..187320ca26e 100644 --- a/make/devkit/Tools.gmk +++ b/make/devkit/Tools.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2024, 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 @@ -539,6 +539,7 @@ $(BUILDDIR)/$(gcc_ver)/Makefile \ $(PATHPRE) $(ENVS) $(GCC_CFG) $(EXTRA_CFLAGS) \ $(CONFIG) \ --with-sysroot=$(SYSROOT) \ + --with-debug-prefix-map=$(OUTPUT_ROOT)=devkit \ --enable-languages=c,c++ \ --enable-shared \ --disable-nls \ From 4031ff45184792f4054d4fb35d51e2f3d90da1aa Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 13 Feb 2024 08:54:01 +0000 Subject: [PATCH 221/261] 8324753: [AIX] adjust os_posix after JDK-8318696 Backport-of: 8950d68ddb36d35831fbb4b98969cd0537527070 --- src/hotspot/os/posix/os_posix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 41d292f5110..4fc82471c2d 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -757,11 +757,11 @@ void os::dll_unload(void *lib) { } jlong os::lseek(int fd, jlong offset, int whence) { - return (jlong) ::lseek(fd, offset, whence); + return (jlong) AIX_ONLY(::lseek64) NOT_AIX(::lseek)(fd, offset, whence); } int os::ftruncate(int fd, jlong length) { - return ::ftruncate(fd, length); + return AIX_ONLY(::ftruncate64) NOT_AIX(::ftruncate)(fd, length); } const char* os::get_current_directory(char *buf, size_t buflen) { From b9cf41daf165aadadacc3ac79bc6547f04bd29f3 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 13 Feb 2024 10:58:45 +0000 Subject: [PATCH 222/261] 8325194: GHA: Add macOS M1 testing 8325444: GHA: JDK-8325194 causes a regression Reviewed-by: shade Backport-of: d1c82156ba6ede4b798ac15f935289cfcc99d1a0 --- .github/actions/get-jtreg/action.yml | 10 ++++++++-- .github/workflows/build-macos.yml | 11 +++++++---- .github/workflows/main.yml | 15 +++++++++++++-- make/conf/github-actions.conf | 6 +++++- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.github/actions/get-jtreg/action.yml b/.github/actions/get-jtreg/action.yml index 3f5786b22d3..a45c0c1e6a9 100644 --- a/.github/actions/get-jtreg/action.yml +++ b/.github/actions/get-jtreg/action.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2023, 2024, 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,8 +56,14 @@ runs: - name: 'Build JTReg' run: | + # If runner architecture is x64 set JAVA_HOME_17_X64 otherwise set to JAVA_HOME_17_arm64 + if [[ '${{ runner.arch }}' == 'X64' ]]; then + JDK="$JAVA_HOME_17_X64" + else + JDK="$JAVA_HOME_17_arm64" + fi # Build JTReg and move files to the proper locations - bash make/build.sh --jdk "$JAVA_HOME_17_X64" + bash make/build.sh --jdk "$JDK" mkdir ../installed mv build/images/jtreg/* ../installed working-directory: jtreg/src diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 3022e07b6ee..90bb6af044f 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2024, 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,6 +31,9 @@ on: platform: required: true type: string + runs-on: + required: true + type: string extra-conf-options: required: false type: string @@ -55,7 +58,7 @@ on: jobs: build-macos: name: build - runs-on: macos-13 + runs-on: ${{ inputs.runs-on }} strategy: fail-fast: false @@ -74,7 +77,7 @@ jobs: id: bootjdk uses: ./.github/actions/get-bootjdk with: - platform: macos-x64 + platform: ${{ inputs.platform }} - name: 'Get JTReg' id: jtreg @@ -87,7 +90,7 @@ jobs: - name: 'Install toolchain and dependencies' run: | # Run Homebrew installation and xcode-select - brew install make + brew install autoconf make sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-toolset-version }}.app/Contents/Developer # This will make GNU make available as 'make' and not only as 'gmake' echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b9e2c48965..686d5ba4eae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2024, 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 @@ -227,6 +227,7 @@ jobs: uses: ./.github/workflows/build-macos.yml with: platform: macos-x64 + runs-on: 'macos-13' xcode-toolset-version: '14.3.1' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} @@ -238,8 +239,8 @@ jobs: uses: ./.github/workflows/build-macos.yml with: platform: macos-aarch64 + runs-on: 'macos-14' xcode-toolset-version: '14.3.1' - extra-conf-options: '--openjdk-target=aarch64-apple-darwin' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.macos-aarch64 == 'true' @@ -320,6 +321,16 @@ jobs: bootjdk-platform: macos-x64 runs-on: macos-13 + test-macos-aarch64: + name: macos-aarch64 + needs: + - build-macos-aarch64 + uses: ./.github/workflows/test.yml + with: + platform: macos-aarch64 + bootjdk-platform: macos-aarch64 + runs-on: macos-14 + test-windows-x64: name: windows-x64 needs: diff --git a/make/conf/github-actions.conf b/make/conf/github-actions.conf index 4370494c9b6..3a08380a8b6 100644 --- a/make/conf/github-actions.conf +++ b/make/conf/github-actions.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2024, 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 @@ -36,6 +36,10 @@ MACOS_X64_BOOT_JDK_EXT=tar.gz MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_macos-x64_bin.tar.gz MACOS_X64_BOOT_JDK_SHA256=47cf960d9bb89dbe987535a389f7e26c42de7c984ef5108612d77c81aa8cc6a4 +MACOS_AARCH64_BOOT_JDK_EXT=tar.gz +MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_macos-aarch64_bin.tar.gz +MACOS_AARCH64_BOOT_JDK_SHA256=d020f5c512c043cfb7119a591bc7e599a5bfd76d866d939f5562891d9db7c9b3 + WINDOWS_X64_BOOT_JDK_EXT=zip WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_windows-x64_bin.zip WINDOWS_X64_BOOT_JDK_SHA256=c92fae5e42b9aecf444a66c8ec563c652f60b1e231dfdd33a4f5a3e3603058fb From 3f3500811dd805d2ffaf1ee30af068572dc13de3 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 14 Feb 2024 11:41:40 +0000 Subject: [PATCH 223/261] 8323515: Create test alias "all" for all test roots 8324647: Invalid test group of lib-test after JDK-8323515 Backport-of: 8b9bf758801400e4491326cd4c90fc117b9d97e1 --- test/hotspot/jtreg/TEST.groups | 7 +++++++ test/jaxp/TEST.groups | 11 ++++++++--- test/jdk/TEST.groups | 11 +++++++++++ test/langtools/TEST.groups | 9 ++++++--- test/lib-test/TEST.groups | 15 +++++++++++++-- 5 files changed, 45 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index e7202db60b0..c1b8aadbd9f 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -21,6 +21,11 @@ # questions. # +# All tests + +all = \ + :hotspot_all + hotspot_all = \ / @@ -28,6 +33,8 @@ hotspot_all_no_apps = \ / \ -applications +# Component test groups + hotspot_compiler = \ compiler diff --git a/test/jaxp/TEST.groups b/test/jaxp/TEST.groups index 0b67ed428b9..f8cb73c4393 100644 --- a/test/jaxp/TEST.groups +++ b/test/jaxp/TEST.groups @@ -20,6 +20,14 @@ # questions. # +# All tests + +all = \ + :jaxp_all + +jaxp_all = \ + / + # Tiered testing definitions # No jaxp tests are tier 1. @@ -34,6 +42,3 @@ tier3 = # No tier 4 tests. tier4 = - -jaxp_all = \ - javax/xml/jaxp diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups index 93baa891619..66097a555b5 100644 --- a/test/jdk/TEST.groups +++ b/test/jdk/TEST.groups @@ -20,6 +20,17 @@ # questions. # +############################################################################### +# +# All tests +# + +all = \ + :jdk_all + +jdk_all = \ + / + ############################################################################### # # Tiered testing definitions diff --git a/test/langtools/TEST.groups b/test/langtools/TEST.groups index 8e521a56e02..e1ffd5d530b 100644 --- a/test/langtools/TEST.groups +++ b/test/langtools/TEST.groups @@ -63,10 +63,13 @@ langtools_jdeps = \ tools/all \ tools/jdeps +# All tests + +all = \ + :langtools_all + langtools_all = \ - jdk \ - lib \ - tools + / # Tiered testing definitions diff --git a/test/lib-test/TEST.groups b/test/lib-test/TEST.groups index eb0c9b317ae..85067f310b1 100644 --- a/test/lib-test/TEST.groups +++ b/test/lib-test/TEST.groups @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2024, 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 @@ -21,4 +21,15 @@ # questions. # -tier1 = . +# All tests + +all = \ + :libtest_all + +libtest_all = \ + / + +# Tiered testing definitions + +tier1 = \ + :all From ecdc22eafb9526787ac5b6ba67ec2df7653eaf3e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 14 Feb 2024 11:42:59 +0000 Subject: [PATCH 224/261] 8305962: update jcstress to 0.16 Backport-of: 292ee630ae32c3b50363b10ffa6090e57ffef1e8 --- .../applications/jcstress/JcstressRunner.java | 28 +++++++++++++++-- .../applications/jcstress/TestGenerator.java | 4 +-- .../applications/jcstress/collections.java | 31 +++++++++++++++++++ .../jtreg/applications/jcstress/mxbeans.java | 31 +++++++++++++++++++ .../jtreg/applications/jcstress/oota.java | 31 +++++++++++++++++++ 5 files changed, 120 insertions(+), 5 deletions(-) create mode 100644 test/hotspot/jtreg/applications/jcstress/collections.java create mode 100644 test/hotspot/jtreg/applications/jcstress/mxbeans.java create mode 100644 test/hotspot/jtreg/applications/jcstress/oota.java diff --git a/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java b/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java index 7505c6972d4..d92dbdfe82d 100644 --- a/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java +++ b/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,11 +42,15 @@ * jcstress tests wrapper */ @Artifact(organization = "org.openjdk.jcstress", name = "jcstress-tests-all", - revision = "0.5", extension = "jar", unpack = false) + revision = "0.16", extension = "jar", unpack = false) public class JcstressRunner { public static final String MAIN_CLASS = "org.openjdk.jcstress.Main"; + // Allow to configure jcstress mode parameter. + // Test mode preset: sanity, quick, default, tough, stress. + public static final String MODE_PROPERTY = "jcstress.mode"; + public static Path pathToArtifact() { Map artifacts; try { @@ -55,7 +59,7 @@ public static Path pathToArtifact() { throw new Error("TESTBUG: Can not resolve artifacts for " + JcstressRunner.class.getName(), e); } - return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-0.5") + return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-0.16") .toAbsolutePath(); } @@ -104,11 +108,29 @@ private static String[] getCmd(String[] args) { extraFlags.add("--jvmArgs"); extraFlags.add("-Djava.io.tmpdir=" + System.getProperty("user.dir")); + + // The "default" preset might take days for some tests + // so use quick testing by default. + String mode = "quick"; for (String jvmArg : Utils.getTestJavaOpts()) { + if(jvmArg.startsWith("-D" + MODE_PROPERTY)) { + String[] pair = jvmArg.split("=", 2); + mode = pair[1]; + continue; + } extraFlags.add("--jvmArgs"); extraFlags.add(jvmArg); } + extraFlags.add("-m"); + extraFlags.add(mode); + + extraFlags.add("-sc"); + extraFlags.add("false"); + + extraFlags.add("-af"); + extraFlags.add("GLOBAL"); + String[] result = new String[extraFlags.size() + args.length]; extraFlags.toArray(result); System.arraycopy(args, 0, result, extraFlags.size(), args.length); diff --git a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java index d999b8a2b29..1b8ff81c48a 100644 --- a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java +++ b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -122,7 +122,7 @@ public static void main(String[] args) throws IOException { BufferedReader reader = Files.newBufferedReader(output); reader.lines() - .skip(4) // skip first 4 lines: name, -{80}, revision and empty line + .filter(s -> s.startsWith("org.openjdk.jcstress.tests")) .map(s -> s.split("\\.")[4]) // group by the package name following "org.openjdk.jcstress.tests." .distinct() .filter(s -> !s.startsWith("sample")) // skip sample test diff --git a/test/hotspot/jtreg/applications/jcstress/collections.java b/test/hotspot/jtreg/applications/jcstress/collections.java new file mode 100644 index 00000000000..176f004495b --- /dev/null +++ b/test/hotspot/jtreg/applications/jcstress/collections.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 2023, 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. + */ + +/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */ + +/** + * @test collections + * @library /test/lib / + * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.collections\. + */ + diff --git a/test/hotspot/jtreg/applications/jcstress/mxbeans.java b/test/hotspot/jtreg/applications/jcstress/mxbeans.java new file mode 100644 index 00000000000..64f5e760f95 --- /dev/null +++ b/test/hotspot/jtreg/applications/jcstress/mxbeans.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 2023, 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. + */ + +/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */ + +/** + * @test mxbeans + * @library /test/lib / + * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.mxbeans\. + */ + diff --git a/test/hotspot/jtreg/applications/jcstress/oota.java b/test/hotspot/jtreg/applications/jcstress/oota.java new file mode 100644 index 00000000000..c558006cc9d --- /dev/null +++ b/test/hotspot/jtreg/applications/jcstress/oota.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 2023, 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. + */ + +/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */ + +/** + * @test oota + * @library /test/lib / + * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.oota\. + */ + From 786c5fb1e587740bfb000ae4422ffcbbf53f52de Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 14 Feb 2024 11:53:34 +0000 Subject: [PATCH 225/261] 8324858: [vectorapi] Bounds checking issues when accessing memory segments Reviewed-by: psandoz Backport-of: 1ae851387f881263ccc6aeace5afdd0f49d41d33 --- .../jdk/incubator/vector/AbstractSpecies.java | 10 +--------- .../classes/jdk/incubator/vector/ByteVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/DoubleVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/FloatVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/IntVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/LongVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/ShortVector.java | 14 ++++++++++++-- .../jdk/incubator/vector/X-Vector.java.template | 14 ++++++++++++-- .../vector/Byte128VectorLoadStoreTests.java | 8 +++++--- .../vector/Byte256VectorLoadStoreTests.java | 8 +++++--- .../vector/Byte512VectorLoadStoreTests.java | 8 +++++--- .../vector/Byte64VectorLoadStoreTests.java | 8 +++++--- .../vector/ByteMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Double128VectorLoadStoreTests.java | 8 +++++--- .../vector/Double256VectorLoadStoreTests.java | 8 +++++--- .../vector/Double512VectorLoadStoreTests.java | 8 +++++--- .../vector/Double64VectorLoadStoreTests.java | 8 +++++--- .../vector/DoubleMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Float128VectorLoadStoreTests.java | 8 +++++--- .../vector/Float256VectorLoadStoreTests.java | 8 +++++--- .../vector/Float512VectorLoadStoreTests.java | 8 +++++--- .../vector/Float64VectorLoadStoreTests.java | 8 +++++--- .../vector/FloatMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Int128VectorLoadStoreTests.java | 8 +++++--- .../vector/Int256VectorLoadStoreTests.java | 8 +++++--- .../vector/Int512VectorLoadStoreTests.java | 8 +++++--- .../vector/Int64VectorLoadStoreTests.java | 8 +++++--- .../vector/IntMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Long128VectorLoadStoreTests.java | 8 +++++--- .../vector/Long256VectorLoadStoreTests.java | 8 +++++--- .../vector/Long512VectorLoadStoreTests.java | 8 +++++--- .../vector/Long64VectorLoadStoreTests.java | 8 +++++--- .../vector/LongMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Short128VectorLoadStoreTests.java | 8 +++++--- .../vector/Short256VectorLoadStoreTests.java | 8 +++++--- .../vector/Short512VectorLoadStoreTests.java | 8 +++++--- .../vector/Short64VectorLoadStoreTests.java | 8 +++++--- .../vector/ShortMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/templates/X-LoadStoreTest.java.template | 8 +++++--- 39 files changed, 240 insertions(+), 116 deletions(-) diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java index fac0012e646..0ff4830ded5 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -360,14 +360,6 @@ VectorShuffle iotaShuffle(int start, int step, boolean wrap) { return dummyVector().iotaShuffle(start, step, wrap); } - @ForceInline - @Override - public final Vector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { - return dummyVector() - .fromMemorySegment0(ms, offset) - .maybeSwap(bo); - } - @Override public VectorMask loadMask(boolean[] bits, int offset) { return VectorMask.fromArray(this, bits, offset); diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java index 3c9217fc985..4db53b189d6 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -4198,11 +4198,21 @@ final ByteVector fromIntValues(int[] values) { @ForceInline @Override final public ByteVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return ByteVector .fromArray(this, (byte[]) a, offset); } + @ForceInline + @Override final + public ByteVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return ByteVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final ByteVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java index 39dc04cedb7..b8607febaef 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3801,11 +3801,21 @@ final DoubleVector fromIntValues(int[] values) { @ForceInline @Override final public DoubleVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return DoubleVector .fromArray(this, (double[]) a, offset); } + @ForceInline + @Override final + public DoubleVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return DoubleVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final DoubleVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java index 2095da4328c..43991701136 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3751,11 +3751,21 @@ final FloatVector fromIntValues(int[] values) { @ForceInline @Override final public FloatVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return FloatVector .fromArray(this, (float[]) a, offset); } + @ForceInline + @Override final + public FloatVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return FloatVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final FloatVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java index 66f6bed91fd..a6806912c8a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3907,11 +3907,21 @@ final IntVector fromIntValues(int[] values) { @ForceInline @Override final public IntVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return IntVector .fromArray(this, (int[]) a, offset); } + @ForceInline + @Override final + public IntVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return IntVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final IntVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java index 672f3ddc3f7..03a38497334 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3833,11 +3833,21 @@ final LongVector fromIntValues(int[] values) { @ForceInline @Override final public LongVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return LongVector .fromArray(this, (long[]) a, offset); } + @ForceInline + @Override final + public LongVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return LongVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final LongVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java index ed74ce21653..da414574dfc 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -4192,11 +4192,21 @@ final ShortVector fromIntValues(int[] values) { @ForceInline @Override final public ShortVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return ShortVector .fromArray(this, (short[]) a, offset); } + @ForceInline + @Override final + public ShortVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return ShortVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final ShortVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template index ae4e136406b..dfec9cc7a67 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -5457,11 +5457,21 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { @ForceInline @Override final public $abstractvectortype$ fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return $abstractvectortype$ .fromArray(this, ($type$[]) a, offset); } + @ForceInline + @Override final + public $abstractvectortype$ fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return $abstractvectortype$ + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final $abstractvectortype$ dummyVector() { diff --git a/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java index 6718c37e34f..6b52621c1dd 100644 --- a/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static byte[] fill(byte[] a, ToByteF f) { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask m) { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java index 63a5c012894..4ff4387f548 100644 --- a/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static byte[] fill(byte[] a, ToByteF f) { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask m) { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java index fabb77f3a97..9c0a8e2c1e1 100644 --- a/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static byte[] fill(byte[] a, ToByteF f) { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask m) { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java index eef32604590..7df23bbadc2 100644 --- a/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static byte[] fill(byte[] a, ToByteF f) { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask m) { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java index 8a51dd67cff..765740805f3 100644 --- a/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -256,7 +256,8 @@ static byte[] fill(byte[] a, ToByteF f) { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -276,7 +277,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask m) { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java index 005f3b2496c..76602500e3a 100644 --- a/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static double[] fill(double[] a, ToDoubleF f) { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(DoubleVector v, double[] a, int i, VectorMask m) { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java index 53133964152..7c0275ea4df 100644 --- a/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static double[] fill(double[] a, ToDoubleF f) { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(DoubleVector v, double[] a, int i, VectorMask m) { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java index 084d700a304..622d09031b7 100644 --- a/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static double[] fill(double[] a, ToDoubleF f) { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(DoubleVector v, double[] a, int i, VectorMask m) { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java index d18a69c5175..82e4f075f3b 100644 --- a/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static double[] fill(double[] a, ToDoubleF f) { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(DoubleVector v, double[] a, int i, VectorMask m) { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java index c6440367576..a32274ced3d 100644 --- a/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -256,7 +256,8 @@ static double[] fill(double[] a, ToDoubleF f) { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -276,7 +277,8 @@ static void intoArray(DoubleVector v, double[] a, int i, VectorMask m) { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java index cd5e0ec09d7..989300ef472 100644 --- a/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static float[] fill(float[] a, ToFloatF f) { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(FloatVector v, float[] a, int i, VectorMask m) { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java index 1620b045de2..b934658edac 100644 --- a/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static float[] fill(float[] a, ToFloatF f) { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(FloatVector v, float[] a, int i, VectorMask m) { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java index be1b009be67..9e549960145 100644 --- a/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static float[] fill(float[] a, ToFloatF f) { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(FloatVector v, float[] a, int i, VectorMask m) { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java index 9f2a5fedba9..3ad9a540ae3 100644 --- a/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static float[] fill(float[] a, ToFloatF f) { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(FloatVector v, float[] a, int i, VectorMask m) { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java index 0d9b2fa0bd4..87ba62c1db3 100644 --- a/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -256,7 +256,8 @@ static float[] fill(float[] a, ToFloatF f) { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -276,7 +277,8 @@ static void intoArray(FloatVector v, float[] a, int i, VectorMask m) { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java index 0de06ca4ec4..8b2c2088166 100644 --- a/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static int[] fill(int[] a, ToIntF f) { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(IntVector v, int[] a, int i, VectorMask m) { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java index 8b9cfb876a8..c12c8bf0f1e 100644 --- a/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static int[] fill(int[] a, ToIntF f) { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(IntVector v, int[] a, int i, VectorMask m) { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java index 96957ec4903..8c64553a5cf 100644 --- a/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static int[] fill(int[] a, ToIntF f) { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(IntVector v, int[] a, int i, VectorMask m) { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java index e82c714654b..f2d58ab0e28 100644 --- a/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static int[] fill(int[] a, ToIntF f) { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(IntVector v, int[] a, int i, VectorMask m) { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java index 96f8aa9e38a..5e6d27750d6 100644 --- a/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -256,7 +256,8 @@ static int[] fill(int[] a, ToIntF f) { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -276,7 +277,8 @@ static void intoArray(IntVector v, int[] a, int i, VectorMask m) { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java index 85662ab0e88..eb91851ea7f 100644 --- a/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static long[] fill(long[] a, ToLongF f) { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(LongVector v, long[] a, int i, VectorMask m) { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java index c502c19d67d..a60822fa2f7 100644 --- a/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static long[] fill(long[] a, ToLongF f) { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(LongVector v, long[] a, int i, VectorMask m) { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java index 9485e1d2c06..84e03c090b3 100644 --- a/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static long[] fill(long[] a, ToLongF f) { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(LongVector v, long[] a, int i, VectorMask m) { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java index 145f8e18718..a1a9b80dd10 100644 --- a/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static long[] fill(long[] a, ToLongF f) { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(LongVector v, long[] a, int i, VectorMask m) { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java index ec0170c8779..872259751d5 100644 --- a/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -256,7 +256,8 @@ static long[] fill(long[] a, ToLongF f) { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -276,7 +277,8 @@ static void intoArray(LongVector v, long[] a, int i, VectorMask m) { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java index f404ee49139..68244dbc4f9 100644 --- a/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static short[] fill(short[] a, ToShortF f) { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ShortVector v, short[] a, int i, VectorMask m) { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java index e6ba0a2f6b0..640feb85ece 100644 --- a/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static short[] fill(short[] a, ToShortF f) { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ShortVector v, short[] a, int i, VectorMask m) { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java index b4c2a899c4e..abc96075a8c 100644 --- a/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static short[] fill(short[] a, ToShortF f) { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ShortVector v, short[] a, int i, VectorMask m) { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java index 229e41248d6..a233ec7d28c 100644 --- a/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -249,7 +249,8 @@ static short[] fill(short[] a, ToShortF f) { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -269,7 +270,8 @@ static void intoArray(ShortVector v, short[] a, int i, VectorMask m) { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java index 4f5ab531c75..ffa8d53509c 100644 --- a/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -256,7 +256,8 @@ static short[] fill(short[] a, ToShortF f) { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -276,7 +277,8 @@ static void intoArray(ShortVector v, short[] a, int i, VectorMask m) { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template b/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template index bac451ae026..979efa81cb4 100644 --- a/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template +++ b/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -269,7 +269,8 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { @DontInline static $abstractvectortype$ fromArray($type$[] a, int i) { - return $abstractvectortype$.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return ($abstractvectortype$) SPECIES.fromArray(a, i); } @DontInline @@ -289,7 +290,8 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { @DontInline static $abstractvectortype$ fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return $abstractvectortype$.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return ($abstractvectortype$) SPECIES.fromMemorySegment(a, i, bo); } @DontInline From 24fae7abaafd32c44cab0f86f4d5834b2f303cc6 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 15 Feb 2024 08:49:33 +0000 Subject: [PATCH 226/261] 8324514: ClassLoaderData::print_on should print address of class loader Backport-of: fb822e49f2a84423c8fd17db2e95bbdd5e7ec191 --- src/hotspot/share/classfile/classLoaderData.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp index aa1f6f53107..282a025c31d 100644 --- a/src/hotspot/share/classfile/classLoaderData.cpp +++ b/src/hotspot/share/classfile/classLoaderData.cpp @@ -1009,7 +1009,11 @@ void ClassLoaderData::print_on(outputStream* out) const { _holder.print_on(out); out->print_cr(""); } - out->print_cr(" - class loader " INTPTR_FORMAT, p2i(_class_loader.ptr_raw())); + if (!_unloading) { + out->print_cr(" - class loader " INTPTR_FORMAT, p2i(_class_loader.peek())); + } else { + out->print_cr(" - class loader "); + } out->print_cr(" - metaspace " INTPTR_FORMAT, p2i(_metaspace)); out->print_cr(" - unloading %s", _unloading ? "true" : "false"); out->print_cr(" - class mirror holder %s", _has_class_mirror_holder ? "true" : "false"); From 3da175b2deddd296cb85cce1046aff430b4da9cc Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 15 Feb 2024 08:49:49 +0000 Subject: [PATCH 227/261] 8323717: Introduce test keyword for tests that need external dependencies Backport-of: 12b89cd2eeb5c2c43a2ce425c96fc4f718e30514 --- test/hotspot/jtreg/TEST.ROOT | 3 ++- test/hotspot/jtreg/applications/jcstress/TestGenerator.java | 1 + test/hotspot/jtreg/applications/jcstress/accessAtomic.java | 3 ++- test/hotspot/jtreg/applications/jcstress/acqrel.java | 3 ++- test/hotspot/jtreg/applications/jcstress/atomicity.java | 3 ++- test/hotspot/jtreg/applications/jcstress/atomics.java | 3 ++- test/hotspot/jtreg/applications/jcstress/causality.java | 3 ++- test/hotspot/jtreg/applications/jcstress/coherence.java | 3 ++- test/hotspot/jtreg/applications/jcstress/collections.java | 3 ++- test/hotspot/jtreg/applications/jcstress/copy.java | 3 ++- test/hotspot/jtreg/applications/jcstress/countdownlatch.java | 3 ++- test/hotspot/jtreg/applications/jcstress/defaultValues.java | 3 ++- test/hotspot/jtreg/applications/jcstress/executors.java | 3 ++- test/hotspot/jtreg/applications/jcstress/fences.java | 3 ++- test/hotspot/jtreg/applications/jcstress/future.java | 3 ++- test/hotspot/jtreg/applications/jcstress/init.java | 3 ++- test/hotspot/jtreg/applications/jcstress/initClass.java | 3 ++- test/hotspot/jtreg/applications/jcstress/initLen.java | 3 ++- test/hotspot/jtreg/applications/jcstress/interrupt.java | 3 ++- test/hotspot/jtreg/applications/jcstress/locks.java | 3 ++- test/hotspot/jtreg/applications/jcstress/memeffects.java | 3 ++- test/hotspot/jtreg/applications/jcstress/mxbeans.java | 3 ++- test/hotspot/jtreg/applications/jcstress/oota.java | 3 ++- test/hotspot/jtreg/applications/jcstress/seqcst.java | 3 ++- test/hotspot/jtreg/applications/jcstress/singletons.java | 3 ++- test/hotspot/jtreg/applications/jcstress/strings.java | 3 ++- test/hotspot/jtreg/applications/jcstress/tearing.java | 3 ++- test/hotspot/jtreg/applications/jcstress/threadlocal.java | 3 ++- test/hotspot/jtreg/applications/jcstress/unsafe.java | 3 ++- test/hotspot/jtreg/applications/jcstress/varhandles.java | 3 ++- test/hotspot/jtreg/applications/jcstress/volatiles.java | 3 ++- test/hotspot/jtreg/applications/scimark/Scimark.java | 1 + 32 files changed, 62 insertions(+), 30 deletions(-) diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 529f0a8bc7a..7b1212ec373 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -33,7 +33,8 @@ # randomness: test uses randomness, test cases differ from run to run # cgroups: test uses cgroups # flag-sensitive: test is sensitive to certain flags and might fail when flags are passed using -vmoptions and -javaoptions -keys=stress headful intermittent randomness cgroups flag-sensitive +# external-dep: test requires external dependencies to work +keys=stress headful intermittent randomness cgroups flag-sensitive external-dep groups=TEST.groups TEST.quick-groups diff --git a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java index 1b8ff81c48a..81d8da356d6 100644 --- a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java +++ b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java @@ -96,6 +96,7 @@ public class TestGenerator { public static String DESC_FORMAT = "\n" + "/**\n" + " * @test %1$s\n" + + " * @key external-dep\n" + " * @library /test/lib /\n" + " * @run driver/timeout=21600 " + JcstressRunner.class.getName() // verbose output diff --git a/test/hotspot/jtreg/applications/jcstress/accessAtomic.java b/test/hotspot/jtreg/applications/jcstress/accessAtomic.java index cfeb8ff0ea7..45311747023 100644 --- a/test/hotspot/jtreg/applications/jcstress/accessAtomic.java +++ b/test/hotspot/jtreg/applications/jcstress/accessAtomic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test accessAtomic + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.accessAtomic\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/acqrel.java b/test/hotspot/jtreg/applications/jcstress/acqrel.java index 0dd102221b5..8313278053e 100644 --- a/test/hotspot/jtreg/applications/jcstress/acqrel.java +++ b/test/hotspot/jtreg/applications/jcstress/acqrel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test acqrel + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.acqrel\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/atomicity.java b/test/hotspot/jtreg/applications/jcstress/atomicity.java index c6c4263aeb0..abffd4fb3dd 100644 --- a/test/hotspot/jtreg/applications/jcstress/atomicity.java +++ b/test/hotspot/jtreg/applications/jcstress/atomicity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test atomicity + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.atomicity\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/atomics.java b/test/hotspot/jtreg/applications/jcstress/atomics.java index 3527fad666d..449b051efa6 100644 --- a/test/hotspot/jtreg/applications/jcstress/atomics.java +++ b/test/hotspot/jtreg/applications/jcstress/atomics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test atomics + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.atomics\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/causality.java b/test/hotspot/jtreg/applications/jcstress/causality.java index 05ca0dc654a..8cda7d61ade 100644 --- a/test/hotspot/jtreg/applications/jcstress/causality.java +++ b/test/hotspot/jtreg/applications/jcstress/causality.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test causality + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.causality\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/coherence.java b/test/hotspot/jtreg/applications/jcstress/coherence.java index f8368834ac4..c2630c2dd66 100644 --- a/test/hotspot/jtreg/applications/jcstress/coherence.java +++ b/test/hotspot/jtreg/applications/jcstress/coherence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test coherence + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.coherence\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/collections.java b/test/hotspot/jtreg/applications/jcstress/collections.java index 176f004495b..b1363b25168 100644 --- a/test/hotspot/jtreg/applications/jcstress/collections.java +++ b/test/hotspot/jtreg/applications/jcstress/collections.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test collections + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.collections\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/copy.java b/test/hotspot/jtreg/applications/jcstress/copy.java index b291dbe7cde..a2d0d6f099f 100644 --- a/test/hotspot/jtreg/applications/jcstress/copy.java +++ b/test/hotspot/jtreg/applications/jcstress/copy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test copy + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.copy\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/countdownlatch.java b/test/hotspot/jtreg/applications/jcstress/countdownlatch.java index 290ec80cc8c..cee4f917c6f 100644 --- a/test/hotspot/jtreg/applications/jcstress/countdownlatch.java +++ b/test/hotspot/jtreg/applications/jcstress/countdownlatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test countdownlatch + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.countdownlatch\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/defaultValues.java b/test/hotspot/jtreg/applications/jcstress/defaultValues.java index c86529491b9..8fce07d8063 100644 --- a/test/hotspot/jtreg/applications/jcstress/defaultValues.java +++ b/test/hotspot/jtreg/applications/jcstress/defaultValues.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test defaultValues + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.defaultValues\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/executors.java b/test/hotspot/jtreg/applications/jcstress/executors.java index b29bbb6507c..f2f50978404 100644 --- a/test/hotspot/jtreg/applications/jcstress/executors.java +++ b/test/hotspot/jtreg/applications/jcstress/executors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test executors + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.executors\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/fences.java b/test/hotspot/jtreg/applications/jcstress/fences.java index 5bca0257717..d2925a0a101 100644 --- a/test/hotspot/jtreg/applications/jcstress/fences.java +++ b/test/hotspot/jtreg/applications/jcstress/fences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test fences + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.fences\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/future.java b/test/hotspot/jtreg/applications/jcstress/future.java index eea5b7de64c..5bc760fe2f5 100644 --- a/test/hotspot/jtreg/applications/jcstress/future.java +++ b/test/hotspot/jtreg/applications/jcstress/future.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test future + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.future\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/init.java b/test/hotspot/jtreg/applications/jcstress/init.java index 625037b8f94..087956881d3 100644 --- a/test/hotspot/jtreg/applications/jcstress/init.java +++ b/test/hotspot/jtreg/applications/jcstress/init.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test init + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.init\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/initClass.java b/test/hotspot/jtreg/applications/jcstress/initClass.java index 5a0e70f19ac..5b936ce46cd 100644 --- a/test/hotspot/jtreg/applications/jcstress/initClass.java +++ b/test/hotspot/jtreg/applications/jcstress/initClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test initClass + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.initClass\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/initLen.java b/test/hotspot/jtreg/applications/jcstress/initLen.java index 4cb040bf878..01ef04b8a13 100644 --- a/test/hotspot/jtreg/applications/jcstress/initLen.java +++ b/test/hotspot/jtreg/applications/jcstress/initLen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test initLen + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.initLen\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/interrupt.java b/test/hotspot/jtreg/applications/jcstress/interrupt.java index 8e4d2ad0fba..1a9ecc357d4 100644 --- a/test/hotspot/jtreg/applications/jcstress/interrupt.java +++ b/test/hotspot/jtreg/applications/jcstress/interrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test interrupt + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.interrupt\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/locks.java b/test/hotspot/jtreg/applications/jcstress/locks.java index 7450e295094..e3e11633323 100644 --- a/test/hotspot/jtreg/applications/jcstress/locks.java +++ b/test/hotspot/jtreg/applications/jcstress/locks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test locks + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.locks\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/memeffects.java b/test/hotspot/jtreg/applications/jcstress/memeffects.java index d4e1b0e26ce..6be6d180939 100644 --- a/test/hotspot/jtreg/applications/jcstress/memeffects.java +++ b/test/hotspot/jtreg/applications/jcstress/memeffects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test memeffects + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.memeffects\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/mxbeans.java b/test/hotspot/jtreg/applications/jcstress/mxbeans.java index 64f5e760f95..4714b335bdd 100644 --- a/test/hotspot/jtreg/applications/jcstress/mxbeans.java +++ b/test/hotspot/jtreg/applications/jcstress/mxbeans.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test mxbeans + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.mxbeans\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/oota.java b/test/hotspot/jtreg/applications/jcstress/oota.java index c558006cc9d..6c21e76a7e9 100644 --- a/test/hotspot/jtreg/applications/jcstress/oota.java +++ b/test/hotspot/jtreg/applications/jcstress/oota.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test oota + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.oota\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/seqcst.java b/test/hotspot/jtreg/applications/jcstress/seqcst.java index 7b0bae61855..def96932d7e 100644 --- a/test/hotspot/jtreg/applications/jcstress/seqcst.java +++ b/test/hotspot/jtreg/applications/jcstress/seqcst.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test seqcst + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.seqcst\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/singletons.java b/test/hotspot/jtreg/applications/jcstress/singletons.java index 1ddaaff4c68..9714dc0ea1d 100644 --- a/test/hotspot/jtreg/applications/jcstress/singletons.java +++ b/test/hotspot/jtreg/applications/jcstress/singletons.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test singletons + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.singletons\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/strings.java b/test/hotspot/jtreg/applications/jcstress/strings.java index 76ed85ab65f..caacea9bcc7 100644 --- a/test/hotspot/jtreg/applications/jcstress/strings.java +++ b/test/hotspot/jtreg/applications/jcstress/strings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test strings + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.strings\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/tearing.java b/test/hotspot/jtreg/applications/jcstress/tearing.java index 3b9c96351c1..a55d43964b7 100644 --- a/test/hotspot/jtreg/applications/jcstress/tearing.java +++ b/test/hotspot/jtreg/applications/jcstress/tearing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test tearing + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.tearing\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/threadlocal.java b/test/hotspot/jtreg/applications/jcstress/threadlocal.java index 4abc459224f..9103b90594a 100644 --- a/test/hotspot/jtreg/applications/jcstress/threadlocal.java +++ b/test/hotspot/jtreg/applications/jcstress/threadlocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test threadlocal + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.threadlocal\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/unsafe.java b/test/hotspot/jtreg/applications/jcstress/unsafe.java index 2983d4e8e04..8be919b0c3b 100644 --- a/test/hotspot/jtreg/applications/jcstress/unsafe.java +++ b/test/hotspot/jtreg/applications/jcstress/unsafe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test unsafe + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.unsafe\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/varhandles.java b/test/hotspot/jtreg/applications/jcstress/varhandles.java index 389714c32a8..af9b4271157 100644 --- a/test/hotspot/jtreg/applications/jcstress/varhandles.java +++ b/test/hotspot/jtreg/applications/jcstress/varhandles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test varhandles + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.varhandles\. */ diff --git a/test/hotspot/jtreg/applications/jcstress/volatiles.java b/test/hotspot/jtreg/applications/jcstress/volatiles.java index 085289fad24..2f1f015b8d5 100644 --- a/test/hotspot/jtreg/applications/jcstress/volatiles.java +++ b/test/hotspot/jtreg/applications/jcstress/volatiles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,6 +25,7 @@ /** * @test volatiles + * @key external-dep * @library /test/lib / * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.volatiles\. */ diff --git a/test/hotspot/jtreg/applications/scimark/Scimark.java b/test/hotspot/jtreg/applications/scimark/Scimark.java index ee4f6f7cef9..c17fad0ac54 100644 --- a/test/hotspot/jtreg/applications/scimark/Scimark.java +++ b/test/hotspot/jtreg/applications/scimark/Scimark.java @@ -23,6 +23,7 @@ /* * @test + * @key external-dep * @library /test/lib * @run driver Scimark */ From fb19cb3c35ca3218793ae5b54720bd4524f1fc5b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 15 Feb 2024 09:07:51 +0000 Subject: [PATCH 228/261] 8319314: NMT detail report slow or hangs for large number of mappings Reviewed-by: phh Backport-of: 9938b3f62babfc35ee682bd979a6bf08ac7cd348 --- src/hotspot/share/services/memBaseline.cpp | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/services/memBaseline.cpp b/src/hotspot/share/services/memBaseline.cpp index df9c4d85aa8..c0522016e1e 100644 --- a/src/hotspot/share/services/memBaseline.cpp +++ b/src/hotspot/share/services/memBaseline.cpp @@ -110,22 +110,25 @@ class MallocAllocationSiteWalker : public MallocSiteWalker { } }; -// Compare virtual memory region's base address -int compare_virtual_memory_base(const ReservedMemoryRegion& r1, const ReservedMemoryRegion& r2) { - return r1.compare(r2); -} - // Walk all virtual memory regions for baselining class VirtualMemoryAllocationWalker : public VirtualMemoryWalker { private: - SortedLinkedList - _virtual_memory_regions; - size_t _count; - + typedef LinkedListImpl EntryList; + EntryList _virtual_memory_regions; + size_t _count; + DEBUG_ONLY(address _last_base;) public: - VirtualMemoryAllocationWalker() : _count(0) { } + VirtualMemoryAllocationWalker() : + _count(0) +#ifdef ASSERT + , _last_base(nullptr) +#endif + {} bool do_allocation_site(const ReservedMemoryRegion* rgn) { + assert(rgn->base() >= _last_base, "region unordered?"); + DEBUG_ONLY(_last_base = rgn->base()); if (rgn->size() > 0) { if (_virtual_memory_regions.add(*rgn) != nullptr) { _count ++; From 941ca60ac4be2c8a25ee8175756fe37b2004370a Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Thu, 15 Feb 2024 13:41:02 +0000 Subject: [PATCH 229/261] 8009550: PlatformPCSC should load versioned so Backport-of: 328b381075ab81fd3f899e49e4d71ef19ea28862 --- .../classes/sun/security/util/Debug.java | 1 + .../security/smartcardio/PlatformPCSC.java | 73 +++++++++++++------ 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/java.base/share/classes/sun/security/util/Debug.java b/src/java.base/share/classes/sun/security/util/Debug.java index bff273c6548..e5a6b288ff8 100644 --- a/src/java.base/share/classes/sun/security/util/Debug.java +++ b/src/java.base/share/classes/sun/security/util/Debug.java @@ -81,6 +81,7 @@ public static void Help() System.err.println("logincontext login context results"); System.err.println("jca JCA engine class debugging"); System.err.println("keystore KeyStore debugging"); + System.err.println("pcsc Smartcard library debugging"); System.err.println("policy loading and granting"); System.err.println("provider security provider debugging"); System.err.println("pkcs11 PKCS11 session manager debugging"); diff --git a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java index bacff32efbc..10a27e7a1b2 100644 --- a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java +++ b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 @@ -46,8 +47,14 @@ class PlatformPCSC { private static final String PROP_NAME = "sun.security.smartcardio.library"; - private static final String LIB1 = "/usr/$LIBISA/libpcsclite.so"; - private static final String LIB2 = "/usr/local/$LIBISA/libpcsclite.so"; + // The architecture templates are for Debian-based systems: https://wiki.debian.org/Multiarch/Tuples + // 32-bit arm differs from the pattern of the rest and has to be specified explicitly + private static final String[] LIB_TEMPLATES = { "/usr/$LIBISA/libpcsclite.so", + "/usr/local/$LIBISA/libpcsclite.so", + "/usr/lib/$ARCH-linux-gnu/libpcsclite.so", + "/usr/lib/arm-linux-gnueabi/libpcsclite.so", + "/usr/lib/arm-linux-gnueabihf/libpcsclite.so" }; + private static final String[] LIB_SUFFIXES = { ".1", ".0", "" }; private static final String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"; PlatformPCSC() { @@ -73,23 +80,38 @@ public Throwable run() { }); // expand $LIBISA to the system specific directory name for libraries + // expand $ARCH to the Debian system architecture in use private static String expand(String lib) { int k = lib.indexOf("$LIBISA"); - if (k == -1) { - return lib; + if (k != -1) { + String libDir; + if ("64".equals(System.getProperty("sun.arch.data.model"))) { + // assume Linux convention + libDir = "lib64"; + } else { + // must be 32-bit + libDir = "lib"; + } + lib = lib.replace("$LIBISA", libDir); } - String s1 = lib.substring(0, k); - String s2 = lib.substring(k + 7); - String libDir; - if ("64".equals(System.getProperty("sun.arch.data.model"))) { - // assume Linux convention - libDir = "lib64"; - } else { - // must be 32-bit - libDir = "lib"; + + k = lib.indexOf("$ARCH"); + if (k != -1) { + String arch = System.getProperty("os.arch"); + lib = lib.replace("$ARCH", getDebianArchitecture(arch)); } - String s = s1 + libDir + s2; - return s; + + return lib; + } + + private static String getDebianArchitecture(String jdkArch) { + return switch (jdkArch) { + case "amd64" -> "x86_64"; + case "ppc" -> "powerpc"; + case "ppc64" -> "powerpc64"; + case "ppc64le" -> "powerpc64le"; + default -> jdkArch; + }; } private static String getLibraryName() throws IOException { @@ -98,15 +120,18 @@ private static String getLibraryName() throws IOException { if (lib.length() != 0) { return lib; } - lib = expand(LIB1); - if (new File(lib).isFile()) { - // if LIB1 exists, use that - return lib; - } - lib = expand(LIB2); - if (new File(lib).isFile()) { - // if LIB2 exists, use that - return lib; + + for (String template : LIB_TEMPLATES) { + for (String suffix : LIB_SUFFIXES) { + lib = expand(template) + suffix; + if (debug != null) { + debug.println("Looking for " + lib); + } + if (new File(lib).isFile()) { + // if library exists, use that + return lib; + } + } } // As of macos 11, framework libraries have been removed from the file From 1c92a05724ec485fba40c3abf49c562886312a80 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 16 Feb 2024 02:30:51 +0000 Subject: [PATCH 230/261] 8318603: Parallelize sun/java2d/marlin/ClipShapeTest.java Backport-of: 6c7029ffd48186353fc1d2a03915386b5f386ae2 --- test/jdk/sun/java2d/marlin/ClipShapeTest.java | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/test/jdk/sun/java2d/marlin/ClipShapeTest.java b/test/jdk/sun/java2d/marlin/ClipShapeTest.java index 65de6e750c9..3bdbd416e63 100644 --- a/test/jdk/sun/java2d/marlin/ClipShapeTest.java +++ b/test/jdk/sun/java2d/marlin/ClipShapeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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,20 +52,43 @@ import javax.imageio.ImageWriter; import javax.imageio.stream.ImageOutputStream; -/** - * @test +/* + * @test id=Poly * @bug 8191814 - * @summary Verifies that Marlin rendering generates the same - * images with and without clipping optimization with all possible - * stroke (cap/join) and/or dashes or fill modes (EO rules) - * for paths made of either 9 lines, 4 quads, 2 cubics (random) - * Note: Use the argument -slow to run more intensive tests (too much time) - * + * @summary Runs the test with "-poly" option * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly + */ + +/* + * @test id=PolyDoDash + * @bug 8191814 + * @summary Runs the test with "-poly -doDash" options * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly -doDash + */ + +/* + * @test id=Cubic + * @bug 8191814 + * @summary Runs the test with "-cubic" option * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic + */ + +/* + * @test id=CubicDoDash + * @bug 8191814 + * @summary Runs the test with "-cubic -doDash" options * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic -doDash -*/ + */ + +/** + * Verifies that Marlin rendering generates the same images with and without + * clipping optimization with all possible stroke (cap/join) and/or dashes or + * fill modes (EO rules) for paths made of either 9 lines, 4 quads, 2 cubics + * (random). + *

    + * Note: Use the argument {@code -slow} to run more intensive tests (too much + * time). + */ public final class ClipShapeTest { // test options: From 70fa49ed5821612fe5373f1669aa3553a4ffeda9 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 16 Feb 2024 17:21:56 +0000 Subject: [PATCH 231/261] 8324347: Enable "maybe-uninitialized" warning for FreeType 2.13.1 Backport-of: 781f368d421a94857929e4168974f43e890637d8 --- make/modules/java.desktop/lib/Awt2dLibraries.gmk | 2 -- 1 file changed, 2 deletions(-) diff --git a/make/modules/java.desktop/lib/Awt2dLibraries.gmk b/make/modules/java.desktop/lib/Awt2dLibraries.gmk index 2c5747af29a..d6a4e6df4fc 100644 --- a/make/modules/java.desktop/lib/Awt2dLibraries.gmk +++ b/make/modules/java.desktop/lib/Awt2dLibraries.gmk @@ -423,7 +423,6 @@ else LIBFREETYPE_LIBS := -lfreetype endif - # gcc_ftobjs.c := maybe-uninitialized required for GCC 7 builds. $(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \ NAME := freetype, \ OPTIMIZATION := HIGHEST, \ @@ -432,7 +431,6 @@ else EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \ DISABLED_WARNINGS_microsoft := 4267 4244 4996, \ DISABLED_WARNINGS_gcc := dangling-pointer stringop-overflow, \ - DISABLED_WARNINGS_gcc_ftobjs.c := maybe-uninitialized, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ )) From e181516611067e612fbfec5eaa3d4d2d44f64909 Mon Sep 17 00:00:00 2001 From: Amos Shi Date: Mon, 19 Feb 2024 07:32:36 +0000 Subject: [PATCH 232/261] 8315602: Open source swing security manager test Backport-of: fd6442c079748dcaff3bb565dc35b108b68a61bd --- test/jdk/javax/swing/text/rtf/bug4178276.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/jdk/javax/swing/text/rtf/bug4178276.java diff --git a/test/jdk/javax/swing/text/rtf/bug4178276.java b/test/jdk/javax/swing/text/rtf/bug4178276.java new file mode 100644 index 00000000000..fc6ea8e2963 --- /dev/null +++ b/test/jdk/javax/swing/text/rtf/bug4178276.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4178276 + * @key headful + * @summary RTFEditorkit.write(...) doesn't throw NPE when used in SecurityManager + * @run main/othervm/secure=allow bug4178276 + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; +import javax.swing.text.Document; +import javax.swing.text.rtf.RTFEditorKit; + +public class bug4178276 { + + public static void main(String[] argv) throws Exception { + System.setSecurityManager(new SecurityManager()); + + String test="{\\rtf1\\ansi\\deff0\\deftab720{\\fonttbl{\\f0\\f swiss MS Sans Serif;}}{\\colortbl\\red0\\green0\\blue0;}\\qc\\plain\\f0 Test 1 \\par \\ql\\plain\\f0 Test 2 \\par \\qr\\plain\\f0 Test 3 \\par \\qj\\plain\\f0 Test 4}"; + RTFEditorKit c = new RTFEditorKit(); + Document doc = c.createDefaultDocument(); + try { + c.read(new ByteArrayInputStream(test.getBytes( + StandardCharsets.ISO_8859_1)), doc, 0); + ByteArrayOutputStream sw = new ByteArrayOutputStream(); + c.write(sw, doc, 0, 0); + } catch (Exception e) { + throw new RuntimeException("Unexpected NPE exception...", e); + } + } +} From 70112e33ae290cb9a17924f914765ce0b43ab835 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 19 Feb 2024 07:32:55 +0000 Subject: [PATCH 233/261] 8315891: java/foreign/TestLinker.java failed with "error occurred while instantiating class TestLinker: null" Backport-of: a62c48b87e814b5b1f4c8089f9ff354156f92f69 --- .../foreign/abi/fallback/LibFallback.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java b/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java index 6ba81263d5c..f4461fc2f4f 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java @@ -36,14 +36,20 @@ private LibFallback() {} static final boolean SUPPORTED = tryLoadLibrary(); + @SuppressWarnings("removal") private static boolean tryLoadLibrary() { - try { - System.loadLibrary("fallbackLinker"); - } catch (UnsatisfiedLinkError ule) { - return false; - } - init(); - return true; + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<>() { + public Boolean run() { + try { + System.loadLibrary("fallbackLinker"); + init(); + return true; + } catch (UnsatisfiedLinkError ule) { + return false; + } + } + }); } static int defaultABI() { return NativeConstants.DEFAULT_ABI; } From 93be33ca289c9bfb58a24495d8c3afc02fdebd84 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 19 Feb 2024 08:30:01 +0000 Subject: [PATCH 234/261] 8325672: C2: allocate PhaseIdealLoop::_loop_or_ctrl from C->comp_arena() Backport-of: 74b90aa87e7cfa52ac09bf2e57258d792f740f00 --- src/hotspot/share/opto/loopnode.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index f4be3278fc4..6d44434d71e 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -1115,6 +1115,7 @@ class PhaseIdealLoop : public PhaseTransform { // Compute the Ideal Node to Loop mapping PhaseIdealLoop(PhaseIterGVN& igvn, LoopOptsMode mode) : PhaseTransform(Ideal_Loop), + _loop_or_ctrl(igvn.C->comp_arena()), _igvn(igvn), _verify_me(nullptr), _verify_only(false), @@ -1129,6 +1130,7 @@ class PhaseIdealLoop : public PhaseTransform { // or only verify that the graph is valid if verify_me is null. PhaseIdealLoop(PhaseIterGVN& igvn, const PhaseIdealLoop* verify_me = nullptr) : PhaseTransform(Ideal_Loop), + _loop_or_ctrl(igvn.C->comp_arena()), _igvn(igvn), _verify_me(verify_me), _verify_only(verify_me == nullptr), From 4d4c47d92f6789234b6bc42a38b648158cf94040 Mon Sep 17 00:00:00 2001 From: Joachim Kern Date: Mon, 19 Feb 2024 09:51:00 +0000 Subject: [PATCH 235/261] 8320890: [AIX] Find a better way to mimic dl handle equality Reviewed-by: mdoerr Backport-of: b8ae4a8c0985d1763ac48ba78943d8b992d7be77 --- src/hotspot/os/aix/os_aix.cpp | 37 +-- src/hotspot/os/aix/os_aix.hpp | 2 - src/hotspot/os/aix/porting_aix.cpp | 278 +++++++++++++++++++++ src/hotspot/os/aix/porting_aix.hpp | 2 + src/hotspot/os/bsd/os_bsd.cpp | 22 ++ src/hotspot/os/linux/os_linux.cpp | 22 ++ src/hotspot/os/posix/os_posix.cpp | 18 +- src/hotspot/share/prims/jvmtiAgent.cpp | 43 ---- src/hotspot/share/prims/jvmtiAgent.hpp | 10 - src/hotspot/share/prims/jvmtiAgentList.cpp | 13 - src/hotspot/share/prims/jvmtiAgentList.hpp | 3 - src/hotspot/share/runtime/os.hpp | 1 + 12 files changed, 338 insertions(+), 113 deletions(-) diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 906b473e51b..3321c32a687 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -1112,7 +1112,9 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { } if (!filename || strlen(filename) == 0) { - ::strncpy(ebuf, "dll_load: empty filename specified", ebuflen - 1); + if (ebuf != nullptr && ebuflen > 0) { + ::strncpy(ebuf, "dll_load: empty filename specified", ebuflen - 1); + } return nullptr; } @@ -1126,7 +1128,9 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { dflags |= RTLD_MEMBER; } - void * result= ::dlopen(filename, dflags); + void* result; + const char* error_report = nullptr; + result = Aix_dlopen(filename, dflags, &error_report); if (result != nullptr) { Events::log_dll_message(nullptr, "Loaded shared library %s", filename); // Reload dll cache. Don't do this in signal handling. @@ -1135,7 +1139,6 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { return result; } else { // error analysis when dlopen fails - const char* error_report = ::dlerror(); if (error_report == nullptr) { error_report = "dlerror returned no error description"; } @@ -3021,31 +3024,3 @@ void os::jfr_report_memory_info() {} #endif // INCLUDE_JFR -// Simulate the library search algorithm of dlopen() (in os::dll_load) -int os::Aix::stat64x_via_LIBPATH(const char* path, struct stat64x* stat) { - if (path[0] == '/' || - (path[0] == '.' && (path[1] == '/' || - (path[1] == '.' && path[2] == '/')))) { - return stat64x(path, stat); - } - - const char* env = getenv("LIBPATH"); - if (env == nullptr || *env == 0) - return -1; - - int ret = -1; - size_t libpathlen = strlen(env); - char* libpath = NEW_C_HEAP_ARRAY(char, libpathlen + 1, mtServiceability); - char* combined = NEW_C_HEAP_ARRAY(char, libpathlen + strlen(path) + 1, mtServiceability); - char *saveptr, *token; - strcpy(libpath, env); - for (token = strtok_r(libpath, ":", &saveptr); token != nullptr; token = strtok_r(nullptr, ":", &saveptr)) { - sprintf(combined, "%s/%s", token, path); - if (0 == (ret = stat64x(combined, stat))) - break; - } - - FREE_C_HEAP_ARRAY(char*, combined); - FREE_C_HEAP_ARRAY(char*, libpath); - return ret; -} diff --git a/src/hotspot/os/aix/os_aix.hpp b/src/hotspot/os/aix/os_aix.hpp index f2596874b05..a1db2b2be3c 100644 --- a/src/hotspot/os/aix/os_aix.hpp +++ b/src/hotspot/os/aix/os_aix.hpp @@ -175,8 +175,6 @@ class os::Aix { static bool platform_print_native_stack(outputStream* st, const void* context, char *buf, int buf_size, address& lastpc); static void* resolve_function_descriptor(void* p); - // Simulate the library search algorithm of dlopen() (in os::dll_load) - static int stat64x_via_LIBPATH(const char* path, struct stat64x* stat); }; #endif // OS_AIX_OS_AIX_HPP diff --git a/src/hotspot/os/aix/porting_aix.cpp b/src/hotspot/os/aix/porting_aix.cpp index ab84dc81027..68233097b49 100644 --- a/src/hotspot/os/aix/porting_aix.cpp +++ b/src/hotspot/os/aix/porting_aix.cpp @@ -21,6 +21,12 @@ * questions. * */ +// needs to be defined first, so that the implicit loaded xcoff.h header defines +// the right structures to analyze the loader header of 64 Bit executable files +// this is needed for rtv_linkedin_libpath() to get the linked (burned) in library +// search path of an XCOFF executable +#define __XCOFF64__ +#include #include "asm/assembler.hpp" #include "compiler/disassembler.hpp" @@ -891,3 +897,275 @@ bool AixMisc::query_stack_bounds_for_current_thread(stackbounds_t* out) { return true; } + +// variables needed to emulate linux behavior in os::dll_load() if library is loaded twice +static pthread_mutex_t g_handletable_mutex = PTHREAD_MUTEX_INITIALIZER; + +struct TableLocker { + TableLocker() { pthread_mutex_lock(&g_handletable_mutex); } + ~TableLocker() { pthread_mutex_unlock(&g_handletable_mutex); } +}; +struct handletableentry{ + void* handle; + ino64_t inode; + dev64_t devid; + uint refcount; +}; +constexpr unsigned init_num_handles = 128; +static unsigned max_handletable = 0; +static unsigned g_handletable_used = 0; +// We start with an empty array. At first use we will dynamically allocate memory for 128 entries. +// If this table is full we dynamically reallocate a memory reagion of double size, and so on. +static struct handletableentry* p_handletable = nullptr; + +// get the library search path burned in to the executable file during linking +// If the libpath cannot be retrieved return an empty path +static const char* rtv_linkedin_libpath() { + constexpr int bufsize = 4096; + static char buffer[bufsize]; + static const char* libpath = 0; + + // we only try to retrieve the libpath once. After that try we + // let libpath point to buffer, which then contains a valid libpath + // or an empty string + if (libpath != nullptr) { + return libpath; + } + + // retrieve the path to the currently running executable binary + // to open it + snprintf(buffer, 100, "/proc/%ld/object/a.out", (long)getpid()); + FILE* f = nullptr; + struct xcoffhdr the_xcoff; + struct scnhdr the_scn; + struct ldhdr the_ldr; + constexpr size_t xcoffsz = FILHSZ + _AOUTHSZ_EXEC; + STATIC_ASSERT(sizeof(the_xcoff) == xcoffsz); + STATIC_ASSERT(sizeof(the_scn) == SCNHSZ); + STATIC_ASSERT(sizeof(the_ldr) == LDHDRSZ); + // read the generic XCOFF header and analyze the substructures + // to find the burned in libpath. In any case of error perform the assert + if (nullptr == (f = fopen(buffer, "r")) || + xcoffsz != fread(&the_xcoff, 1, xcoffsz, f) || + the_xcoff.filehdr.f_magic != U64_TOCMAGIC || + 0 != fseek(f, (FILHSZ + the_xcoff.filehdr.f_opthdr + (the_xcoff.aouthdr.o_snloader -1)*SCNHSZ), SEEK_SET) || + SCNHSZ != fread(&the_scn, 1, SCNHSZ, f) || + 0 != strcmp(the_scn.s_name, ".loader") || + 0 != fseek(f, the_scn.s_scnptr, SEEK_SET) || + LDHDRSZ != fread(&the_ldr, 1, LDHDRSZ, f) || + 0 != fseek(f, the_scn.s_scnptr + the_ldr.l_impoff, SEEK_SET) || + 0 == fread(buffer, 1, bufsize, f)) { + buffer[0] = 0; + assert(false, "could not retrieve burned in library path from executables loader section"); + } + + if (f) { + fclose(f); + } + libpath = buffer; + + return libpath; +} + +// Simulate the library search algorithm of dlopen() (in os::dll_load) +static bool search_file_in_LIBPATH(const char* path, struct stat64x* stat) { + if (path == nullptr) + return false; + + char* path2 = os::strdup(path); + // if exist, strip off trailing (shr_64.o) or similar + char* substr; + if (path2[strlen(path2) - 1] == ')' && (substr = strrchr(path2, '('))) { + *substr = 0; + } + + bool ret = false; + // If FilePath contains a slash character, FilePath is used directly, + // and no directories are searched. + // But if FilePath does not start with / or . we have to prepend it with ./ + if (strchr(path2, '/')) { + stringStream combined; + if (*path2 == '/' || *path2 == '.') { + combined.print("%s", path2); + } else { + combined.print("./%s", path2); + } + ret = (0 == stat64x(combined.base(), stat)); + os::free(path2); + return ret; + } + + const char* env = getenv("LIBPATH"); + if (env == nullptr) { + // no LIBPATH, try with LD_LIBRARY_PATH + env = getenv("LD_LIBRARY_PATH"); + } + + stringStream Libpath; + if (env == nullptr) { + // no LIBPATH or LD_LIBRARY_PATH given -> try only with burned in libpath + Libpath.print("%s", rtv_linkedin_libpath()); + } else if (*env == 0) { + // LIBPATH or LD_LIBRARY_PATH given but empty -> try first with burned + // in libpath and with current working directory second + Libpath.print("%s:.", rtv_linkedin_libpath()); + } else { + // LIBPATH or LD_LIBRARY_PATH given with content -> try first with + // LIBPATH or LD_LIBRARY_PATH and second with burned in libpath. + // No check against current working directory + Libpath.print("%s:%s", env, rtv_linkedin_libpath()); + } + + char* libpath = os::strdup(Libpath.base()); + + char *saveptr, *token; + for (token = strtok_r(libpath, ":", &saveptr); token != nullptr; token = strtok_r(nullptr, ":", &saveptr)) { + stringStream combined; + combined.print("%s/%s", token, path2); + if ((ret = (0 == stat64x(combined.base(), stat)))) + break; + } + + os::free(libpath); + os::free(path2); + return ret; +} + +// specific AIX versions for ::dlopen() and ::dlclose(), which handles the struct g_handletable +// This way we mimic dl handle equality for a library +// opened a second time, as it is implemented on other platforms. +void* Aix_dlopen(const char* filename, int Flags, const char** error_report) { + assert(error_report != nullptr, "error_report is nullptr"); + void* result; + struct stat64x libstat; + + if (false == search_file_in_LIBPATH(filename, &libstat)) { + // file with filename does not exist + #ifdef ASSERT + result = ::dlopen(filename, Flags); + assert(result == nullptr, "dll_load: Could not stat() file %s, but dlopen() worked; Have to improve stat()", filename); + #endif + *error_report = "Could not load module .\nSystem error: No such file or directory"; + return nullptr; + } + else { + unsigned i = 0; + TableLocker lock; + // check if library belonging to filename is already loaded. + // If yes use stored handle from previous ::dlopen() and increase refcount + for (i = 0; i < g_handletable_used; i++) { + if ((p_handletable + i)->handle && + (p_handletable + i)->inode == libstat.st_ino && + (p_handletable + i)->devid == libstat.st_dev) { + (p_handletable + i)->refcount++; + result = (p_handletable + i)->handle; + break; + } + } + if (i == g_handletable_used) { + // library not yet loaded. Check if there is space left in array + // to store new ::dlopen() handle + if (g_handletable_used == max_handletable) { + // No place in array anymore; increase array. + unsigned new_max = MAX2(max_handletable * 2, init_num_handles); + struct handletableentry* new_tab = (struct handletableentry*)::realloc(p_handletable, new_max * sizeof(struct handletableentry)); + assert(new_tab != nullptr, "no more memory for handletable"); + if (new_tab == nullptr) { + *error_report = "dlopen: no more memory for handletable"; + return nullptr; + } + max_handletable = new_max; + p_handletable = new_tab; + } + // Library not yet loaded; load it, then store its handle in handle table + result = ::dlopen(filename, Flags); + if (result != nullptr) { + g_handletable_used++; + (p_handletable + i)->handle = result; + (p_handletable + i)->inode = libstat.st_ino; + (p_handletable + i)->devid = libstat.st_dev; + (p_handletable + i)->refcount = 1; + } + else { + // error analysis when dlopen fails + *error_report = ::dlerror(); + if (*error_report == nullptr) { + *error_report = "dlerror returned no error description"; + } + } + } + } + return result; +} + +bool os::pd_dll_unload(void* libhandle, char* ebuf, int ebuflen) { + unsigned i = 0; + bool res = false; + + if (ebuf && ebuflen > 0) { + ebuf[0] = '\0'; + ebuf[ebuflen - 1] = '\0'; + } + + { + TableLocker lock; + // try to find handle in array, which means library was loaded by os::dll_load() call + for (i = 0; i < g_handletable_used; i++) { + if ((p_handletable + i)->handle == libhandle) { + // handle found, decrease refcount + assert((p_handletable + i)->refcount > 0, "Sanity"); + (p_handletable + i)->refcount--; + if ((p_handletable + i)->refcount > 0) { + // if refcount is still >0 then we have to keep library and just return true + return true; + } + // refcount == 0, so we have to ::dlclose() the lib + // and delete the entry from the array. + break; + } + } + + // If we reach this point either the libhandle was found with refcount == 0, or the libhandle + // was not found in the array at all. In both cases we have to ::dlclose the lib and perform + // the error handling. In the first case we then also have to delete the entry from the array + // while in the second case we simply have to nag. + res = (0 == ::dlclose(libhandle)); + if (!res) { + // error analysis when dlopen fails + const char* error_report = ::dlerror(); + if (error_report == nullptr) { + error_report = "dlerror returned no error description"; + } + if (ebuf != nullptr && ebuflen > 0) { + snprintf(ebuf, ebuflen - 1, "%s", error_report); + } + assert(false, "os::pd_dll_unload() ::dlclose() failed"); + } + + if (i < g_handletable_used) { + if (res) { + // First case: libhandle was found (with refcount == 0) and ::dlclose successful, + // so delete entry from array + g_handletable_used--; + // If the entry was the last one of the array, the previous g_handletable_used-- + // is sufficient to remove the entry from the array, otherwise we move the last + // entry of the array to the place of the entry we want to remove and overwrite it + if (i < g_handletable_used) { + *(p_handletable + i) = *(p_handletable + g_handletable_used); + (p_handletable + g_handletable_used)->handle = nullptr; + } + } + } + else { + // Second case: libhandle was not found (library was not loaded by os::dll_load()) + // therefore nag + assert(false, "os::pd_dll_unload() library was not loaded by os::dll_load()"); + } + } + + // Update the dll cache + LoadedLibraries::reload(); + + return res; +} // end: os::pd_dll_unload() + diff --git a/src/hotspot/os/aix/porting_aix.hpp b/src/hotspot/os/aix/porting_aix.hpp index 2c4c0e002a8..109eceee3fc 100644 --- a/src/hotspot/os/aix/porting_aix.hpp +++ b/src/hotspot/os/aix/porting_aix.hpp @@ -115,4 +115,6 @@ class AixMisc { }; +void* Aix_dlopen(const char* filename, int Flags, const char** error_report); + #endif // OS_AIX_PORTING_AIX_HPP diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index ec8fd440bf3..4a2922cb728 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -2488,3 +2488,25 @@ void os::jfr_report_memory_info() { } #endif // INCLUDE_JFR + +bool os::pd_dll_unload(void* libhandle, char* ebuf, int ebuflen) { + + if (ebuf && ebuflen > 0) { + ebuf[0] = '\0'; + ebuf[ebuflen - 1] = '\0'; + } + + bool res = (0 == ::dlclose(libhandle)); + if (!res) { + // error analysis when dlopen fails + const char* error_report = ::dlerror(); + if (error_report == nullptr) { + error_report = "dlerror returned no error description"; + } + if (ebuf != nullptr && ebuflen > 0) { + snprintf(ebuf, ebuflen - 1, "%s", error_report); + } + } + + return res; +} // end: os::pd_dll_unload() diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index bde690d70de..aa8be1d897d 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -5570,3 +5570,25 @@ bool os::trim_native_heap(os::size_change_t* rss_change) { return false; // musl #endif } + +bool os::pd_dll_unload(void* libhandle, char* ebuf, int ebuflen) { + + if (ebuf && ebuflen > 0) { + ebuf[0] = '\0'; + ebuf[ebuflen - 1] = '\0'; + } + + bool res = (0 == ::dlclose(libhandle)); + if (!res) { + // error analysis when dlopen fails + const char* error_report = ::dlerror(); + if (error_report == nullptr) { + error_report = "dlerror returned no error description"; + } + if (ebuf != nullptr && ebuflen > 0) { + snprintf(ebuf, ebuflen - 1, "%s", error_report); + } + } + + return res; +} // end: os::pd_dll_unload() diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 4fc82471c2d..af7de184b14 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -50,6 +50,7 @@ #include "utilities/vmError.hpp" #ifdef AIX #include "loadlib_aix.hpp" +#include "os_aix.hpp" #endif #ifdef LINUX #include "os_linux.hpp" @@ -734,25 +735,20 @@ void os::dll_unload(void *lib) { if (l_path == nullptr) { l_path = ""; } - int res = ::dlclose(lib); - if (res == 0) { + char ebuf[1024]; + bool res = os::pd_dll_unload(lib, ebuf, sizeof(ebuf)); + + if (res) { Events::log_dll_message(nullptr, "Unloaded shared library \"%s\" [" INTPTR_FORMAT "]", l_path, p2i(lib)); log_info(os)("Unloaded shared library \"%s\" [" INTPTR_FORMAT "]", l_path, p2i(lib)); } else { - const char* error_report = ::dlerror(); - if (error_report == nullptr) { - error_report = "dlerror returned no error description"; - } - Events::log_dll_message(nullptr, "Attempt to unload shared library \"%s\" [" INTPTR_FORMAT "] failed, %s", - l_path, p2i(lib), error_report); + l_path, p2i(lib), ebuf); log_info(os)("Attempt to unload shared library \"%s\" [" INTPTR_FORMAT "] failed, %s", - l_path, p2i(lib), error_report); + l_path, p2i(lib), ebuf); } - // Update the dll cache - AIX_ONLY(LoadedLibraries::reload()); LINUX_ONLY(os::free(l_pathdup)); } diff --git a/src/hotspot/share/prims/jvmtiAgent.cpp b/src/hotspot/share/prims/jvmtiAgent.cpp index 86c5a32a1df..f70935982b5 100644 --- a/src/hotspot/share/prims/jvmtiAgent.cpp +++ b/src/hotspot/share/prims/jvmtiAgent.cpp @@ -74,10 +74,6 @@ JvmtiAgent::JvmtiAgent(const char* name, const char* options, bool is_absolute_p _options(copy_string(options)), _os_lib(nullptr), _os_lib_path(nullptr), -#ifdef AIX - _inode(0), - _device(0), -#endif _jplis(nullptr), _loaded(false), _absolute_path(is_absolute_path), @@ -122,24 +118,6 @@ const char* JvmtiAgent::os_lib_path() const { return _os_lib_path; } -#ifdef AIX -void JvmtiAgent::set_inode(ino64_t inode) { - _inode = inode; -} - -void JvmtiAgent::set_device(dev64_t device) { - _device = device; -} - -ino64_t JvmtiAgent::inode() const { - return _inode; -} - -dev64_t JvmtiAgent::device() const { - return _device; -} -#endif - bool JvmtiAgent::is_loaded() const { return _loaded; } @@ -294,20 +272,6 @@ static bool load_agent_from_executable(JvmtiAgent* agent, const char* on_load_sy return os::find_builtin_agent(agent, &on_load_symbols[0], num_symbol_entries); } -#ifdef AIX -// save the inode and device of the library's file as a signature. This signature can be used -// in the same way as the library handle as a signature on other platforms. -static void save_library_signature(JvmtiAgent* agent, const char* name) { - struct stat64x libstat; - if (0 == os::Aix::stat64x_via_LIBPATH(name, &libstat)) { - agent->set_inode(libstat.st_ino); - agent->set_device(libstat.st_dev); - } else { - assert(false, "stat64x failed"); - } -} -#endif - // Load the library from the absolute path of the agent, if available. static void* load_agent_from_absolute_path(JvmtiAgent* agent, bool vm_exit_on_error) { DEBUG_ONLY(assert_preload(agent);) @@ -317,7 +281,6 @@ static void* load_agent_from_absolute_path(JvmtiAgent* agent, bool vm_exit_on_er if (library == nullptr && vm_exit_on_error) { vm_exit(agent, " in absolute path, with error: ", nullptr); } - AIX_ONLY(if (library != nullptr) save_library_signature(agent, agent->name());) return library; } @@ -330,13 +293,11 @@ static void* load_agent_from_relative_path(JvmtiAgent* agent, bool vm_exit_on_er // Try to load the agent from the standard dll directory if (os::dll_locate_lib(&buffer[0], sizeof buffer, Arguments::get_dll_dir(), name)) { library = os::dll_load(&buffer[0], &ebuf[0], sizeof ebuf); - AIX_ONLY(if (library != nullptr) save_library_signature(agent, &buffer[0]);) } if (library == nullptr && os::dll_build_name(&buffer[0], sizeof buffer, name)) { // Try the library path directory. library = os::dll_load(&buffer[0], &ebuf[0], sizeof ebuf); if (library != nullptr) { - AIX_ONLY(save_library_signature(agent, &buffer[0]);) return library; } if (vm_exit_on_error) { @@ -554,11 +515,7 @@ static bool invoke_Agent_OnAttach(JvmtiAgent* agent, outputStream* st) { agent->set_os_lib_path(&buffer[0]); agent->set_os_lib(library); agent->set_loaded(); - #ifdef AIX - previously_loaded = JvmtiAgentList::is_dynamic_lib_loaded(agent->device(), agent->inode()); - #else previously_loaded = JvmtiAgentList::is_dynamic_lib_loaded(library); - #endif } // Print warning if agent was not previously loaded and EnableDynamicAgentLoading not enabled on the command line. diff --git a/src/hotspot/share/prims/jvmtiAgent.hpp b/src/hotspot/share/prims/jvmtiAgent.hpp index 95e910354e6..9baf6698868 100644 --- a/src/hotspot/share/prims/jvmtiAgent.hpp +++ b/src/hotspot/share/prims/jvmtiAgent.hpp @@ -43,10 +43,6 @@ class JvmtiAgent : public CHeapObj { const char* _options; void* _os_lib; const char* _os_lib_path; -#ifdef AIX - ino64_t _inode; - dev64_t _device; -#endif const void* _jplis; bool _loaded; bool _absolute_path; @@ -84,12 +80,6 @@ class JvmtiAgent : public CHeapObj { void initialization_end(); const Ticks& initialization_time() const; const Tickspan& initialization_duration() const; -#ifdef AIX - void set_inode(ino64_t inode); - void set_device(dev64_t device); - unsigned long inode() const; - unsigned long device() const; -#endif bool load(outputStream* st = nullptr); void unload(); diff --git a/src/hotspot/share/prims/jvmtiAgentList.cpp b/src/hotspot/share/prims/jvmtiAgentList.cpp index b7312b9b75e..a32eeb7076c 100644 --- a/src/hotspot/share/prims/jvmtiAgentList.cpp +++ b/src/hotspot/share/prims/jvmtiAgentList.cpp @@ -243,19 +243,6 @@ bool JvmtiAgentList::is_dynamic_lib_loaded(void* os_lib) { } return false; } -#ifdef AIX -bool JvmtiAgentList::is_dynamic_lib_loaded(dev64_t device, ino64_t inode) { - JvmtiAgentList::Iterator it = JvmtiAgentList::agents(); - while (it.has_next()) { - JvmtiAgent* const agent = it.next(); - if (!agent->is_static_lib() && device != 0 && inode != 0 && - agent->device() == device && agent->inode() == inode) { - return true; - } - } - return false; -} -#endif static bool match(JvmtiEnv* env, const JvmtiAgent* agent, const void* os_module_address) { assert(env != nullptr, "invariant"); diff --git a/src/hotspot/share/prims/jvmtiAgentList.hpp b/src/hotspot/share/prims/jvmtiAgentList.hpp index 95dad006ec3..cf698c69c01 100644 --- a/src/hotspot/share/prims/jvmtiAgentList.hpp +++ b/src/hotspot/share/prims/jvmtiAgentList.hpp @@ -78,9 +78,6 @@ class JvmtiAgentList : AllStatic { static bool is_static_lib_loaded(const char* name); static bool is_dynamic_lib_loaded(void* os_lib); -#ifdef AIX - static bool is_dynamic_lib_loaded(dev64_t device, ino64_t inode); -#endif static JvmtiAgent* lookup(JvmtiEnv* env, void* f_ptr); diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index 9dbf895965a..f445669ab23 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -1055,6 +1055,7 @@ class os: AllStatic { char pathSep); static bool set_boot_path(char fileSep, char pathSep); + static bool pd_dll_unload(void* libhandle, char* ebuf, int ebuflen); }; // Note that "PAUSE" is almost always used with synchronization From d6f4f5ed741edc00692267c02380fe7878f47c8e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 19 Feb 2024 15:40:29 +0000 Subject: [PATCH 236/261] 8318737: Fallback linker passes bad JNI handle Backport-of: 3885dc5b9acf08dc90397ab02b814bc72d7b4ed5 --- src/hotspot/share/runtime/jniHandles.cpp | 8 ++----- .../foreign/abi/fallback/LibFallback.java | 9 +++++--- .../native/libfallbackLinker/fallbackLinker.c | 23 ++++++++++++++++--- test/jdk/java/foreign/TestDowncallScope.java | 2 +- test/jdk/java/foreign/TestDowncallStack.java | 2 +- test/jdk/java/foreign/TestUpcallScope.java | 2 +- test/jdk/java/foreign/TestUpcallStack.java | 2 +- 7 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/hotspot/share/runtime/jniHandles.cpp b/src/hotspot/share/runtime/jniHandles.cpp index feceec366a5..25c8aa8b10b 100644 --- a/src/hotspot/share/runtime/jniHandles.cpp +++ b/src/hotspot/share/runtime/jniHandles.cpp @@ -199,13 +199,9 @@ jobjectRefType JNIHandles::handle_type(JavaThread* thread, jobject handle) { default: ShouldNotReachHere(); } - } else { + } else if (is_local_handle(thread, handle) || is_frame_handle(thread, handle)) { // Not in global storage. Might be a local handle. - if (is_local_handle(thread, handle) || is_frame_handle(thread, handle)) { - result = JNILocalRefType; - } else { - ShouldNotReachHere(); - } + result = JNILocalRefType; } return result; } diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java b/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java index f4461fc2f4f..aa0d6151f8b 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/fallback/LibFallback.java @@ -43,11 +43,14 @@ private static boolean tryLoadLibrary() { public Boolean run() { try { System.loadLibrary("fallbackLinker"); - init(); - return true; } catch (UnsatisfiedLinkError ule) { return false; } + if (!init()) { + // library failed to initialize. Do not silently mark as unsupported + throw new ExceptionInInitializerError("Fallback library failed to initialize"); + } + return true; } }); } @@ -195,7 +198,7 @@ private static void checkStatus(int code) { } } - private static native void init(); + private static native boolean init(); private static native long sizeofCif(); diff --git a/src/java.base/share/native/libfallbackLinker/fallbackLinker.c b/src/java.base/share/native/libfallbackLinker/fallbackLinker.c index 7f554d49737..86cbb2e853f 100644 --- a/src/java.base/share/native/libfallbackLinker/fallbackLinker.c +++ b/src/java.base/share/native/libfallbackLinker/fallbackLinker.c @@ -40,12 +40,29 @@ static jclass LibFallback_class; static jmethodID LibFallback_doUpcall_ID; static const char* LibFallback_doUpcall_sig = "(JJLjava/lang/invoke/MethodHandle;)V"; -JNIEXPORT void JNICALL +#define CHECK_NULL(expr) \ + if (expr == NULL) { \ + return JNI_FALSE; \ + } + +JNIEXPORT jboolean JNICALL Java_jdk_internal_foreign_abi_fallback_LibFallback_init(JNIEnv* env, jclass cls) { - (*env)->GetJavaVM(env, &VM); - LibFallback_class = (*env)->FindClass(env, "jdk/internal/foreign/abi/fallback/LibFallback"); + jint result = (*env)->GetJavaVM(env, &VM); + if (result != 0) { + return JNI_FALSE; + } + + jclass LibFallback_class_local = (*env)->FindClass(env, "jdk/internal/foreign/abi/fallback/LibFallback"); + CHECK_NULL(LibFallback_class_local) + + LibFallback_class = (*env)->NewGlobalRef(env, LibFallback_class_local); + CHECK_NULL(LibFallback_class) + LibFallback_doUpcall_ID = (*env)->GetStaticMethodID(env, LibFallback_class, "doUpcall", LibFallback_doUpcall_sig); + CHECK_NULL(LibFallback_doUpcall_ID) + + return JNI_TRUE; } JNIEXPORT jlong JNICALL diff --git a/test/jdk/java/foreign/TestDowncallScope.java b/test/jdk/java/foreign/TestDowncallScope.java index 15ba35e6fb5..22a643750bc 100644 --- a/test/jdk/java/foreign/TestDowncallScope.java +++ b/test/jdk/java/foreign/TestDowncallScope.java @@ -28,7 +28,7 @@ * @modules java.base/jdk.internal.foreign * @build NativeTestHelper CallGeneratorHelper TestDowncallBase * - * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + * @run testng/othervm -Xcheck:jni -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies * --enable-native-access=ALL-UNNAMED -Dgenerator.sample.factor=17 * TestDowncallScope * diff --git a/test/jdk/java/foreign/TestDowncallStack.java b/test/jdk/java/foreign/TestDowncallStack.java index 6279922766b..2c6451e5122 100644 --- a/test/jdk/java/foreign/TestDowncallStack.java +++ b/test/jdk/java/foreign/TestDowncallStack.java @@ -28,7 +28,7 @@ * @modules java.base/jdk.internal.foreign * @build NativeTestHelper CallGeneratorHelper TestDowncallBase * - * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + * @run testng/othervm -Xcheck:jni -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies * --enable-native-access=ALL-UNNAMED -Dgenerator.sample.factor=17 * TestDowncallStack */ diff --git a/test/jdk/java/foreign/TestUpcallScope.java b/test/jdk/java/foreign/TestUpcallScope.java index b00aa406c99..005372a233a 100644 --- a/test/jdk/java/foreign/TestUpcallScope.java +++ b/test/jdk/java/foreign/TestUpcallScope.java @@ -28,7 +28,7 @@ * @modules java.base/jdk.internal.foreign * @build NativeTestHelper CallGeneratorHelper TestUpcallBase * - * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + * @run testng/othervm -Xcheck:jni -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies * --enable-native-access=ALL-UNNAMED -Dgenerator.sample.factor=17 * TestUpcallScope */ diff --git a/test/jdk/java/foreign/TestUpcallStack.java b/test/jdk/java/foreign/TestUpcallStack.java index cea15bd9d8c..07dd2346db3 100644 --- a/test/jdk/java/foreign/TestUpcallStack.java +++ b/test/jdk/java/foreign/TestUpcallStack.java @@ -28,7 +28,7 @@ * @modules java.base/jdk.internal.foreign * @build NativeTestHelper CallGeneratorHelper TestUpcallBase * - * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + * @run testng/othervm -Xcheck:jni -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies * --enable-native-access=ALL-UNNAMED -Dgenerator.sample.factor=17 * TestUpcallStack */ From a9792a8420b4fb04fceb9924ae810140c928b7ec Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Mon, 19 Feb 2024 15:47:35 +0000 Subject: [PATCH 237/261] 8324874: AArch64: crypto pmull based CRC32/CRC32C intrinsics clobber V8-V15 registers Backport-of: 4cd318756d4a8de64d25fb6512ecba9a008edfa1 --- .../cpu/aarch64/macroAssembler_aarch64.cpp | 173 +++++++++--------- .../intrinsics/zip/TestFpRegsABI.java | 163 +++++++++++++++++ 2 files changed, 254 insertions(+), 82 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/intrinsics/zip/TestFpRegsABI.java diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 8f07289ae44..5a90cf189ce 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -4156,108 +4156,117 @@ void MacroAssembler::kernel_crc32_common_fold_using_crypto_pmull(Register crc, R } add(table, table, table_offset); + // Registers v0..v7 are used as data registers. + // Registers v16..v31 are used as tmp registers. sub(buf, buf, 0x10); - ldrq(v1, Address(buf, 0x10)); - ldrq(v2, Address(buf, 0x20)); - ldrq(v3, Address(buf, 0x30)); - ldrq(v4, Address(buf, 0x40)); - ldrq(v5, Address(buf, 0x50)); - ldrq(v6, Address(buf, 0x60)); - ldrq(v7, Address(buf, 0x70)); - ldrq(v8, Address(pre(buf, 0x80))); - - movi(v25, T4S, 0); - mov(v25, S, 0, crc); - eor(v1, T16B, v1, v25); - - ldrq(v0, Address(table)); + ldrq(v0, Address(buf, 0x10)); + ldrq(v1, Address(buf, 0x20)); + ldrq(v2, Address(buf, 0x30)); + ldrq(v3, Address(buf, 0x40)); + ldrq(v4, Address(buf, 0x50)); + ldrq(v5, Address(buf, 0x60)); + ldrq(v6, Address(buf, 0x70)); + ldrq(v7, Address(pre(buf, 0x80))); + + movi(v31, T4S, 0); + mov(v31, S, 0, crc); + eor(v0, T16B, v0, v31); + + // Register v16 contains constants from the crc table. + ldrq(v16, Address(table)); b(CRC_by128_loop); align(OptoLoopAlignment); BIND(CRC_by128_loop); - pmull (v9, T1Q, v1, v0, T1D); - pmull2(v10, T1Q, v1, v0, T2D); - ldrq(v1, Address(buf, 0x10)); - eor3(v1, T16B, v9, v10, v1); - - pmull (v11, T1Q, v2, v0, T1D); - pmull2(v12, T1Q, v2, v0, T2D); - ldrq(v2, Address(buf, 0x20)); - eor3(v2, T16B, v11, v12, v2); - - pmull (v13, T1Q, v3, v0, T1D); - pmull2(v14, T1Q, v3, v0, T2D); - ldrq(v3, Address(buf, 0x30)); - eor3(v3, T16B, v13, v14, v3); - - pmull (v15, T1Q, v4, v0, T1D); - pmull2(v16, T1Q, v4, v0, T2D); - ldrq(v4, Address(buf, 0x40)); - eor3(v4, T16B, v15, v16, v4); - - pmull (v17, T1Q, v5, v0, T1D); - pmull2(v18, T1Q, v5, v0, T2D); - ldrq(v5, Address(buf, 0x50)); - eor3(v5, T16B, v17, v18, v5); - - pmull (v19, T1Q, v6, v0, T1D); - pmull2(v20, T1Q, v6, v0, T2D); - ldrq(v6, Address(buf, 0x60)); - eor3(v6, T16B, v19, v20, v6); - - pmull (v21, T1Q, v7, v0, T1D); - pmull2(v22, T1Q, v7, v0, T2D); - ldrq(v7, Address(buf, 0x70)); - eor3(v7, T16B, v21, v22, v7); - - pmull (v23, T1Q, v8, v0, T1D); - pmull2(v24, T1Q, v8, v0, T2D); - ldrq(v8, Address(pre(buf, 0x80))); - eor3(v8, T16B, v23, v24, v8); + pmull (v17, T1Q, v0, v16, T1D); + pmull2(v18, T1Q, v0, v16, T2D); + ldrq(v0, Address(buf, 0x10)); + eor3(v0, T16B, v17, v18, v0); + + pmull (v19, T1Q, v1, v16, T1D); + pmull2(v20, T1Q, v1, v16, T2D); + ldrq(v1, Address(buf, 0x20)); + eor3(v1, T16B, v19, v20, v1); + + pmull (v21, T1Q, v2, v16, T1D); + pmull2(v22, T1Q, v2, v16, T2D); + ldrq(v2, Address(buf, 0x30)); + eor3(v2, T16B, v21, v22, v2); + + pmull (v23, T1Q, v3, v16, T1D); + pmull2(v24, T1Q, v3, v16, T2D); + ldrq(v3, Address(buf, 0x40)); + eor3(v3, T16B, v23, v24, v3); + + pmull (v25, T1Q, v4, v16, T1D); + pmull2(v26, T1Q, v4, v16, T2D); + ldrq(v4, Address(buf, 0x50)); + eor3(v4, T16B, v25, v26, v4); + + pmull (v27, T1Q, v5, v16, T1D); + pmull2(v28, T1Q, v5, v16, T2D); + ldrq(v5, Address(buf, 0x60)); + eor3(v5, T16B, v27, v28, v5); + + pmull (v29, T1Q, v6, v16, T1D); + pmull2(v30, T1Q, v6, v16, T2D); + ldrq(v6, Address(buf, 0x70)); + eor3(v6, T16B, v29, v30, v6); + + // Reuse registers v23, v24. + // Using them won't block the first instruction of the next iteration. + pmull (v23, T1Q, v7, v16, T1D); + pmull2(v24, T1Q, v7, v16, T2D); + ldrq(v7, Address(pre(buf, 0x80))); + eor3(v7, T16B, v23, v24, v7); subs(len, len, 0x80); br(Assembler::GE, CRC_by128_loop); // fold into 512 bits - ldrq(v0, Address(table, 0x10)); + // Use v31 for constants because v16 can be still in use. + ldrq(v31, Address(table, 0x10)); - pmull (v10, T1Q, v1, v0, T1D); - pmull2(v11, T1Q, v1, v0, T2D); - eor3(v1, T16B, v10, v11, v5); + pmull (v17, T1Q, v0, v31, T1D); + pmull2(v18, T1Q, v0, v31, T2D); + eor3(v0, T16B, v17, v18, v4); - pmull (v12, T1Q, v2, v0, T1D); - pmull2(v13, T1Q, v2, v0, T2D); - eor3(v2, T16B, v12, v13, v6); + pmull (v19, T1Q, v1, v31, T1D); + pmull2(v20, T1Q, v1, v31, T2D); + eor3(v1, T16B, v19, v20, v5); - pmull (v14, T1Q, v3, v0, T1D); - pmull2(v15, T1Q, v3, v0, T2D); - eor3(v3, T16B, v14, v15, v7); + pmull (v21, T1Q, v2, v31, T1D); + pmull2(v22, T1Q, v2, v31, T2D); + eor3(v2, T16B, v21, v22, v6); - pmull (v16, T1Q, v4, v0, T1D); - pmull2(v17, T1Q, v4, v0, T2D); - eor3(v4, T16B, v16, v17, v8); + pmull (v23, T1Q, v3, v31, T1D); + pmull2(v24, T1Q, v3, v31, T2D); + eor3(v3, T16B, v23, v24, v7); // fold into 128 bits - ldrq(v5, Address(table, 0x20)); - pmull (v10, T1Q, v1, v5, T1D); - pmull2(v11, T1Q, v1, v5, T2D); - eor3(v4, T16B, v4, v10, v11); - - ldrq(v6, Address(table, 0x30)); - pmull (v12, T1Q, v2, v6, T1D); - pmull2(v13, T1Q, v2, v6, T2D); - eor3(v4, T16B, v4, v12, v13); - - ldrq(v7, Address(table, 0x40)); - pmull (v14, T1Q, v3, v7, T1D); - pmull2(v15, T1Q, v3, v7, T2D); - eor3(v1, T16B, v4, v14, v15); + // Use v17 for constants because v31 can be still in use. + ldrq(v17, Address(table, 0x20)); + pmull (v25, T1Q, v0, v17, T1D); + pmull2(v26, T1Q, v0, v17, T2D); + eor3(v3, T16B, v3, v25, v26); + + // Use v18 for constants because v17 can be still in use. + ldrq(v18, Address(table, 0x30)); + pmull (v27, T1Q, v1, v18, T1D); + pmull2(v28, T1Q, v1, v18, T2D); + eor3(v3, T16B, v3, v27, v28); + + // Use v19 for constants because v18 can be still in use. + ldrq(v19, Address(table, 0x40)); + pmull (v29, T1Q, v2, v19, T1D); + pmull2(v30, T1Q, v2, v19, T2D); + eor3(v0, T16B, v3, v29, v30); add(len, len, 0x80); add(buf, buf, 0x10); - mov(tmp0, v1, D, 0); - mov(tmp1, v1, D, 1); + mov(tmp0, v0, D, 0); + mov(tmp1, v0, D, 1); } SkipIfEqual::SkipIfEqual( diff --git a/test/hotspot/jtreg/compiler/intrinsics/zip/TestFpRegsABI.java b/test/hotspot/jtreg/compiler/intrinsics/zip/TestFpRegsABI.java new file mode 100644 index 00000000000..46ecb64096b --- /dev/null +++ b/test/hotspot/jtreg/compiler/intrinsics/zip/TestFpRegsABI.java @@ -0,0 +1,163 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * @test TestFpRegsABI + * @bug 8324874 + * @summary ABI for the Arm 64-bit Architecture requires to preserve registers v8-v15 by a callee across subroutine calls + * + * @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileCommand=inline,*::calcValue compiler.intrinsics.zip.TestFpRegsABI + * @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileCommand=dontinline,*::calcValue compiler.intrinsics.zip.TestFpRegsABI + * @run main/othervm -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xbatch -XX:CompileCommand=inline,*::calcValue compiler.intrinsics.zip.TestFpRegsABI + * @run main/othervm -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xbatch -XX:CompileCommand=dontinline,*::calcValue compiler.intrinsics.zip.TestFpRegsABI + * @run main/othervm -Xbatch -XX:CompileCommand=inline,*::calcValue compiler.intrinsics.zip.TestFpRegsABI + * @run main/othervm -Xbatch -XX:CompileCommand=dontinline,*::calcValue compiler.intrinsics.zip.TestFpRegsABI + * @run main/othervm -Xint compiler.intrinsics.zip.TestFpRegsABI + */ + +package compiler.intrinsics.zip; + +import java.util.zip.Checksum; +import java.util.zip.CRC32; +import java.util.zip.CRC32C; + +public class TestFpRegsABI { + private static byte[] buf; + + static { + buf = new byte[1024]; + for (int i = 0; i < buf.length; ++i) { + buf[i] = (byte)i; + } + } + + private static class RegressionTest { + Checksum checksum; + + RegressionTest(Checksum checksum) { + this.checksum = checksum; + } + + public void run(byte[] buf, long expectedValue) { + for (int i = 0; i < 20_000; ++i) { + runIteration(buf, expectedValue); + } + } + + // If checksum intrinsic does not save fp registers as ABI requires, + // the second call of calcValue might produce a wrong result. + private void runIteration(byte[] buf, long expectedValue) { + int v1 = calcValue(buf); + checksum.reset(); + checksum.update(buf, 0, buf.length); + long checksumValue = checksum.getValue(); + if (checksumValue != expectedValue) { + System.err.printf("ERROR: checksum = 0x%016x, expected = 0x%016x\n", + checksumValue, expectedValue); + throw new RuntimeException("Checksum Error"); + } + int v2 = calcValue(buf); + if (v1 != v2) { + throw new RuntimeException("Expect v2(" + v2 + ") to equal v1(" + v1 + ")"); + } + } + + private int calcValue(byte[] buf) { + return (int)(2.5 * buf.length); + } + } + + private static class TestIntrinsic { + Checksum checksum; + + TestIntrinsic(Checksum checksum) { + this.checksum = checksum; + } + + public void run(byte[] buf, long expectedValue) { + for (int i = 0; i < 20_000; ++i) { + runIteration(buf, expectedValue); + } + } + + // If checksum intrinsic does not save fp registers as ABI requires, + // the second call of calcValue might produce a wrong result. + private void runIteration(byte[] buf, long expectedValue) { + int v1 = calcValue(buf); + checksum.reset(); + checksum.update(buf, 0, buf.length); + long checksumValue = checksum.getValue(); + if (checksumValue != expectedValue) { + System.err.printf("ERROR: checksum = 0x%016x, expected = 0x%016x\n", + checksumValue, expectedValue); + throw new RuntimeException("Checksum Error"); + } + int v2 = calcValue(buf); + if (v1 != v2) { + throw new RuntimeException("Expect v2(" + v2 + ") to equal v1(" + v1 + ")"); + } + } + + // ABI can require some fp registers to be saved by a callee, e.g. v8-15 in ARM64 ABI. + // We create fp register pressure to get as many fp registers used as possible. + private int calcValue(byte[] buf) { + double v = 0.0; + for (int i = 24; i <= buf.length; i += 24) { + v += buf[i - 1] * ((double)i - 1.0) + (double)i - 1.0; + v += buf[i - 2] * ((double)i - 2.0) + (double)i - 2.0; + v += buf[i - 3] * ((double)i - 3.0) + (double)i - 3.0; + v += buf[i - 4] * ((double)i - 4.0) + (double)i - 4.0; + v += buf[i - 5] * ((double)i - 5.0) + (double)i - 5.0; + v += buf[i - 6] * ((double)i - 6.0) + (double)i - 6.0; + v += buf[i - 7] * ((double)i - 7.0) + (double)i - 7.0; + v += buf[i - 8] * ((double)i - 8.0) + (double)i - 8.0; + v += buf[i - 9] * ((double)i - 9.0) + (double)i - 9.0; + v += buf[i - 10] * ((double)i - 10.0) + (double)i - 10.0; + v += buf[i - 11] * ((double)i - 11.0) + (double)i - 11.0; + v += buf[i - 12] * ((double)i - 12.0) + (double)i - 12.0; + v += buf[i - 13] * ((double)i - 13.0) + (double)i - 13.0; + v += buf[i - 14] * ((double)i - 14.0) + (double)i - 14.0; + v += buf[i - 15] * ((double)i - 15.0) + (double)i - 15.0; + v += buf[i - 16] * ((double)i - 16.0) + (double)i - 16.0; + v += buf[i - 17] * ((double)i - 17.0) + (double)i - 17.0; + v += buf[i - 18] * ((double)i - 18.0) + (double)i - 18.0; + v += buf[i - 19] * ((double)i - 19.0) + (double)i - 19.0; + v += buf[i - 20] * ((double)i - 20.0) + (double)i - 20.0; + v += buf[i - 21] * ((double)i - 21.0) + (double)i - 21.0; + v += buf[i - 22] * ((double)i - 22.0) + (double)i - 22.0; + v += buf[i - 23] * ((double)i - 23.0) + (double)i - 23.0; + v += buf[i - 24] * ((double)i - 24.0) + (double)i - 24.0; + } + return (int)v; + } + } + + public static void main(final String[] argv) { + new TestIntrinsic(new CRC32()).run(buf, 0x00000000b70b4c26L); + new TestIntrinsic(new CRC32C()).run(buf, 0x000000002cdf6e8fL); + new RegressionTest(new CRC32()).run(buf, 0x00000000b70b4c26L); + new RegressionTest(new CRC32C()).run(buf, 0x000000002cdf6e8fL); + } +} + From 4fcc5c74860aa04c634c282db19d8ed64cd526b5 Mon Sep 17 00:00:00 2001 From: Ilya Gavrilin Date: Tue, 20 Feb 2024 11:26:42 +0000 Subject: [PATCH 238/261] 8322790: RISC-V: Tune costs for shuffles with no conversion Backport-of: 2acb5bd9924511b58b0e57ea9eb6c2dee9fd3ee8 --- src/hotspot/cpu/riscv/riscv.ad | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index 521c97b9fc8..e63ff695a86 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -981,6 +981,7 @@ definitions %{ int_def LOAD_COST ( 300, 3 * DEFAULT_COST); // load, fpload int_def STORE_COST ( 100, 1 * DEFAULT_COST); // store, fpstore int_def XFER_COST ( 300, 3 * DEFAULT_COST); // mfc, mtc, fcvt, fmove, fcmp + int_def FMVX_COST ( 100, 1 * DEFAULT_COST); // shuffles with no conversion int_def BRANCH_COST ( 200, 2 * DEFAULT_COST); // branch, jmp, call int_def IMUL_COST ( 1000, 10 * DEFAULT_COST); // imul int_def IDIVSI_COST ( 3400, 34 * DEFAULT_COST); // idivdi @@ -8483,7 +8484,7 @@ instruct MoveF2I_reg_reg(iRegINoSp dst, fRegF src) %{ effect(DEF dst, USE src); - ins_cost(XFER_COST); + ins_cost(FMVX_COST); format %{ "fmv.x.w $dst, $src\t#@MoveL2D_reg_stack" %} @@ -8501,7 +8502,7 @@ instruct MoveI2F_reg_reg(fRegF dst, iRegI src) %{ effect(DEF dst, USE src); - ins_cost(XFER_COST); + ins_cost(FMVX_COST); format %{ "fmv.w.x $dst, $src\t#@MoveI2F_reg_reg" %} @@ -8519,7 +8520,7 @@ instruct MoveD2L_reg_reg(iRegLNoSp dst, fRegD src) %{ effect(DEF dst, USE src); - ins_cost(XFER_COST); + ins_cost(FMVX_COST); format %{ "fmv.x.d $dst, $src\t#@MoveD2L_reg_reg" %} @@ -8537,7 +8538,7 @@ instruct MoveL2D_reg_reg(fRegD dst, iRegL src) %{ effect(DEF dst, USE src); - ins_cost(XFER_COST); + ins_cost(FMVX_COST); format %{ "fmv.d.x $dst, $src\t#@MoveD2L_reg_reg" %} From 90c9f70e7c251d1d044c13d3f48daa292482a0f1 Mon Sep 17 00:00:00 2001 From: Darragh Clarke Date: Wed, 21 Feb 2024 09:52:36 +0000 Subject: [PATCH 239/261] 8314164: java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java fails intermittently in timeout Backport-of: fbaaac63d4ae8d7cc0ec02ab4b5a934824d1fec1 --- .../HttpURLConnection/HttpURLConnectionExpectContinueTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/jdk/java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java b/test/jdk/java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java index b21a47ed1be..c9b8bc85b70 100644 --- a/test/jdk/java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java +++ b/test/jdk/java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, 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 @@ -431,7 +431,6 @@ private HttpURLConnection createConnection() throws Exception { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); - connection.setConnectTimeout(1000); connection.setReadTimeout(5000); connection.setUseCaches(false); connection.setInstanceFollowRedirects(false); From 36569de5e4e7996b76f25d28b80a05813966887a Mon Sep 17 00:00:00 2001 From: Liang Mao Date: Wed, 21 Feb 2024 09:53:47 +0000 Subject: [PATCH 240/261] 8314629: Generational ZGC: Clearing All SoftReferences log line lacks GCId Backport-of: 88dafe564f163ed738a8cb6adc449b94e606999f --- src/hotspot/share/gc/z/zReferenceProcessor.cpp | 8 +++++++- src/hotspot/share/gc/z/zReferenceProcessor.hpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/z/zReferenceProcessor.cpp b/src/hotspot/share/gc/z/zReferenceProcessor.cpp index 1037093523d..df8cb2b0e95 100644 --- a/src/hotspot/share/gc/z/zReferenceProcessor.cpp +++ b/src/hotspot/share/gc/z/zReferenceProcessor.cpp @@ -113,6 +113,7 @@ static void list_append(zaddress& head, zaddress& tail, zaddress reference) { ZReferenceProcessor::ZReferenceProcessor(ZWorkers* workers) : _workers(workers), _soft_reference_policy(nullptr), + _clear_all_soft_refs(false), _encountered_count(), _discovered_count(), _enqueued_count(), @@ -124,8 +125,9 @@ void ZReferenceProcessor::set_soft_reference_policy(bool clear) { static AlwaysClearPolicy always_clear_policy; static LRUMaxHeapPolicy lru_max_heap_policy; + _clear_all_soft_refs = clear; + if (clear) { - log_info(gc, ref)("Clearing All SoftReferences"); _soft_reference_policy = &always_clear_policy; } else { _soft_reference_policy = &lru_max_heap_policy; @@ -438,6 +440,10 @@ class ZReferenceProcessorTask : public ZTask { void ZReferenceProcessor::process_references() { ZStatTimerOld timer(ZSubPhaseConcurrentReferencesProcess); + if (_clear_all_soft_refs) { + log_info(gc, ref)("Clearing All SoftReferences"); + } + // Process discovered lists ZReferenceProcessorTask task(this); _workers->run(&task); diff --git a/src/hotspot/share/gc/z/zReferenceProcessor.hpp b/src/hotspot/share/gc/z/zReferenceProcessor.hpp index d39cc8634cd..7a8900827da 100644 --- a/src/hotspot/share/gc/z/zReferenceProcessor.hpp +++ b/src/hotspot/share/gc/z/zReferenceProcessor.hpp @@ -41,6 +41,7 @@ class ZReferenceProcessor : public ReferenceDiscoverer { ZWorkers* const _workers; ReferencePolicy* _soft_reference_policy; + bool _clear_all_soft_refs; ZPerWorker _encountered_count; ZPerWorker _discovered_count; ZPerWorker _enqueued_count; From 92d533e78210c7a9fb50720ce81ef577d01543f1 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Wed, 21 Feb 2024 13:55:18 +0000 Subject: [PATCH 241/261] 8323640: [TESTBUG]testMemoryFailCount in jdk/internal/platform/docker/TestDockerMemoryMetrics.java always fail because OOM killed Backport-of: 791b427f4410057cdcdf8fd8ea0dcce71f7dc513 --- .../jdk/internal/platform/docker/MetricsMemoryTester.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java b/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java index 08773b3e8b5..6307a93fa56 100644 --- a/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java +++ b/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java @@ -72,12 +72,12 @@ private static void testMemoryFailCount() { } else { long count = Metrics.systemMetrics().getMemoryFailCount(); - // Allocate 512M of data - byte[][] bytes = new byte[64][]; + // Allocate 512M of data in 1M chunks per iteration + byte[][] bytes = new byte[64 * 8][]; boolean atLeastOneAllocationWorked = false; - for (int i = 0; i < 64; i++) { + for (int i = 0; i < 64 * 8; i++) { try { - bytes[i] = new byte[8 * 1024 * 1024]; + bytes[i] = new byte[1024 * 1024]; atLeastOneAllocationWorked = true; // Break out as soon as we see an increase in failcount // to avoid getting killed by the OOM killer. From 3b4932b0b3b25468993dd9d3898bd6a9554d803a Mon Sep 17 00:00:00 2001 From: Andrew Lu Date: Thu, 22 Feb 2024 09:07:53 +0000 Subject: [PATCH 242/261] 8315726: Open source several AWT applet tests Backport-of: 1741d13b1260253d1e299e8da9c42b5519a7ae48 --- .../jdk/java/awt/Choice/ChoiceSelectTest.java | 174 ++++++++ test/jdk/java/awt/Component/Displayable.java | 156 +++++++ .../java/awt/Focus/TestWindowsLFFocus.java | 127 ++++++ .../java/awt/geom/HitTest/PathHitTest.java | 392 ++++++++++++++++++ 4 files changed, 849 insertions(+) create mode 100644 test/jdk/java/awt/Choice/ChoiceSelectTest.java create mode 100644 test/jdk/java/awt/Component/Displayable.java create mode 100644 test/jdk/java/awt/Focus/TestWindowsLFFocus.java create mode 100644 test/jdk/java/awt/geom/HitTest/PathHitTest.java diff --git a/test/jdk/java/awt/Choice/ChoiceSelectTest.java b/test/jdk/java/awt/Choice/ChoiceSelectTest.java new file mode 100644 index 00000000000..cf5b2e6d114 --- /dev/null +++ b/test/jdk/java/awt/Choice/ChoiceSelectTest.java @@ -0,0 +1,174 @@ +/* + * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Panel; + +/* + * @test + * @bug 4115139 4128213 + * @summary Tests that the (rather bizarre) rules for handling selection + * in Choice components are implemented as documented in + * "The Java Class Libraries 2nd Edition" + * @key headful + */ + +public class ChoiceSelectTest extends Panel { + final Choice c; + + public ChoiceSelectTest() { + setLayout(new FlowLayout()); + c = new Choice(); + add(c); + } + + private void test() { + testAddition(); + testInsertion(); + testRemoval(); + testIndices(); + } + + public void testAddition() { + c.removeAll(); + + // check that after first item added selection is zero + c.addItem("zero"); + if (c.getSelectedIndex() != 0) { + throw new SelectionException("selection wrong after first add"); + } + + // check that selection doesn't change for subsequent adds + c.addItem("one"); + c.select(1); + c.addItem("two"); + if (c.getSelectedIndex() != 1) { + throw new SelectionException("selection wrong after subsequent add"); + } + } + + public void testInsertion() { + c.removeAll(); + + // check that after first item inserted selection is zero + c.insert("zero", 0); + if (c.getSelectedIndex() != 0) { + throw new SelectionException("selection wrong after first insert"); + } + + // check that if selected item shifted, selection goes to zero + c.insert("three", 1); + c.select(1); + c.insert("one", 1); + if (c.getSelectedIndex() != 0) { + throw new SelectionException("selection wrong after selected item shifted"); + } + + // check that if selected item not shifted, selection stays the same + c.select(1); + c.insert("two", 2); + if (c.getSelectedIndex() != 1) { + throw new SelectionException("selection wrong after item inserted after selection"); + } + } + + public void testRemoval() { + c.removeAll(); + + // check that if removing selected item, selection goes to 0 + c.add("zero"); + c.add("one"); + c.add("two"); + c.select(2); + c.remove(2); + if (c.getSelectedIndex() != 0) { + throw new SelectionException("selection wrong after removing selected item"); + } + + // check that if removing item before the selection + // the selected index is updated + c.add("two"); + c.add("three"); + c.select(3); + c.remove(1); + if (c.getSelectedIndex() != 2) { + throw new SelectionException("selection wrong after removing item before it"); + } + } + + public void testIndices() { + c.removeAll(); + + c.addItem("zero"); + c.addItem("one"); + c.addItem("two"); + c.addItem("three"); + c.addItem("four"); + c.addItem("five"); + + // Test selection of negative index + try { + c.select(-1); + throw new SelectionException("Negative Index Test FAILED"); + } catch (IllegalArgumentException expected) {} + + // Test selection of zero index + try { + c.select(0); + } catch (IllegalArgumentException iae) { + throw new SelectionException("Zero Index Test FAILED", iae); + } + + // Test selection of maximum index + try { + c.select(5); + } catch (IllegalArgumentException iae) { + throw new SelectionException("Maximum Index Test FAILED", iae); + } + + // Test selection of index that is too large + try { + c.select(6); + throw new SelectionException("Greater than Maximum Index Test FAILED"); + } catch (IllegalArgumentException expected) {} + } + + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> new ChoiceSelectTest().test()); + } + + class SelectionException extends RuntimeException { + SelectionException(String msg, Throwable cause) { + super(msg, cause); + System.out.println( + "Selection item is '" + c.getSelectedItem() + + "' at index " + c.getSelectedIndex()); + } + + SelectionException(String msg) { + this(msg, null); + } + } +} diff --git a/test/jdk/java/awt/Component/Displayable.java b/test/jdk/java/awt/Component/Displayable.java new file mode 100644 index 00000000000..0c4969bb595 --- /dev/null +++ b/test/jdk/java/awt/Component/Displayable.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Label; +import java.awt.Panel; + +/* + * @test + * @key headful + * @summary automated test for "displayable" property on Component + */ + +public class Displayable extends Panel { + Label status = new Label("Displayable Test started..."); + + public void init() { + setLayout(new BorderLayout()); + add("South", status); + + LightDisplayable light = new LightDisplayable(); + shouldNotBeDisplayable(light, "before added to container "); + + HeavyDisplayable heavy = new HeavyDisplayable(); + shouldNotBeDisplayable(heavy, "before added to container "); + + add("West", light); + add("East", heavy); + + statusMessage("Displayable test completed successfully."); + } + + protected void addImpl(Component child, Object constraints, int index) { + super.addImpl(child, constraints, index); + if (isDisplayable()) { + shouldBeDisplayable(child, "after added to displayable container "); + } else { + shouldNotBeDisplayable(child, "after added to undisplayable container "); + } + } + + public void remove(Component child) { + super.remove(child); + shouldNotBeDisplayable(child, "after removed from displayable container "); + } + + public void statusMessage(String msg) { + status.setText(msg); + status.invalidate(); + validate(); + } + + public static void shouldNotBeDisplayable(Component c, String why) { + if (c.isDisplayable()) { + throw new RuntimeException("Component is displayable "+why+c.getName()); + } + } + + public static void shouldBeDisplayable(Component c, String why) { + if (!c.isDisplayable()) { + throw new RuntimeException("Component is NOT displayable "+why+c.getName()); + } + } + + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + Frame f = new Frame(); + try { + Displayable test = new Displayable(); + test.init(); + f.add("North", test); + f.pack(); + } finally { + f.dispose(); + } + }); + } +} + +class LightDisplayable extends Component { + + public Dimension getPreferredSize() { + return new Dimension(50,50); + } + + public void paint(Graphics g) { + Dimension size = getSize(); + g.setColor(Color.blue); + g.fillRect(0, 0, size.width, size.height); + super.paint(g); + } + + public void addNotify() { + Displayable.shouldNotBeDisplayable(this, "before addNotify "); + super.addNotify(); + Displayable.shouldBeDisplayable(this, "after addNotify "); + } + + public void removeNotify() { + Displayable.shouldBeDisplayable(this, "before removeNotify "); + super.removeNotify(); + Displayable.shouldNotBeDisplayable(this, "after removeNotify "); + } +} + +class HeavyDisplayable extends Panel { + + public Dimension getPreferredSize() { + return new Dimension(50, 50); + } + + public void paint(Graphics g) { + Dimension size = getSize(); + g.setColor(Color.black); + g.fillRect(0, 0, size.width, size.height); + super.paint(g); + } + + public void addNotify() { + Displayable.shouldNotBeDisplayable(this, "before addNotify "); + super.addNotify(); + Displayable.shouldBeDisplayable(this, "after addNotify "); + } + + public void removeNotify() { + Displayable.shouldBeDisplayable(this, "before removeNotify "); + super.removeNotify(); + Displayable.shouldNotBeDisplayable(this, "after removeNotify "); + } +} diff --git a/test/jdk/java/awt/Focus/TestWindowsLFFocus.java b/test/jdk/java/awt/Focus/TestWindowsLFFocus.java new file mode 100644 index 00000000000..8dd27f0a649 --- /dev/null +++ b/test/jdk/java/awt/Focus/TestWindowsLFFocus.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.WindowConstants; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; + +/* + * @test + * @bug 4749659 + * @summary Tests that popup menu doesn't steal focus from top-level + * @key headful + */ + +public class TestWindowsLFFocus { + static volatile boolean actionFired; + + static JFrame frame; + static JMenuBar bar; + static JMenuItem item; + static volatile Point frameLoc; + + public static void main(String[] args) throws Exception { + for (UIManager.LookAndFeelInfo lookAndFeel : UIManager.getInstalledLookAndFeels()) { + UIManager.setLookAndFeel(lookAndFeel.getClassName()); + test(); + } + + System.err.println("PASSED"); + } + + private static void test() throws Exception { + try { + SwingUtilities.invokeAndWait(() -> { + actionFired = false; + frame = new JFrame(); + bar = new JMenuBar(); + frame.setJMenuBar(bar); + JMenu menu = new JMenu("menu"); + bar.add(menu); + item = new JMenuItem("item"); + menu.add(item); + item.addActionListener(e -> actionFired = true); + + frame.getContentPane().add(new JButton("none")); + frame.setBounds(100, 100, 100, 100); + frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + frame.setVisible(true); + }); + + Robot robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(50); + + robot.waitForIdle(); + robot.delay(1000); + + SwingUtilities.invokeAndWait(() -> { + Point location = frame.getLocationOnScreen(); + Insets insets = frame.getInsets(); + + location.translate(insets.left + 15, insets.top + bar.getHeight() / 2); + + frameLoc = location; + }); + + robot.mouseMove(frameLoc.x, frameLoc.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.delay(1000); + + SwingUtilities.invokeAndWait(() -> { + Point location = new Point(frameLoc); + location.y += bar.getHeight() / 2 + item.getHeight() / 2; + + frameLoc = location; + }); + + robot.mouseMove(frameLoc.x, frameLoc.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + robot.delay(500); + + if (!actionFired) { + throw new RuntimeException("Menu closed without action"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } +} diff --git a/test/jdk/java/awt/geom/HitTest/PathHitTest.java b/test/jdk/java/awt/geom/HitTest/PathHitTest.java new file mode 100644 index 00000000000..930e7f764a6 --- /dev/null +++ b/test/jdk/java/awt/geom/HitTest/PathHitTest.java @@ -0,0 +1,392 @@ +/* + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Canvas; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Panel; +import java.awt.Polygon; +import java.awt.Shape; +import java.awt.geom.AffineTransform; +import java.awt.geom.Area; +import java.awt.geom.Ellipse2D; +import java.awt.geom.GeneralPath; +import java.awt.geom.Point2D; + +/* + * @test + * @bug 4210936 4214524 + * @summary Tests the results of the hit test methods on 3 different + * Shape objects - Polygon, Area, and GeneralPath. Both an + * automatic test for constraint compliance and a manual + * test for correctness are included in this one class. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main PathHitTest + */ + +/* + * @test + * @bug 4210936 4214524 + * @summary Tests the results of the hit test methods on 3 different + * Shape objects - Polygon, Area, and GeneralPath. Both an + * automatic test for constraint compliance and a manual + * test for correctness are included in this one class. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual PathHitTest manual + */ + +public class PathHitTest { + + public static final int BOXSIZE = 5; + public static final int BOXCENTER = 2; + public static final int TESTSIZE = 400; + public static final int NUMTESTS = (TESTSIZE + BOXSIZE - 1) / BOXSIZE; + + public static Shape[] testShapes = new Shape[5]; + public static String[] testNames = { + "Polygon", + "EvenOdd GeneralPath", + "NonZero GeneralPath", + "Area from EO GeneralPath", + "Area from NZ GeneralPath", + }; + + static { + GeneralPath gpeo = new GeneralPath(GeneralPath.WIND_EVEN_ODD); + Ellipse2D ell = new Ellipse2D.Float(); + Point2D center = new Point2D.Float(); + AffineTransform at = new AffineTransform(); + for (int i = 0; i < 360; i += 30) { + center.setLocation(100, 0); + at.setToTranslation(200, 200); + at.rotate(i * Math.PI / 180); + at.transform(center, center); + ell.setFrame(center.getX() - 50, center.getY() - 50, 100, 100); + gpeo.append(ell, false); + } + GeneralPath side = new GeneralPath(); + side.moveTo(0, 0); + side.lineTo(15, 10); + side.lineTo(30, 0); + side.lineTo(45, -10); + side.lineTo(60, 0); + append4sides(gpeo, side, 20, 20); + side.reset(); + side.moveTo(0, 0); + side.quadTo(15, 10, 30, 0); + side.quadTo(45, -10, 60, 0); + append4sides(gpeo, side, 320, 20); + side.reset(); + side.moveTo(0, 0); + side.curveTo(15, 10, 45, -10, 60, 0); + append4sides(gpeo, side, 20, 320); + + GeneralPath gpnz = new GeneralPath(GeneralPath.WIND_NON_ZERO); + gpnz.append(gpeo, false); + Polygon p = new Polygon(); + p.addPoint( 50, 50); + p.addPoint( 60, 350); + p.addPoint(250, 340); + p.addPoint(260, 150); + p.addPoint(140, 140); + p.addPoint(150, 260); + p.addPoint(340, 250); + p.addPoint(350, 60); + testShapes[0] = p; + testShapes[1] = gpeo; + testShapes[2] = gpnz; + testShapes[3] = new Area(gpeo); + testShapes[3].getPathIterator(null); + testShapes[4] = new Area(gpnz); + testShapes[4].getPathIterator(null); + } + + private static void append4sides(GeneralPath path, GeneralPath side, + double xoff, double yoff) { + AffineTransform at = new AffineTransform(); + at.setToTranslation(xoff, yoff); + for (int i = 0; i < 4; i++) { + path.append(side.getPathIterator(at), i != 0); + at.rotate(Math.toRadians(90), 30, 30); + } + } + + public static void main(String[] argv) throws Exception { + if (argv.length > 0 && argv[0].equals("manual")) { + PathHitTestManual.doManual(); + } else { + int totalerrs = 0; + for (int i = 0; i < testShapes.length; i++) { + totalerrs += testshape(testShapes[i], testNames[i]); + } + if (totalerrs != 0) { + throw new RuntimeException(totalerrs + + " constraint conditions violated!"); + } + } + } + + public static int testshape(Shape s, String name) { + int numerrs = 0; + long start = System.currentTimeMillis(); + for (int y = 0; y < TESTSIZE; y += BOXSIZE) { + for (int x = 0; x < TESTSIZE; x += BOXSIZE) { + boolean rectintersects = s.intersects(x, y, BOXSIZE, BOXSIZE); + boolean rectcontains = s.contains(x, y, BOXSIZE, BOXSIZE); + boolean pointcontains = s.contains(x + BOXCENTER, y + BOXCENTER); + if (rectcontains && !rectintersects) { + System.err.println("rect is contained " + + "but does not intersect!"); + numerrs++; + } + if (rectcontains && !pointcontains) { + System.err.println("rect is contained " + + "but center is not contained!"); + numerrs++; + } + if (pointcontains && !rectintersects) { + System.err.println("center is contained " + + "but rect does not intersect!"); + numerrs++; + } + } + } + long end = System.currentTimeMillis(); + System.out.println(name + " completed in " + + (end - start) + "ms with " + + numerrs + " errors"); + return numerrs; + } + + static class PathHitTestManual extends Panel { + private static final String INSTRUCTIONS = """ + This test displays the results of hit testing 5 different Shape + objects one at a time. + + You can switch between shapes using the Choice component located + at the bottom of the window. + + Each square in the test represents the + return values of the hit testing operators for that square region: + + yellow - not yet tested + translucent blue overlay - the shape being tested + + black - all outside + dark gray - rectangle intersects shape + light gray - rectangle intersects and center point is inside shape + white - rectangle is entirely contained in shape + red - some constraint was violated, including: + rectangle is contained, but center point is not + rectangle is contained, but rectangle.intersects is false + centerpoint is contained, but rectangle.intersects is false + + Visually inspect the results to see if they match the above table. + Note that it is not a violation for rectangles that are entirely + inside the path to be light gray instead of white since sometimes + the path is complex enough to make an exact determination expensive. + You might see this on the GeneralPath NonZero example where the + circles that make up the path cross over the interior of the shape + and cause the hit testing methods to guess that the rectangle is + not guaranteed to be contained within the shape. + """; + + PathHitTestCanvas phtc; + + public void init() { + setLayout(new BorderLayout()); + phtc = new PathHitTestCanvas(); + add("Center", phtc); + final Choice ch = new Choice(); + for (int i = 0; i < PathHitTest.testNames.length; i++) { + ch.add(PathHitTest.testNames[i]); + } + ch.addItemListener(e -> phtc.setShape(ch.getSelectedIndex())); + ch.select(0); + phtc.setShape(0); + add("South", ch); + } + + public void start() { + phtc.start(); + } + + public void stop() { + phtc.stop(); + } + + public static class PathHitTestCanvas extends Canvas implements Runnable { + public static final Color[] colors = { + /* contains? point in? intersects? */ + Color.black, /* NO NO NO */ + Color.darkGray, /* NO NO YES */ + Color.red, /* NO YES NO */ + Color.lightGray, /* NO YES YES */ + Color.red, /* YES NO NO */ + Color.red, /* YES NO YES */ + Color.red, /* YES YES NO */ + Color.white, /* YES YES YES */ + Color.yellow, /* used for untested points */ + }; + + public Dimension getPreferredSize() { + return new Dimension(TESTSIZE, TESTSIZE); + } + + public synchronized void start() { + if (!testdone) { + renderer = new Thread(this); + renderer.setPriority(Thread.MIN_PRIORITY); + renderer.start(); + } + } + + public synchronized void stop() { + renderer = null; + } + + private Thread renderer; + private int shapeIndex = 0; + private byte[] indices = new byte[NUMTESTS * NUMTESTS]; + boolean testdone = false; + + private synchronized void setShape(int index) { + shapeIndex = index; + testdone = false; + start(); + } + + public void run() { + Thread me = Thread.currentThread(); + Graphics2D g2d = (Graphics2D) getGraphics(); + byte[] indices; + Shape s = testShapes[shapeIndex]; + synchronized (this) { + if (renderer != me) { + return; + } + this.indices = new byte[NUMTESTS * NUMTESTS]; + java.util.Arrays.fill(this.indices, (byte) 8); + indices = this.indices; + } + + System.err.printf("%s %s\n", g2d, Color.yellow); + g2d.setColor(Color.yellow); + g2d.fillRect(0, 0, TESTSIZE, TESTSIZE); + int numtests = 0; + long start = System.currentTimeMillis(); + for (int y = 0; renderer == me && y < TESTSIZE; y += BOXSIZE) { + for (int x = 0; renderer == me && x < TESTSIZE; x += BOXSIZE) { + byte index = 0; + if (s.intersects(x, y, BOXSIZE, BOXSIZE)) { + index += 1; + } + if (s.contains(x + BOXCENTER, y + BOXCENTER)) { + index += 2; + } + if (s.contains(x, y, BOXSIZE, BOXSIZE)) { + index += 4; + } + numtests++; + int i = (y / BOXSIZE) * NUMTESTS + (x / BOXSIZE); + indices[i] = index; + g2d.setColor(colors[index]); + g2d.fillRect(x, y, BOXSIZE, BOXSIZE); + } + } + synchronized (this) { + if (renderer != me) { + return; + } + g2d.setColor(new Color(0, 0, 1, .2f)); + g2d.fill(s); + testdone = true; + long end = System.currentTimeMillis(); + System.out.println(numtests + " tests took " + (end - start) + "ms"); + } + } + + public void paint(Graphics g) { + g.setColor(Color.yellow); + g.fillRect(0, 0, TESTSIZE, TESTSIZE); + byte[] indices = this.indices; + if (indices != null) { + for (int y = 0; y < TESTSIZE; y += BOXSIZE) { + for (int x = 0; x < TESTSIZE; x += BOXSIZE) { + int i = (y / BOXSIZE) * NUMTESTS + (x / BOXSIZE); + g.setColor(colors[indices[i]]); + g.fillRect(x, y, BOXSIZE, BOXSIZE); + } + } + } + Graphics2D g2d = (Graphics2D) g; + g2d.setColor(new Color(0, 0, 1, .2f)); + g2d.fill(testShapes[shapeIndex]); + } + } + + static volatile PathHitTestManual pathHitTestManual; + + private static void createAndShowGUI() { + pathHitTestManual = new PathHitTestManual(); + Frame frame = new Frame("PathHitTestManual test window"); + + frame.add(pathHitTestManual); + frame.setSize(400, 450); + + PassFailJFrame.addTestWindow(frame); + PassFailJFrame.positionTestWindow(frame, PassFailJFrame.Position.HORIZONTAL); + + frame.setVisible(true); + + pathHitTestManual.init(); + pathHitTestManual.start(); + } + + public static void doManual() throws Exception { + PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() + .title("PathHitTestManual Instructions") + .instructions(INSTRUCTIONS) + .testTimeOut(5) + .rows(30) + .columns(70) + .screenCapture() + .build(); + + EventQueue.invokeAndWait(PathHitTestManual::createAndShowGUI); + try { + passFailJFrame.awaitAndCheck(); + } finally { + pathHitTestManual.stop(); + } + } + } +} From 9adc281a50bafa081decc64cd8b2d00c94cd879d Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 22 Feb 2024 09:24:47 +0000 Subject: [PATCH 243/261] 8325074: ZGC fails assert(index == 0 || is_power_of_2(index)) failed: Incorrect load shift: 11 Backport-of: 2705ed0a71e606a517518569d60051c85ad3c516 --- src/hotspot/share/gc/z/zBarrierSet.cpp | 5 +++-- src/hotspot/share/gc/z/zBarrierSet.hpp | 2 +- src/hotspot/share/gc/z/zBarrierSet.inline.hpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/z/zBarrierSet.cpp b/src/hotspot/share/gc/z/zBarrierSet.cpp index a82cc67754b..48228a3e1ab 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.cpp +++ b/src/hotspot/share/gc/z/zBarrierSet.cpp @@ -152,11 +152,12 @@ void ZBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) { deoptimize_allocation(thread); } -void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj, size_t size) { +void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj) { volatile zpointer* src = (volatile zpointer*)src_obj->base(); volatile zpointer* dst = (volatile zpointer*)dst_obj->base(); + const int length = src_obj->length(); - for (const zpointer* const end = cast_from_oop(src_obj) + size; src < end; src++, dst++) { + for (const volatile zpointer* const end = src + length; src < end; src++, dst++) { zaddress elem = ZBarrier::load_barrier_on_oop_field(src); // We avoid healing here because the store below colors the pointer store good, // hence avoiding the cost of a CAS. diff --git a/src/hotspot/share/gc/z/zBarrierSet.hpp b/src/hotspot/share/gc/z/zBarrierSet.hpp index adba5ee15c1..bf233df683a 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.hpp +++ b/src/hotspot/share/gc/z/zBarrierSet.hpp @@ -39,7 +39,7 @@ class ZBarrierSet : public BarrierSet { static ZBarrierSetAssembler* assembler(); static bool barrier_needed(DecoratorSet decorators, BasicType type); - static void clone_obj_array(objArrayOop src, objArrayOop dst, size_t size); + static void clone_obj_array(objArrayOop src, objArrayOop dst); virtual void on_thread_create(Thread* thread); virtual void on_thread_destroy(Thread* thread); diff --git a/src/hotspot/share/gc/z/zBarrierSet.inline.hpp b/src/hotspot/share/gc/z/zBarrierSet.inline.hpp index 997e5bae58d..d53b69345dd 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/z/zBarrierSet.inline.hpp @@ -439,7 +439,7 @@ inline void ZBarrierSet::AccessBarrier::clone_in_heap(o // for cloning arrays transform the clone to an optimized allocation // and arraycopy sequence, so the performance of this runtime call // does not matter for object arrays. - clone_obj_array(objArrayOop(src), objArrayOop(dst), size); + clone_obj_array(objArrayOop(src), objArrayOop(dst)); return; } From 290cd1171fbe0fe63c754c7f34850e2f504abf2e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 22 Feb 2024 09:25:00 +0000 Subject: [PATCH 244/261] 8321408: Add Certainly roots R1 and E1 Backport-of: f3073db42aa80b3ced47edea8d2e8add874fb70f --- .../share/data/cacerts/certainlyroote1 | 20 ++++++++++ .../share/data/cacerts/certainlyrootr1 | 38 +++++++++++++++++++ .../certification/CAInterop.java | 27 ++++++++++++- .../security/lib/cacerts/VerifyCACerts.java | 11 ++++-- 4 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 src/java.base/share/data/cacerts/certainlyroote1 create mode 100644 src/java.base/share/data/cacerts/certainlyrootr1 diff --git a/src/java.base/share/data/cacerts/certainlyroote1 b/src/java.base/share/data/cacerts/certainlyroote1 new file mode 100644 index 00000000000..3f0d0face0e --- /dev/null +++ b/src/java.base/share/data/cacerts/certainlyroote1 @@ -0,0 +1,20 @@ +Owner: CN=Certainly Root E1, O=Certainly, C=US +Issuer: CN=Certainly Root E1, O=Certainly, C=US +Serial number: 62533b1470333275cf98d9ab9bfccf8 +Valid from: Thu Apr 01 00:00:00 GMT 2021 until: Sun Apr 01 00:00:00 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIB9zCCAX2gAwIBAgIQBiUzsUcDMydc+Y2aub/M+DAKBggqhkjOPQQDAzA9MQsw +CQYDVQQGEwJVUzESMBAGA1UEChMJQ2VydGFpbmx5MRowGAYDVQQDExFDZXJ0YWlu +bHkgUm9vdCBFMTAeFw0yMTA0MDEwMDAwMDBaFw00NjA0MDEwMDAwMDBaMD0xCzAJ +BgNVBAYTAlVTMRIwEAYDVQQKEwlDZXJ0YWlubHkxGjAYBgNVBAMTEUNlcnRhaW5s +eSBSb290IEUxMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE3m/4fxzf7flHh4axpMCK ++IKXgOqPyEpeKn2IaKcBYhSRJHpcnqMXfYqGITQYUBsQ3tA3SybHGWCA6TS9YBk2 +QNYphwk8kXr2vBMj3VlOBF7PyAIcGFPBMdjaIOlEjeR2o0IwQDAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU8ygYy2R17ikq6+2uI1g4 +hevIIgcwCgYIKoZIzj0EAwMDaAAwZQIxALGOWiDDshliTd6wT99u0nCK8Z9+aozm +ut6Dacpps6kFtZaSF4fC0urQe87YQVt8rgIwRt7qy12a7DLCZRawTDBcMPPaTnOG +BtjOiQRINzf43TNRnXCve1XYAS59BWQOhriR +-----END CERTIFICATE----- diff --git a/src/java.base/share/data/cacerts/certainlyrootr1 b/src/java.base/share/data/cacerts/certainlyrootr1 new file mode 100644 index 00000000000..dbb99fad32c --- /dev/null +++ b/src/java.base/share/data/cacerts/certainlyrootr1 @@ -0,0 +1,38 @@ +Owner: CN=Certainly Root R1, O=Certainly, C=US +Issuer: CN=Certainly Root R1, O=Certainly, C=US +Serial number: 8e0ff94b907168653354f4d44439b7e0 +Valid from: Thu Apr 01 00:00:00 GMT 2021 until: Sun Apr 01 00:00:00 GMT 2046 +Signature algorithm name: SHA256withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFRzCCAy+gAwIBAgIRAI4P+UuQcWhlM1T01EQ5t+AwDQYJKoZIhvcNAQELBQAw +PTELMAkGA1UEBhMCVVMxEjAQBgNVBAoTCUNlcnRhaW5seTEaMBgGA1UEAxMRQ2Vy +dGFpbmx5IFJvb3QgUjEwHhcNMjEwNDAxMDAwMDAwWhcNNDYwNDAxMDAwMDAwWjA9 +MQswCQYDVQQGEwJVUzESMBAGA1UEChMJQ2VydGFpbmx5MRowGAYDVQQDExFDZXJ0 +YWlubHkgUm9vdCBSMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANA2 +1B/q3avk0bbm+yLA3RMNansiExyXPGhjZjKcA7WNpIGD2ngwEc/csiu+kr+O5MQT +vqRoTNoCaBZ0vrLdBORrKt03H2As2/X3oXyVtwxwhi7xOu9S98zTm/mLvg7fMbed +aFySpvXl8wo0tf97ouSHocavFwDvA5HtqRxOcT3Si2yJ9HiG5mpJoM610rCrm/b0 +1C7jcvk2xusVtyWMOvwlDbMicyF0yEqWYZL1LwsYpfSt4u5BvQF5+paMjRcCMLT5 +r3gajLQ2EBAHBXDQ9DGQilHFhiZ5shGIXsXwClTNSaa/ApzSRKft43jvRl5tcdF5 +cBxGX1HpyTfcX35pe0HfNEXgO4T0oYoKNp43zGJS4YkNKPl6I7ENPT2a/Z2B7yyQ +wHtETrtJ4A5KVpK8y7XdeReJkd5hiXSSqOMyhb5OhaRLWcsrxXiOcVTQAjeZjOVJ +6uBUcqQRBi8LjMFbvrWhsFNunLhgkR9Za/kt9JQKl7XsxXYDVBtlUrpMklZRNaBA +2CnbrlJ2Oy0wQJuK0EJWtLeIAaSHO1OWzaMWj/Nmqhexx2DgwUMFDO6bW2BvBlyH +Wyf5QBGenDPBt+U1VwV/J84XIIwc/PH72jEpSe31C4SnT8H2TsIonPru4K8H+zMR +eiFPCyEQtkA6qyI6BJyLm4SGcprSp6XEtHWRqSsjAgMBAAGjQjBAMA4GA1UdDwEB +/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTgqj8ljZ9EXME66C6u +d0yEPmcM9DANBgkqhkiG9w0BAQsFAAOCAgEAuVevuBLaV4OPaAszHQNTVfSVcOQr +PbA56/qJYv331hgELyE03fFo8NWWWt7CgKPBjcZq91l3rhVkz1t5BXdm6ozTaw3d +8VkswTOlMIAVRQdFGjEitpIAq5lNOo93r6kiyi9jyhXWx8bwPWz8HA2YEGGeEaIi +1wrykXprOQ4vMMM2SZ/g6Q8CRFA3lFV96p/2O7qUpUzpvD5RtOjKkjZUbVwlKNrd +rRT90+7iIgXr0PK3aBLXWopBGsaSpVo7Y0VPv+E6dyIvXL9G+VoDhRNCX8reU9di +taY1BMJH/5n9hN9czulegChB8n3nHpDYT3Y+gjwN/KUD+nsa2UUeYNrEjvn8K8l7 +lcUq/6qJ34IxD3L/DCfXCh5WAFAeDJDBlrXYFIW7pw0WwfgHJBu6haEaBQmAupVj +yTrsJZ9/nbqkRxWbRHDxakvWOF5D8xh+UG7pWijmZeZ3Gzr9Hb4DJqPb1OG7fpYn +Kx3upPvaJVQTA945xsMfTZDsjxtK0hzthZU4UHlG1sGQUDGpXJpuHfUzVounmdLy +yCwzk5Iwx06MZTMQZBf9JBeW0Y3COmor6xOLRPIh80oat3df1+2IpHLlOR+Vnb5n +wXARPbv0+Em34yaXOp/SX3z7wJl8OSngex2/DaeP0ik0biQVy96QXr8axGbqwua6 +OV+KmalBWQewLK8= +-----END CERTIFICATE----- diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index b5bb698e458..0ef37377b1e 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, 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 @@ -451,6 +451,24 @@ * @run main/othervm -Djava.security.debug=certpath CAInterop emsigneccrootcag3 CRL */ +/* + * @test id=certainlyrootr1 + * @bug 8321408 + * @summary Interoperability tests with Certainly Root R1 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop certainlyrootr1 DEFAULT + */ + +/* + * @test id=certainlyroote1 + * @bug 8321408 + * @summary Interoperability tests with Certainly Root E1 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop certainlyroote1 DEFAULT + */ + /** * Collection of certificate validation tests for interoperability with external CAs */ @@ -613,6 +631,13 @@ private CATestURLs getTestURLs(String alias) { new CATestURLs("https://testovg3.emsign.com/RootOVG3.html", "https://testovg3r.emsign.com/RootOVG3MR.html"); + case "certainlyrootr1" -> + new CATestURLs("https://valid.root-r1.certainly.com", + "https://revoked.root-r1.certainly.com"); + case "certainlyroote1" -> + new CATestURLs("https://valid.root-e1.certainly.com", + "https://revoked.root-e1.certainly.com"); + default -> throw new RuntimeException("No test setup found for: " + alias); }; } diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java index 595cce5d2b7..548024efc6c 100644 --- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -29,6 +29,7 @@ * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187 + * 8321408 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -47,12 +48,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 106; + private static final int COUNT = 108; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "C6:81:90:32:46:65:82:69:6B:BF:EE:C2:BE:AB:48:59:CB:2F:B6:7B:93:F2:B3:7E:A0:07:17:0C:79:F6:D9:AC"; + = "C4:A2:41:9E:B6:4D:77:26:AA:21:02:83:51:C7:88:21:66:1E:D8:88:4A:AC:84:D5:B0:15:0C:7C:C6:45:85:AF"; // Hex formatter to upper case with ":" delimiter private static final HexFormat HEX = HexFormat.ofDelimiter(":").withUpperCase(); @@ -273,6 +274,10 @@ public class VerifyCACerts { "86:A1:EC:BA:08:9C:4A:8D:3B:BE:27:34:C6:12:BA:34:1D:81:3E:04:3C:F9:E8:A8:62:CD:5C:57:A3:6B:BE:6B"); put("emsignrootcag2 [jdk]", "1A:A0:C2:70:9E:83:1B:D6:E3:B5:12:9A:00:BA:41:F7:EE:EF:02:08:72:F1:E6:50:4B:F0:F6:C3:F2:4F:3A:F3"); + put("certainlyrootr1 [jdk]", + "77:B8:2C:D8:64:4C:43:05:F7:AC:C5:CB:15:6B:45:67:50:04:03:3D:51:C6:0C:62:02:A8:E0:C3:34:67:D3:A0"); + put("certainlyroote1 [jdk]", + "B4:58:5F:22:E4:AC:75:6A:4E:86:12:A1:36:1C:5D:9D:03:1A:93:FD:84:FE:BB:77:8F:A3:06:8B:0F:C4:2D:C2"); } }; From e69b61133bc0ad3fbed4d0a90685d5bf22b24fe7 Mon Sep 17 00:00:00 2001 From: Pasam Soujanya Date: Thu, 22 Feb 2024 13:43:14 +0000 Subject: [PATCH 245/261] 8311893: Interactive component with ARIA role 'tabpanel' does not have a programmatically associated name Reviewed-by: hannesw Backport-of: 783ae56634a3bca23516c22b071d224fec18591f --- .../internal/doclets/formats/html/Table.java | 4 +- .../doclets/toolkit/resources/script.js | 2 +- .../TestHtmlTableStyles.java | 2 +- .../testHtmlTableTags/TestHtmlTableTags.java | 8 +- .../testHtmlVersion/TestHtmlVersion.java | 6 +- .../doclet/testModules/TestModules.java | 10 +- .../doclet/testNewApiList/TestNewApiList.java | 100 +++++++++--------- .../TestOverrideMethods.java | 2 +- .../doclet/testPreview/TestPreview.java | 8 +- .../javadoc/doclet/testSearch/TestSearch.java | 4 +- .../doclet/testSpecTag/TestSpecTag.java | 4 +- 11 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java index 90bcb0755d4..3de72ab7d93 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java @@ -404,7 +404,6 @@ private Content toContent() { } else { tablist.add(getCaption(defaultTab)); } - table.put(HtmlAttr.ARIA_LABELLEDBY, defaultTabId.name()); if (renderTabs) { for (var tab : tabs) { if (occurringTabs.contains(tab)) { @@ -417,7 +416,8 @@ private Content toContent() { } var tabpanel = new HtmlTree(TagName.DIV) .setId(HtmlIds.forTabPanel(id)) - .put(HtmlAttr.ROLE, "tabpanel"); + .put(HtmlAttr.ROLE, "tabpanel") + .put(HtmlAttr.ARIA_LABELLEDBY, defaultTabId.name()); table.add(getTableBody()); tabpanel.add(table); main.add(tablist); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js index 8b9691a167d..bb9c8a2415d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js @@ -157,7 +157,7 @@ function show(tableId, selected, columns) { } function updateTabs(tableId, selected) { - document.querySelector('div#' + tableId +' .summary-table') + document.getElementById(tableId + '.tabpanel') .setAttribute('aria-labelledby', selected); document.querySelectorAll('button[id^="' + tableId + '"]') .forEach(function(tab, index) { diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java b/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java index 930445113f0..2225de2f9c5 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java @@ -65,7 +65,7 @@ public void test() {

    Constructors
    """, """ -
    """); +
    """); checkOutput("pkg1/package-summary.html", true, """ diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java index 61cd6f77566..0b8ff056059 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java @@ -84,24 +84,24 @@ void checkHtmlTableTag() { //Package summary checkOutput("pkg1/package-summary.html", true, """ -
    """); +
    """); checkOutput("pkg2/package-summary.html", true, """ -
    """); +
    """); // Class documentation checkOutput("pkg1/C1.html", true, """
    """, """ -
    """); +
    """); checkOutput("pkg2/C2.html", true, """
    """, """ -
    """); +
    """); checkOutput("pkg2/C2.ModalExclusionType.html", true, """ diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java index d850b3a8baf..b5467fe56ee 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java @@ -97,7 +97,7 @@ void html5Output() { */ -public class PassFailJFrame { +public final class PassFailJFrame { private static final String TITLE = "Test Instruction Frame"; private static final long TEST_TIMEOUT = 5; @@ -277,12 +281,18 @@ private PassFailJFrame(Builder builder) throws InterruptedException, this(builder.title, builder.instructions, builder.testTimeOut, builder.rows, builder.columns, builder.screenCapture); - if (builder.windowCreator != null) { + if (builder.windowListCreator != null) { invokeOnEDT(() -> - builder.testWindows = builder.windowCreator.createTestUI()); + builder.testWindows = builder.windowListCreator.createTestUI()); + if (builder.testWindows == null) { + throw new IllegalStateException("Window list creator returned null list"); + } } if (builder.testWindows != null) { + if (builder.testWindows.isEmpty()) { + throw new IllegalStateException("Window list is empty"); + } addTestWindow(builder.testWindows); builder.testWindows .forEach(w -> w.addWindowListener(windowClosingHandler)); @@ -293,17 +303,15 @@ private PassFailJFrame(Builder builder) throws InterruptedException, builder.positionWindows .positionTestWindows(unmodifiableList(builder.testWindows), builder.instructionUIHandler); - - windowList.forEach(w -> w.setVisible(true)); }); } else if (builder.testWindows.size() == 1) { Window window = builder.testWindows.get(0); positionTestWindow(window, builder.position); - window.setVisible(true); } else { positionTestWindow(null, builder.position); } } + showAllWindows(); } /** @@ -369,7 +377,7 @@ private static void createUI(String title, String instructions, frame.add(buttonsPanel, BorderLayout.SOUTH); frame.pack(); frame.setLocationRelativeTo(null); - windowList.add(frame); + addTestWindow(frame); } private static JTextComponent configurePlainText(String instructions, @@ -400,14 +408,27 @@ private static JTextComponent configureHTML(String instructions, /** - * Creates one or more windows for test UI. + * Creates a test UI window. */ @FunctionalInterface public interface WindowCreator { + /** + * Creates a window for test UI. + * This method is called by the framework on the EDT. + * @return a test UI window + */ + Window createTestUI(); + } + + /** + * Creates a list of test UI windows. + */ + @FunctionalInterface + public interface WindowListCreator { /** * Creates one or more windows for test UI. * This method is called by the framework on the EDT. - * @return a list of windows. + * @return a list of test UI windows */ List createTestUI(); } @@ -423,8 +444,13 @@ public interface PositionWindows { * the instruction UI frame was positioned on the screen. *

    * The list of the test windows contains the windows - * that were passed to the framework via - * {@link Builder#testUI(WindowCreator) testUI} method. + * that were passed to the framework via the + * {@link Builder#testUI(Window...) testUI(Window...)} method or + * that were created with {@code WindowCreator} + * or {@code WindowListCreator} which were passed via + * {@link Builder#testUI(WindowCreator) testUI(WindowCreator)} or + * {@link Builder#testUI(WindowListCreator) testUI(WindowListCreator)} + * correspondingly. * * @param testWindows the list of test windows * @param instructionUI information about the instruction frame @@ -859,6 +885,29 @@ public static synchronized void addTestWindow(Collection testW windowList.addAll(testWindows); } + /** + * Displays all the windows in {@code windowList}. + * + * @throws InterruptedException if the thread is interrupted while + * waiting for the event dispatch thread to finish running + * the {@link #showUI() showUI} + * @throws InvocationTargetException if an exception is thrown while + * the event dispatch thread executes {@code showUI} + */ + private static void showAllWindows() + throws InterruptedException, InvocationTargetException { + invokeOnEDT(PassFailJFrame::showUI); + } + + /** + * Displays all the windows in {@code windowList}; it has to be called on + * the EDT — use {@link #showAllWindows() showAllWindows} to ensure it. + */ + private static synchronized void showUI() { + windowList.forEach(w -> w.setVisible(true)); + } + + /** * Forcibly pass the test. *

    The sample usage: @@ -900,7 +949,7 @@ public static final class Builder { private boolean screenCapture; private List testWindows; - private WindowCreator windowCreator; + private WindowListCreator windowListCreator; private PositionWindows positionWindows; private InstructionUI instructionUIHandler; @@ -936,39 +985,109 @@ public Builder screenCapture() { return this; } + /** + * Adds a {@code WindowCreator} which the framework will use + * to create the test UI window. + * + * @param windowCreator a {@code WindowCreator} + * to create the test UI window + * @return this builder + * @throws IllegalArgumentException if {@code windowCreator} is {@code null} + * @throws IllegalStateException if a window creator + * or a list of test windows is already set + */ + public Builder testUI(WindowCreator windowCreator) { + if (windowCreator == null) { + throw new IllegalArgumentException("The window creator can't be null"); + } + + checkWindowsLists(); + + this.windowListCreator = () -> List.of(windowCreator.createTestUI()); + return this; + } + + /** + * Adds a {@code WindowListCreator} which the framework will use + * to create a list of test UI windows. + * + * @param windowListCreator a {@code WindowListCreator} + * to create test UI windows + * @return this builder + * @throws IllegalArgumentException if {@code windowListCreator} is {@code null} + * @throws IllegalStateException if a window creator + * or a list of test windows is already set + */ + public Builder testUI(WindowListCreator windowListCreator) { + if (windowListCreator == null) { + throw new IllegalArgumentException("The window list creator can't be null"); + } + + checkWindowsLists(); + + this.windowListCreator = windowListCreator; + return this; + } + + /** + * Adds an already created test UI window. + * The window is positioned and shown automatically. + * + * @param window a test UI window + * @return this builder + */ public Builder testUI(Window window) { return testUI(List.of(window)); } + /** + * Adds an array of already created test UI windows. + * + * @param windows an array of test UI windows + * @return this builder + */ public Builder testUI(Window... windows) { return testUI(List.of(windows)); } - public Builder testUI(List windows) { + /** + * Adds a list of already created test UI windows. + * + * @param windows a list of test UI windows + * @return this builder + * @throws IllegalArgumentException if {@code windows} is {@code null} + * or the list contains {@code null} + * @throws IllegalStateException if a window creator + * or a list of test windows is already set + */ + public Builder testUI(List windows) { if (windows == null) { throw new IllegalArgumentException("The list of windows can't be null"); } if (windows.stream() .anyMatch(Objects::isNull)) { - throw new IllegalArgumentException("The windows list can't contain null"); + throw new IllegalArgumentException("The list of windows can't contain null"); } - if (windowCreator != null) { - throw new IllegalStateException("windowCreator is already set"); - } + checkWindowsLists(); + this.testWindows = windows; return this; } - public Builder testUI(WindowCreator windowCreator) { - if (windowCreator == null) { - throw new IllegalArgumentException("The window creator can't be null"); + /** + * Verifies the state of window list and window creator. + * + * @throws IllegalStateException if a windows list creator + * or a list of test windows is already set + */ + private void checkWindowsLists() { + if (windowListCreator != null) { + throw new IllegalStateException("Window list creator is already set"); } if (testWindows != null) { - throw new IllegalStateException("testWindows are already set"); + throw new IllegalStateException("The list of test windows is already set"); } - this.windowCreator = windowCreator; - return this; } public Builder positionTestUI(PositionWindows positionWindows) { @@ -1010,13 +1129,13 @@ private void validate() { } if (position == null - && (testWindows != null || windowCreator != null)) { + && (testWindows != null || windowListCreator != null)) { position = Position.HORIZONTAL; } if (positionWindows != null) { - if (testWindows == null && windowCreator == null) { + if (testWindows == null && windowListCreator == null) { throw new IllegalStateException("To position windows, " + "provide an a list of windows to the builder"); } From 69aa4ab1f51a27a6e2d3fed7b38dd4bfafcf97e7 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Mon, 26 Feb 2024 10:53:01 +0000 Subject: [PATCH 250/261] 8325470: [AIX] use fclose after fopen in read_psinfo Backport-of: 4513da949670dfd29ca64183edc78ca44432aeb3 --- src/hotspot/os/aix/os_perf_aix.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/os/aix/os_perf_aix.cpp b/src/hotspot/os/aix/os_perf_aix.cpp index bdb70250a76..f4e13374fd7 100644 --- a/src/hotspot/os/aix/os_perf_aix.cpp +++ b/src/hotspot/os/aix/os_perf_aix.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2022, IBM Corp. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, IBM Corp. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,6 +87,7 @@ static bool read_psinfo(const u_longlong_t& pid, psinfo_t& psinfo) { } len = fread(&psinfo, 1, sizeof(psinfo_t), fp); + fclose(fp); return len == sizeof(psinfo_t); } From 55f9bcf0bda18993a85af5b7208e0980eba68eeb Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Mon, 26 Feb 2024 11:03:01 +0000 Subject: [PATCH 251/261] 8325876: crashes in docker container tests on Linuxppc64le Power8 machines Backport-of: ba8db1f6d737bf369f1795d03327217186c0cf64 --- .../jdk/test/lib/containers/docker/DockerfileConfig.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java b/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java index 37db2e8053e..9d73ad185f1 100644 --- a/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java +++ b/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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,6 +63,11 @@ public static String getBaseImageVersion() { return version; } + // Ubuntu 22.04 ppc started to crash in libz inflateReset on Power8 based host + // those recent Ubuntu versions only work on Power9+ + if (Platform.isPPC()) { + return "20.04"; + } return "latest"; } } From 1b7c5aff86ff08e09de52abb002ff26ef1afc6ae Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Mon, 26 Feb 2024 18:15:04 +0000 Subject: [PATCH 252/261] 8321151: JDK-8294427 breaks Windows L&F on all older Windows versions Backport-of: f695ca588453265d6ad791c6a396197e8a53ba39 --- .../native/libawt/windows/ThemeReader.cpp | 63 +++++++++++++++---- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp b/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp index 1c317f6f334..e55f167a966 100644 --- a/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp +++ b/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp @@ -46,6 +46,7 @@ typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme); typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); +typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList); typedef HTHEME(__stdcall *PFNOPENTHEMEDATAFORDPI)(HWND hwnd, LPCWSTR pszClassList, UINT dpi); typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, @@ -90,6 +91,7 @@ typedef HRESULT (__stdcall *PFNGETTHEMETRANSITIONDURATION) (HTHEME hTheme, int iPartId, int iStateIdFrom, int iStateIdTo, int iPropId, DWORD *pdwDuration); +static PFNOPENTHEMEDATA OpenThemeDataFunc = NULL; static PFNOPENTHEMEDATAFORDPI OpenThemeDataForDpiFunc = NULL; static PFNDRAWTHEMEBACKGROUND DrawThemeBackgroundFunc = NULL; static PFNCLOSETHEMEDATA CloseThemeDataFunc = NULL; @@ -109,13 +111,17 @@ static PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT IsThemeBackgroundPartiallyTransparentFunc = NULL; static PFNGETTHEMETRANSITIONDURATION GetThemeTransitionDurationFunc = NULL; +constexpr unsigned int defaultDPI = 96; -BOOL InitThemes() { + +static BOOL InitThemes() { static HMODULE hModThemes = NULL; hModThemes = JDK_LoadSystemLibrary("UXTHEME.DLL"); DTRACE_PRINTLN1("InitThemes hModThemes = %x\n", hModThemes); if(hModThemes) { DTRACE_PRINTLN("Loaded UxTheme.dll\n"); + OpenThemeDataFunc = (PFNOPENTHEMEDATA)GetProcAddress(hModThemes, + "OpenThemeData"); OpenThemeDataForDpiFunc = (PFNOPENTHEMEDATAFORDPI)GetProcAddress( hModThemes, "OpenThemeDataForDpi"); DrawThemeBackgroundFunc = (PFNDRAWTHEMEBACKGROUND)GetProcAddress( @@ -152,7 +158,7 @@ BOOL InitThemes() { (PFNGETTHEMETRANSITIONDURATION)GetProcAddress(hModThemes, "GetThemeTransitionDuration"); - if(OpenThemeDataForDpiFunc + if((OpenThemeDataForDpiFunc || OpenThemeDataFunc) && DrawThemeBackgroundFunc && CloseThemeDataFunc && DrawThemeTextFunc @@ -173,10 +179,12 @@ BOOL InitThemes() { DTRACE_PRINTLN("Loaded function pointers.\n"); // We need to make sure we can load the Theme. // Use the default DPI value of 96 on windows. - constexpr unsigned int defaultDPI = 96; - HTHEME hTheme = OpenThemeDataForDpiFunc ( - AwtToolkit::GetInstance().GetHWnd(), - L"Button", defaultDPI); + HTHEME hTheme = OpenThemeDataForDpiFunc + ? OpenThemeDataForDpiFunc(AwtToolkit::GetInstance().GetHWnd(), + L"Button", defaultDPI) + : OpenThemeDataFunc(AwtToolkit::GetInstance().GetHWnd(), + L"Button"); + if(hTheme) { DTRACE_PRINTLN("Loaded Theme data.\n"); CloseThemeDataFunc(hTheme); @@ -246,11 +254,13 @@ JNIEXPORT jlong JNICALL Java_sun_awt_windows_ThemeReader_openTheme JNU_ThrowOutOfMemoryError(env, 0); return 0; } + // We need to open the Theme on a Window that will stick around. // The best one for that purpose is the Toolkit window. - HTHEME htheme = OpenThemeDataForDpiFunc( - AwtToolkit::GetInstance().GetHWnd(), - str, dpi); + HTHEME htheme = OpenThemeDataForDpiFunc + ? OpenThemeDataForDpiFunc(AwtToolkit::GetInstance().GetHWnd(), str, dpi) + : OpenThemeDataFunc(AwtToolkit::GetInstance().GetHWnd(), str); + JNU_ReleaseStringPlatformChars(env, widget, str); return (jlong) htheme; } @@ -430,9 +440,14 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_ThemeReader_paintBackground rect.left = 0; rect.top = 0; - rect.bottom = rectBottom; - rect.right = rectRight; + if (OpenThemeDataForDpiFunc) { + rect.bottom = rectBottom; + rect.right = rectRight; + } else { + rect.bottom = h; + rect.right = w; + } ZeroMemory(pSrcBits,(BITS_PER_PIXEL>>3)*w*h); HRESULT hres = DrawThemeBackgroundFunc(hTheme, memDC, part, state, &rect, NULL); @@ -455,6 +470,28 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_ThemeReader_paintBackground ReleaseDC(NULL,defaultDC); } +static void rescale(SIZE *size) { + static int dpiX = -1; + static int dpiY = -1; + + if (dpiX == -1 || dpiY == -1) { + HWND hWnd = ::GetDesktopWindow(); + HDC hDC = ::GetDC(hWnd); + dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX); + dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY); + ::ReleaseDC(hWnd, hDC); + } + + if (dpiX !=0 && dpiX != defaultDPI) { + float invScaleX = (float) defaultDPI / dpiX; + size->cx = (int) round(size->cx * invScaleX); + } + if (dpiY != 0 && dpiY != defaultDPI) { + float invScaleY = (float) defaultDPI / dpiY; + size->cy = (int) round(size->cy * invScaleY); + } +} + jobject newInsets(JNIEnv *env, jint top, jint left, jint bottom, jint right) { if (env->EnsureLocalCapacity(2) < 0) { return NULL; @@ -746,6 +783,10 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_ThemeReader_getPartSize CHECK_NULL_RETURN(dimMID, NULL); } + if (!OpenThemeDataForDpiFunc) { + rescale(&size); + } + jobject dimObj = env->NewObject(dimClassID, dimMID, size.cx, size.cy); if (safe_ExceptionOccurred(env)) { env->ExceptionDescribe(); From 4296ddfc6336f062e92fdfdc3b41ca20da26a126 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 27 Feb 2024 09:24:21 +0000 Subject: [PATCH 253/261] 8325496: Make TrimNativeHeapInterval a product switch Backport-of: d31fd78d963d5d103b1b1bf66ae0bdbe4be2b790 --- src/hotspot/share/runtime/globals.hpp | 4 ++-- src/java.base/share/man/java.1 | 13 ++++++++++++- .../jtreg/gtest/NativeHeapTrimmerGtest.java | 6 +++--- test/hotspot/jtreg/runtime/os/TestTrimNative.java | 14 +++++++------- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 23c0a3bdcb2..7137270fd17 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -1976,7 +1976,7 @@ const int ObjectAlignmentInBytes = 8; "2: monitors & new lightweight locking (LM_LIGHTWEIGHT)") \ range(0, 2) \ \ - product(uint, TrimNativeHeapInterval, 0, EXPERIMENTAL, \ + product(uint, TrimNativeHeapInterval, 0, \ "Interval, in ms, at which the JVM will trim the native heap if " \ "the platform supports that. Lower values will reclaim memory " \ "more eagerly at the cost of higher overhead. A value of 0 " \ diff --git a/src/java.base/share/man/java.1 b/src/java.base/share/man/java.1 index 1eeeac1889f..32cc16fb08f 100644 --- a/src/java.base/share/man/java.1 +++ b/src/java.base/share/man/java.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 1994, 2024, 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 @@ -1446,6 +1446,17 @@ usage by individual \f[V]CallSite\f[R], individual virtual memory region and its committed regions. .RE .TP +\f[V]-XX:TrimNativeHeapInterval=\f[R]\f[I]millis\f[R] +Interval, in ms, at which the JVM will trim the native heap. +Lower values will reclaim memory more eagerly at the cost of higher +overhead. +A value of 0 (default) disables native heap trimming. +Native heap trimming is performed in a dedicated thread. +.RS +.PP +This option is only supported on Linux with GNU C Library (glibc). +.RE +.TP \f[V]-XX:+NeverActAsServerClassMachine\f[R] Enable the \[dq]Client VM emulation\[dq] mode which only uses the C1 JIT compiler, a 32Mb CodeCache and the Serial GC. diff --git a/test/hotspot/jtreg/gtest/NativeHeapTrimmerGtest.java b/test/hotspot/jtreg/gtest/NativeHeapTrimmerGtest.java index 60a93e748f6..82ee888f653 100644 --- a/test/hotspot/jtreg/gtest/NativeHeapTrimmerGtest.java +++ b/test/hotspot/jtreg/gtest/NativeHeapTrimmerGtest.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2023 Red Hat, Inc. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, 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 @@ -29,5 +29,5 @@ * @modules java.base/jdk.internal.misc * java.xml * @requires vm.flagless - * @run main/native GTestWrapper --gtest_filter=os.trim* -Xlog:trimnative -XX:+UnlockExperimentalVMOptions -XX:TrimNativeHeapInterval=100 + * @run main/native GTestWrapper --gtest_filter=os.trim* -Xlog:trimnative -XX:TrimNativeHeapInterval=100 */ diff --git a/test/hotspot/jtreg/runtime/os/TestTrimNative.java b/test/hotspot/jtreg/runtime/os/TestTrimNative.java index 6bca3132b3d..33df4f06d56 100644 --- a/test/hotspot/jtreg/runtime/os/TestTrimNative.java +++ b/test/hotspot/jtreg/runtime/os/TestTrimNative.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 SAP SE. All rights reserved. - * Copyright (c) 2023 Red Hat, Inc. All rights reserved. - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Red Hat, Inc. All rights reserved. + * Copyright (c) 2023, 2024, 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 @@ -270,7 +270,7 @@ public static void main(String[] args) throws Exception { long trimInterval = 500; // twice per second long ms1 = System.currentTimeMillis(); OutputAnalyzer output = runTestWithOptions( - new String[] { "-XX:+UnlockExperimentalVMOptions", "-XX:TrimNativeHeapInterval=" + trimInterval }, + new String[] { "-XX:TrimNativeHeapInterval=" + trimInterval }, new String[] { TestTrimNative.Tester.class.getName(), "5000" } ); long ms2 = System.currentTimeMillis(); @@ -285,7 +285,7 @@ public static void main(String[] args) throws Exception { case "trimNativeHighInterval": { OutputAnalyzer output = runTestWithOptions( - new String[] { "-XX:+UnlockExperimentalVMOptions", "-XX:TrimNativeHeapInterval=" + Integer.MAX_VALUE }, + new String[] { "-XX:TrimNativeHeapInterval=" + Integer.MAX_VALUE }, new String[] { TestTrimNative.Tester.class.getName(), "5000" } ); checkExpectedLogMessages(output, true, Integer.MAX_VALUE); @@ -297,7 +297,7 @@ public static void main(String[] args) throws Exception { case "trimNativeLowIntervalStrict": { long ms1 = System.currentTimeMillis(); OutputAnalyzer output = runTestWithOptions( - new String[] { "-XX:+UnlockExperimentalVMOptions", "-XX:TrimNativeHeapInterval=1" }, + new String[] { "-XX:TrimNativeHeapInterval=1" }, new String[] { TestTrimNative.Tester.class.getName(), "0" } ); long ms2 = System.currentTimeMillis(); @@ -308,7 +308,7 @@ public static void main(String[] args) throws Exception { case "testOffOnNonCompliantPlatforms": { OutputAnalyzer output = runTestWithOptions( - new String[] { "-XX:+UnlockExperimentalVMOptions", "-XX:TrimNativeHeapInterval=1" }, + new String[] { "-XX:TrimNativeHeapInterval=1" }, new String[] { "-version" } ); checkExpectedLogMessages(output, false, 0); @@ -319,7 +319,7 @@ public static void main(String[] args) throws Exception { case "testOffExplicit": { OutputAnalyzer output = runTestWithOptions( - new String[] { "-XX:+UnlockExperimentalVMOptions", "-XX:TrimNativeHeapInterval=0" }, + new String[] { "-XX:TrimNativeHeapInterval=0" }, new String[] { "-version" } ); checkExpectedLogMessages(output, false, 0); From 36b5ac46ed4cb450a17fc993d2b734c0a8e32bc0 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Tue, 27 Feb 2024 09:50:34 +0000 Subject: [PATCH 254/261] 8323664: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java still fails with JNI warning on some Windows configurations Backport-of: 99c9ae127c0a3b8c4fc6ede87079ff7c693a2905 --- .../native/libawt/windows/awt_Debug.cpp | 21 +++++++++---------- .../font/JNICheck/FreeTypeScalerJNICheck.java | 11 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Debug.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Debug.cpp index 88dc0f17abe..148170b5a9a 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Debug.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -153,21 +153,20 @@ AwtDebugSupport::~AwtDebugSupport() { static jboolean isHeadless() { jmethodID headlessFn; JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - jclass graphicsEnvClass = env->FindClass( - "java/awt/GraphicsEnvironment"); + // be on the safe side and avoid JNI warnings by calling ExceptionCheck + // an accumulated exception is not cleared + env->ExceptionCheck(); + jclass graphicsEnvClass = env->FindClass("java/awt/GraphicsEnvironment"); if (graphicsEnvClass != NULL) { - headlessFn = env->GetStaticMethodID( - graphicsEnvClass, "isHeadless", "()Z"); + headlessFn = env->GetStaticMethodID(graphicsEnvClass, "isHeadless", "()Z"); if (headlessFn != NULL) { - return env->CallStaticBooleanMethod(graphicsEnvClass, - headlessFn); + return env->CallStaticBooleanMethod(graphicsEnvClass, headlessFn); } } return true; } - void AwtDebugSupport::AssertCallback(const char * expr, const char * file, int line) { static const int ASSERT_MSG_SIZE = 1024; static const char * AssertFmt = @@ -177,9 +176,9 @@ void AwtDebugSupport::AssertCallback(const char * expr, const char * file, int l "Do you want to break into the debugger?"; static char assertMsg[ASSERT_MSG_SIZE+1]; - DWORD lastError = GetLastError(); - LPSTR msgBuffer = NULL; - int ret = IDNO; + DWORD lastError = GetLastError(); + LPSTR msgBuffer = NULL; + int ret = IDNO; static jboolean headless = isHeadless(); DWORD fret= FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | diff --git a/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java b/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java index 73c2770fba5..942416ff781 100644 --- a/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java +++ b/test/jdk/java/awt/font/JNICheck/FreeTypeScalerJNICheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, JetBrains s.r.o.. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -45,7 +45,10 @@ public static void main(String[] args) throws Exception { } else { ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-Xcheck:jni", FreeTypeScalerJNICheck.class.getName(), "runtest"); OutputAnalyzer oa = ProcessTools.executeProcess(pb); - oa.shouldContain("Done").shouldNotContain("WARNING").shouldHaveExitValue(0); + oa.shouldContain("Done") + .shouldNotContain("WARNING") + .shouldNotContain("AWT Assertion") + .shouldHaveExitValue(0); } } @@ -54,8 +57,7 @@ public static void runTest() { BufferedImage bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi.createGraphics(); - for (String ff : families) - { + for (String ff : families) { Font font = new Font(ff, Font.PLAIN, 12); Rectangle2D bounds = font.getStringBounds("test", g2d.getFontRenderContext()); g2d.setFont(font); @@ -66,4 +68,3 @@ public static void runTest() { System.out.println("Done"); } } - From 29bf21fd99f54eb8336f64f649e515f51c7f5090 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 5 Mar 2024 03:24:52 +0000 Subject: [PATCH 255/261] 8322750: Test "api/java_awt/interactive/SystemTrayTests.html" failed because A blue ball icon is added outside of the system tray Backport-of: 5a988a5087d0afbb577c6715fd5e1e44564888cb --- .../unix/classes/sun/awt/UNIXToolkit.java | 72 ++++++++++++++++++- .../classes/sun/awt/X11/XSystemTrayPeer.java | 27 +++++-- 2 files changed, 92 insertions(+), 7 deletions(-) diff --git a/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java b/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java index 03693e6eb8d..191a12092a1 100644 --- a/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java +++ b/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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 @@ -33,6 +33,7 @@ import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VBGR; import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VRGB; import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON; +import static java.util.concurrent.TimeUnit.SECONDS; import java.awt.color.ColorSpace; @@ -47,6 +48,9 @@ import java.awt.image.DataBufferByte; import java.awt.image.Raster; import java.awt.image.WritableRaster; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; @@ -240,6 +244,72 @@ protected Object lazilyLoadGTKIcon(String longname) { return img; } + private static volatile Boolean shouldDisableSystemTray = null; + + /** + * There is an issue displaying the xembed icons in appIndicators + * area with certain Gnome Shell versions. + * To avoid any loss of quality of service, we are disabling + * SystemTray support in such cases. + * + * @return true if system tray should be disabled + */ + public boolean shouldDisableSystemTray() { + Boolean result = shouldDisableSystemTray; + if (result == null) { + synchronized (GTK_LOCK) { + result = shouldDisableSystemTray; + if (result == null) { + if ("gnome".equals(getDesktop())) { + @SuppressWarnings("removal") + Integer gnomeShellMajorVersion = + AccessController + .doPrivileged((PrivilegedAction) + this::getGnomeShellMajorVersion); + + if (gnomeShellMajorVersion == null + || gnomeShellMajorVersion < 45) { + + return shouldDisableSystemTray = true; + } + } + shouldDisableSystemTray = result = false; + } + } + } + return result; + } + + private Integer getGnomeShellMajorVersion() { + try { + Process process = + new ProcessBuilder("/usr/bin/gnome-shell", "--version") + .start(); + try (InputStreamReader isr = new InputStreamReader(process.getInputStream()); + BufferedReader reader = new BufferedReader(isr)) { + + if (process.waitFor(2, SECONDS) && process.exitValue() == 0) { + String line = reader.readLine(); + if (line != null) { + String[] versionComponents = line + .replaceAll("[^\\d.]", "") + .split("\\."); + + if (versionComponents.length >= 1) { + return Integer.parseInt(versionComponents[0]); + } + } + } + } + } catch (IOException + | InterruptedException + | IllegalThreadStateException + | NumberFormatException ignored) { + } + + return null; + } + /** * Returns a BufferedImage which contains the Gtk icon requested. If no * such icon exists or an error occurs loading the icon the result will diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java index 1a9d040616e..cdbb74ddac1 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ import sun.awt.SunToolkit; import sun.awt.AppContext; import sun.awt.AWTAccessor; +import sun.awt.UNIXToolkit; import sun.util.logging.PlatformLogger; public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener { @@ -48,22 +49,32 @@ public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener { private static final XAtom _NET_SYSTEM_TRAY_OPCODE = XAtom.get("_NET_SYSTEM_TRAY_OPCODE"); private static final XAtom _NET_WM_ICON = XAtom.get("_NET_WM_ICON"); private static final long SYSTEM_TRAY_REQUEST_DOCK = 0; + private final boolean shouldDisableSystemTray; XSystemTrayPeer(SystemTray target) { this.target = target; peerInstance = this; - selection.addSelectionListener(this); + UNIXToolkit tk = (UNIXToolkit)Toolkit.getDefaultToolkit(); + shouldDisableSystemTray = tk.shouldDisableSystemTray(); - long selection_owner = selection.getOwner(SCREEN); - available = (selection_owner != XConstants.None); + if (!shouldDisableSystemTray) { + selection.addSelectionListener(this); - if (log.isLoggable(PlatformLogger.Level.FINE)) { - log.fine(" check if system tray is available. selection owner: " + selection_owner); + long selection_owner = selection.getOwner(SCREEN); + available = (selection_owner != XConstants.None); + + if (log.isLoggable(PlatformLogger.Level.FINE)) { + log.fine(" check if system tray is available. selection owner: " + selection_owner); + } } } public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) { + if (shouldDisableSystemTray) { + return; + } + if (screen != SCREEN) { return; } @@ -77,6 +88,10 @@ public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, } public void ownerDeath(int screen, XMSelection sel, long deadOwner) { + if (shouldDisableSystemTray) { + return; + } + if (screen != SCREEN) { return; } From 07fc624683c58b708486fb1dc8afa0c2cd85ce11 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 15 Mar 2024 08:50:52 +0000 Subject: [PATCH 256/261] 8327391: Add SipHash attribution file Backport-of: fcf48ab3d36a7f8eed84e81c3e2445adcbc95374 --- src/hotspot/share/legal/siphash.md | 150 +++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 src/hotspot/share/legal/siphash.md diff --git a/src/hotspot/share/legal/siphash.md b/src/hotspot/share/legal/siphash.md new file mode 100644 index 00000000000..1583f229e1e --- /dev/null +++ b/src/hotspot/share/legal/siphash.md @@ -0,0 +1,150 @@ +## SipHash v1.0-68c8a7c + +### Notice +SipHash reference C implementation + +``` + Copyright (c) 2012-2021 Jean-Philippe Aumasson + + Copyright (c) 2012-2014 Daniel J. Bernstein + To the extent possible under law, the author(s) have dedicated all copyright + and related and neighboring rights to this software to the public domain + worldwide. This software is distributed without any warranty. + You should have received a copy of the CC0 Public Domain Dedication along + with + this software. If not, see + . +``` + +### Licenses +The code is dual-licensed CCO and MIT + +#### MIT License +``` +Copyright 2012-2024 JP Aumasson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +``` + +#### CC0 1.0 Universal +``` +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator and +subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific +works ("Commons") that the public can reliably and without fear of later +claims of infringement build upon, modify, incorporate in other works, reuse +and redistribute as freely as possible in any form whatsoever and for any +purposes, including without limitation commercial purposes. These owners may +contribute to the Commons to promote the ideal of a free culture and the +further production of creative, cultural and scientific works, or to gain +reputation or greater distribution for their Work in part through the use and +efforts of others. + +For these and/or other purposes and motivations, and without any expectation +of additional consideration or compensation, the person associating CC0 with a +Work (the "Affirmer"), to the extent that he or she is an owner of Copyright +and Related Rights in the Work, voluntarily elects to apply CC0 to the Work +and publicly distribute the Work under its terms, with knowledge of his or her +Copyright and Related Rights in the Work and the meaning and intended legal +effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not limited +to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, communicate, + and translate a Work; + + ii. moral rights retained by the original author(s) and/or performer(s); + + iii. publicity and privacy rights pertaining to a person's image or likeness + depicted in a Work; + + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + + v. rights protecting the extraction, dissemination, use and reuse of data in + a Work; + + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation thereof, + including any amended or successor version of such directive); and + + vii. other similar, equivalent or corresponding rights throughout the world + based on applicable law or treaty, and any national implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention of, +applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and +unconditionally waives, abandons, and surrenders all of Affirmer's Copyright +and Related Rights and associated claims and causes of action, whether now +known or unknown (including existing as well as future claims and causes of +action), in the Work (i) in all territories worldwide, (ii) for the maximum +duration provided by applicable law or treaty (including future time +extensions), (iii) in any current or future medium and for any number of +copies, and (iv) for any purpose whatsoever, including without limitation +commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes +the Waiver for the benefit of each member of the public at large and to the +detriment of Affirmer's heirs and successors, fully intending that such Waiver +shall not be subject to revocation, rescission, cancellation, termination, or +any other legal or equitable action to disrupt the quiet enjoyment of the Work +by the public as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason be +judged legally invalid or ineffective under applicable law, then the Waiver +shall be preserved to the maximum extent permitted taking into account +Affirmer's express Statement of Purpose. In addition, to the extent the Waiver +is so judged Affirmer hereby grants to each affected person a royalty-free, +non transferable, non sublicensable, non exclusive, irrevocable and +unconditional license to exercise Affirmer's Copyright and Related Rights in +the Work (i) in all territories worldwide, (ii) for the maximum duration +provided by applicable law or treaty (including future time extensions), (iii) +in any current or future medium and for any number of copies, and (iv) for any +purpose whatsoever, including without limitation commercial, advertising or +promotional purposes (the "License"). The License shall be deemed effective as +of the date CC0 was applied by Affirmer to the Work. Should any part of the +License for any reason be judged legally invalid or ineffective under +applicable law, such partial invalidity or ineffectiveness shall not +invalidate the remainder of the License, and in such case Affirmer hereby +affirms that he or she will not (i) exercise any of his or her remaining +Copyright and Related Rights in the Work or (ii) assert any associated claims +and causes of action with respect to the Work, in either case contrary to +Affirmer's express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + + b. Affirmer offers the Work as-is and makes no representations or warranties + of any kind concerning the Work, express, implied, statutory or otherwise, + including without limitation warranties of title, merchantability, fitness + for a particular purpose, non infringement, or the absence of latent or + other defects, accuracy, or the present or absence of errors, whether or not + discoverable, all to the greatest extent permissible under applicable law. + + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without limitation + any person's Copyright and Related Rights in the Work. Further, Affirmer + disclaims responsibility for obtaining any necessary consents, permissions + or other rights required for any use of the Work. + + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to this + CC0 or use of the Work. + +For more information, please see + + +``` From 8eba98ad61905be909b673144b68c6259346665f Mon Sep 17 00:00:00 2001 From: Yuri Nesterenko Date: Tue, 30 Jan 2024 19:48:35 +0400 Subject: [PATCH 257/261] 8315708: Enhance HTTP/2 client usage Reviewed-by: mbalao Backport-of: 4bd9637dfe12d330afd7409c27c5778b28a24cf4 --- .../jdk/internal/net/http/ConnectionPool.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java b/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java index e03dc34e900..265accdbc37 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java @@ -104,14 +104,10 @@ public boolean equals(Object obj) { return false; } if (secure && destination != null) { - if (destination.getHostName() != null) { - if (!destination.getHostName().equalsIgnoreCase( - other.destination.getHostName())) { - return false; - } - } else { - if (other.destination.getHostName() != null) - return false; + String hostString = destination.getHostString(); + if (hostString == null || !hostString.equalsIgnoreCase( + other.destination.getHostString())) { + return false; } } return true; From 5378f80a1da5aa4852e04e66aa571a47662879f8 Mon Sep 17 00:00:00 2001 From: Alexey Bakhtin Date: Mon, 5 Feb 2024 11:27:09 -0800 Subject: [PATCH 258/261] 8318340: Improve RSA key implementations Reviewed-by: mbalao Backport-of: 62d9cec1d6b804a70381bfb8ac902b6bb649f8ae --- .../security/rsa/RSAPrivateCrtKeyImpl.java | 8 -------- .../sun/security/rsa/RSAPrivateKeyImpl.java | 8 -------- .../classes/sun/security/mscapi/CKey.java | 18 +++++++++++++++++- .../sun/security/mscapi/CPrivateKey.java | 12 +----------- .../sun/security/mscapi/CPublicKey.java | 19 +++++-------------- 5 files changed, 23 insertions(+), 42 deletions(-) diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java index 99365640ec7..218b1f6f4ba 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java @@ -301,14 +301,6 @@ public AlgorithmParameterSpec getParams() { return keyParams; } - // return a string representation of this key for debugging - @Override - public String toString() { - return "SunRsaSign " + type.keyAlgo + " private CRT key, " - + n.bitLength() + " bits" + "\n params: " + keyParams - + "\n modulus: " + n + "\n private exponent: " + d; - } - // utility method for parsing DER encoding of RSA private keys in PKCS#1 // format as defined in RFC 8017 Appendix A.1.2, i.e. SEQ of version, n, // e, d, p, q, pe, qe, and coeff, and return the parsed components. diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java b/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java index da5474cb26a..aa5297b0040 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java @@ -138,14 +138,6 @@ public AlgorithmParameterSpec getParams() { return keyParams; } - // return a string representation of this key for debugging - @Override - public String toString() { - return "Sun " + type.keyAlgo + " private key, " + n.bitLength() - + " bits" + "\n params: " + keyParams + "\n modulus: " + n - + "\n private exponent: " + d; - } - /** * Restores the state of this object from the stream. *

    diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java index e010e971787..9c985f0e483 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java @@ -76,10 +76,14 @@ protected void finalize() throws Throwable { protected final String algorithm; - protected CKey(String algorithm, NativeHandles handles, int keyLength) { + private final boolean isPublic; + + protected CKey(String algorithm, NativeHandles handles, int keyLength, + boolean isPublic) { this.algorithm = algorithm; this.handles = handles; this.keyLength = keyLength; + this.isPublic = isPublic; } // Native method to cleanup the key handle. @@ -102,6 +106,18 @@ public String getAlgorithm() { return algorithm; } + public String toString() { + String typeStr; + if (handles.hCryptKey != 0) { + typeStr = getKeyType(handles.hCryptKey) + ", container=" + + getContainerName(handles.hCryptProv); + } else { + typeStr = "CNG"; + } + return algorithm + " " + (isPublic ? "PublicKey" : "PrivateKey") + + " [size=" + keyLength + " bits, type=" + typeStr + "]"; + } + protected static native String getContainerName(long hCryptProv); protected static native String getKeyType(long hCryptKey); diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPrivateKey.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPrivateKey.java index 91a7775b8bd..c3882616615 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPrivateKey.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPrivateKey.java @@ -42,7 +42,7 @@ class CPrivateKey extends CKey implements PrivateKey { private static final long serialVersionUID = 8113152807912338063L; private CPrivateKey(String alg, NativeHandles handles, int keyLength) { - super(alg, handles, keyLength); + super(alg, handles, keyLength, false); } // Called by native code inside security.cpp @@ -65,16 +65,6 @@ public byte[] getEncoded() { return null; } - public String toString() { - if (handles.hCryptKey != 0) { - return algorithm + "PrivateKey [size=" + keyLength + " bits, type=" + - getKeyType(handles.hCryptKey) + ", container=" + - getContainerName(handles.hCryptProv) + "]"; - } else { - return algorithm + "PrivateKey [size=" + keyLength + " bits, type=CNG]"; - } - } - // This class is not serializable @java.io.Serial private void writeObject(java.io.ObjectOutputStream out) diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java index 5cd5fe48d3d..3068a501b5e 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java @@ -114,9 +114,8 @@ public ECParameterSpec getParams() { } public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append(algorithm).append("PublicKey [size=").append(keyLength) - .append("]\n ECPoint: ").append(getW()) + StringBuffer sb = new StringBuffer(super.toString()); + sb.append("\n ECPoint: ").append(getW()) .append("\n params: ").append(getParams()); return sb.toString(); } @@ -135,16 +134,8 @@ public static class CRSAPublicKey extends CPublicKey implements RSAPublicKey { } public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append(algorithm).append("PublicKey [size=").append(keyLength) - .append(" bits, type="); - if (handles.hCryptKey != 0) { - sb.append(getKeyType(handles.hCryptKey)) - .append(", container=").append(getContainerName(handles.hCryptProv)); - } else { - sb.append("CNG"); - } - sb.append("]\n modulus: ").append(getModulus()) + StringBuffer sb = new StringBuffer(super.toString()); + sb.append("\n modulus: ").append(getModulus()) .append("\n public exponent: ").append(getPublicExponent()); return sb.toString(); } @@ -215,7 +206,7 @@ public static CPublicKey of( protected CPublicKey( String alg, NativeHandles handles, int keyLength) { - super(alg, handles, keyLength); + super(alg, handles, keyLength, true); } @Override From 517bd93d019ceeae9c10460b709b54581f4f48ed Mon Sep 17 00:00:00 2001 From: Martin Balao Date: Fri, 9 Feb 2024 13:06:47 +0000 Subject: [PATCH 259/261] 8322122: Enhance generation of addresses Backport-of: 1a4a46e102a2bc282fcbec571169867d715f4ade --- src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp | 6 ++++-- src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp | 8 +++++--- src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp | 8 +++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp index 952e060ed21..a9a24f7e712 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp @@ -168,8 +168,10 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, if (index->is_register()) { // apply the shift and accumulate the displacement if (shift > 0) { - LIR_Opr tmp = new_pointer_register(); - __ shift_left(index, shift, tmp); + // Use long register to avoid overflow when shifting large index values left. + LIR_Opr tmp = new_register(T_LONG); + __ convert(Bytecodes::_i2l, index, tmp); + __ shift_left(tmp, shift, tmp); index = tmp; } if (large_disp != 0) { diff --git a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp index 32aab91c7d3..b58defc1847 100644 --- a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2023 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -165,8 +165,10 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, if (index->is_register()) { // Apply the shift and accumulate the displacement. if (shift > 0) { - LIR_Opr tmp = new_pointer_register(); - __ shift_left(index, shift, tmp); + // Use long register to avoid overflow when shifting large index values left. + LIR_Opr tmp = new_register(T_LONG); + __ convert(Bytecodes::_i2l, index, tmp); + __ shift_left(tmp, shift, tmp); index = tmp; } if (large_disp != 0) { diff --git a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp index c216897d68f..8df13597425 100644 --- a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -157,8 +157,10 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, return new LIR_Address(base, index, type); } else { if (shift > 0) { - LIR_Opr tmp = new_pointer_register(); - __ shift_left(index, shift, tmp); + // Use long register to avoid overflow when shifting large index values left. + LIR_Opr tmp = new_register(T_LONG); + __ convert(Bytecodes::_i2l, index, tmp); + __ shift_left(tmp, shift, tmp); index = tmp; } return new LIR_Address(base, index, disp, type); From 778a6c40303c0b6c0b757ef5365e491d53c5a129 Mon Sep 17 00:00:00 2001 From: Martin Balao Date: Wed, 21 Feb 2024 23:31:47 +0000 Subject: [PATCH 260/261] 8319851: Improve exception logging Reviewed-by: mbaesken Backport-of: 87dfeeb14fdd0fa1648a8bec91b5b713cc2c1b83 --- src/hotspot/share/classfile/javaClasses.cpp | 19 +++++----- src/hotspot/share/classfile/javaClasses.hpp | 8 ++-- .../share/classfile/resolutionErrors.cpp | 24 +++++++----- .../share/classfile/resolutionErrors.hpp | 31 ++++++++------- .../share/classfile/systemDictionary.cpp | 7 ++-- .../share/classfile/systemDictionary.hpp | 9 +++-- src/hotspot/share/oops/constantPool.cpp | 38 ++++++++++--------- src/hotspot/share/oops/cpCache.cpp | 4 +- src/hotspot/share/utilities/exceptions.cpp | 4 +- 9 files changed, 79 insertions(+), 65 deletions(-) diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index 3e00a3fab4e..610c6baa1da 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -2073,18 +2073,17 @@ oop java_lang_Throwable::message(oop throwable) { return throwable->obj_field(_detailMessage_offset); } -oop java_lang_Throwable::cause(oop throwable) { - return throwable->obj_field(_cause_offset); +const char* java_lang_Throwable::message_as_utf8(oop throwable) { + oop msg = java_lang_Throwable::message(throwable); + const char* msg_utf8 = nullptr; + if (msg != nullptr) { + msg_utf8 = java_lang_String::as_utf8_string(msg); + } + return msg_utf8; } -// Return Symbol for detailed_message or null -Symbol* java_lang_Throwable::detail_message(oop throwable) { - PreserveExceptionMark pm(Thread::current()); - oop detailed_message = java_lang_Throwable::message(throwable); - if (detailed_message != nullptr) { - return java_lang_String::as_symbol(detailed_message); - } - return nullptr; +oop java_lang_Throwable::cause(oop throwable) { + return throwable->obj_field(_cause_offset); } void java_lang_Throwable::set_message(oop throwable, oop value) { diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp index 84ce35ba767..851ec68416e 100644 --- a/src/hotspot/share/classfile/javaClasses.hpp +++ b/src/hotspot/share/classfile/javaClasses.hpp @@ -591,12 +591,14 @@ class java_lang_Throwable: AllStatic { static void set_backtrace(oop throwable, oop value); static int depth(oop throwable); static void set_depth(oop throwable, int value); - static int get_detailMessage_offset() { CHECK_INIT(_detailMessage_offset); } // Message + static int get_detailMessage_offset() { CHECK_INIT(_detailMessage_offset); } static oop message(oop throwable); - static oop cause(oop throwable); + static const char* message_as_utf8(oop throwable); static void set_message(oop throwable, oop value); - static Symbol* detail_message(oop throwable); + + static oop cause(oop throwable); + static void print_stack_element(outputStream *st, Method* method, int bci); static void compute_offsets(); diff --git a/src/hotspot/share/classfile/resolutionErrors.cpp b/src/hotspot/share/classfile/resolutionErrors.cpp index dc916eefaf2..cf598df59d7 100644 --- a/src/hotspot/share/classfile/resolutionErrors.cpp +++ b/src/hotspot/share/classfile/resolutionErrors.cpp @@ -66,8 +66,8 @@ void ResolutionErrorTable::initialize() { // create new error entry void ResolutionErrorTable::add_entry(const constantPoolHandle& pool, int cp_index, - Symbol* error, Symbol* message, - Symbol* cause, Symbol* cause_msg) + Symbol* error, const char* message, + Symbol* cause, const char* cause_msg) { assert_locked_or_safepoint(SystemDictionary_lock); assert(!pool.is_null() && error != nullptr, "adding null obj"); @@ -97,26 +97,30 @@ ResolutionErrorEntry* ResolutionErrorTable::find_entry(const constantPoolHandle& return entry == nullptr ? nullptr : *entry; } -ResolutionErrorEntry::ResolutionErrorEntry(Symbol* error, Symbol* message, - Symbol* cause, Symbol* cause_msg): +ResolutionErrorEntry::ResolutionErrorEntry(Symbol* error, const char* message, + Symbol* cause, const char* cause_msg): _error(error), - _message(message), + _message(message != nullptr ? os::strdup(message) : nullptr), _cause(cause), - _cause_msg(cause_msg), + _cause_msg(cause_msg != nullptr ? os::strdup(cause_msg) : nullptr), _nest_host_error(nullptr) { Symbol::maybe_increment_refcount(_error); - Symbol::maybe_increment_refcount(_message); Symbol::maybe_increment_refcount(_cause); - Symbol::maybe_increment_refcount(_cause_msg); } ResolutionErrorEntry::~ResolutionErrorEntry() { // decrement error refcount Symbol::maybe_decrement_refcount(_error); - Symbol::maybe_decrement_refcount(_message); Symbol::maybe_decrement_refcount(_cause); - Symbol::maybe_decrement_refcount(_cause_msg); + + if (_message != nullptr) { + FREE_C_HEAP_ARRAY(char, _message); + } + + if (_cause_msg != nullptr) { + FREE_C_HEAP_ARRAY(char, _cause_msg); + } if (nest_host_error() != nullptr) { FREE_C_HEAP_ARRAY(char, nest_host_error()); diff --git a/src/hotspot/share/classfile/resolutionErrors.hpp b/src/hotspot/share/classfile/resolutionErrors.hpp index fc846970194..a80348e506b 100644 --- a/src/hotspot/share/classfile/resolutionErrors.hpp +++ b/src/hotspot/share/classfile/resolutionErrors.hpp @@ -36,10 +36,11 @@ class ResolutionErrorTable : AllStatic { public: static void initialize(); - static void add_entry(const constantPoolHandle& pool, int which, Symbol* error, Symbol* message, - Symbol* cause, Symbol* cause_msg); + static void add_entry(const constantPoolHandle& pool, int cp_index, + Symbol* error, const char* error_msg, + Symbol* cause, const char* cause_msg); - static void add_entry(const constantPoolHandle& pool, int which, const char* message); + static void add_entry(const constantPoolHandle& pool, int cp_index, const char* message); // find error given the constant pool and constant pool index static ResolutionErrorEntry* find_entry(const constantPoolHandle& pool, int cp_index); @@ -69,34 +70,38 @@ class ResolutionErrorTable : AllStatic { class ResolutionErrorEntry : public CHeapObj { private: Symbol* _error; - Symbol* _message; + const char* _message; Symbol* _cause; - Symbol* _cause_msg; + const char* _cause_msg; const char* _nest_host_error; NONCOPYABLE(ResolutionErrorEntry); public: - ResolutionErrorEntry(Symbol* error, Symbol* message, Symbol* cause, Symbol* cause_msg); + // The incoming message and cause_msg are copied to the C-Heap. + ResolutionErrorEntry(Symbol* error, const char* message, + Symbol* cause, const char* cause_msg); - ResolutionErrorEntry(const char* message): + // The incoming nest host error message is already in the C-Heap. + ResolutionErrorEntry(const char* message): _error(nullptr), _message(nullptr), _cause(nullptr), _cause_msg(nullptr), _nest_host_error(message) {} - ~ResolutionErrorEntry(); + ~ResolutionErrorEntry(); - void set_nest_host_error(const char* message) { - _nest_host_error = message; - } + // The incoming nest host error message is already in the C-Heap. + void set_nest_host_error(const char* message) { + _nest_host_error = message; + } Symbol* error() const { return _error; } - Symbol* message() const { return _message; } + const char* message() const { return _message; } Symbol* cause() const { return _cause; } - Symbol* cause_msg() const { return _cause_msg; } + const char* cause_msg() const { return _cause_msg; } const char* nest_host_error() const { return _nest_host_error; } }; diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index a078596814f..7022bfca7a5 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1797,8 +1797,8 @@ bool SystemDictionary::add_loader_constraint(Symbol* class_name, // Add entry to resolution error table to record the error when the first // attempt to resolve a reference to a class has failed. void SystemDictionary::add_resolution_error(const constantPoolHandle& pool, int which, - Symbol* error, Symbol* message, - Symbol* cause, Symbol* cause_msg) { + Symbol* error, const char* message, + Symbol* cause, const char* cause_msg) { { MutexLocker ml(Thread::current(), SystemDictionary_lock); ResolutionErrorEntry* entry = ResolutionErrorTable::find_entry(pool, which); @@ -1815,7 +1815,8 @@ void SystemDictionary::delete_resolution_error(ConstantPool* pool) { // Lookup resolution error table. Returns error if found, otherwise null. Symbol* SystemDictionary::find_resolution_error(const constantPoolHandle& pool, int which, - Symbol** message, Symbol** cause, Symbol** cause_msg) { + const char** message, + Symbol** cause, const char** cause_msg) { { MutexLocker ml(Thread::current(), SystemDictionary_lock); diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp index a65606e8cf6..9f65cb593d3 100644 --- a/src/hotspot/share/classfile/systemDictionary.hpp +++ b/src/hotspot/share/classfile/systemDictionary.hpp @@ -272,12 +272,13 @@ class SystemDictionary : AllStatic { // Record the error when the first attempt to resolve a reference from a constant // pool entry to a class fails. - static void add_resolution_error(const constantPoolHandle& pool, int which, Symbol* error, - Symbol* message, Symbol* cause = nullptr, Symbol* cause_msg = nullptr); + static void add_resolution_error(const constantPoolHandle& pool, int which, + Symbol* error, const char* message, + Symbol* cause = nullptr, const char* cause_msg = nullptr); static void delete_resolution_error(ConstantPool* pool); static Symbol* find_resolution_error(const constantPoolHandle& pool, int which, - Symbol** message, Symbol** cause, Symbol** cause_msg); - + const char** message, + Symbol** cause, const char** cause_msg); // Record a nest host resolution/validation error static void add_nest_host_error(const constantPoolHandle& pool, int which, diff --git a/src/hotspot/share/oops/constantPool.cpp b/src/hotspot/share/oops/constantPool.cpp index f697164c630..e2d86540641 100644 --- a/src/hotspot/share/oops/constantPool.cpp +++ b/src/hotspot/share/oops/constantPool.cpp @@ -803,13 +803,16 @@ void ConstantPool::resolve_string_constants_impl(const constantPoolHandle& this_ } } -static Symbol* exception_message(const constantPoolHandle& this_cp, int which, constantTag tag, oop pending_exception) { +static const char* exception_message(const constantPoolHandle& this_cp, int which, constantTag tag, oop pending_exception) { + // Note: caller needs ResourceMark + // Dig out the detailed message to reuse if possible - Symbol* message = java_lang_Throwable::detail_message(pending_exception); - if (message != nullptr) { - return message; + const char* msg = java_lang_Throwable::message_as_utf8(pending_exception); + if (msg != nullptr) { + return msg; } + Symbol* message = nullptr; // Return specific message for the tag switch (tag.value()) { case JVM_CONSTANT_UnresolvedClass: @@ -832,49 +835,48 @@ static Symbol* exception_message(const constantPoolHandle& this_cp, int which, c ShouldNotReachHere(); } - return message; + return message != nullptr ? message->as_C_string() : nullptr; } -static void add_resolution_error(const constantPoolHandle& this_cp, int which, +static void add_resolution_error(JavaThread* current, const constantPoolHandle& this_cp, int which, constantTag tag, oop pending_exception) { + ResourceMark rm(current); Symbol* error = pending_exception->klass()->name(); oop cause = java_lang_Throwable::cause(pending_exception); // Also dig out the exception cause, if present. Symbol* cause_sym = nullptr; - Symbol* cause_msg = nullptr; + const char* cause_msg = nullptr; if (cause != nullptr && cause != pending_exception) { cause_sym = cause->klass()->name(); - cause_msg = java_lang_Throwable::detail_message(cause); + cause_msg = java_lang_Throwable::message_as_utf8(cause); } - Symbol* message = exception_message(this_cp, which, tag, pending_exception); + const char* message = exception_message(this_cp, which, tag, pending_exception); SystemDictionary::add_resolution_error(this_cp, which, error, message, cause_sym, cause_msg); } void ConstantPool::throw_resolution_error(const constantPoolHandle& this_cp, int which, TRAPS) { ResourceMark rm(THREAD); - Symbol* message = nullptr; + const char* message = nullptr; Symbol* cause = nullptr; - Symbol* cause_msg = nullptr; + const char* cause_msg = nullptr; Symbol* error = SystemDictionary::find_resolution_error(this_cp, which, &message, &cause, &cause_msg); assert(error != nullptr, "checking"); - const char* cause_str = cause_msg != nullptr ? cause_msg->as_C_string() : nullptr; CLEAR_PENDING_EXCEPTION; if (message != nullptr) { - char* msg = message->as_C_string(); if (cause != nullptr) { - Handle h_cause = Exceptions::new_exception(THREAD, cause, cause_str); - THROW_MSG_CAUSE(error, msg, h_cause); + Handle h_cause = Exceptions::new_exception(THREAD, cause, cause_msg); + THROW_MSG_CAUSE(error, message, h_cause); } else { - THROW_MSG(error, msg); + THROW_MSG(error, message); } } else { if (cause != nullptr) { - Handle h_cause = Exceptions::new_exception(THREAD, cause, cause_str); + Handle h_cause = Exceptions::new_exception(THREAD, cause, cause_msg); THROW_CAUSE(error, h_cause); } else { THROW(error); @@ -896,7 +898,7 @@ void ConstantPool::save_and_throw_exception(const constantPoolHandle& this_cp, i // and OutOfMemoryError, etc, or if the thread was hit by stop() // Needs clarification to section 5.4.3 of the VM spec (see 6308271) } else if (this_cp->tag_at(which).value() != error_tag) { - add_resolution_error(this_cp, which, tag, PENDING_EXCEPTION); + add_resolution_error(THREAD, this_cp, which, tag, PENDING_EXCEPTION); // CAS in the tag. If a thread beat us to registering this error that's fine. // If another thread resolved the reference, this is a race condition. This // thread may have had a security manager or something temporary. diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp index 23b3ee0d49c..2d3285bb982 100644 --- a/src/hotspot/share/oops/cpCache.cpp +++ b/src/hotspot/share/oops/cpCache.cpp @@ -849,9 +849,9 @@ bool ConstantPoolCache::save_and_throw_indy_exc( CLEAR_PENDING_EXCEPTION; return false; } - + ResourceMark rm(THREAD); Symbol* error = PENDING_EXCEPTION->klass()->name(); - Symbol* message = java_lang_Throwable::detail_message(PENDING_EXCEPTION); + const char* message = java_lang_Throwable::message_as_utf8(PENDING_EXCEPTION); int encoded_index = ResolutionErrorTable::encode_cpcache_index( ConstantPool::encode_invokedynamic_index(index)); diff --git a/src/hotspot/share/utilities/exceptions.cpp b/src/hotspot/share/utilities/exceptions.cpp index fe4d849ffeb..614c1a73d20 100644 --- a/src/hotspot/share/utilities/exceptions.cpp +++ b/src/hotspot/share/utilities/exceptions.cpp @@ -565,11 +565,11 @@ void Exceptions::debug_check_abort_helper(Handle exception, const char* message) // for logging exceptions void Exceptions::log_exception(Handle exception, const char* message) { ResourceMark rm; - Symbol* detail_message = java_lang_Throwable::detail_message(exception()); + const char* detail_message = java_lang_Throwable::message_as_utf8(exception()); if (detail_message != nullptr) { log_info(exceptions)("Exception <%s: %s>\n thrown in %s", exception->print_value_string(), - detail_message->as_C_string(), + detail_message, message); } else { log_info(exceptions)("Exception <%s>\n thrown in %s", From 05f18b10620834883180013bb8873a6b4bdc6df2 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Mon, 8 Apr 2024 08:22:02 +0200 Subject: [PATCH 261/261] 8329838: [21u] Remove designator DEFAULT_PROMOTED_VERSION_PRE=ea for release 21.0.3 Reviewed-by: goetz --- make/conf/version-numbers.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/conf/version-numbers.conf b/make/conf/version-numbers.conf index b4571b544e2..819f8796e2e 100644 --- a/make/conf/version-numbers.conf +++ b/make/conf/version-numbers.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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,4 +39,4 @@ DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_VERSION_DOCS_API_SINCE=11 DEFAULT_ACCEPTABLE_BOOT_VERSIONS="20 21" DEFAULT_JDK_SOURCE_TARGET_VERSION=21 -DEFAULT_PROMOTED_VERSION_PRE=ea +DEFAULT_PROMOTED_VERSION_PRE=