From 63a6adf2b5347fff3e95c2570772bee33db8e954 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Fri, 3 Jul 2020 10:02:37 -0700 Subject: [PATCH 1/6] 8248746: Undo jhsdb related exclusiveAccess.dirs changes that were done for JDK-8220295 Reviewed-by: iignatyev --- test/jdk/TEST.ROOT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index 948f35b4774..0234ca697c4 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -24,7 +24,7 @@ javax/management sun/awt sun/java2d javax/xml/jaxp/testng/validation java/lang/P # Tests that cannot run concurrently exclusiveAccess.dirs=java/math/BigInteger/largeMemory \ java/rmi/Naming java/util/prefs sun/management/jmxremote \ -sun/tools/jstatd sun/tools/jcmd sun/tools/jhsdb sun/tools/jhsdb/heapconfig \ +sun/tools/jstatd sun/tools/jcmd \ sun/tools/jinfo sun/tools/jmap sun/tools/jps sun/tools/jstack sun/tools/jstat \ com/sun/tools/attach sun/security/mscapi java/util/stream java/util/Arrays/largeMemory \ java/util/BitSet/stream javax/rmi From 79ad5512cfe5c4ef7d0b61616f3763c62d3427a5 Mon Sep 17 00:00:00 2001 From: Yong Zhou Date: Sat, 4 Jul 2020 08:18:17 +0800 Subject: [PATCH 2/6] 8243670: Unexpected test result caused by C2 MergeMemNode::Ideal Reviewed-by: thartmann, roland --- src/hotspot/share/opto/cfgnode.cpp | 24 ++++++ src/hotspot/share/opto/memnode.cpp | 18 ----- .../compiler/c2/TestReplaceEquivPhis.java | 77 +++++++++++++++++++ 3 files changed, 101 insertions(+), 18 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index 5d1d1fc6b76..4d8e1577999 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -1335,6 +1335,30 @@ Node* PhiNode::Identity(PhaseGVN* phase) { if (id != NULL) return id; } + // Looking for phis with identical inputs. If we find one that has + // type TypePtr::BOTTOM, replace the current phi with the bottom phi. + if (phase->is_IterGVN() && type() == Type::MEMORY && adr_type() != + TypePtr::BOTTOM && !adr_type()->is_known_instance()) { + uint phi_len = req(); + Node* phi_reg = region(); + for (DUIterator_Fast imax, i = phi_reg->fast_outs(imax); i < imax; i++) { + Node* u = phi_reg->fast_out(i); + if (u->is_Phi() && u->as_Phi()->type() == Type::MEMORY && + u->adr_type() == TypePtr::BOTTOM && u->in(0) == phi_reg && + u->req() == phi_len) { + for (uint j = 1; j < phi_len; j++) { + if (in(j) != u->in(j)) { + u = NULL; + break; + } + } + if (u != NULL) { + return u; + } + } + } + } + return this; // No identity } diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index 801a2822672..42de3503de6 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -4605,24 +4605,6 @@ Node *MergeMemNode::Ideal(PhaseGVN *phase, bool can_reshape) { } // else preceding memory was not a MergeMem - // replace equivalent phis (unfortunately, they do not GVN together) - if (new_mem != NULL && new_mem != new_base && - new_mem->req() == phi_len && new_mem->in(0) == phi_reg) { - if (new_mem->is_Phi()) { - PhiNode* phi_mem = new_mem->as_Phi(); - for (uint i = 1; i < phi_len; i++) { - if (phi_base->in(i) != phi_mem->in(i)) { - phi_mem = NULL; - break; - } - } - if (phi_mem != NULL) { - // equivalent phi nodes; revert to the def - new_mem = new_base; - } - } - } - // maybe store down a new value Node* new_in = new_mem; if (new_in == new_base) new_in = empty_mem; diff --git a/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java b/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java new file mode 100644 index 00000000000..d4c93b390dd --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8243670 + * @summary Unexpected test result caused by C2 MergeMemNode::Ideal + * + * @run main/othervm -Xcomp -XX:-SplitIfBlocks + * -XX:CompileOnly=compiler.c2.TestReplaceEquivPhis::test + * -XX:-BackgroundCompilation compiler.c2.TestReplaceEquivPhis + */ + +package compiler.c2; + +public class TestReplaceEquivPhis { + + public static final int N = 400; + public static volatile int instanceCount = 0; + public int iFld = 0; + public static int iArrFld[] = new int[N]; + + public int test() { + int v = 0; + boolean bArr[] = new boolean[N]; + + for (int i = 1; i < 344; i++) { + iFld = i; + for (int j = 2; j <177 ; j++) { + v = iFld; + iFld = TestReplaceEquivPhis.instanceCount; + TestReplaceEquivPhis.iArrFld[i] = 0; + iFld += TestReplaceEquivPhis.instanceCount; + TestReplaceEquivPhis.iArrFld[i] = 0; + bArr[j] = false; + TestReplaceEquivPhis.instanceCount = 1; + + for (int k = 1; k < 3; k++) { + // do nothing + } + } + } + return v; + } + + public static void main(String[] args) { + TestReplaceEquivPhis obj = new TestReplaceEquivPhis(); + for (int i = 0; i < 5; i++) { + int result = obj.test(); + if (result != 2) { + throw new RuntimeException("Test failed."); + } + } + System.out.println("Test passed."); + } + +} From a8d20c9254dca816c597f22d3ed85be68dc6b19c Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Sat, 4 Jul 2020 01:06:07 -0700 Subject: [PATCH 3/6] 8247527: serviceability/dcmd/gc/HeapDumpCompressedTest.java fails with Graal + ZGC Excludes running Graal with GC which it does not support Reviewed-by: dholmes, iignatyev --- .../serviceability/dcmd/gc/HeapDumpCompressedTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/dcmd/gc/HeapDumpCompressedTest.java b/test/hotspot/jtreg/serviceability/dcmd/gc/HeapDumpCompressedTest.java index cb0a19a65b2..60847905beb 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/gc/HeapDumpCompressedTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/gc/HeapDumpCompressedTest.java @@ -72,7 +72,7 @@ import jdk.test.lib.process.OutputAnalyzer; /* * @test - * @requires vm.gc.Z + * @requires vm.gc.Z & !vm.graal.enabled * @summary Test of diagnostic command GC.heap_dump with gzipped output (Z GC) * @library /test/lib * @modules java.base/jdk.internal.misc @@ -84,7 +84,7 @@ import jdk.test.lib.process.OutputAnalyzer; /* * @test - * @requires vm.gc.Shenandoah + * @requires vm.gc.Shenandoah & !vm.graal.enabled * @summary Test of diagnostic command GC.heap_dump with gzipped output (Shenandoah GC) * @library /test/lib * @modules java.base/jdk.internal.misc @@ -96,7 +96,7 @@ import jdk.test.lib.process.OutputAnalyzer; /* * @test - * @requires vm.gc.Epsilon + * @requires vm.gc.Epsilon & !vm.graal.enabled * @summary Test of diagnostic command GC.heap_dump with gzipped output (Epsilon GC) * @library /test/lib * @modules java.base/jdk.internal.misc From 45fce6baf9da7698e1dc540cda1ce704bf2cf2df Mon Sep 17 00:00:00 2001 From: John Jiang Date: Tue, 7 Jul 2020 06:06:18 +0800 Subject: [PATCH 4/6] 8242538: java/security/SecureRandom/ThreadSafe.java failed on windows Reviewed-by: mullan --- test/jdk/java/security/SecureRandom/ThreadSafe.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/java/security/SecureRandom/ThreadSafe.java b/test/jdk/java/security/SecureRandom/ThreadSafe.java index fda344b199f..174f3253c5f 100644 --- a/test/jdk/java/security/SecureRandom/ThreadSafe.java +++ b/test/jdk/java/security/SecureRandom/ThreadSafe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,7 +87,7 @@ public class ThreadSafe { } inCall = true; try { - Thread.sleep(100); + Thread.sleep(500); } catch (Exception e) { // OK } From 7a4bf2456eb206952852b6d03a07525814d71efb Mon Sep 17 00:00:00 2001 From: Andy Herrick Date: Fri, 3 Jul 2020 07:49:00 -0400 Subject: [PATCH 5/6] 8248501: [macos] App created with jpackage on Mac fails with error -10810 Reviewed-by: asemenyuk, almatvee --- .../jdk/incubator/jpackage/internal/LauncherData.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/LauncherData.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/LauncherData.java index 752509444a9..f6d169558e1 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/LauncherData.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/LauncherData.java @@ -231,10 +231,11 @@ final class LauncherData { if (inputDir == null) { classPath = Collections.emptyList(); } else { - try (Stream walk = Files.walk(inputDir, 1)) { + try (Stream walk = Files.walk(inputDir, Integer.MAX_VALUE)) { Set jars = walk.filter(Files::isRegularFile) .filter(file -> file.toString().endsWith(".jar")) - .map(Path::getFileName) + .map(p -> inputDir.toAbsolutePath() + .relativize(p.toAbsolutePath())) .collect(Collectors.toSet()); jars.remove(mainJarName); classPath = jars.stream().sorted().collect(Collectors.toList()); From 653af300cc83a840a684fe2f0dc992e72b6eeabd Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 7 Jul 2020 00:09:29 +0000 Subject: [PATCH 6/6] 8248348: Regression caused by the update to BCEL 6.0 Reviewed-by: smarks, plevart --- .../internal/generic/BranchInstruction.java | 19 +- .../bcel/internal/generic/Instruction.java | 4 +- .../unittest/transform/BCELHashCodeTest.java | 58 + .../unittest/transform/BCELHashCodeTest.xsl | 2160 +++++++++++++++++ 4 files changed, 2238 insertions(+), 3 deletions(-) create mode 100644 test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.java create mode 100644 test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.xsl diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java index aea205a78f2..e650bea8ec5 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java +++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java @@ -30,7 +30,7 @@ import com.sun.org.apache.bcel.internal.util.ByteSequence; * LOOKUPSWITCH and TABLESWITCH. * * @see InstructionList - * @LastModified: Jan 2020 + * @LastModified: July 2020 */ public abstract class BranchInstruction extends Instruction implements InstructionTargeter { @@ -230,6 +230,23 @@ public abstract class BranchInstruction extends Instruction implements Instructi return target == ih; } + /** + * Updates the opcode. Before changing the opcode, reset the target so that + * the old instruction is removed from the HashSet and the new one then added. + * @param opcode the opcode + */ + @Override + void setOpcode( final short opcode ) { + if (target == null) { + super.setOpcode(opcode); + } else { + // reset target before changing the opcode + InstructionHandle t = target; + setTarget(null); + super.setOpcode(opcode); + setTarget(t); + } + } /** * Inform target that it's not targeted anymore. diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java index 08f801a0bb4..20188a9f16a 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java +++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Instruction.java @@ -29,7 +29,7 @@ import com.sun.org.apache.bcel.internal.util.ByteSequence; /** * Abstract super class for all Java byte codes. * - * @LastModified: Jan 2020 + * @LastModified: July 2020 */ public abstract class Instruction implements Cloneable { @@ -511,7 +511,7 @@ public abstract class Instruction implements Cloneable { /** * Needed in readInstruction and subclasses in this package */ - final void setOpcode( final short opcode ) { + void setOpcode( final short opcode ) { this.opcode = opcode; } diff --git a/test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.java b/test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.java new file mode 100644 index 00000000000..538aa9e2909 --- /dev/null +++ b/test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package transform; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamSource; +import org.testng.annotations.Test; + +/* + * @test + * @bug 8248348 + * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest + * @run testng transform.BCELHashCodeTest + * @summary The addition of the hashCode() method to Instruction.java in BCEL 6.0 + * caused a regression. This test verifies that the issue has been fixed. + */ +public class BCELHashCodeTest { + /** + * Verifies the patch by attempting to create a transformer from the stylesheet. + * The stylesheet contains an extra table-row with element-id="17921" that + * causes the generated bytecode to exceed the 64Kbyte method size limit. + * Splitting it into multiple methods requires mutating the instructions that + * results in an Exception without the fix. The stylesheet would pass with + * or without the fix if the extra table-row is removed. + * + * @throws TransformerConfigurationException if the test fails + */ + @Test + public void test() throws TransformerConfigurationException { + StreamSource stylesheet = new StreamSource(this.getClass() + .getResourceAsStream("BCELHashCodeTest.xsl")); + TransformerFactory tFactory =TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(stylesheet); + } +} diff --git a/test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.xsl b/test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.xsl new file mode 100644 index 00000000000..a6f37e14db2 --- /dev/null +++ b/test/jaxp/javax/xml/jaxp/unittest/transform/BCELHashCodeTest.xsl @@ -0,0 +1,2160 @@ + + +en +GB + + +null +file:. +true +null + + + + + + + + +27.94cm +29.7cm + + + + +21.59cm +21cm + + + + + + + + + + + +2.3cm +2.0cm + + +2.0cm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +