From 75ed38eaafc88aacbb7b6f06f73756c0376f5f06 Mon Sep 17 00:00:00 2001
From: Jesper Wilhelmsson
Date: Thu, 14 Feb 2019 01:22:07 +0100
Subject: [PATCH 001/109] Added tag jdk-12+32 for changeset 4ce47bc1fb92
---
.hgtags | 1 +
1 file changed, 1 insertion(+)
diff --git a/.hgtags b/.hgtags
index 0a2ba5b9f1a..0deec91eab8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -534,3 +534,4 @@ f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27
44f41693631f9b5ac78ff4d2bfabd6734fe46df2 jdk-12+29
6c377af36a5c4203f16aed8a5e4c2ecc08fcd8bd jdk-12+30
b5f7bb57de2f797be34f6c75d45c3245ad37ab97 jdk-12+31
+4ce47bc1fb92cf94c6e3d1f49d582f02dcb851ab jdk-12+32
From 799c9a66fd2c9959244ec5a41eda75416672e32d Mon Sep 17 00:00:00 2001
From: Tobias Hartmann
Date: Tue, 19 Feb 2019 08:58:55 +0100
Subject: [PATCH 002/109] 8218721: C1's CEE optimization produces safepoint
poll with invalid debug information
Bail out of CEE if one of the gotos is a safepoint but the if is not.
Reviewed-by: vlivanov, mdoerr
---
src/hotspot/share/c1/c1_Optimizer.cpp | 8 +-
.../hotspot/jtreg/compiler/c1/TestGotoIf.jasm | 171 ++++++++++++++++++
.../jtreg/compiler/c1/TestGotoIfMain.java | 46 +++++
3 files changed, 224 insertions(+), 1 deletion(-)
create mode 100644 test/hotspot/jtreg/compiler/c1/TestGotoIf.jasm
create mode 100644 test/hotspot/jtreg/compiler/c1/TestGotoIfMain.java
diff --git a/src/hotspot/share/c1/c1_Optimizer.cpp b/src/hotspot/share/c1/c1_Optimizer.cpp
index f5931ced20b..2e65a543b13 100644
--- a/src/hotspot/share/c1/c1_Optimizer.cpp
+++ b/src/hotspot/share/c1/c1_Optimizer.cpp
@@ -174,6 +174,12 @@ void CE_Eliminator::block_do(BlockBegin* block) {
for_each_phi_fun(t_block, phi, return; );
for_each_phi_fun(f_block, phi, return; );
+ // Only replace safepoint gotos if state_before information is available (if is a safepoint)
+ bool is_safepoint = if_->is_safepoint();
+ if (!is_safepoint && (t_goto->is_safepoint() || f_goto->is_safepoint())) {
+ return;
+ }
+
// 2) substitute conditional expression
// with an IfOp followed by a Goto
// cut if_ away and get node before
@@ -202,7 +208,7 @@ void CE_Eliminator::block_do(BlockBegin* block) {
// append Goto to successor
ValueStack* state_before = if_->state_before();
- Goto* goto_ = new Goto(sux, state_before, if_->is_safepoint() || t_goto->is_safepoint() || f_goto->is_safepoint());
+ Goto* goto_ = new Goto(sux, state_before, is_safepoint);
// prepare state for Goto
ValueStack* goto_state = if_state;
diff --git a/test/hotspot/jtreg/compiler/c1/TestGotoIf.jasm b/test/hotspot/jtreg/compiler/c1/TestGotoIf.jasm
new file mode 100644
index 00000000000..b5dc03af232
--- /dev/null
+++ b/test/hotspot/jtreg/compiler/c1/TestGotoIf.jasm
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 compiler/c1/TestGotoIf version 52:0 {
+ public Field f1:"I";
+ public Field f2:"I";
+ public static Field i:"I";
+
+ Method "":"()V" stack 1 locals 1 {
+ aload_0;
+ invokespecial Method java/lang/Object."":"()V";
+ return;
+ }
+
+ public Method test1:"()I" stack 3 locals 1 {
+ aload_0;
+ getfield Field f1:"I";
+ aload_0;
+ getfield Field f2:"I";
+ iconst_1;
+ isub;
+ // Without the fix, if got eliminated by CEE
+ if_icmpgt Null;
+ iconst_1;
+ Return: stack_frame_type stack1;
+ stack_map int;
+ ireturn;
+ Null: stack_frame_type same;
+ iconst_0;
+ goto Return; // Backbranch (t_goto) with safepoint
+ }
+
+ public Method test2:"()I" stack 3 locals 1 {
+ aload_0;
+ getfield Field f1:"I";
+ aload_0;
+ getfield Field f2:"I";
+ iconst_1;
+ isub;
+ goto Skip;
+ Return: stack_frame_type full;
+ stack_map int;
+ ireturn;
+ Skip: stack_frame_type full;
+ stack_map int, int;
+ // Without the fix, if got eliminated by CEE
+ if_icmpgt Null;
+ iconst_1;
+ goto Return; // Backbranch (f_goto) with safepoint
+ Null: stack_frame_type full;
+ stack_map;
+ iconst_0;
+ goto Return; // Backbranch (t_goto) with safepoint
+ }
+
+ public Method test3:"()I" stack 3 locals 1 {
+ aload_0;
+ getfield Field f1:"I";
+ aload_0;
+ getfield Field f2:"I";
+ iconst_1;
+ isub;
+ goto Skip;
+ Return: stack_frame_type full;
+ stack_map int;
+ ireturn;
+ Null: stack_frame_type full;
+ stack_map;
+ iconst_0;
+ goto Return; // Backbranch (t_goto) with safepoint
+ Skip: stack_frame_type full;
+ stack_map int, int;
+ // If will be eliminated by CEE
+ if_icmpgt Null; // Backbranch (if) with safepoint
+ iconst_1;
+ goto Return; // Backbranch (f_goto) with safepoint
+ }
+
+ public Method test4:"()I" stack 3 locals 1 {
+ aload_0;
+ getfield Field f1:"I";
+ aload_0;
+ getfield Field f2:"I";
+ iconst_1;
+ isub;
+ goto Skip;
+ Null: stack_frame_type full;
+ stack_map;
+ iconst_0;
+ Return: stack_frame_type full;
+ stack_map int;
+ ireturn;
+ Skip: stack_frame_type full;
+ stack_map int, int;
+ // If will be eliminated by CEE
+ if_icmpgt Null; // Backbranch (if) with safepoint
+ iconst_1;
+ goto Return; // Backbranch (f_goto) with safepoint
+ }
+
+ public Method test5:"()I" stack 3 locals 2 {
+ aload_0;
+ getfield Field f1:"I";
+ aload_0;
+ getfield Field f2:"I";
+ iconst_1;
+ isub;
+ goto Skip;
+ Null: stack_frame_type full;
+ stack_map;
+ iconst_0;
+ goto Return;
+ Skip: stack_frame_type full;
+ stack_map int, int;
+ // If will be eliminated by CEE
+ if_icmpgt Null; // Backbranch (if) with safepoint
+ iconst_1;
+ Return: stack_frame_type full;
+ stack_map int;
+ ireturn;
+ }
+
+ public Method test6:"()I" stack 4 locals 1 {
+ getstatic Field i:"I";
+ Loop: stack_frame_type full;
+ stack_map int;
+ // Decrement i and exit loop if < 0
+ iconst_0;
+ getstatic Field i:"I";
+ iconst_1;
+ isub;
+ dup;
+ putstatic Field i:"I";
+ if_icmpgt Exit;
+
+ iconst_1;
+ // Without the fix, if got eliminated by CEE
+ if_icmpgt Null;
+ iconst_1;
+ goto Loop; // Backbranch (f_goto) with safepoint
+ Null: stack_frame_type same;
+ iconst_0;
+ goto Loop; // Backbranch (t_goto) with safepoint
+
+ Exit: stack_frame_type full;
+ stack_map int;
+ iconst_0;
+ ireturn;
+ }
+}
diff --git a/test/hotspot/jtreg/compiler/c1/TestGotoIfMain.java b/test/hotspot/jtreg/compiler/c1/TestGotoIfMain.java
new file mode 100644
index 00000000000..ac8b1b8bedc
--- /dev/null
+++ b/test/hotspot/jtreg/compiler/c1/TestGotoIfMain.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8218721
+ * @compile TestGotoIf.jasm
+ * @run main/othervm -XX:TieredStopAtLevel=1 -Xcomp
+ * -XX:CompileCommand=compileonly,compiler.c1.TestGotoIf::test*
+ * compiler.c1.TestGotoIfMain
+ */
+
+package compiler.c1;
+
+public class TestGotoIfMain {
+ public static void main(String[] args) {
+ TestGotoIf test = new TestGotoIf();
+ test.i = 5;
+ test.test1();
+ test.test2();
+ test.test3();
+ test.test4();
+ test.test5();
+ test.test6();
+ }
+}
From b6987a91a3db7e077f13d04327de3c076eeed231 Mon Sep 17 00:00:00 2001
From: Matthias Baesken
Date: Mon, 18 Feb 2019 09:38:43 +0100
Subject: [PATCH 003/109] 8219112: name_and_sig_as_C_string usages in
frame_s390 miss ResourceMark
Reviewed-by: shade, lucy
---
src/hotspot/cpu/s390/frame_s390.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/cpu/s390/frame_s390.cpp b/src/hotspot/cpu/s390/frame_s390.cpp
index 35173f04f5b..67d519ac327 100644
--- a/src/hotspot/cpu/s390/frame_s390.cpp
+++ b/src/hotspot/cpu/s390/frame_s390.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, 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
@@ -479,6 +479,7 @@ void frame::back_trace(outputStream* st, intptr_t* start_sp, intptr_t* top_pc, u
// name
Method* method = *(Method**)((address)current_fp + _z_ijava_state_neg(method));
if (method) {
+ ResourceMark rm;
if (method->is_synchronized()) st->print("synchronized ");
if (method->is_static()) st->print("static ");
if (method->is_native()) st->print("native ");
@@ -543,6 +544,7 @@ void frame::back_trace(outputStream* st, intptr_t* start_sp, intptr_t* top_pc, u
// name
Method* method = ((nmethod *)blob)->method();
if (method) {
+ ResourceMark rm;
method->name_and_sig_as_C_string(buf, sizeof(buf));
st->print("%s ", buf);
}
From e79488cc1bd31c0e4e10b609a4d5dc97ec298db3 Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:00:51 +0100
Subject: [PATCH 004/109] 8218731: SA: Use concrete class the as return type of
VMObjectFactory.newObject
Reviewed-by: eosterlund
---
.../classes/sun/jvm/hotspot/runtime/VMObjectFactory.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java
index 7ab2c4a6d3b..ec486667979 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,14 +45,14 @@ import sun.jvm.hotspot.types.*;
*/
public class VMObjectFactory {
- public static Object newObject(Class clazz, Address addr)
+ public static T newObject(Class clazz, Address addr)
throws ConstructionException {
try {
if (addr == null) {
return null;
}
- Constructor c = clazz.getConstructor(new Class[] {
+ Constructor c = clazz.getConstructor(new Class[] {
Address.class
});
return c.newInstance(new Object[] { addr });
From ec5471796079f53deb44fc224d6402f664ab2ea1 Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:01:50 +0100
Subject: [PATCH 005/109] 8218732: SA: Resolves ZPageAllocator::_physical
incorrectly
Reviewed-by: eosterlund, jgeorge
---
.../classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java
index 07e859097fa..41d90b2a599 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@ import sun.jvm.hotspot.types.TypeDataBase;
public class ZPageAllocator extends VMObject {
- private static AddressField physicalField;
+ private static long physicalFieldOffset;
private static CIntegerField usedField;
static {
@@ -47,12 +47,12 @@ public class ZPageAllocator extends VMObject {
static private synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("ZPageAllocator");
- physicalField = type.getAddressField("_physical");
+ physicalFieldOffset = type.getAddressField("_physical").getOffset();
usedField = type.getCIntegerField("_used");
}
private ZPhysicalMemoryManager physical() {
- Address physicalAddr = physicalField.getValue(addr);
+ Address physicalAddr = addr.addOffsetTo(physicalFieldOffset);
return (ZPhysicalMemoryManager)VMObjectFactory.newObject(ZPhysicalMemoryManager.class, physicalAddr);
}
From 797122c227c29c44da4abe2cb0331b4e839393aa Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:02:00 +0100
Subject: [PATCH 006/109] 8218733: SA: CollectedHeap provides broken
implementation for used() and capacity()
Reviewed-by: shade, jgeorge, eosterlund
---
.../sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java | 10 ++++++++++
.../sun/jvm/hotspot/gc/shared/CollectedHeap.java | 6 +++---
.../jvm/hotspot/gc/shenandoah/ShenandoahHeap.java | 5 +++++
.../classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java | 12 +++++++++++-
4 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java
index 0c82492a22a..4b6ef34caf7 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java
@@ -66,6 +66,16 @@ public class EpsilonHeap extends CollectedHeap {
return CollectedHeapName.EPSILON;
}
+ @Override
+ public long capacity() {
+ return space.capacity();
+ }
+
+ @Override
+ public long used() {
+ return space.used();
+ }
+
public ContiguousSpace space() {
return space;
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
index ec47fab40d3..c240b53bd6c 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,8 +58,8 @@ public abstract class CollectedHeap extends VMObject {
return reservedRegion().start();
}
- public long capacity() { return 0; }
- public long used() { return 0; }
+ public abstract long capacity();
+ public abstract long used();
public MemRegion reservedRegion() {
return new MemRegion(addr.addOffsetTo(reservedFieldOffset));
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java
index 200633eedcc..f12a650a416 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java
@@ -63,6 +63,11 @@ public class ShenandoahHeap extends CollectedHeap {
return numRegions.getValue(addr);
}
+ @Override
+ public long capacity() {
+ return numOfRegions() * ShenandoahHeapRegion.regionSizeBytes();
+ }
+
@Override
public long used() {
return used.getValue(addr);
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
index da30683387a..321d8b24bc2 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -70,6 +70,16 @@ public class ZCollectedHeap extends CollectedHeap {
super(addr);
}
+ @Override
+ public long capacity() {
+ return heap().capacity();
+ }
+
+ @Override
+ public long used() {
+ return heap().used();
+ }
+
public OopHandle oop_load_at(OopHandle handle, long offset) {
assert(!VM.getVM().isCompressedOopsEnabled());
From 5f5c6362d9aa7f752d09be672da96c4fd3ce3b12 Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:02:42 +0100
Subject: [PATCH 007/109] 8218734: SA: Incorrect and raw loads of OopHandles
Reviewed-by: eosterlund, coleenp, jgeorge
---
src/hotspot/share/oops/oopHandle.hpp | 1 +
src/hotspot/share/runtime/vmStructs.cpp | 4 +-
.../hotspot/classfile/ClassLoaderData.java | 17 ++---
.../jvm/hotspot/gc/shared/CollectedHeap.java | 4 ++
.../sun/jvm/hotspot/gc/z/ZCollectedHeap.java | 21 +++++-
.../classes/sun/jvm/hotspot/oops/Klass.java | 20 ++----
.../sun/jvm/hotspot/oops/VMOopHandle.java | 65 +++++++++++++++++++
7 files changed, 103 insertions(+), 29 deletions(-)
create mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VMOopHandle.java
diff --git a/src/hotspot/share/oops/oopHandle.hpp b/src/hotspot/share/oops/oopHandle.hpp
index 7742106ac18..c07d4f1e976 100644
--- a/src/hotspot/share/oops/oopHandle.hpp
+++ b/src/hotspot/share/oops/oopHandle.hpp
@@ -36,6 +36,7 @@
// future uses for read barriers.
class OopHandle {
+ friend class VMStructs;
private:
oop* _obj;
diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp
index dbab2aaf124..30c6e4d86da 100644
--- a/src/hotspot/share/runtime/vmStructs.cpp
+++ b/src/hotspot/share/runtime/vmStructs.cpp
@@ -332,6 +332,7 @@ typedef PaddedEnd PaddedObjectMonitor;
unchecked_nonstatic_field(Symbol, _body, sizeof(u1)) /* NOTE: no type */ \
nonstatic_field(Symbol, _body[0], u1) \
nonstatic_field(TypeArrayKlass, _max_length, jint) \
+ nonstatic_field(OopHandle, _obj, oop*) \
\
/***********************/ \
/* Constant Pool Cache */ \
@@ -1299,7 +1300,8 @@ typedef PaddedEnd PaddedObjectMonitor;
declare_oop_type(oop) \
declare_oop_type(narrowOop) \
declare_oop_type(typeArrayOop) \
- declare_oop_type(OopHandle) \
+ \
+ declare_toplevel_type(OopHandle) \
\
/*************************************/ \
/* MethodOop-related data structures */ \
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java
index d79538b0b77..e8e6e2a72d5 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
package sun.jvm.hotspot.classfile;
-import java.io.PrintStream;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.runtime.*;
@@ -42,14 +41,14 @@ public class ClassLoaderData extends VMObject {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("ClassLoaderData");
- classLoaderField = type.getAddressField("_class_loader");
+ classLoaderFieldOffset = type.getAddressField("_class_loader").getOffset();
nextField = type.getAddressField("_next");
klassesField = new MetadataField(type.getAddressField("_klasses"), 0);
isUnsafeAnonymousField = new CIntField(type.getCIntegerField("_is_unsafe_anonymous"), 0);
dictionaryField = type.getAddressField("_dictionary");
}
- private static AddressField classLoaderField;
+ private static long classLoaderFieldOffset;
private static AddressField nextField;
private static MetadataField klassesField;
private static CIntField isUnsafeAnonymousField;
@@ -72,13 +71,9 @@ public class ClassLoaderData extends VMObject {
}
public Oop getClassLoader() {
- Address handle = classLoaderField.getValue(getAddress());
- if (handle != null) {
- // Load through the handle
- OopHandle refs = handle.getOopHandleAt(0);
- return (Instance)VM.getVM().getObjectHeap().newOop(refs);
- }
- return null;
+ Address addr = getAddress().addOffsetTo(classLoaderFieldOffset);
+ VMOopHandle vmOopHandle = VMObjectFactory.newObject(VMOopHandle.class, addr);
+ return vmOopHandle.resolve();
}
public boolean getisUnsafeAnonymous() {
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
index c240b53bd6c..1a4a8e0dc4d 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
@@ -83,6 +83,10 @@ public abstract class CollectedHeap extends VMObject {
return handle.getOopHandleAt(offset);
}
+ public OopHandle oop_load_in_native(Address addr) {
+ return addr.getOopHandleAt(0);
+ }
+
public void print() { printOn(System.out); }
public void printOn(PrintStream tty) {
MemRegion mr = reservedRegion();
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
index 321d8b24bc2..46aef865dff 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
@@ -80,11 +80,9 @@ public class ZCollectedHeap extends CollectedHeap {
return heap().used();
}
- public OopHandle oop_load_at(OopHandle handle, long offset) {
- assert(!VM.getVM().isCompressedOopsEnabled());
- Address oopAddress = handle.getAddressAt(offset);
+ private OopHandle oop_load_barrier(Address oopAddress) {
oopAddress = ZBarrier.weak_barrier(oopAddress);
if (oopAddress == null) {
return null;
@@ -93,6 +91,23 @@ public class ZCollectedHeap extends CollectedHeap {
return oopAddress.addOffsetToAsOopHandle(0);
}
+ @Override
+ public OopHandle oop_load_at(OopHandle handle, long offset) {
+ assert(!VM.getVM().isCompressedOopsEnabled());
+
+ Address oopAddress = handle.getAddressAt(offset);
+
+ return oop_load_barrier(oopAddress);
+ }
+
+ // addr can be either in heap or in native
+ @Override
+ public OopHandle oop_load_in_native(Address addr) {
+ Address oopAddress = addr.getAddressAt(0);
+
+ return oop_load_barrier(oopAddress);
+ }
+
public String oopAddressDescription(OopHandle handle) {
Address origOop = ZOop.to_address(handle);
Address loadBarrieredOop = ZBarrier.weak_barrier(origOop);
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java
index 81210e97f54..7740278cb08 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@ public class Klass extends Metadata implements ClassConstants {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("Klass");
- javaMirror = type.getAddressField("_java_mirror");
+ javaMirrorFieldOffset = type.getField("_java_mirror").getOffset();
superField = new MetadataField(type.getAddressField("_super"), 0);
layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
name = type.getAddressField("_name");
@@ -89,7 +89,7 @@ public class Klass extends Metadata implements ClassConstants {
public boolean isArrayKlass() { return false; }
// Fields
- private static AddressField javaMirror;
+ private static long javaMirrorFieldOffset;
private static MetadataField superField;
private static IntField layoutHelper;
private static AddressField name;
@@ -101,23 +101,15 @@ public class Klass extends Metadata implements ClassConstants {
private static CIntField vtableLen;
private static AddressField classLoaderData;
- private Address getValue(AddressField field) {
- return addr.getAddressAt(field.getOffset());
- }
-
protected Symbol getSymbol(AddressField field) {
return Symbol.create(addr.getAddressAt(field.getOffset()));
}
// Accessors for declared fields
public Instance getJavaMirror() {
- Address handle = javaMirror.getValue(getAddress());
- if (handle != null) {
- // Load through the handle
- OopHandle refs = handle.getOopHandleAt(0);
- return (Instance)VM.getVM().getObjectHeap().newOop(refs);
- }
- return null;
+ Address addr = getAddress().addOffsetTo(javaMirrorFieldOffset);
+ VMOopHandle vmOopHandle = VMObjectFactory.newObject(VMOopHandle.class, addr);
+ return vmOopHandle.resolve();
}
public Klass getSuper() { return (Klass) superField.getValue(this); }
public Klass getJavaSuper() { return null; }
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VMOopHandle.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VMOopHandle.java
new file mode 100644
index 00000000000..56ae46df6c0
--- /dev/null
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VMOopHandle.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import sun.jvm.hotspot.debugger.Address;
+import sun.jvm.hotspot.debugger.OopHandle;
+import sun.jvm.hotspot.runtime.VM;
+import sun.jvm.hotspot.runtime.VMObject;
+import sun.jvm.hotspot.types.AddressField;
+import sun.jvm.hotspot.types.Type;
+import sun.jvm.hotspot.types.TypeDataBase;
+
+public class VMOopHandle extends VMObject {
+ private static AddressField objField;
+
+ static {
+ VM.registerVMInitializedObserver((o, d) -> initialize(VM.getVM().getTypeDataBase()));
+ }
+
+ private static synchronized void initialize(TypeDataBase db) {
+ Type type = db.lookupType("OopHandle");
+
+ objField = type.getAddressField("_obj");
+ }
+
+ public VMOopHandle(Address addr) {
+ super(addr);
+ }
+
+ public Address getObj() {
+ return objField.getValue(addr);
+ }
+
+ public Instance resolve() {
+ Address handle = getObj();
+ if (handle != null) {
+ // Load through the handle
+ OopHandle refs = VM.getVM().getUniverse().heap().oop_load_in_native(handle);
+ return (Instance)VM.getVM().getObjectHeap().newOop(refs);
+ }
+ return null;
+ }
+}
From fc881dd8fe9ca5597e1653a16c503949381c2b8c Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:02:54 +0100
Subject: [PATCH 008/109] 8218743: SA: Add support for large bitmaps
Reviewed-by: eosterlund, jgeorge
---
.../jvm/hotspot/gc/shared/CollectedHeap.java | 6 ++
.../hotspot/utilities/BitMapInterface.java | 32 ++++++
.../hotspot/utilities/BitMapSegmented.java | 99 +++++++++++++++++++
.../sun/jvm/hotspot/utilities/MarkBits.java | 25 ++---
4 files changed, 143 insertions(+), 19 deletions(-)
create mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapInterface.java
create mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapSegmented.java
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
index 1a4a8e0dc4d..ac3ba6c0f95 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
@@ -31,6 +31,8 @@ import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.BitMapInterface;
+import sun.jvm.hotspot.utilities.BitMapSegmented;
public abstract class CollectedHeap extends VMObject {
private static long reservedFieldOffset;
@@ -93,4 +95,8 @@ public abstract class CollectedHeap extends VMObject {
tty.println("unknown subtype of CollectedHeap @ " + getAddress() + " (" +
mr.start() + "," + mr.end() + ")");
}
+
+ public BitMapInterface createBitMap(long bits) {
+ return new BitMapSegmented(bits);
+ }
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapInterface.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapInterface.java
new file mode 100644
index 00000000000..109c737e1bb
--- /dev/null
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapInterface.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.utilities;
+
+/** Minimal bitmap interface to support bitmaps spanning more than Integer.MAX_VALUE bits. */
+public interface BitMapInterface {
+ public boolean at(long offset);
+ public void atPut(long offset, boolean value);
+ public void clear();
+}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapSegmented.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapSegmented.java
new file mode 100644
index 00000000000..765709e7820
--- /dev/null
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapSegmented.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.utilities;
+
+/** A BitMap implementing the BitMapInterface. */
+public class BitMapSegmented implements BitMapInterface {
+ private static final int SegmentSizeBits = 30;
+ private static final int SegmentSize = 1 << (SegmentSizeBits - 1);
+
+ public BitMapSegmented(long sizeInBits) {
+ this.size = sizeInBits;
+
+ if (sizeInBits == 0) {
+ segmentBitMaps = new BitMap[0];
+ return;
+ }
+
+ int lastSegmentSize = (int)(sizeInBits % SegmentSize);
+
+ int segments = segmentIndex(sizeInBits - 1) + 1;
+ int completeSegments = segments - ((lastSegmentSize != 0) ? 1 : 0);
+
+ segmentBitMaps = new BitMap[segments];
+
+ for (int i = 0; i < completeSegments; i++) {
+ segmentBitMaps[i] = new BitMap(SegmentSize);
+ }
+
+ if (lastSegmentSize != 0) {
+ segmentBitMaps[completeSegments] = new BitMap(lastSegmentSize);
+ }
+ }
+
+ public long size() {
+ return size;
+ }
+
+ // Accessors
+ public boolean at(long offset) {
+ assert offset < size;
+
+ int segmentIndex = segmentIndex(offset);
+ int segmentOffset = segmentOffset(offset);
+ return segmentBitMaps[segmentIndex].at(segmentOffset);
+ }
+
+ public void atPut(long offset, boolean value) {
+ assert offset < size;
+
+ int segmentIndex = segmentIndex(offset);
+ int segmentOffset = segmentOffset(offset);
+ segmentBitMaps[segmentIndex].atPut(segmentOffset, value);
+ }
+
+ public void clear() {
+ for (BitMap map : segmentBitMaps) {
+ map.clear();
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+ private final long size; // in bits
+ private final BitMap[] segmentBitMaps;
+
+ private int segmentIndex(long offset) {
+ long longIndex = offset / SegmentSize;
+
+ assert longIndex < Integer.MAX_VALUE;
+ return (int)longIndex;
+ }
+
+ private int segmentOffset(long offset) {
+ return (int)(offset % SegmentSize);
+ }
+}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java
index 5b247573749..a3c52ad316a 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,8 +41,7 @@ public class MarkBits {
start = reserved.start();
end = reserved.end();
long numOopHandles = end.minus(start) / VM.getVM().getOopSize();
- // FIXME: will have trouble with larger heap sizes
- bits = new BitMap((int) numOopHandles);
+ bits = heap.createBitMap(numOopHandles);
}
public void clear() {
@@ -60,34 +59,22 @@ public class MarkBits {
}
OopHandle handle = obj.getHandle();
- // FIXME: will have trouble with larger heap sizes
long idx = handle.minus(start) / VM.getVM().getOopSize();
- if ((idx < 0) || (idx >= bits.size())) {
- System.err.println("MarkBits: WARNING: object " + handle + " outside of heap, ignoring");
- return false;
- }
- int intIdx = (int) idx;
- if (bits.at(intIdx)) {
+ if (bits.at(idx)) {
return false; // already marked
}
- bits.atPut(intIdx, true);
+ bits.atPut(idx, true);
return true;
}
/** Forces clearing of a given mark bit. */
public void clear(Oop obj) {
OopHandle handle = obj.getHandle();
- // FIXME: will have trouble with larger heap sizes
long idx = handle.minus(start) / VM.getVM().getOopSize();
- if ((idx < 0) || (idx >= bits.size())) {
- System.err.println("MarkBits: WARNING: object " + handle + " outside of heap, ignoring");
- return;
- }
- int intIdx = (int) idx;
- bits.atPut(intIdx, false);
+ bits.atPut(idx, false);
}
- private BitMap bits;
+ private BitMapInterface bits;
private Address start;
private Address end;
}
From a5ec26c6817f1c979f40a3a21f50254af618175b Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:03:29 +0100
Subject: [PATCH 009/109] 8218746: SA: Implement discontiguous bitmap for ZGC
Reviewed-by: eosterlund, jgeorge
---
.../sun/jvm/hotspot/gc/z/ZCollectedHeap.java | 7 ++
.../sun/jvm/hotspot/gc/z/ZExternalBitMap.java | 111 ++++++++++++++++++
.../classes/sun/jvm/hotspot/gc/z/ZPage.java | 8 +-
3 files changed, 124 insertions(+), 2 deletions(-)
create mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
index 46aef865dff..dc7e443c4f2 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
@@ -34,6 +34,7 @@ import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
+import sun.jvm.hotspot.utilities.BitMapInterface;
// Mirror class for ZCollectedHeap.
@@ -117,4 +118,10 @@ public class ZCollectedHeap extends CollectedHeap {
return handle.toString();
}
}
+
+ @Override
+ public BitMapInterface createBitMap(long size) {
+ // Ignores the size
+ return new ZExternalBitMap(this);
+ }
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java
new file mode 100644
index 00000000000..c0d11d86958
--- /dev/null
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.gc.z;
+
+import java.util.HashMap;
+
+import sun.jvm.hotspot.runtime.VM;
+import sun.jvm.hotspot.utilities.BitMap;
+import sun.jvm.hotspot.utilities.BitMapInterface;
+
+/** Discontiguous bitmap for ZGC. */
+public class ZExternalBitMap implements BitMapInterface {
+ private ZPageTable pageTable;
+ private final long oopSize;
+
+ private HashMap pageToBitMap = new HashMap();
+
+ public ZExternalBitMap(ZCollectedHeap collectedHeap) {
+ pageTable = collectedHeap.heap().pageTable();
+ oopSize = VM.getVM().getOopSize();
+ }
+
+ private ZPage getPage(long zOffset) {
+ if (zOffset > ZGlobals.ZAddressOffsetMask) {
+ throw new RuntimeException("Not a Z offset: " + zOffset);
+ }
+
+ ZPage page = pageTable.get(ZOop.to_address(zOffset));
+ if (page == null) {
+ throw new RuntimeException("Address not in pageTable: " + zOffset);
+ }
+ return page;
+ }
+
+ private BitMap getOrAddBitMap(ZPage page) {
+ BitMap bitMap = pageToBitMap.get(page);
+ if (bitMap == null) {
+ long size = page.size();
+
+ long maxNumObjects = size >>> page.object_alignment_shift();
+ if (maxNumObjects > Integer.MAX_VALUE) {
+ throw new RuntimeException("int overflow");
+ }
+ int intMaxNumObjects = (int)maxNumObjects;
+
+ bitMap = new BitMap(intMaxNumObjects);
+ pageToBitMap.put(page, bitMap);
+ }
+
+ return bitMap;
+ }
+
+ private int pageLocalBitMapIndex(ZPage page, long zOffset) {
+ long pageLocalZOffset = zOffset - page.start();
+ return (int)(pageLocalZOffset >>> page.object_alignment_shift());
+ }
+
+ private long convertToZOffset(long offset) {
+ long addr = ZGlobals.ZAddressSpaceStart + oopSize * offset;
+ return addr & ZGlobals.ZAddressOffsetMask;
+ }
+
+ @Override
+ public boolean at(long offset) {
+ long zOffset = convertToZOffset(offset);
+ ZPage page = getPage(zOffset);
+ BitMap bitMap = getOrAddBitMap(page);
+ int index = pageLocalBitMapIndex(page, zOffset);
+
+ return bitMap.at(index);
+ }
+
+ @Override
+ public void atPut(long offset, boolean value) {
+ long zOffset = convertToZOffset(offset);
+ ZPage page = getPage(zOffset);
+ BitMap bitMap = getOrAddBitMap(page);
+ int index = pageLocalBitMapIndex(page, zOffset);
+
+ bitMap.atPut(index, value);
+ }
+
+ @Override
+ public void clear() {
+ for (BitMap bitMap : pageToBitMap.values()) {
+ bitMap.clear();
+ }
+ }
+}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java
index 806b1d66774..82ef313ca3e 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -65,10 +65,14 @@ public class ZPage extends VMObject {
return (ZForwardingTable)VMObjectFactory.newObject(ZForwardingTable.class, addr.addOffsetTo(forwardingFieldOffset));
}
- private long start() {
+ long start() {
return virtual().start();
}
+ long size() {
+ return virtual().end() - virtual().start();
+ }
+
Address forward_object(Address from) {
// Lookup address in forwarding table
long from_offset = ZAddress.offset(from);
From f9dfc701c8a80d814635fb8a22982da9a4f9d696 Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:03:41 +0100
Subject: [PATCH 010/109] 8219003: SA: Refactor live regions iteration in
preparation for JDK-8218922
Reviewed-by: eosterlund, ysuenaga
---
.../gc/cms/CompactibleFreeListSpace.java | 15 ++--
.../gc/cms/ConcurrentMarkSweepGeneration.java | 5 +-
.../jvm/hotspot/gc/epsilon/EpsilonHeap.java | 5 ++
.../jvm/hotspot/gc/g1/G1CollectedHeap.java | 14 ++-
.../sun/jvm/hotspot/gc/g1/HeapRegion.java | 9 +-
.../hotspot/gc/parallel/ImmutableSpace.java | 4 +-
.../jvm/hotspot/gc/parallel/MutableSpace.java | 6 +-
.../gc/parallel/ParallelScavengeHeap.java | 32 ++++++-
.../hotspot/gc/serial/DefNewGeneration.java | 7 +-
.../hotspot/gc/serial/TenuredGeneration.java | 6 +-
.../jvm/hotspot/gc/shared/CollectedHeap.java | 3 +
.../hotspot/gc/shared/ContiguousSpace.java | 8 +-
.../hotspot/gc/shared/GenCollectedHeap.java | 11 ++-
.../sun/jvm/hotspot/gc/shared/Generation.java | 3 +-
.../hotspot/gc/shared/GenerationFactory.java | 4 +-
.../hotspot/gc/shared/LiveRegionsClosure.java | 29 ++++++
.../gc/shared/LiveRegionsProvider.java | 33 +++++++
.../sun/jvm/hotspot/gc/shared/Space.java | 5 +-
.../hotspot/gc/shenandoah/ShenandoahHeap.java | 7 ++
.../sun/jvm/hotspot/gc/z/ZCollectedHeap.java | 9 +-
.../sun/jvm/hotspot/oops/ObjectHeap.java | 89 +++++--------------
21 files changed, 205 insertions(+), 99 deletions(-)
create mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsClosure.java
create mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsProvider.java
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java
index 01034aeeb7e..0678c1b1b92 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@ import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;
-public class CompactibleFreeListSpace extends CompactibleSpace {
+public class CompactibleFreeListSpace extends CompactibleSpace implements LiveRegionsProvider {
private static AddressField collectorField;
private static AddressField indexedFreeListField;
private static AddressField dictionaryField;
@@ -93,10 +93,10 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
}
public long used0() {
- List regions = getLiveRegions();
+ List regions = getLiveRegions();
long usedSize = 0L;
- for (Iterator itr = regions.iterator(); itr.hasNext();) {
- MemRegion mr = (MemRegion) itr.next();
+ for (Iterator itr = regions.iterator(); itr.hasNext();) {
+ MemRegion mr = itr.next();
usedSize += mr.byteSize();
}
return usedSize;
@@ -154,8 +154,9 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
return addr;
}
- public List/**/ getLiveRegions() {
- List res = new ArrayList(); // List
+ @Override
+ public List getLiveRegions() {
+ List res = new ArrayList<>();
VM vm = VM.getVM();
Debugger dbg = vm.getDebugger();
ObjectHeap heap = vm.getObjectHeap();
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java
index 86b1caad447..22a4ef40f9d 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,6 +66,9 @@ public class ConcurrentMarkSweepGeneration extends CardGeneration {
public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
blk.doSpace(cmsSpace());
}
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ closure.doLiveRegions(cmsSpace());
+ }
public Generation.Name kind() {
return Generation.Name.CONCURRENT_MARK_SWEEP;
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java
index 4b6ef34caf7..7360927f783 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/epsilon/EpsilonHeap.java
@@ -80,6 +80,11 @@ public class EpsilonHeap extends CollectedHeap {
return space;
}
+ @Override
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ closure.doLiveRegions(space());
+ }
+
@Override
public void printOn(PrintStream tty) {
MemRegion mr = reservedRegion();
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java
index 65e7caac7bf..0d359d7f8b3 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,9 @@ import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.gc.shared.CollectedHeap;
import sun.jvm.hotspot.gc.shared.CollectedHeapName;
-import sun.jvm.hotspot.gc.shared.SpaceClosure;
+import sun.jvm.hotspot.gc.shared.LiveRegionsClosure;
import sun.jvm.hotspot.gc.shared.PrintRegionClosure;
+import sun.jvm.hotspot.gc.shared.SpaceClosure;
import sun.jvm.hotspot.memory.MemRegion;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
@@ -137,6 +138,15 @@ public class G1CollectedHeap extends CollectedHeap {
return CollectedHeapName.G1;
}
+ @Override
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ Iterator iter = heapRegionIterator();
+ while (iter.hasNext()) {
+ HeapRegion hr = iter.next();
+ closure.doLiveRegions(hr);
+ }
+ }
+
@Override
public void printOn(PrintStream tty) {
MemRegion mr = reservedRegion();
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java
index 47d721386ea..126f8308038 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@ import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.gc.shared.CompactibleSpace;
+import sun.jvm.hotspot.gc.shared.LiveRegionsProvider;
import sun.jvm.hotspot.memory.MemRegion;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
@@ -43,7 +44,7 @@ import sun.jvm.hotspot.types.TypeDataBase;
// Mirror class for HeapRegion. Currently we don't actually include
// any of its fields but only iterate over it.
-public class HeapRegion extends CompactibleSpace {
+public class HeapRegion extends CompactibleSpace implements LiveRegionsProvider {
// static int GrainBytes;
static private CIntegerField grainBytesField;
static private AddressField topField;
@@ -86,8 +87,8 @@ public class HeapRegion extends CompactibleSpace {
}
@Override
- public List getLiveRegions() {
- List res = new ArrayList();
+ public List getLiveRegions() {
+ List res = new ArrayList<>();
res.add(new MemRegion(bottom(), top()));
return res;
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java
index 61a3b749c34..831e13d6661 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ public abstract class ImmutableSpace extends VMObject {
}
/** returns all MemRegions where live objects are */
- public abstract List/**/ getLiveRegions();
+ public abstract List getLiveRegions();
/** Returned value is in bytes */
public long capacity() { return end().minus(bottom()); }
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java
index 7a6aa3914ad..540fc981d7b 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,8 +62,8 @@ public class MutableSpace extends ImmutableSpace {
}
/** returns all MemRegions where live objects are */
- public List/**/ getLiveRegions() {
- List res = new ArrayList();
+ public List getLiveRegions() {
+ List res = new ArrayList<>();
res.add(new MemRegion(bottom(), top()));
return res;
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java
index 220fe9d3a41..93b62112359 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@ import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.gc.shared.*;
+import sun.jvm.hotspot.memory.MemRegion;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
@@ -88,6 +89,35 @@ public class ParallelScavengeHeap extends CollectedHeap {
return CollectedHeapName.PARALLEL;
}
+ // Simple wrapper to provide toString() usable for debugging.
+ private class LiveRegionProviderImpl implements LiveRegionsProvider {
+ private String name;
+ private MutableSpace space;
+
+ public LiveRegionProviderImpl(String name, MutableSpace space) {
+ this.name = name;
+ this.space = space;
+ }
+
+ @Override
+ public List getLiveRegions() {
+ return space.getLiveRegions();
+ }
+ @Override
+ public String toString() {
+ return name;
+ }
+ }
+
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ // Add eden space
+ closure.doLiveRegions(new LiveRegionProviderImpl("eden", youngGen().edenSpace()));
+ // Add from-space but not to-space
+ closure.doLiveRegions(new LiveRegionProviderImpl("from", youngGen().fromSpace()));
+
+ closure.doLiveRegions(new LiveRegionProviderImpl("old ", oldGen().objectSpace()));
+ }
+
public void printOn(PrintStream tty) {
tty.print("ParallelScavengeHeap [ ");
youngGen().printOn(tty);
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java
index 620c2d76cdf..8fbe0f93c9f 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -94,6 +94,11 @@ public class DefNewGeneration extends Generation {
}
}
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ closure.doLiveRegions(eden());
+ closure.doLiveRegions(from());
+ }
+
public void printOn(PrintStream tty) {
tty.print(" eden");
eden().printOn(tty);
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java
index 9a81b0774e7..18e09a01d8a 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -76,6 +76,10 @@ public class TenuredGeneration extends CardGeneration {
blk.doSpace(theSpace());
}
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ closure.doLiveRegions(theSpace());
+ }
+
public void printOn(PrintStream tty) {
tty.print(" old ");
theSpace().printOn(tty);
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
index ac3ba6c0f95..d27d311d39f 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java
@@ -28,6 +28,7 @@ import java.io.*;
import java.util.*;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.gc.shared.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
@@ -77,6 +78,8 @@ public abstract class CollectedHeap extends VMObject {
public abstract CollectedHeapName kind();
+ public abstract void liveRegionsIterate(LiveRegionsClosure closure);
+
public String oopAddressDescription(OopHandle handle) {
return handle.toString();
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java
index c62c47dc97c..9530d88dac6 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
-public class ContiguousSpace extends CompactibleSpace {
+public class ContiguousSpace extends CompactibleSpace implements LiveRegionsProvider {
private static AddressField topField;
static {
@@ -79,8 +79,8 @@ public class ContiguousSpace extends CompactibleSpace {
}
/** Returns regions of Space where live objects live */
- public List/**/ getLiveRegions() {
- List res = new ArrayList();
+ public List getLiveRegions() {
+ List res = new ArrayList<>();
res.add(new MemRegion(bottom(), top()));
return res;
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java
index ad49d153c38..33f2452a9f1 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@ import java.io.*;
import java.util.*;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.gc.shared.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;
@@ -134,6 +135,14 @@ abstract public class GenCollectedHeap extends CollectedHeap {
}
}
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ // Run through all generations, obtaining bottom-top pairs.
+ for (int i = 0; i < nGens(); i++) {
+ Generation gen = getGen(i);
+ gen.liveRegionsIterate(closure);
+ }
+ }
+
public void printOn(PrintStream tty) {
for (int i = 0; i < nGens(); i++) {
tty.print("Gen " + i + ": ");
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java
index fcefa7386ed..03ca5a17b89 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -184,6 +184,7 @@ public abstract class Generation extends VMObject {
/** Iteration - do not use for time critical operations */
public abstract void spaceIterate(SpaceClosure blk, boolean usedOnly);
+ public abstract void liveRegionsIterate(LiveRegionsClosure closure);
public void print() { printOn(System.out); }
public abstract void printOn(PrintStream tty);
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java
index 5818513c330..5ae969218bd 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -65,6 +65,8 @@ public class GenerationFactory {
}
public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
}
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ }
public void printOn(java.io.PrintStream tty) {
tty.println("unknown subtype of Generation @ " + getAddress() + " (" +
virtualSpace().low() + "," + virtualSpace().high() + ")");
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsClosure.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsClosure.java
new file mode 100644
index 00000000000..9b7298536e2
--- /dev/null
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsClosure.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.gc.shared;
+
+public interface LiveRegionsClosure {
+ public void doLiveRegions(LiveRegionsProvider lrp);
+}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsProvider.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsProvider.java
new file mode 100644
index 00000000000..45fcf83f4fd
--- /dev/null
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/LiveRegionsProvider.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.gc.shared;
+
+import java.util.List;
+
+import sun.jvm.hotspot.memory.MemRegion;
+
+public interface LiveRegionsProvider {
+ public List getLiveRegions();
+}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java
index 1f941e9747b..56008b2dec4 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,9 +89,6 @@ public abstract class Space extends VMObject {
return handle.addOffsetToAsOopHandle(size);
}
- /** returns all MemRegions where live objects are */
- public abstract List/**/ getLiveRegions();
-
/** Returned value is in bytes */
public long capacity() { return end().minus(bottom()); }
/** Returned value is in bytes */
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java
index f12a650a416..001ed51f430 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java
@@ -25,6 +25,7 @@ package sun.jvm.hotspot.gc.shenandoah;
import sun.jvm.hotspot.gc.shared.CollectedHeap;
import sun.jvm.hotspot.gc.shared.CollectedHeapName;
+import sun.jvm.hotspot.gc.shared.LiveRegionsClosure;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Type;
@@ -77,6 +78,12 @@ public class ShenandoahHeap extends CollectedHeap {
return committed.getValue(addr);
}
+ @Override
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ // Operation (currently) not supported with Shenandoah GC.
+ System.err.println("Warning: Operation not supported with Shenandoah GC");
+ }
+
@Override
public void printOn(PrintStream tty) {
MemRegion mr = reservedRegion();
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
index dc7e443c4f2..61d1a0a19f4 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
@@ -30,6 +30,7 @@ import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.gc.shared.CollectedHeap;
import sun.jvm.hotspot.gc.shared.CollectedHeapName;
+import sun.jvm.hotspot.gc.shared.LiveRegionsClosure;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.Type;
@@ -39,7 +40,6 @@ import sun.jvm.hotspot.utilities.BitMapInterface;
// Mirror class for ZCollectedHeap.
public class ZCollectedHeap extends CollectedHeap {
-
private static long zHeapFieldOffset;
static {
@@ -119,6 +119,13 @@ public class ZCollectedHeap extends CollectedHeap {
}
}
+ @Override
+ public void liveRegionsIterate(LiveRegionsClosure closure) {
+ // Operation (currently) not supported with ZGC. Print
+ // a warning and leave the list of live regions empty.
+ System.err.println("Warning: Operation not supported with ZGC");
+ }
+
@Override
public BitMapInterface createBitMap(long size) {
// Ignores the size
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
index 831f6d33285..2a96a58a6aa 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -304,87 +304,48 @@ public class ObjectHeap {
visitor.epilogue();
}
- private void addLiveRegions(String name, List input, List output) {
- for (Iterator itr = input.iterator(); itr.hasNext();) {
- MemRegion reg = (MemRegion) itr.next();
+ private static class LiveRegionsCollector implements LiveRegionsClosure {
+ LiveRegionsCollector(List l) {
+ liveRegions = l;
+ }
+
+ @Override
+ public void doLiveRegions(LiveRegionsProvider lrp) {
+ for (MemRegion reg : lrp.getLiveRegions()) {
Address top = reg.end();
Address bottom = reg.start();
if (Assert.ASSERTS_ENABLED) {
- Assert.that(top != null, "top address in a live region should not be null");
+ Assert.that(top != null, "top address in a live region should not be null");
}
if (Assert.ASSERTS_ENABLED) {
- Assert.that(bottom != null, "bottom address in a live region should not be null");
+ Assert.that(bottom != null, "bottom address in a live region should not be null");
}
- output.add(top);
- output.add(bottom);
+ liveRegions.add(top);
+ liveRegions.add(bottom);
if (DEBUG) {
- System.err.println("Live region: " + name + ": " + bottom + ", " + top);
- }
- }
+ System.err.println("Live region: " + lrp + ": " + bottom + ", " + top);
+ }
+ }
}
- private class LiveRegionsCollector implements SpaceClosure {
- LiveRegionsCollector(List l) {
- liveRegions = l;
- }
-
- public void doSpace(Space s) {
- addLiveRegions(s.toString(), s.getLiveRegions(), liveRegions);
- }
- private List liveRegions;
+ private List liveRegions;
}
// Returns a List where the addresses come in pairs. These
// designate the live regions of the heap.
- private List collectLiveRegions() {
+ private List collectLiveRegions() {
// We want to iterate through all live portions of the heap, but
// do not want to abort the heap traversal prematurely if we find
// a problem (like an allocated but uninitialized object at the
// top of a generation). To do this we enumerate all generations'
// bottom and top regions, and factor in TLABs if necessary.
- // List. Addresses come in pairs.
- List liveRegions = new ArrayList();
+ // Addresses come in pairs.
+ List liveRegions = new ArrayList<>();
LiveRegionsCollector lrc = new LiveRegionsCollector(liveRegions);
CollectedHeap heap = VM.getVM().getUniverse().heap();
-
- if (heap instanceof GenCollectedHeap) {
- GenCollectedHeap genHeap = (GenCollectedHeap) heap;
- // Run through all generations, obtaining bottom-top pairs.
- for (int i = 0; i < genHeap.nGens(); i++) {
- Generation gen = genHeap.getGen(i);
- gen.spaceIterate(lrc, true);
- }
- } else if (heap instanceof ParallelScavengeHeap) {
- ParallelScavengeHeap psh = (ParallelScavengeHeap) heap;
- PSYoungGen youngGen = psh.youngGen();
- // Add eden space
- addLiveRegions("eden", youngGen.edenSpace().getLiveRegions(), liveRegions);
- // Add from-space but not to-space
- addLiveRegions("from", youngGen.fromSpace().getLiveRegions(), liveRegions);
- PSOldGen oldGen = psh.oldGen();
- addLiveRegions("old ", oldGen.objectSpace().getLiveRegions(), liveRegions);
- } else if (heap instanceof G1CollectedHeap) {
- G1CollectedHeap g1h = (G1CollectedHeap) heap;
- g1h.heapRegionIterate(lrc);
- } else if (heap instanceof ShenandoahHeap) {
- // Operation (currently) not supported with Shenandoah GC. Print
- // a warning and leave the list of live regions empty.
- System.err.println("Warning: Operation not supported with Shenandoah GC");
- } else if (heap instanceof ZCollectedHeap) {
- // Operation (currently) not supported with ZGC. Print
- // a warning and leave the list of live regions empty.
- System.err.println("Warning: Operation not supported with ZGC");
- } else if (heap instanceof EpsilonHeap) {
- EpsilonHeap eh = (EpsilonHeap) heap;
- liveRegions.add(eh.space().top());
- liveRegions.add(eh.space().bottom());
- } else {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(false, "Unexpected CollectedHeap type: " + heap.getClass().getName());
- }
- }
+ heap.liveRegionsIterate(lrc);
// If UseTLAB is enabled, snip out regions associated with TLABs'
// dead regions. Note that TLABs can be present in any generation.
@@ -440,11 +401,9 @@ public class ObjectHeap {
return liveRegions;
}
- private void sortLiveRegions(List liveRegions) {
- Collections.sort(liveRegions, new Comparator() {
- public int compare(Object o1, Object o2) {
- Address a1 = (Address) o1;
- Address a2 = (Address) o2;
+ private void sortLiveRegions(List liveRegions) {
+ Collections.sort(liveRegions, new Comparator() {
+ public int compare(Address a1, Address a2) {
if (AddressOps.lt(a1, a2)) {
return -1;
} else if (AddressOps.gt(a1, a2)) {
From f7e7180ff4269600ba7fd08d0840d7d68688f6c7 Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:04:28 +0100
Subject: [PATCH 011/109] 8218922: SA: Enable best-effort implementation of
live regions iteration for ZGC
Reviewed-by: eosterlund, ysuenaga
---
src/hotspot/share/gc/z/vmStructs_z.cpp | 3 +-
src/hotspot/share/gc/z/vmStructs_z.hpp | 7 +
src/hotspot/share/gc/z/zCollectedHeap.cpp | 6 +-
src/hotspot/share/gc/z/zCollectedHeap.hpp | 4 +-
src/hotspot/share/gc/z/zMark.cpp | 6 +
.../sun/jvm/hotspot/gc/z/ZAddress.java | 4 +-
.../gc/z/ZAddressRangeMapForPageTable.java | 31 +++-
.../sun/jvm/hotspot/gc/z/ZCollectedHeap.java | 9 +-
.../sun/jvm/hotspot/gc/z/ZExternalBitMap.java | 2 +-
.../sun/jvm/hotspot/gc/z/ZGlobals.java | 8 +-
.../hotspot/gc/z/ZGlobalsForVMStructs.java | 8 +-
.../classes/sun/jvm/hotspot/gc/z/ZOop.java | 18 +--
.../classes/sun/jvm/hotspot/gc/z/ZPage.java | 140 +++++++++++++++++-
.../sun/jvm/hotspot/gc/z/ZPageTable.java | 112 +++++++++++++-
.../sun/jvm/hotspot/gc/z/ZPageTableEntry.java | 12 +-
.../classes/sun/jvm/hotspot/gc/z/ZUtils.java | 43 ++++++
16 files changed, 369 insertions(+), 44 deletions(-)
create mode 100644 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZUtils.java
diff --git a/src/hotspot/share/gc/z/vmStructs_z.cpp b/src/hotspot/share/gc/z/vmStructs_z.cpp
index 68b3880534b..12b2f364df1 100644
--- a/src/hotspot/share/gc/z/vmStructs_z.cpp
+++ b/src/hotspot/share/gc/z/vmStructs_z.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
ZGlobalsForVMStructs::ZGlobalsForVMStructs() :
_ZGlobalPhase(&ZGlobalPhase),
+ _ZGlobalSeqNum(&ZGlobalSeqNum),
_ZAddressGoodMask(&ZAddressGoodMask),
_ZAddressBadMask(&ZAddressBadMask),
_ZAddressWeakBadMask(&ZAddressWeakBadMask),
diff --git a/src/hotspot/share/gc/z/vmStructs_z.hpp b/src/hotspot/share/gc/z/vmStructs_z.hpp
index 498ff173969..fb8fb8992a5 100644
--- a/src/hotspot/share/gc/z/vmStructs_z.hpp
+++ b/src/hotspot/share/gc/z/vmStructs_z.hpp
@@ -42,6 +42,8 @@ public:
uint32_t* _ZGlobalPhase;
+ uint32_t* _ZGlobalSeqNum;
+
uintptr_t* _ZAddressGoodMask;
uintptr_t* _ZAddressBadMask;
uintptr_t* _ZAddressWeakBadMask;
@@ -55,6 +57,7 @@ typedef ZAddressRangeMap ZAddressRangeMapFor
#define VM_STRUCTS_ZGC(nonstatic_field, volatile_nonstatic_field, static_field) \
static_field(ZGlobalsForVMStructs, _instance_p, ZGlobalsForVMStructs*) \
nonstatic_field(ZGlobalsForVMStructs, _ZGlobalPhase, uint32_t*) \
+ nonstatic_field(ZGlobalsForVMStructs, _ZGlobalSeqNum, uint32_t*) \
nonstatic_field(ZGlobalsForVMStructs, _ZAddressGoodMask, uintptr_t*) \
nonstatic_field(ZGlobalsForVMStructs, _ZAddressBadMask, uintptr_t*) \
nonstatic_field(ZGlobalsForVMStructs, _ZAddressWeakBadMask, uintptr_t*) \
@@ -67,7 +70,10 @@ typedef ZAddressRangeMap ZAddressRangeMapFor
nonstatic_field(ZHeap, _pagetable, ZPageTable) \
\
nonstatic_field(ZPage, _type, const uint8_t) \
+ nonstatic_field(ZPage, _seqnum, uint32_t) \
nonstatic_field(ZPage, _virtual, const ZVirtualMemory) \
+ volatile_nonstatic_field(ZPage, _top, uintptr_t) \
+ volatile_nonstatic_field(ZPage, _refcount, uint32_t) \
nonstatic_field(ZPage, _forwarding, ZForwardingTable) \
\
nonstatic_field(ZPageAllocator, _physical, ZPhysicalMemoryManager) \
@@ -101,6 +107,7 @@ typedef ZAddressRangeMap ZAddressRangeMapFor
declare_constant(ZAddressOffsetShift) \
declare_constant(ZAddressOffsetBits) \
declare_constant(ZAddressOffsetMask) \
+ declare_constant(ZAddressOffsetMax) \
declare_constant(ZAddressSpaceStart)
#define VM_TYPES_ZGC(declare_type, declare_toplevel_type, declare_integer_type) \
diff --git a/src/hotspot/share/gc/z/zCollectedHeap.cpp b/src/hotspot/share/gc/z/zCollectedHeap.cpp
index 5f1277387a9..8457ca53a14 100644
--- a/src/hotspot/share/gc/z/zCollectedHeap.cpp
+++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -118,10 +118,6 @@ bool ZCollectedHeap::is_in_closed_subset(const void* p) const {
return is_in(p);
}
-void ZCollectedHeap::fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap) {
- // Does nothing, not a parsable heap
-}
-
HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size) {
const size_t size_in_bytes = ZUtils::words_to_bytes(align_object_size(requested_size));
const uintptr_t addr = _heap.alloc_tlab(size_in_bytes);
diff --git a/src/hotspot/share/gc/z/zCollectedHeap.hpp b/src/hotspot/share/gc/z/zCollectedHeap.hpp
index 0ada2f32ac0..02dd3d309a0 100644
--- a/src/hotspot/share/gc/z/zCollectedHeap.hpp
+++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,8 +75,6 @@ public:
virtual bool is_in(const void* p) const;
virtual bool is_in_closed_subset(const void* p) const;
- virtual void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
-
virtual HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded);
virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
size_t size,
diff --git a/src/hotspot/share/gc/z/zMark.cpp b/src/hotspot/share/gc/z/zMark.cpp
index 101fdc65681..861e74608c3 100644
--- a/src/hotspot/share/gc/z/zMark.cpp
+++ b/src/hotspot/share/gc/z/zMark.cpp
@@ -119,6 +119,11 @@ void ZMark::prepare_mark() {
}
class ZMarkRootsIteratorClosure : public ZRootsIteratorClosure {
+private:
+ static void fixup_address(HeapWord** p) {
+ *p = (HeapWord*)ZAddress::good_or_null((uintptr_t)*p);
+ }
+
public:
ZMarkRootsIteratorClosure() {
ZStatTLAB::reset();
@@ -136,6 +141,7 @@ public:
// Retire TLAB
if (UseTLAB && thread->is_Java_thread()) {
+ thread->tlab().addresses_do(fixup_address);
thread->tlab().retire(ZStatTLAB::get());
thread->tlab().resize();
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddress.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddress.java
index b9ff2a1301e..31e158b0dd5 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddress.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddress.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@ class ZAddress {
value |= ZGlobals.ZAddressSpaceStart;
}
- return ZOop.to_address(value);
+ return ZUtils.longToAddress(value);
}
static Address good(Address value) {
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddressRangeMapForPageTable.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddressRangeMapForPageTable.java
index 3d2d2c90869..62224d641c2 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddressRangeMapForPageTable.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddressRangeMapForPageTable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,15 +54,38 @@ public class ZAddressRangeMapForPageTable extends VMObject {
return mapField.getValue(addr);
}
+ public long size() {
+ return ZGlobals.ZAddressOffsetMax >> AddressRangeShift;
+ }
+
private long index_for_addr(Address addr) {
long index = ZAddress.offset(addr) >> AddressRangeShift;
return index;
}
- Address get(Address addr) {
- long index = index_for_addr(addr);
-
+ Address at(long index) {
return map().getAddressAt(index * VM.getVM().getBytesPerLong());
}
+
+ Address get(Address addr) {
+ long index = index_for_addr(addr);
+ return at(index);
+ }
+
+ public class Iterator {
+ private long next = 0;
+
+ boolean hasNext() {
+ return next < size();
+ }
+
+ Address next() {
+ if (next >= size()) {
+ throw new RuntimeException("OOIBE");
+ }
+
+ return at(next++);
+ }
+ }
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
index 61d1a0a19f4..e54da112312 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZCollectedHeap.java
@@ -25,6 +25,7 @@
package sun.jvm.hotspot.gc.z;
import java.io.PrintStream;
+import java.util.Iterator;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
@@ -121,9 +122,11 @@ public class ZCollectedHeap extends CollectedHeap {
@Override
public void liveRegionsIterate(LiveRegionsClosure closure) {
- // Operation (currently) not supported with ZGC. Print
- // a warning and leave the list of live regions empty.
- System.err.println("Warning: Operation not supported with ZGC");
+ Iterator iter = heap().pageTable().activePagesIterator();
+ while (iter.hasNext()) {
+ ZPage page = iter.next();
+ closure.doLiveRegions(page);
+ }
}
@Override
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java
index c0d11d86958..842221b80e0 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java
@@ -47,7 +47,7 @@ public class ZExternalBitMap implements BitMapInterface {
throw new RuntimeException("Not a Z offset: " + zOffset);
}
- ZPage page = pageTable.get(ZOop.to_address(zOffset));
+ ZPage page = pageTable.get(ZUtils.longToAddress(zOffset));
if (page == null) {
throw new RuntimeException("Address not in pageTable: " + zOffset);
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobals.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobals.java
index 174e7a62553..86ffb5f91c0 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobals.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobals.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,7 @@ public class ZGlobals {
// Pointer part of address
public static long ZAddressOffsetBits;
public static long ZAddressOffsetMask;
+ public static long ZAddressOffsetMax;
// Address space start/end/size
public static long ZAddressSpaceStart;
@@ -84,6 +85,7 @@ public class ZGlobals {
ZAddressOffsetBits = db.lookupLongConstant("ZAddressOffsetBits").longValue();
ZAddressOffsetMask = db.lookupLongConstant("ZAddressOffsetMask").longValue();
+ ZAddressOffsetMax = db.lookupLongConstant("ZAddressOffsetMax").longValue();
ZAddressSpaceStart = db.lookupLongConstant("ZAddressSpaceStart").longValue();
}
@@ -96,6 +98,10 @@ public class ZGlobals {
return instance().ZGlobalPhase();
}
+ public static int ZGlobalSeqNum() {
+ return instance().ZGlobalSeqNum();
+ }
+
public static long ZAddressGoodMask() {
return instance().ZAddressGoodMask();
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobalsForVMStructs.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobalsForVMStructs.java
index a6bfb3a33c2..a8cb54a1aa9 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobalsForVMStructs.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobalsForVMStructs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@ import sun.jvm.hotspot.types.TypeDataBase;
class ZGlobalsForVMStructs extends VMObject {
private static AddressField ZGlobalPhaseField;
+ private static AddressField ZGlobalSeqNumField;
private static AddressField ZAddressGoodMaskField;
private static AddressField ZAddressBadMaskField;
private static AddressField ZAddressWeakBadMaskField;
@@ -47,6 +48,7 @@ class ZGlobalsForVMStructs extends VMObject {
Type type = db.lookupType("ZGlobalsForVMStructs");
ZGlobalPhaseField = type.getAddressField("_ZGlobalPhase");
+ ZGlobalSeqNumField = type.getAddressField("_ZGlobalSeqNum");
ZAddressGoodMaskField = type.getAddressField("_ZAddressGoodMask");
ZAddressBadMaskField = type.getAddressField("_ZAddressBadMask");
ZAddressWeakBadMaskField = type.getAddressField("_ZAddressWeakBadMask");
@@ -62,6 +64,10 @@ class ZGlobalsForVMStructs extends VMObject {
return ZGlobalPhaseField.getValue(addr).getJIntAt(0);
}
+ int ZGlobalSeqNum() {
+ return ZGlobalSeqNumField.getValue(addr).getJIntAt(0);
+ }
+
long ZAddressGoodMask() {
return ZAddressGoodMaskField.getValue(addr).getJLongAt(0);
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZOop.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZOop.java
index 20d8e0decbc..3c922d953d9 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZOop.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZOop.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,23 +26,9 @@ package sun.jvm.hotspot.gc.z;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
-import sun.jvm.hotspot.runtime.VM;
class ZOop {
- private static final long MSB = ~0L ^ (~0L >>> 1);
-
- private static Address msbAddress() {
- return VM.getVM().getUniverse().heap().start().orWithMask(MSB).andWithMask(MSB);
- }
-
- static Address to_address(long value) {
- // If the value of an Address becomes 0, null is returned instead of an Address.
- // Start with a one-bit address and as a last step, remove that bit.
- Address oneAddress = msbAddress();
- return oneAddress.orWithMask(value).xorWithMask(ZAddress.as_long(oneAddress));
- }
-
static Address to_address(OopHandle oop) {
- return to_address(ZAddress.as_long(oop));
+ return ZUtils.longToAddress(ZAddress.as_long(oop));
}
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java
index 82ef313ca3e..79f48aeef5b 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPage.java
@@ -24,17 +24,29 @@
package sun.jvm.hotspot.gc.z;
+import java.util.ArrayList;
+import java.util.List;
+
import sun.jvm.hotspot.debugger.Address;
+import sun.jvm.hotspot.debugger.OopHandle;
+import sun.jvm.hotspot.gc.shared.LiveRegionsProvider;
+import sun.jvm.hotspot.memory.MemRegion;
+import sun.jvm.hotspot.oops.Oop;
+import sun.jvm.hotspot.oops.UnknownOopException;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.runtime.VMObjectFactory;
+import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
-public class ZPage extends VMObject {
+public class ZPage extends VMObject implements LiveRegionsProvider {
private static CIntegerField typeField;
+ private static CIntegerField seqnumField;
private static long virtualFieldOffset;
+ private static AddressField topField;
+ private static CIntegerField refcountField;
private static long forwardingFieldOffset;
static {
@@ -45,7 +57,10 @@ public class ZPage extends VMObject {
Type type = db.lookupType("ZPage");
typeField = type.getCIntegerField("_type");
+ seqnumField = type.getCIntegerField("_seqnum");
virtualFieldOffset = type.getField("_virtual").getOffset();
+ topField = type.getAddressField("_top");
+ refcountField = type.getCIntegerField("_refcount");
forwardingFieldOffset = type.getField("_forwarding").getOffset();
}
@@ -57,12 +72,40 @@ public class ZPage extends VMObject {
return typeField.getJByte(addr);
}
+ private int seqnum() {
+ return seqnumField.getJInt(addr);
+ }
+
private ZVirtualMemory virtual() {
- return (ZVirtualMemory)VMObjectFactory.newObject(ZVirtualMemory.class, addr.addOffsetTo(virtualFieldOffset));
+ return VMObjectFactory.newObject(ZVirtualMemory.class, addr.addOffsetTo(virtualFieldOffset));
+ }
+
+ private Address top() {
+ return topField.getValue(addr);
+ }
+
+ private int refcount() {
+ // refcount is uint32_t so need to be cautious when using this field.
+ return refcountField.getJInt(addr);
}
private ZForwardingTable forwarding() {
- return (ZForwardingTable)VMObjectFactory.newObject(ZForwardingTable.class, addr.addOffsetTo(forwardingFieldOffset));
+ return VMObjectFactory.newObject(ZForwardingTable.class, addr.addOffsetTo(forwardingFieldOffset));
+ }
+
+ private boolean is_forwarding() {
+ return forwarding().table() != null;
+ }
+
+ private boolean is_relocatable() {
+ return is_active() && seqnum() < ZGlobals.ZGlobalSeqNum();
+ }
+
+ private boolean isPageRelocating() {
+ assert(is_active());
+ // is_forwarding(): Has a (relocation) forwarding table
+ // is_relocatable(): Has not been freed yet
+ return is_forwarding() && is_relocatable();
}
long start() {
@@ -98,7 +141,6 @@ public class ZPage extends VMObject {
return ZAddress.good(from);
}
-
long object_alignment_shift() {
if (type() == ZGlobals.ZPageTypeSmall) {
return ZGlobals.ZObjectAlignmentSmallShift();
@@ -109,4 +151,94 @@ public class ZPage extends VMObject {
return ZGlobals.ZObjectAlignmentLargeShift;
}
}
+
+ long objectAlignmentSize() {
+ return 1 << object_alignment_shift();
+ }
+
+ public boolean is_active() {
+ return refcount() != 0;
+ }
+
+ private long getObjectSize(Address good) {
+ OopHandle handle = good.addOffsetToAsOopHandle(0);
+ Oop obj = null;
+
+ try {
+ obj = VM.getVM().getObjectHeap().newOop(handle);
+ } catch (UnknownOopException exp) {
+ throw new RuntimeException(" UnknownOopException " + exp);
+ }
+
+ return VM.getVM().alignUp(obj.getObjectSize(), objectAlignmentSize());
+ }
+
+ private void addNotRelocatedRegions(List regions) {
+ MemRegion mr = null;
+
+ // Some objects have already been forwarded to new locations.
+ long topValue = top().asLongValue();
+ for (long offsetValue = start(); offsetValue < topValue;) {
+ Address from = ZAddress.good(ZUtils.longToAddress(offsetValue));
+
+ Address to = relocate_object(from);
+
+ long byteSize;
+ try {
+ byteSize = getObjectSize(to);
+ } catch (Exception e) {
+ // Parsing the ZHeap is inherently unsafe
+ // when classes have been unloaded. Dead objects
+ // might have stale Klass pointers, and there's
+ // no way to get the size of the dead object.
+ //
+ // If possible, run with -XX:-ClassUnloading
+ // to ensure that all Klasses are kept alive.
+ System.err.println("Unparsable regions found. Skipping: "
+ + from
+ + " "
+ + from.addOffsetTo(topValue - offsetValue));
+
+ // Can't proceed further. Just return the collected regions.
+ return;
+ }
+
+ if (from.equals(to)) {
+ // Not relocated - add region
+ if (mr == null) {
+ mr = new MemRegion(from, 0 /* wordSize */);
+ regions.add(mr);
+ }
+
+ long wordSize = byteSize / VM.getVM().getBytesPerWord();
+ mr.setWordSize(mr.wordSize() + wordSize);
+ } else {
+ // Forwarded somewhere else, split region.
+ mr = null;
+ }
+
+ offsetValue += byteSize;
+ }
+ }
+
+ public List getLiveRegions() {
+ List res = new ArrayList<>();
+
+ if (isPageRelocating()) {
+ addNotRelocatedRegions(res);
+ } else {
+ Address start = ZAddress.good(ZUtils.longToAddress(start()));
+
+ // Can't convert top() to a "good" address because it might
+ // be at the top of the "offset" range, and therefore also
+ // looks like one of the color bits. Instead use the "good"
+ // address and add the size.
+ long size = top().asLongValue() - start();
+ Address end = start.addOffsetTo(size);
+
+ res.add(new MemRegion(start, end));
+ }
+
+ return res;
+ }
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTable.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTable.java
index 128f03d63db..ae11742093e 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTable.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
package sun.jvm.hotspot.gc.z;
+import java.util.Iterator;
+
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
@@ -63,4 +65,112 @@ public class ZPageTable extends VMObject {
boolean is_relocating(Address o) {
return getEntry(o).relocating();
}
+
+ private class ZPagesIterator implements Iterator {
+ private ZAddressRangeMapForPageTable.Iterator mapIter;
+ private ZPage next;
+
+ ZPagesIterator() {
+ mapIter = map().new Iterator();
+ positionToNext();
+ }
+
+ private ZPage positionToNext() {
+ ZPage current = next;
+
+ // Find next
+ ZPage found = null;
+ while (mapIter.hasNext()) {
+ ZPageTableEntry entry = new ZPageTableEntry(mapIter.next());
+ if (!entry.isEmpty()) {
+ ZPage page = entry.page();
+ // Medium pages have repeated entries for all covered slots,
+ // therefore we need to compare against the current page.
+ if (page != null && !page.equals(current)) {
+ found = page;
+ break;
+ }
+ }
+ }
+
+ next = found;
+
+ return current;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return next != null;
+ }
+
+ @Override
+ public ZPage next() {
+ return positionToNext();
+ }
+
+ @Override
+ public void remove() {
+ /* not supported */
+ }
+ }
+
+ abstract class ZPageFilter {
+ public abstract boolean accept(ZPage page);
+ }
+
+ class ZPagesFilteredIterator implements Iterator {
+ private ZPage next;
+ private ZPagesIterator iter = new ZPagesIterator();
+ private ZPageFilter filter;
+
+ ZPagesFilteredIterator(ZPageFilter filter) {
+ this.filter = filter;
+ positionToNext();
+ }
+
+ public ZPage positionToNext() {
+ ZPage current = next;
+
+ // Find next
+ ZPage found = null;
+ while (iter.hasNext()) {
+ ZPage page = iter.next();
+ if (filter.accept(page)) {
+ found = page;
+ break;
+ }
+ }
+
+ next = found;
+
+ return current;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return next != null;
+ }
+
+ @Override
+ public ZPage next() {
+ return positionToNext();
+ }
+
+ @Override
+ public void remove() {
+ /* not supported */
+ }
+ }
+
+ public Iterator iterator() {
+ return new ZPagesIterator();
+ }
+
+ public Iterator activePagesIterator() {
+ return new ZPagesFilteredIterator(new ZPageFilter() {
+ public boolean accept(ZPage page) {
+ return page.is_active();
+ }
+ });
+ }
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTableEntry.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTableEntry.java
index 8b7af88213f..bad4e999ae3 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTableEntry.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageTableEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,10 +35,18 @@ class ZPageTableEntry {
}
ZPage page() {
- return (ZPage)VMObjectFactory.newObject(ZPage.class, entry.andWithMask(~1L));
+ return (ZPage)VMObjectFactory.newObject(ZPage.class, zPageBits());
+ }
+
+ private Address zPageBits() {
+ return entry.andWithMask(~1L);
}
boolean relocating() {
return (entry.asLongValue() & 1) == 1;
}
+
+ boolean isEmpty() {
+ return entry == null || zPageBits() == null;
+ }
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZUtils.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZUtils.java
new file mode 100644
index 00000000000..64916bc74d5
--- /dev/null
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZUtils.java
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ *
+ */
+
+package sun.jvm.hotspot.gc.z;
+
+import sun.jvm.hotspot.debugger.Address;
+import sun.jvm.hotspot.runtime.VM;
+
+class ZUtils {
+ private static final long MSB = ~0L ^ (~0L >>> 1);
+
+ private static Address msbAddress() {
+ return VM.getVM().getUniverse().heap().start().orWithMask(MSB).andWithMask(MSB);
+ }
+
+ static Address longToAddress(long value) {
+ // If the value of an Address becomes 0, null is returned instead of an Address.
+ // Start with a one-bit address and as a last step, remove that bit.
+ Address oneAddress = msbAddress();
+ return oneAddress.orWithMask(value).xorWithMask(ZAddress.as_long(oneAddress));
+ }
+}
From e9af7c1561307e15965619d2f440cbf82075c2e5 Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:04:44 +0100
Subject: [PATCH 012/109] 8218970: SA: Enable HeapHprofBinWriter for ZGC
Reviewed-by: eosterlund, ysuenaga
---
.../classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
index 1c41dc40ff6..6864be53ab2 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
@@ -390,9 +390,6 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
public synchronized void write(String fileName) throws IOException {
VM vm = VM.getVM();
- if (vm.getUniverse().heap() instanceof ZCollectedHeap) {
- throw new RuntimeException("This operation is not supported with ZGC.");
- }
// open file stream and create buffered data output stream
fos = new FileOutputStream(fileName);
From bbbcf986ead77356c2f826ac6e8318a752bbaa2d Mon Sep 17 00:00:00 2001
From: Stefan Karlsson
Date: Tue, 19 Feb 2019 10:04:53 +0100
Subject: [PATCH 013/109] 8218978: SA: Enable more ZGC testing
Reviewed-by: eosterlund, ysuenaga
---
.../jtreg/serviceability/sa/ClhsdbJhisto.java | 1 -
.../sa/TestHeapDumpForInvokeDynamic.java | 1 -
.../sa/TestHeapDumpForLargeArray.java | 1 -
.../jtreg/serviceability/sa/TestJmapCore.java | 15 ++-------------
4 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java
index 6b4b6917096..51e582e92f6 100644
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java
@@ -36,7 +36,6 @@ import jtreg.SkippedException;
* @summary Test clhsdb jhisto command
* @requires vm.hasSA
* @requires vm.gc != "Shenandoah"
- * @requires vm.gc != "Z"
* @library /test/lib
* @run main/othervm ClhsdbJhisto
*/
diff --git a/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java b/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java
index c31638eeded..134975ead10 100644
--- a/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java
+++ b/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java
@@ -50,7 +50,6 @@ import jdk.test.lib.hprof.model.Snapshot;
* @test
* @library /test/lib
* @requires vm.hasSAandCanAttach & os.family != "mac"
- * @requires vm.gc != "Z"
* @modules java.base/jdk.internal.misc
* jdk.hotspot.agent/sun.jvm.hotspot
* jdk.hotspot.agent/sun.jvm.hotspot.utilities
diff --git a/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java b/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java
index d1aa3c61558..8691854557b 100644
--- a/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java
+++ b/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java
@@ -48,7 +48,6 @@ import jdk.test.lib.Asserts;
* @bug 8171084
* @requires vm.hasSAandCanAttach & (vm.bits == "64" & os.maxMemory > 8g)
* @requires vm.gc != "Shenandoah"
- * @requires vm.gc != "Z"
* @modules java.base/jdk.internal.misc
* jdk.hotspot.agent/sun.jvm.hotspot
* jdk.hotspot.agent/sun.jvm.hotspot.utilities
diff --git a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java
index c1aa70668c5..8821d0b7371 100644
--- a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java
+++ b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java
@@ -138,19 +138,8 @@ public class TestJmapCore {
if (dumpFile.exists() && dumpFile.isFile()) {
HprofParser.parse(dumpFile);
} else {
- boolean ZGCUsed = false;
-
- for (String opt: Utils.getFilteredTestJavaOpts()) {
- if (opt.contains("+UseZGC")) {
- ZGCUsed = true;
- break;
- }
- }
-
- if (!ZGCUsed) {
- throw new RuntimeException(
- "Could not find dump file " + dumpFile.getAbsolutePath());
- }
+ throw new RuntimeException(
+ "Could not find dump file " + dumpFile.getAbsolutePath());
}
System.out.println("PASSED");
From a3b6a825bc08853bbbfe498ba3623b8358d91d18 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Tue, 19 Feb 2019 12:56:00 +0100
Subject: [PATCH 014/109] 8218672: AOT code root scanning shows in the wrong
position in the logs
Reviewed-by: lkorinth, kbarrett
---
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp | 15 ++++++---------
src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp | 6 +++---
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
index 14b18a1d213..a3d254693bf 100644
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
@@ -60,6 +60,9 @@ G1GCPhaseTimes::G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads) :
_gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray(max_gc_threads, "SystemDictionary Roots (ms):");
_gc_par_phases[CLDGRoots] = new WorkerDataArray(max_gc_threads, "CLDG Roots (ms):");
_gc_par_phases[JVMTIRoots] = new WorkerDataArray(max_gc_threads, "JVMTI Roots (ms):");
+#if INCLUDE_AOT
+ _gc_par_phases[AOTCodeRoots] = new WorkerDataArray(max_gc_threads, "AOT Root Scan (ms):");
+#endif
_gc_par_phases[CMRefRoots] = new WorkerDataArray(max_gc_threads, "CM RefProcessor Roots (ms):");
_gc_par_phases[WaitForStrongCLD] = new WorkerDataArray(max_gc_threads, "Wait For Strong CLD (ms):");
_gc_par_phases[WeakCLDRoots] = new WorkerDataArray(max_gc_threads, "Weak CLD Roots (ms):");
@@ -74,9 +77,6 @@ G1GCPhaseTimes::G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads) :
_gc_par_phases[ScanRS] = new WorkerDataArray(max_gc_threads, "Scan RS (ms):");
_gc_par_phases[OptScanRS] = new WorkerDataArray(max_gc_threads, "Optional Scan RS (ms):");
_gc_par_phases[CodeRoots] = new WorkerDataArray(max_gc_threads, "Code Root Scanning (ms):");
-#if INCLUDE_AOT
- _gc_par_phases[AOTCodeRoots] = new WorkerDataArray(max_gc_threads, "AOT Root Scanning (ms):");
-#endif
_gc_par_phases[ObjCopy] = new WorkerDataArray(max_gc_threads, "Object Copy (ms):");
_gc_par_phases[OptObjCopy] = new WorkerDataArray(max_gc_threads, "Optional Object Copy (ms):");
_gc_par_phases[Termination] = new WorkerDataArray(max_gc_threads, "Termination (ms):");
@@ -389,9 +389,6 @@ double G1GCPhaseTimes::print_evacuate_collection_set() const {
}
debug_phase(_gc_par_phases[ScanRS]);
debug_phase(_gc_par_phases[CodeRoots]);
-#if INCLUDE_AOT
- debug_phase(_gc_par_phases[AOTCodeRoots]);
-#endif
debug_phase(_gc_par_phases[ObjCopy]);
debug_phase(_gc_par_phases[Termination]);
debug_phase(_gc_par_phases[Other]);
@@ -503,6 +500,9 @@ const char* G1GCPhaseTimes::phase_name(GCParPhases phase) {
"SystemDictionaryRoots",
"CLDGRoots",
"JVMTIRoots",
+#if INCLUDE_AOT
+ "AOTCodeRoots",
+#endif
"CMRefRoots",
"WaitForStrongCLD",
"WeakCLDRoots",
@@ -512,9 +512,6 @@ const char* G1GCPhaseTimes::phase_name(GCParPhases phase) {
"ScanRS",
"OptScanRS",
"CodeRoots",
-#if INCLUDE_AOT
- "AOTCodeRoots",
-#endif
"ObjCopy",
"OptObjCopy",
"Termination",
diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
index eabc64c14e0..1f3fcd529ac 100644
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
@@ -55,6 +55,9 @@ class G1GCPhaseTimes : public CHeapObj {
SystemDictionaryRoots,
CLDGRoots,
JVMTIRoots,
+#if INCLUDE_AOT
+ AOTCodeRoots,
+#endif
CMRefRoots,
WaitForStrongCLD,
WeakCLDRoots,
@@ -64,9 +67,6 @@ class G1GCPhaseTimes : public CHeapObj {
ScanRS,
OptScanRS,
CodeRoots,
-#if INCLUDE_AOT
- AOTCodeRoots,
-#endif
ObjCopy,
OptObjCopy,
Termination,
From 8b5d08be9ff8f73ad21b3b54154d32da0bcb5b91 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Tue, 19 Feb 2019 12:56:02 +0100
Subject: [PATCH 015/109] 8218920: Scan HCC should be on the same level as
Update RS etc. in the log
Reviewed-by: lkorinth, kbarrett
---
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp | 4 ++--
test/hotspot/jtreg/gc/g1/TestGCLogMessages.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
index a3d254693bf..b469d1cf2e8 100644
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
@@ -383,10 +383,10 @@ double G1GCPhaseTimes::print_evacuate_collection_set() const {
for (int i = ThreadRoots; i <= SATBFiltering; i++) {
trace_phase(_gc_par_phases[i]);
}
- debug_phase(_gc_par_phases[UpdateRS]);
if (G1HotCardCache::default_use_cache()) {
- trace_phase(_gc_par_phases[ScanHCC]);
+ debug_phase(_gc_par_phases[ScanHCC]);
}
+ debug_phase(_gc_par_phases[UpdateRS]);
debug_phase(_gc_par_phases[ScanRS]);
debug_phase(_gc_par_phases[CodeRoots]);
debug_phase(_gc_par_phases[ObjCopy]);
diff --git a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
index d1e22154629..8c0a2baff50 100644
--- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
+++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
@@ -100,7 +100,7 @@ public class TestGCLogMessages {
new LogMessageWithLevel("Processed Buffers", Level.DEBUG),
new LogMessageWithLevel("Scanned Cards", Level.DEBUG),
new LogMessageWithLevel("Skipped Cards", Level.DEBUG),
- new LogMessageWithLevel("Scan HCC", Level.TRACE),
+ new LogMessageWithLevel("Scan HCC", Level.DEBUG),
// Scan RS
new LogMessageWithLevel("Scan RS", Level.DEBUG),
new LogMessageWithLevel("Scanned Cards", Level.DEBUG),
From 9e563f9a0823ae8cb7c4fb1a481c76cbc9ef5e58 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Tue, 19 Feb 2019 12:56:02 +0100
Subject: [PATCH 016/109] 8219097: Move comment about using weak code blobs
closure for code root scanning to correct place
Reviewed-by: kbarrett
---
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 4 ----
src/hotspot/share/gc/g1/g1RemSet.cpp | 4 ++++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
index 562c8bc10c4..39670c99870 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
@@ -3282,10 +3282,6 @@ public:
_root_processor->evacuate_roots(pss, worker_id);
- // We pass a weak code blobs closure to the remembered set scanning because we want to avoid
- // treating the nmethods visited to act as roots for concurrent marking.
- // We only want to make sure that the oops in the nmethods are adjusted with regard to the
- // objects copied by the current evacuation.
_g1h->g1_rem_set()->oops_into_collection_set_do(pss, worker_id);
double strong_roots_sec = os::elapsedTime() - start_strong_roots_sec;
diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp
index 336b05d4ae3..cdc2cc1536e 100644
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp
@@ -409,6 +409,10 @@ void G1ScanRSForRegionClosure::scan_rem_set_roots(HeapRegion* r) {
void G1ScanRSForRegionClosure::scan_strong_code_roots(HeapRegion* r) {
EventGCPhaseParallel event;
+ // We pass a weak code blobs closure to the remembered set scanning because we want to avoid
+ // treating the nmethods visited to act as roots for concurrent marking.
+ // We only want to make sure that the oops in the nmethods are adjusted with regard to the
+ // objects copied by the current evacuation.
r->strong_code_roots_do(_pss->closures()->weak_codeblobs());
event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::CodeRoots));
}
From 7252ba2762f56b962d8371e7d1962c6b96650b52 Mon Sep 17 00:00:00 2001
From: Arno Zeller
Date: Mon, 18 Feb 2019 12:52:55 +0100
Subject: [PATCH 017/109] 8219228:
java/util/Base64/TestEncodingDecodingLength.java failing on 8GB test machine
Reviewed-by: clanger, rriggs, nishjain, mbaesken
---
test/jdk/java/util/Base64/TestEncodingDecodingLength.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/jdk/java/util/Base64/TestEncodingDecodingLength.java b/test/jdk/java/util/Base64/TestEncodingDecodingLength.java
index 3bac2781ac5..8e6033addb1 100644
--- a/test/jdk/java/util/Base64/TestEncodingDecodingLength.java
+++ b/test/jdk/java/util/Base64/TestEncodingDecodingLength.java
@@ -30,7 +30,7 @@ import java.util.Base64;
* @bug 8210583 8217969 8218265
* @summary Tests Base64.Encoder.encode and Base64.Decoder.decode
* with the large size of input array/buffer
- * @requires os.maxMemory >= 8g
+ * @requires os.maxMemory >= 10g
* @run main/othervm -Xms6g -Xmx8g TestEncodingDecodingLength
*
*/
From 145c79b8c96c833ef1d5715ee37d98591a953415 Mon Sep 17 00:00:00 2001
From: Ivan Gerasimov
Date: Tue, 19 Feb 2019 09:06:44 -0800
Subject: [PATCH 018/109] 4887513: Typo in RMIFailureHandler interface doc page
Co-authored-by: Andrey Turbanov
Reviewed-by: dfuchs
---
.../java/rmi/server/RMIFailureHandler.java | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/java.rmi/share/classes/java/rmi/server/RMIFailureHandler.java b/src/java.rmi/share/classes/java/rmi/server/RMIFailureHandler.java
index d25f22a04d2..d7b7dcc6fbb 100644
--- a/src/java.rmi/share/classes/java/rmi/server/RMIFailureHandler.java
+++ b/src/java.rmi/share/classes/java/rmi/server/RMIFailureHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,13 +26,13 @@
package java.rmi.server;
/**
- * An RMIFailureHandler can be registered via the
- * RMISocketFactory.setFailureHandler call. The
- * failure method of the handler is invoked when the RMI
- * runtime is unable to create a ServerSocket to listen
- * for incoming calls. The failure method returns a boolean
+ * An {@code RMIFailureHandler} can be registered via the
+ * {@code RMISocketFactory.setFailureHandler} call. The
+ * {@code failure} method of the handler is invoked when the RMI
+ * runtime is unable to create a {@code ServerSocket} to listen
+ * for incoming calls. The {@code failure} method returns a boolean
* indicating whether the runtime should attempt to re-create the
- * ServerSocket.
+ * {@code ServerSocket}.
*
* @author Ann Wollrath
* @since 1.1
@@ -40,18 +40,18 @@ package java.rmi.server;
public interface RMIFailureHandler {
/**
- * The failure callback is invoked when the RMI
- * runtime is unable to create a ServerSocket via the
- * RMISocketFactory. An RMIFailureHandler
+ * The {@code failure} callback is invoked when the RMI
+ * runtime is unable to create a {@code ServerSocket} via the
+ * {@code RMISocketFactory}. An {@code RMIFailureHandler}
* is registered via a call to
- * RMISocketFacotry.setFailureHandler. If no failure
+ * {@code RMISocketFactory.setFailureHandler}. If no failure
* handler is installed, the default behavior is to attempt to
* re-create the ServerSocket.
*
- * @param ex the exception that occurred during ServerSocket
+ * @param ex the exception that occurred during {@code ServerSocket}
* creation
* @return if true, the RMI runtime attempts to retry
- * ServerSocket creation
+ * {@code ServerSocket} creation
* @see java.rmi.server.RMISocketFactory#setFailureHandler(RMIFailureHandler)
* @since 1.1
*/
From 87e7f97d7d1fccad4bfa1ec4cec14c44136ff534 Mon Sep 17 00:00:00 2001
From: Zhengyu Gu
Date: Tue, 19 Feb 2019 12:50:09 -0500
Subject: [PATCH 019/109] 8219368: Quarantine
runtime/NMT/CheckForProperDetailStackTrace.java test
Reviewed-by: dcubed
---
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 6d099da8a7e..172aef141bd 100644
--- a/test/hotspot/jtreg/ProblemList.txt
+++ b/test/hotspot/jtreg/ProblemList.txt
@@ -81,6 +81,7 @@ gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8193639 solaris-all
# :hotspot_runtime
runtime/handshake/HandshakeWalkSuspendExitTest.java 8214174 generic-all
+runtime/NMT/CheckForProperDetailStackTrace.java 8218458 generic-all
runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all
#############################################################################
From c296f4ae0d1b6ff2a62f09a6708daaa5a89fc1d4 Mon Sep 17 00:00:00 2001
From: Chris Plummer
Date: Tue, 19 Feb 2019 12:05:43 -0800
Subject: [PATCH 020/109] 8218947: jdb threads command should print threadID in
decimal, not hex
Print objectIDs in decimal.
Reviewed-by: sspitsyn, dholmes, jcbeyler
---
.../com/sun/tools/example/debug/tty/Env.java | 50 ++-----------------
.../tools/example/debug/tty/TTYResources.java | 2 +-
.../interrupt/interrupt001/interrupt001.java | 10 +++-
3 files changed, 12 insertions(+), 50 deletions(-)
diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Env.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Env.java
index 5df60491983..e5d513f75a7 100644
--- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Env.java
+++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Env.java
@@ -211,58 +211,14 @@ class Env {
ReferenceType clazz = ref.referenceType();
long id = ref.uniqueID();
if (clazz == null) {
- return toHex(id);
+ return Long.toString(id);
} else {
- return MessageOutput.format("object description and hex id",
+ return MessageOutput.format("object description and id",
new Object [] {clazz.name(),
- toHex(id)});
+ Long.toString(id)});
}
}
- /** Convert a long to a hexadecimal string. */
- static String toHex(long n) {
- char s1[] = new char[16];
- char s2[] = new char[18];
-
- /* Store digits in reverse order. */
- int i = 0;
- do {
- long d = n & 0xf;
- s1[i++] = (char)((d < 10) ? ('0' + d) : ('a' + d - 10));
- } while ((n >>>= 4) > 0);
-
- /* Now reverse the array. */
- s2[0] = '0';
- s2[1] = 'x';
- int j = 2;
- while (--i >= 0) {
- s2[j++] = s1[i];
- }
- return new String(s2, 0, j);
- }
-
- /** Convert hexadecimal strings to longs. */
- static long fromHex(String hexStr) {
- String str = hexStr.startsWith("0x") ?
- hexStr.substring(2).toLowerCase() : hexStr.toLowerCase();
- if (hexStr.length() == 0) {
- throw new NumberFormatException();
- }
-
- long ret = 0;
- for (int i = 0; i < str.length(); i++) {
- int c = str.charAt(i);
- if (c >= '0' && c <= '9') {
- ret = (ret * 16) + (c - '0');
- } else if (c >= 'a' && c <= 'f') {
- ret = (ret * 16) + (c - 'a' + 10);
- } else {
- throw new NumberFormatException();
- }
- }
- return ret;
- }
-
static ReferenceType getReferenceTypeFromToken(String idToken) {
ReferenceType cls = null;
if (Character.isDigit(idToken.charAt(0))) {
diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java
index f1be94db510..6fbc1e7f7f1 100644
--- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java
+++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java
@@ -235,7 +235,7 @@ public class TTYResources extends java.util.ListResourceBundle {
{"Not owned", " Not owned"},
{"Not waiting for a monitor", " Not waiting for a monitor"},
{"Nothing suspended.", "Nothing suspended."},
- {"object description and hex id", "({0}){1}"},
+ {"object description and id", "({0}){1}"},
{"Operation is not supported on the target VM", "Operation is not supported on the target VM"},
{"operation not yet supported", "operation not yet supported"},
{"Owned by:", " Owned by: {0}, entry count: {1,number,integer}"},
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java
index a1ebd49253f..37263dad6eb 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,13 @@ public class interrupt001 extends JdbTest {
static int numThreads = nsk.jdb.interrupt.interrupt001.interrupt001a.numThreads;
- private static Pattern tidPattern = Pattern.compile("(0x[0-9a-f]+)");
+ /*
+ * Pattern for finding the thread ID in a line like the following:
+ * (nsk.jdb.interrupt.interrupt001.interrupt001a$MyThread)651 Thread-0 cond. waiting
+ * Note we can't match on DEBUGGEE_THREAD because it includes a $, which Pattern
+ * uses to match the end of a line.
+ */
+ private static Pattern tidPattern = Pattern.compile("\\(.+" + MYTHREAD + "\\)(\\S+)");
protected void runCases() {
String[] reply;
From 4281bf2e38df26808b968127fc7f21f44a3f20cf Mon Sep 17 00:00:00 2001
From: Erik Joelsson
Date: Tue, 19 Feb 2019 12:40:44 -0800
Subject: [PATCH 021/109] 8219129: Allow overriding of license files in legal
dir
Reviewed-by: ihse
---
make/copy/CopyCommon.gmk | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/make/copy/CopyCommon.gmk b/make/copy/CopyCommon.gmk
index 1bf4dad34d0..656d21d5241 100644
--- a/make/copy/CopyCommon.gmk
+++ b/make/copy/CopyCommon.gmk
@@ -66,6 +66,8 @@ endif
# Setup make rules for copying legal files. This is only needed if the files
# need to be filtered due to optional components being enabled/disabled.
# Otherwise CreateJmods.gmk will find the legal files in the original src dirs.
+# If multiple license files with the same name are found, only the first one
+# found will get copied.
#
# Parameter 1 is the name of the rule.
#
@@ -75,10 +77,12 @@ SetupCopyLegalFiles = $(NamedParamsMacroTemplate)
define SetupCopyLegalFilesBody
$$(foreach f, $$(filter-out $$(addprefix %/, $$($1_EXCLUDES)), \
$$(wildcard $$(addsuffix /*, $$(call FindModuleLegalSrcDirs, $$(MODULE))))), \
- $$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \
- DEST := $$(LEGAL_DST_DIR), \
- FILES := $$f, \
- )) \
- $$(eval $1 += $$($1_$$(notdir $$f))) \
+ $$(if $$(filter $$($1_$$(notdir $$f)), $$($1)), , \
+ $$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \
+ DEST := $$(LEGAL_DST_DIR), \
+ FILES := $$f, \
+ )) \
+ $$(eval $1 += $$($1_$$(notdir $$f))) \
+ ) \
)
endef
From 0a976502a75f064bbde84f33928f63b29f5792d6 Mon Sep 17 00:00:00 2001
From: Erik Joelsson
Date: Tue, 19 Feb 2019 12:43:10 -0800
Subject: [PATCH 022/109] 8211016: make images does not update jdk/lib/src.zip
with latest changes
Reviewed-by: ihse
---
make/common/MakeBase.gmk | 3 ++-
make/common/ZipArchive.gmk | 17 +++++++++++------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index 201695600f3..8288474bd9f 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -392,9 +392,10 @@ ifneq ($(DISABLE_CACHE_FIND), true)
#
# Param 1 - Dirs to find in
# Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
+ # Param 3 - (optional) options to find.
define CacheFind
$(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
- $(if $(wildcard $1), $(shell $(FIND) $(wildcard $1) \( -type f -o -type l \) $2 \
+ $(if $(wildcard $1), $(shell $(FIND) $3 $(wildcard $1) \( -type f -o -type l \) $2 \
| $(TR) ' ' '?')), \
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
endef
diff --git a/make/common/ZipArchive.gmk b/make/common/ZipArchive.gmk
index 64b995dbdf0..e8dd56f791b 100644
--- a/make/common/ZipArchive.gmk
+++ b/make/common/ZipArchive.gmk
@@ -62,8 +62,9 @@ define SetupZipArchiveBody
$1_FIND_LIST := $$($1_SRC)
endif
- # Find all files in the source tree.
- $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST)))
+ # Find all files in the source tree. Follow symlinks in this find since that is
+ # what zip does.
+ $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST), , -L))
# Filter on suffixes if set
ifneq ($$($1_SUFFIXES),)
@@ -126,10 +127,14 @@ define SetupZipArchiveBody
$$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
$$(call LogWarn, Updating $$($1_NAME))
$$(call MakeTargetDir)
- $$(foreach s,$$($1_SRC),(cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \
- $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \
- $$($1_ZIP_EXCLUDES_$$s) \
- || test "$$$$?" = "12" )$$(NEWLINE)) true
+ $$(foreach s,$$($1_SRC), $$(call ExecuteWithLog, \
+ $$(SUPPORT_OUTPUTDIR)/zip/$$(patsubst $$(OUTPUTDIR)/%,%, $$@), \
+ (cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \
+ $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \
+ $$($1_ZIP_EXCLUDES_$$s) \
+ || test "$$$$?" = "12" \
+ ))$$(NEWLINE) \
+ ) true \
$(TOUCH) $$@
# Add zip to target list
From 4f45b5f9739e5a5e7d1c4f80da9c42e0d77dd0bf Mon Sep 17 00:00:00 2001
From: Erik Joelsson
Date: Tue, 19 Feb 2019 12:44:56 -0800
Subject: [PATCH 023/109] 8217032: Check pandoc capabilities in configure
Reviewed-by: mikael, ihse
---
make/autoconf/basics.m4 | 37 ++++++++++++++++++++++++++-------
make/autoconf/spec.gmk.in | 1 +
make/common/ProcessMarkdown.gmk | 3 ++-
3 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/make/autoconf/basics.m4 b/make/autoconf/basics.m4
index f35de8faf3f..9bc0d0c337e 100644
--- a/make/autoconf/basics.m4
+++ b/make/autoconf/basics.m4
@@ -618,14 +618,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
BASIC_PATH_PROGS(NICE, nice)
- BASIC_PATH_PROGS(PANDOC, pandoc)
- if test -n "$PANDOC"; then
- ENABLE_PANDOC="true"
- else
- ENABLE_PANDOC="false"
- fi
- AC_SUBST(ENABLE_PANDOC)
-
BASIC_PATH_PROGS(LSB_RELEASE, lsb_release)
BASIC_PATH_PROGS(CMD, [cmd.exe /mnt/c/Windows/System32/cmd.exe])
])
@@ -1193,6 +1185,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
BASIC_CHECK_FIND_DELETE
BASIC_CHECK_TAR
BASIC_CHECK_GREP
+ BASIC_SETUP_PANDOC
# These tools might not be installed by default,
# need hint on how to install them.
@@ -1377,6 +1370,34 @@ AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
AC_SUBST(BASH_ARGS)
])
+################################################################################
+#
+# Setup Pandoc
+#
+AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
+[
+ BASIC_PATH_PROGS(PANDOC, pandoc)
+
+ PANDOC_MARKDOWN_FLAG="markdown"
+ if test -n "$PANDOC"; then
+ AC_MSG_CHECKING(if the pandoc smart extension needs to be disabled for markdown)
+ if $PANDOC --list-extensions | $GREP -q '\+smart'; then
+ AC_MSG_RESULT([yes])
+ PANDOC_MARKDOWN_FLAG="markdown-smart"
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ if test -n "$PANDOC"; then
+ ENABLE_PANDOC="true"
+ else
+ ENABLE_PANDOC="false"
+ fi
+ AC_SUBST(ENABLE_PANDOC)
+ AC_SUBST(PANDOC_MARKDOWN_FLAG)
+])
+
################################################################################
#
# Default make target
diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in
index 1ac80135b50..a8f80a8d2c0 100644
--- a/make/autoconf/spec.gmk.in
+++ b/make/autoconf/spec.gmk.in
@@ -774,6 +774,7 @@ MSVCP_DLL:=@MSVCP_DLL@
UCRT_DLL_DIR:=@UCRT_DLL_DIR@
STLPORT_LIB:=@STLPORT_LIB@
ENABLE_PANDOC:=@ENABLE_PANDOC@
+PANDOC_MARKDOWN_FLAG:=@PANDOC_MARKDOWN_FLAG@
####################################################
#
diff --git a/make/common/ProcessMarkdown.gmk b/make/common/ProcessMarkdown.gmk
index c2797e2d8c1..52589a3046e 100644
--- a/make/common/ProcessMarkdown.gmk
+++ b/make/common/ProcessMarkdown.gmk
@@ -80,7 +80,8 @@ define ProcessMarkdown
$$(call LogInfo, Converting $2 to $$($1_FORMAT))
$$(call MakeDir, $$(SUPPORT_OUTPUTDIR)/markdown $$(dir $$($1_$2_PANDOC_OUTPUT)))
$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \
- $$(PANDOC) $$($1_OPTIONS) -f markdown-smart -t $$($1_FORMAT) --standalone \
+ $$(PANDOC) $$($1_OPTIONS) -f $$(PANDOC_MARKDOWN_FLAG) \
+ -t $$($1_FORMAT) --standalone \
$$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$($1_$2_PANDOC_INPUT)' \
-o '$$($1_$2_PANDOC_OUTPUT)')
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
From 67df8f228c6846a6d1579c1b68e5360fd59e7d20 Mon Sep 17 00:00:00 2001
From: Erik Joelsson
Date: Tue, 19 Feb 2019 12:46:22 -0800
Subject: [PATCH 024/109] 8218135: Redo: Add ppc64le and s390x profiles to
jib-profiles.js
Reviewed-by: ihse
---
make/conf/jib-profiles.js | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js
index e2103344086..335b91c2e89 100644
--- a/make/conf/jib-profiles.js
+++ b/make/conf/jib-profiles.js
@@ -241,7 +241,7 @@ var getJibProfilesCommon = function (input, data) {
common.main_profile_names = [
"linux-x64", "linux-x86", "macosx-x64", "solaris-x64",
"solaris-sparcv9", "windows-x64", "windows-x86",
- "linux-aarch64", "linux-arm32"
+ "linux-aarch64", "linux-arm32", "linux-ppc64le", "linux-s390x"
];
// These are the base setttings for all the main build profiles.
@@ -464,6 +464,28 @@ var getJibProfilesProfiles = function (input, common, data) {
"--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors"
],
},
+
+ "linux-ppc64le": {
+ target_os: "linux",
+ target_cpu: "ppc64le",
+ build_cpu: "x64",
+ dependencies: ["devkit", "build_devkit", "cups"],
+ configure_args: [
+ "--openjdk-target=ppc64le-linux-gnu", "--with-freetype=bundled",
+ "--disable-warnings-as-errors"
+ ],
+ },
+
+ "linux-s390x": {
+ target_os: "linux",
+ target_cpu: "s390x",
+ build_cpu: "x64",
+ dependencies: ["devkit", "build_devkit", "cups"],
+ configure_args: [
+ "--openjdk-target=s390x-linux-gnu", "--with-freetype=bundled",
+ "--disable-warnings-as-errors"
+ ],
+ },
};
// Add the base settings to all the main profiles
@@ -626,6 +648,12 @@ var getJibProfilesProfiles = function (input, common, data) {
},
"linux-arm32": {
platform: "linux-arm32",
+ },
+ "linux-ppc64le": {
+ platform: "linux-ppc64le",
+ },
+ "linux-s390x": {
+ platform: "linux-s390x",
}
}
// Generate common artifacts for all main profiles
@@ -870,7 +898,9 @@ var getJibProfilesDependencies = function (input, common) {
solaris_sparcv9: "SS12u6-Solaris11u3+1.0",
windows_x64: "VS2017-15.5.5+1.0",
linux_aarch64: "gcc7.3.0-Fedora27+1.2",
- linux_arm: "gcc7.3.0-Fedora27+1.2"
+ linux_arm: "gcc7.3.0-Fedora27+1.2",
+ linux_ppc64le: "gcc7.3.0-Fedora27+1.0",
+ linux_s390x: "gcc7.3.0-Fedora27+1.0"
};
var devkit_platform = (input.target_cpu == "x86"
From 47ccdad73532a1d2106429780e68322e8a6e5665 Mon Sep 17 00:00:00 2001
From: Brian Burkhalter
Date: Tue, 19 Feb 2019 13:05:16 -0800
Subject: [PATCH 025/109] 8065262: (bf spec) CharBuffer.chars() should make it
clearer that the sequence starts from the buffer position
Reviewed-by: alanb, darcy, rriggs
---
src/java.base/share/classes/java/nio/X-Buffer.java.template | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/java.base/share/classes/java/nio/X-Buffer.java.template b/src/java.base/share/classes/java/nio/X-Buffer.java.template
index 231c994e20d..8e0465a570e 100644
--- a/src/java.base/share/classes/java/nio/X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template
@@ -209,6 +209,8 @@ import jdk.internal.util.ArraysSupport;
*
This class implements the {@link CharSequence} interface so that
* character buffers may be used wherever character sequences are accepted, for
* example in the regular-expression package {@link java.util.regex}.
+ * The methods defined by {@code CharSequence} operate relative to the current
+ * position of the buffer when they are invoked.
*
*
#end[char]
From 272869390eb69623fa638d61bb1c6fa5e61a04d5 Mon Sep 17 00:00:00 2001
From: Igor Ignatyev
Date: Tue, 19 Feb 2019 13:51:11 -0800
Subject: [PATCH 026/109] 8219391: extend gcov support to llvm/clang
Reviewed-by: erikj
---
make/autoconf/jdk-options.m4 | 39 +++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4
index 62ea13c20e5..5ee34aeeeee 100644
--- a/make/autoconf/jdk-options.m4
+++ b/make/autoconf/jdk-options.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -372,23 +372,26 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
[enable native compilation with code coverage data@<:@disabled@:>@])])
GCOV_ENABLED="false"
if test "x$enable_native_coverage" = "xyes"; then
- if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
- AC_MSG_CHECKING([if native coverage is enabled])
- AC_MSG_RESULT([yes])
- GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
- GCOV_LDFLAGS="-fprofile-arcs"
- JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
- JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
- CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
- CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
- CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
- CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
- LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
- LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
- GCOV_ENABLED="true"
- else
- AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc])
- fi
+ case $TOOLCHAIN_TYPE in
+ gcc | clang)
+ AC_MSG_CHECKING([if native coverage is enabled])
+ AC_MSG_RESULT([yes])
+ GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
+ GCOV_LDFLAGS="-fprofile-arcs"
+ JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
+ JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
+ CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
+ CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
+ CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
+ CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
+ LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
+ LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
+ GCOV_ENABLED="true"
+ ;;
+ *)
+ AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc or clang])
+ ;;
+ esac
elif test "x$enable_native_coverage" = "xno"; then
AC_MSG_CHECKING([if native coverage is enabled])
AC_MSG_RESULT([no])
From 67c2e382d35734ea85c69bd5d01a03e272727672 Mon Sep 17 00:00:00 2001
From: Jorn Vernee
Date: Tue, 19 Feb 2019 23:02:41 +0100
Subject: [PATCH 027/109] 8219393: Add native library support for
microbenchmarks
Reviewed-by: erikj
---
make/RunTests.gmk | 2 ++
make/test/BuildMicrobenchmark.gmk | 27 +++++++++++++++++++++++++--
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
index 37a21829947..b42c27faa36 100644
--- a/make/RunTests.gmk
+++ b/make/RunTests.gmk
@@ -658,6 +658,8 @@ define SetupRunMicroTestBody
# Current tests needs to open java.io
$1_MICRO_JAVA_OPTIONS += --add-opens=java.base/java.io=ALL-UNNAMED
+ # Set library path for native dependencies
+ $1_MICRO_JAVA_OPTIONS += -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
# Save output as JSON or CSV file
ifneq ($$(MICRO_RESULTS_FORMAT), )
diff --git a/make/test/BuildMicrobenchmark.gmk b/make/test/BuildMicrobenchmark.gmk
index cebf444cafe..d12f67fa460 100644
--- a/make/test/BuildMicrobenchmark.gmk
+++ b/make/test/BuildMicrobenchmark.gmk
@@ -30,6 +30,7 @@ include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
+include TestFilesCompilation.gmk
ifeq ($(JMH_CORE_JAR), )
$(info Error: JMH is missing. Please use configure --with-jmh.)
@@ -39,7 +40,8 @@ endif
#### Variables
MICROBENCHMARK_SRC := $(TOPDIR)/test/micro
-MICROBENCHMARK_JAR := $(IMAGES_OUTPUTDIR)/test/micro/benchmarks.jar
+MICROBENCHMARK_IMAGE_DIR := $(TEST_IMAGE_DIR)/micro
+MICROBENCHMARK_JAR := $(MICROBENCHMARK_IMAGE_DIR)/benchmarks.jar
MICROBENCHMARK_OUTPUT := $(SUPPORT_OUTPUTDIR)/test/micro
MICROBENCHMARK_CLASSES := $(MICROBENCHMARK_OUTPUT)/classes
@@ -54,6 +56,11 @@ JMH_RUNTIME_JARS := $(JMH_CORE_JAR) $(JMH_COMMONS_MATH_JAR) $(JMH_JOPT_SIMPLE_JA
MICROBENCHMARK_CLASSPATH := $(call PathList, $(JMH_COMPILE_JARS))
+# Native dependencies
+MICROBENCHMARK_NATIVE_SRC_DIRS := $(MICROBENCHMARK_SRC)
+MICROBENCHMARK_NATIVE_OUTPUT := $(MICROBENCHMARK_OUTPUT)/native
+MICROBENCHMARK_NATIVE_EXCLUDE :=
+
###
# Need double \n to get new lines and no trailing spaces
@@ -108,6 +115,22 @@ $(eval $(call SetupJarArchive, BUILD_JDK_JAR, \
JAR := $(MICROBENCHMARK_JAR), \
))
-all: $(MICROBENCHMARK_JAR)
+# Setup compilation of native library dependencies
+$(eval $(call SetupTestFilesCompilation, BUILD_MICROBENCHMARK_LIBRARIES, \
+ TYPE := LIBRARY, \
+ SOURCE_DIRS := $(MICROBENCHMARK_NATIVE_SRC_DIRS), \
+ OUTPUT_DIR := $(MICROBENCHMARK_NATIVE_OUTPUT), \
+ EXCLUDE := $(MICROBENCHMARK_NATIVE_EXCLUDE), \
+))
+
+# Setup copy of native dependencies to image output dir
+$(eval $(call SetupCopyFiles, COPY_MICROBENCHMARK_NATIVE, \
+ SRC := $(MICROBENCHMARK_NATIVE_OUTPUT), \
+ DEST := $(MICROBENCHMARK_IMAGE_DIR)/native, \
+ FILES := $(BUILD_MICROBENCHMARK_LIBRARIES), \
+ FLATTEN := true, \
+))
+
+all: $(MICROBENCHMARK_JAR) $(BUILD_MICROBENCHMARK_LIBRARIES) $(COPY_MICROBENCHMARK_NATIVE)
.PHONY: all
From 22fe6edc6c18e621cd76c08bfb6e047c709d41ee Mon Sep 17 00:00:00 2001
From: Erik Joelsson
Date: Tue, 19 Feb 2019 14:25:52 -0800
Subject: [PATCH 028/109] 8219394: Missing FIXPATH in microbenchmark test
runner
Reviewed-by: redestad
---
make/RunTests.gmk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
index b42c27faa36..3fccf3cd5b2 100644
--- a/make/RunTests.gmk
+++ b/make/RunTests.gmk
@@ -692,7 +692,8 @@ define SetupRunMicroTestBody
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, \
- $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) -jar $$($1_MICRO_BENCHMARKS_JAR) \
+ $$(FIXPATH) $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) \
+ -jar $$($1_MICRO_BENCHMARKS_JAR) \
$$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \
$$($1_MICRO_WARMUP_ITER) $$($1_MICRO_WARMUP_TIME) \
$$($1_MICRO_VM_OPTIONS) $$($1_MICRO_BASIC_OPTIONS) $$(MICRO_OPTIONS) \
From 8679b085ce82d07f3d3a4ee43f4cdcfa18a94ea1 Mon Sep 17 00:00:00 2001
From: Igor Ignatyev
Date: Tue, 19 Feb 2019 19:27:08 -0800
Subject: [PATCH 029/109] 8219132: switch to jtreg4.2-b14
Reviewed-by: erikj
---
make/conf/jib-profiles.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js
index 335b91c2e89..aea5f6a7ba0 100644
--- a/make/conf/jib-profiles.js
+++ b/make/conf/jib-profiles.js
@@ -960,7 +960,7 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: {
server: "javare",
revision: "4.2",
- build_number: "b13",
+ build_number: "b14",
checksum_file: "MD5_VALUES",
file: "jtreg_bin-4.2.zip",
environment_name: "JT_HOME",
From d9463e629ed4375475c27c3d07c5e9bb36d6886a Mon Sep 17 00:00:00 2001
From: Matthias Baesken
Date: Tue, 19 Feb 2019 09:02:28 +0100
Subject: [PATCH 030/109] 8218965: aix: support xlclang++ in the compiler
detection
Reviewed-by: ihse, mdoerr
---
make/autoconf/flags-cflags.m4 | 6 ++++-
make/autoconf/toolchain.m4 | 22 +++++++++++++++++++
.../harfbuzz/hb-atomic-private.hh | 2 +-
3 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
index 40021632ed2..9594ec51ed4 100644
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -121,7 +121,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
# -g0 enables debug symbols without disabling inlining.
CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
- CFLAGS_DEBUG_SYMBOLS="-g"
+ if test "x$XLC_USES_CLANG" = xtrue; then
+ CFLAGS_DEBUG_SYMBOLS="-g1"
+ else
+ CFLAGS_DEBUG_SYMBOLS="-g"
+ fi
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
CFLAGS_DEBUG_SYMBOLS="-Z7 -d2Zi+"
fi
diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4
index fa21f5813a0..c67e9909e68 100644
--- a/make/autoconf/toolchain.m4
+++ b/make/autoconf/toolchain.m4
@@ -276,6 +276,20 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
fi
AC_SUBST(TOOLCHAIN_TYPE)
+ # on AIX, check for xlclang++ on the PATH and TOOLCHAIN_PATH and use it if it is available
+ if test "x$OPENJDK_TARGET_OS" = xaix; then
+ if test "x$TOOLCHAIN_PATH" != x; then
+ XLC_TEST_PATH=${TOOLCHAIN_PATH}/
+ fi
+
+ XLCLANG_VERSION_OUTPUT=`${XLC_TEST_PATH}xlclang++ -qversion 2>&1 | $HEAD -n 1`
+ $ECHO "$XLCLANG_VERSION_OUTPUT" | $GREP "IBM XL C/C++ for AIX" > /dev/null
+ if test $? -eq 0; then
+ AC_MSG_NOTICE([xlclang++ output: $XLCLANG_VERSION_OUTPUT])
+ XLC_USES_CLANG=true
+ fi
+ fi
+
TOOLCHAIN_CC_BINARY_clang="clang"
TOOLCHAIN_CC_BINARY_gcc="gcc"
TOOLCHAIN_CC_BINARY_microsoft="cl$EXE_SUFFIX"
@@ -288,6 +302,14 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
TOOLCHAIN_CXX_BINARY_solstudio="CC"
TOOLCHAIN_CXX_BINARY_xlc="xlC_r"
+ if test "x$OPENJDK_TARGET_OS" = xaix; then
+ if test "x$XLC_USES_CLANG" = xtrue; then
+ AC_MSG_NOTICE([xlclang++ detected, using it])
+ TOOLCHAIN_CC_BINARY_xlc="xlclang"
+ TOOLCHAIN_CXX_BINARY_xlc="xlclang++"
+ fi
+ fi
+
# Use indirect variable referencing
toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
diff --git a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh
index 73d7f005e8c..32e0377181b 100644
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh
@@ -115,7 +115,7 @@ typedef int32_t hb_atomic_int_impl_t;
#endif
-#elif !defined(HB_NO_MT) && defined(_AIX) && defined(__IBMCPP__)
+#elif !defined(HB_NO_MT) && defined(_AIX) && (defined(__IBMCPP__) || defined(__ibmxl__))
#include
From 9dae227e4f0e44bd75a30e55bc54ea68f6cbc841 Mon Sep 17 00:00:00 2001
From: Sandhya Viswanathan
Date: Tue, 19 Feb 2019 08:25:11 -0800
Subject: [PATCH 031/109] 8219151: Illegal instruction exception on JDK 12 due
to incorrect CPU feature bits
Fix wrong CPU feature bits set
Reviewed-by: kvn, neliasso
---
src/hotspot/cpu/x86/vm_version_x86.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp
index e435ea53be6..4cd945d72e8 100644
--- a/src/hotspot/cpu/x86/vm_version_x86.hpp
+++ b/src/hotspot/cpu/x86/vm_version_x86.hpp
@@ -336,7 +336,7 @@ protected:
#define CPU_AVX512_VPOPCNTDQ ((uint64_t)UCONST64(0x2000000000)) // Vector popcount
#define CPU_VPCLMULQDQ ((uint64_t)UCONST64(0x4000000000)) //Vector carryless multiplication
#define CPU_VAES ((uint64_t)UCONST64(0x8000000000)) // Vector AES instructions
-#define CPU_VNNI ((uint64_t)UCONST64(0x16000000000)) // Vector Neural Network Instructions
+#define CPU_VNNI ((uint64_t)UCONST64(0x10000000000)) // Vector Neural Network Instructions
enum Extended_Family {
// AMD
From dbdfbb518ffec4dff09fbb059a70b39597b7c3c7 Mon Sep 17 00:00:00 2001
From: Claes Redestad
Date: Wed, 20 Feb 2019 09:53:28 +0100
Subject: [PATCH 032/109] 8219229: Make ConstantPool::tag_at and
release_tag_at_put inlineable
Reviewed-by: dholmes, coleenp
---
src/hotspot/share/ci/ciReplay.cpp | 1 +
src/hotspot/share/classfile/stackMapTable.cpp | 1 +
.../share/interpreter/linkResolver.cpp | 1 +
src/hotspot/share/interpreter/rewriter.cpp | 1 +
.../jfrEventClassTransformer.cpp | 1 +
src/hotspot/share/oops/array.hpp | 5 ++-
src/hotspot/share/oops/array.inline.hpp | 37 -------------------
src/hotspot/share/oops/constantPool.cpp | 6 +--
src/hotspot/share/oops/constantPool.hpp | 4 +-
src/hotspot/share/oops/generateOopMap.cpp | 1 +
src/hotspot/share/oops/instanceKlass.cpp | 1 +
src/hotspot/share/oops/method.cpp | 1 +
.../reflectionAccessorImplKlassHelper.cpp | 1 +
src/hotspot/share/prims/jvm.cpp | 1 +
.../share/prims/jvmtiRedefineClasses.cpp | 1 +
src/hotspot/share/runtime/deoptimization.cpp | 1 +
src/hotspot/share/runtime/fieldDescriptor.cpp | 1 +
17 files changed, 19 insertions(+), 46 deletions(-)
delete mode 100644 src/hotspot/share/oops/array.inline.hpp
diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp
index 206fd374dfb..02bf28f7040 100644
--- a/src/hotspot/share/ci/ciReplay.cpp
+++ b/src/hotspot/share/ci/ciReplay.cpp
@@ -33,6 +33,7 @@
#include "memory/allocation.inline.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
#include "oops/method.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
diff --git a/src/hotspot/share/classfile/stackMapTable.cpp b/src/hotspot/share/classfile/stackMapTable.cpp
index 7c9a2a1564f..95e79c169f5 100644
--- a/src/hotspot/share/classfile/stackMapTable.cpp
+++ b/src/hotspot/share/classfile/stackMapTable.cpp
@@ -26,6 +26,7 @@
#include "classfile/stackMapTable.hpp"
#include "classfile/verifier.hpp"
#include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/fieldType.hpp"
#include "runtime/handles.inline.hpp"
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
index 5e6395a2cf6..69f90b4a3d7 100644
--- a/src/hotspot/share/interpreter/linkResolver.cpp
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
@@ -39,6 +39,7 @@
#include "logging/logStream.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
+#include "oops/constantPool.hpp"
#include "oops/cpCache.inline.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/method.hpp"
diff --git a/src/hotspot/share/interpreter/rewriter.cpp b/src/hotspot/share/interpreter/rewriter.cpp
index 70cf6f8d2ea..c5994844066 100644
--- a/src/hotspot/share/interpreter/rewriter.cpp
+++ b/src/hotspot/share/interpreter/rewriter.cpp
@@ -28,6 +28,7 @@
#include "interpreter/rewriter.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
#include "oops/generateOopMap.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
diff --git a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
index 8c581208035..24a19c60225 100644
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
@@ -43,6 +43,7 @@
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "oops/array.hpp"
+#include "oops/constantPool.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/method.hpp"
#include "prims/jvmtiRedefineClasses.hpp"
diff --git a/src/hotspot/share/oops/array.hpp b/src/hotspot/share/oops/array.hpp
index 4e400e11810..1f0b2bcec35 100644
--- a/src/hotspot/share/oops/array.hpp
+++ b/src/hotspot/share/oops/array.hpp
@@ -27,6 +27,7 @@
#include "memory/allocation.hpp"
#include "memory/metaspace.hpp"
+#include "runtime/orderAccess.hpp"
#include "utilities/align.hpp"
// Array for metadata allocation
@@ -121,8 +122,8 @@ protected:
T* adr_at(const int i) { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); return &_data[i]; }
int find(const T& x) { return index_of(x); }
- T at_acquire(const int which);
- void release_at_put(int which, T contents);
+ T at_acquire(const int i) { return OrderAccess::load_acquire(adr_at(i)); }
+ void release_at_put(int i, T x) { OrderAccess::release_store(adr_at(i), x); }
static int size(int length) {
size_t bytes = align_up(byte_sizeof(length), BytesPerWord);
diff --git a/src/hotspot/share/oops/array.inline.hpp b/src/hotspot/share/oops/array.inline.hpp
deleted file mode 100644
index 2260b7496fa..00000000000
--- a/src/hotspot/share/oops/array.inline.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_OOPS_ARRAY_INLINE_HPP
-#define SHARE_OOPS_ARRAY_INLINE_HPP
-
-#include "oops/array.hpp"
-#include "runtime/orderAccess.hpp"
-
-template
-inline T Array::at_acquire(const int which) { return OrderAccess::load_acquire(adr_at(which)); }
-
-template
-inline void Array::release_at_put(int which, T contents) { OrderAccess::release_store(adr_at(which), contents); }
-
-#endif // SHARE_OOPS_ARRAY_INLINE_HPP
diff --git a/src/hotspot/share/oops/constantPool.cpp b/src/hotspot/share/oops/constantPool.cpp
index 296e26b7bae..3bf8df05b3b 100644
--- a/src/hotspot/share/oops/constantPool.cpp
+++ b/src/hotspot/share/oops/constantPool.cpp
@@ -39,7 +39,7 @@
#include "memory/metaspaceShared.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
-#include "oops/array.inline.hpp"
+#include "oops/array.hpp"
#include "oops/constantPool.inline.hpp"
#include "oops/cpCache.inline.hpp"
#include "oops/instanceKlass.hpp"
@@ -56,10 +56,6 @@
#include "runtime/vframe.inline.hpp"
#include "utilities/copy.hpp"
-constantTag ConstantPool::tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
-
-void ConstantPool::release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
-
ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
Array* tags = MetadataFactory::new_array(loader_data, length, 0, CHECK_NULL);
int size = ConstantPool::size(length);
diff --git a/src/hotspot/share/oops/constantPool.hpp b/src/hotspot/share/oops/constantPool.hpp
index 5f436a89636..116f10eb40c 100644
--- a/src/hotspot/share/oops/constantPool.hpp
+++ b/src/hotspot/share/oops/constantPool.hpp
@@ -131,7 +131,7 @@ class ConstantPool : public Metadata {
void set_tags(Array* tags) { _tags = tags; }
void tag_at_put(int which, jbyte t) { tags()->at_put(which, t); }
- void release_tag_at_put(int which, jbyte t);
+ void release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
u1* tag_addr_at(int which) const { return tags()->adr_at(which); }
@@ -379,7 +379,7 @@ class ConstantPool : public Metadata {
// Tag query
- constantTag tag_at(int which) const;
+ constantTag tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
// Fetching constants
diff --git a/src/hotspot/share/oops/generateOopMap.cpp b/src/hotspot/share/oops/generateOopMap.cpp
index edb9c106d42..3fa07c3df5c 100644
--- a/src/hotspot/share/oops/generateOopMap.cpp
+++ b/src/hotspot/share/oops/generateOopMap.cpp
@@ -27,6 +27,7 @@
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/allocation.inline.hpp"
+#include "oops/constantPool.hpp"
#include "oops/generateOopMap.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index b329a257688..05ff886e958 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -53,6 +53,7 @@
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/fieldStreams.hpp"
+#include "oops/constantPool.hpp"
#include "oops/instanceClassLoaderKlass.hpp"
#include "oops/instanceKlass.inline.hpp"
#include "oops/instanceMirrorKlass.hpp"
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
index 4af5d06cbb7..c60e36787fa 100644
--- a/src/hotspot/share/oops/method.cpp
+++ b/src/hotspot/share/oops/method.cpp
@@ -42,6 +42,7 @@
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/constMethod.hpp"
+#include "oops/constantPool.hpp"
#include "oops/method.inline.hpp"
#include "oops/methodData.hpp"
#include "oops/objArrayOop.inline.hpp"
diff --git a/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp b/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp
index 8470f8b3a4c..144f0b6b197 100644
--- a/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp
+++ b/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp
@@ -26,6 +26,7 @@
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
#include "oops/reflectionAccessorImplKlassHelper.hpp"
#include "utilities/constantTag.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp
index 7446202fb03..7f0065c9641 100644
--- a/src/hotspot/share/prims/jvm.cpp
+++ b/src/hotspot/share/prims/jvm.cpp
@@ -45,6 +45,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/access.inline.hpp"
+#include "oops/constantPool.hpp"
#include "oops/fieldStreams.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/method.hpp"
diff --git a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
index 0dc83c8d61e..8002f4bd8dc 100644
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
@@ -39,6 +39,7 @@
#include "memory/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
+#include "oops/constantPool.hpp"
#include "oops/fieldStreams.hpp"
#include "oops/klassVtable.hpp"
#include "oops/oop.inline.hpp"
diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp
index 0d96a7d5cbc..287af4fb0be 100644
--- a/src/hotspot/share/runtime/deoptimization.cpp
+++ b/src/hotspot/share/runtime/deoptimization.cpp
@@ -36,6 +36,7 @@
#include "memory/allocation.inline.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
#include "oops/method.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
diff --git a/src/hotspot/share/runtime/fieldDescriptor.cpp b/src/hotspot/share/runtime/fieldDescriptor.cpp
index edf0ed996e1..9bfaa7e9612 100644
--- a/src/hotspot/share/runtime/fieldDescriptor.cpp
+++ b/src/hotspot/share/runtime/fieldDescriptor.cpp
@@ -28,6 +28,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/annotations.hpp"
+#include "oops/constantPool.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oop.inline.hpp"
#include "oops/fieldStreams.hpp"
From 708b339eb4b4ddd51fba6d9f88aa5196318ee475 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Wed, 20 Feb 2019 10:48:36 +0100
Subject: [PATCH 033/109] 8219098: Make output of region strings more regular
in error messages
Error messages should use the HR_PARAMS/HR_FORMAT_PARAMS macros to print information about HeapRegions.
Reviewed-by: kbarrett, lkorinth
---
.../share/gc/g1/g1FullGCOopClosures.cpp | 23 +++++--------
src/hotspot/share/gc/g1/heapRegion.cpp | 32 ++++++++++---------
2 files changed, 25 insertions(+), 30 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp b/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp
index 0c94c3e332c..d17c004a0a8 100644
--- a/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -71,26 +71,19 @@ template void G1VerifyOopClosure::do_oop_work(T* p) {
}
if (!_g1h->is_in_closed_subset(obj)) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
- yy.print_cr("Field " PTR_FORMAT
- " of live obj " PTR_FORMAT " in region "
- "[" PTR_FORMAT ", " PTR_FORMAT ")",
- p2i(p), p2i(_containing_obj),
- p2i(from->bottom()), p2i(from->end()));
+ yy.print_cr("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
+ p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
print_object(&yy, _containing_obj);
yy.print_cr("points to obj " PTR_FORMAT " not in the heap",
- p2i(obj));
+ p2i(obj));
} else {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
- yy.print_cr("Field " PTR_FORMAT
- " of live obj " PTR_FORMAT " in region "
- "[" PTR_FORMAT ", " PTR_FORMAT ")",
- p2i(p), p2i(_containing_obj),
- p2i(from->bottom()), p2i(from->end()));
+ yy.print_cr("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
+ p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
print_object(&yy, _containing_obj);
- yy.print_cr("points to dead obj " PTR_FORMAT " in region "
- "[" PTR_FORMAT ", " PTR_FORMAT ")",
- p2i(obj), p2i(to->bottom()), p2i(to->end()));
+ yy.print_cr("points to dead obj " PTR_FORMAT " in region " HR_FORMAT,
+ p2i(obj), HR_FORMAT_PARAMS(to));
print_object(&yy, obj);
}
yy.print_cr("----------");
diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp
index ff2cf2465af..2dfe1d03e87 100644
--- a/src/hotspot/share/gc/g1/heapRegion.cpp
+++ b/src/hotspot/share/gc/g1/heapRegion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -336,8 +336,8 @@ class VerifyStrongCodeRootOopClosure: public OopClosure {
// Object is in the region. Check that its less than top
if (_hr->top() <= (HeapWord*)obj) {
// Object is above top
- log_error(gc, verify)("Object " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ") is above top " PTR_FORMAT,
- p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top()));
+ log_error(gc, verify)("Object " PTR_FORMAT " in region " HR_FORMAT " is above top ",
+ p2i(obj), HR_FORMAT_PARAMS(_hr));
_failures = true;
return;
}
@@ -415,8 +415,8 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const
// on its strong code root list
if (is_empty()) {
if (strong_code_roots_length > 0) {
- log_error(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] is empty but has " SIZE_FORMAT " code root entries",
- p2i(bottom()), p2i(end()), strong_code_roots_length);
+ log_error(gc, verify)("region " HR_FORMAT " is empty but has " SIZE_FORMAT " code root entries",
+ HR_FORMAT_PARAMS(this), strong_code_roots_length);
*failures = true;
}
return;
@@ -524,21 +524,22 @@ public:
ResourceMark rm;
if (!_g1h->is_in_closed_subset(obj)) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
- log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
- p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
+ log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
+ p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
LogStream ls(log.error());
print_object(&ls, _containing_obj);
HeapRegion* const to = _g1h->heap_region_containing(obj);
- log.error("points to obj " PTR_FORMAT " in region " HR_FORMAT " remset %s", p2i(obj), HR_FORMAT_PARAMS(to), to->rem_set()->get_state_str());
+ log.error("points to obj " PTR_FORMAT " in region " HR_FORMAT " remset %s",
+ p2i(obj), HR_FORMAT_PARAMS(to), to->rem_set()->get_state_str());
} else {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
- log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
- p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
+ log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
+ p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
LogStream ls(log.error());
print_object(&ls, _containing_obj);
- log.error("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
- p2i(obj), p2i(to->bottom()), p2i(to->end()));
+ log.error("points to dead obj " PTR_FORMAT " in region " HR_FORMAT,
+ p2i(obj), HR_FORMAT_PARAMS(to));
print_object(&ls, obj);
}
log.error("----------");
@@ -593,12 +594,13 @@ public:
log.error("----------");
}
log.error("Missing rem set entry:");
- log.error("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT,
- p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
+ log.error("Field " PTR_FORMAT " of obj " PTR_FORMAT " in region " HR_FORMAT,
+ p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
ResourceMark rm;
LogStream ls(log.error());
_containing_obj->print_on(&ls);
- log.error("points to obj " PTR_FORMAT " in region " HR_FORMAT " remset %s", p2i(obj), HR_FORMAT_PARAMS(to), to->rem_set()->get_state_str());
+ log.error("points to obj " PTR_FORMAT " in region " HR_FORMAT " remset %s",
+ p2i(obj), HR_FORMAT_PARAMS(to), to->rem_set()->get_state_str());
if (oopDesc::is_oop(obj)) {
obj->print_on(&ls);
}
From 7f0669764449f99a8eddca00984ebf16a23bb5d4 Mon Sep 17 00:00:00 2001
From: Jan Lahoda
Date: Wed, 20 Feb 2019 11:11:38 +0100
Subject: [PATCH 034/109] 8218287: jshell tool: input behavior unstable after
12-ea+24 on Windows
Ensure correct wrapping of input on Windows.
Reviewed-by: rfield
---
.../impl/AbstractWindowsTerminal.java | 2 +-
.../internal/org/jline/utils/NonBlocking.java | 4 +-
.../windows/native/lible/Kernel32.cpp | 2 +-
.../jline/AbstractWindowsTerminalTest.java | 93 +++++++++++++++++++
4 files changed, 97 insertions(+), 4 deletions(-)
create mode 100644 test/jdk/jdk/internal/jline/AbstractWindowsTerminalTest.java
diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractWindowsTerminal.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractWindowsTerminal.java
index 3de71574ae1..80807463802 100644
--- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractWindowsTerminal.java
+++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractWindowsTerminal.java
@@ -86,8 +86,8 @@ public abstract class AbstractWindowsTerminal extends AbstractTerminal {
super(name, type, selectCharset(encoding, codepage), signalHandler);
NonBlockingPumpReader reader = NonBlocking.nonBlockingPumpReader();
this.slaveInputPipe = reader.getWriter();
- this.reader = reader;
this.input = inputStreamWrapper.apply(NonBlocking.nonBlockingStream(reader, encoding()));
+ this.reader = NonBlocking.nonBlocking(name, input, encoding());
this.writer = new PrintWriter(writer);
this.output = new WriterOutputStream(writer, encoding());
parseInfoCmp();
diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/NonBlocking.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/NonBlocking.java
index ce68619527a..9fbee17b665 100644
--- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/NonBlocking.java
+++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/NonBlocking.java
@@ -123,9 +123,9 @@ public class NonBlocking {
}
if (bytes.hasRemaining()) {
if (isPeek) {
- return bytes.get(bytes.position());
+ return Byte.toUnsignedInt(bytes.get(bytes.position()));
} else {
- return bytes.get();
+ return Byte.toUnsignedInt(bytes.get());
}
} else {
return READ_EXPIRED;
diff --git a/src/jdk.internal.le/windows/native/lible/Kernel32.cpp b/src/jdk.internal.le/windows/native/lible/Kernel32.cpp
index 0293191197a..89fcc0acbda 100644
--- a/src/jdk.internal.le/windows/native/lible/Kernel32.cpp
+++ b/src/jdk.internal.le/windows/native/lible/Kernel32.cpp
@@ -460,7 +460,7 @@ JNIEXPORT void JNICALL Java_jdk_internal_org_jline_terminal_impl_jna_win_Kernel3
HANDLE h = GetStdHandle((jint) env->GetLongField(in_hConsoleOutput, pointerValue));
INPUT_RECORD *buffer = new INPUT_RECORD[in_nLength];
DWORD numberOfEventsRead;
- if (!ReadConsoleInput(h, buffer, in_nLength, &numberOfEventsRead)) {
+ if (!ReadConsoleInputW(h, buffer, in_nLength, &numberOfEventsRead)) {
delete buffer;
DWORD error = GetLastError();
jobject exc = env->NewObject(lastErrorExceptionClass,
diff --git a/test/jdk/jdk/internal/jline/AbstractWindowsTerminalTest.java b/test/jdk/jdk/internal/jline/AbstractWindowsTerminalTest.java
new file mode 100644
index 00000000000..500ea5d2548
--- /dev/null
+++ b/test/jdk/jdk/internal/jline/AbstractWindowsTerminalTest.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8218287
+ * @summary Verify the wrapper input stream is used when using Terminal.reader()
+ * @modules jdk.internal.le/jdk.internal.org.jline.terminal
+ * jdk.internal.le/jdk.internal.org.jline.terminal.impl
+ * jdk.internal.le/jdk.internal.org.jline.utils
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+
+import jdk.internal.org.jline.terminal.Size;
+import jdk.internal.org.jline.terminal.Terminal.SignalHandler;
+import jdk.internal.org.jline.terminal.impl.AbstractWindowsTerminal;
+
+
+public class AbstractWindowsTerminalTest {
+ public static void main(String... args) throws IOException {
+ new AbstractWindowsTerminalTest().run();
+ }
+
+ void run() throws IOException {
+ var out = new StringWriter();
+ AtomicBoolean called = new AtomicBoolean();
+ Function isWrapper = is -> new InputStream() {
+ @Override
+ public int read() throws IOException {
+ called.set(true);
+ return is.read();
+ }
+ };
+ var t = new AbstractWindowsTerminal(out, "test", "vt100", null, -1, false, SignalHandler.SIG_DFL, isWrapper) {
+ @Override
+ protected int getConsoleOutputCP() {
+ throw new UnsupportedOperationException("unexpected.");
+ }
+
+ @Override
+ protected int getConsoleMode() {
+ return -1;
+ }
+
+ @Override
+ protected void setConsoleMode(int mode) {
+ throw new UnsupportedOperationException("unexpected.");
+ }
+
+ @Override
+ protected boolean processConsoleInput() throws IOException {
+ throw new UnsupportedOperationException("unexpected.");
+ }
+
+ @Override
+ public Size getSize() {
+ throw new UnsupportedOperationException("unexpected.");
+ }
+ };
+ t.processInputChar(' ');
+ if (t.reader().read() != ' ') {
+ throw new AssertionError("Unexpected input!");
+ }
+ if (!called.get()) {
+ throw new AssertionError("The wrapper was not called!");
+ }
+ }
+}
From 28590e9343753f97ec5762aca15371877b4fdb68 Mon Sep 17 00:00:00 2001
From: Roman Kennke
Date: Wed, 20 Feb 2019 13:01:57 +0100
Subject: [PATCH 035/109] 8217909: Make unused r12 register (without compressed
oops) available to regalloc in C2
Reviewed-by: adinn, dlong, neliasso
---
src/hotspot/cpu/x86/c2_init_x86.cpp | 3 +
src/hotspot/cpu/x86/x86_64.ad | 484 +++++++++++-----------------
src/hotspot/share/adlc/formsopt.hpp | 3 -
3 files changed, 190 insertions(+), 300 deletions(-)
diff --git a/src/hotspot/cpu/x86/c2_init_x86.cpp b/src/hotspot/cpu/x86/c2_init_x86.cpp
index 522af0038ae..81f1e4e50c3 100644
--- a/src/hotspot/cpu/x86/c2_init_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_init_x86.cpp
@@ -29,6 +29,8 @@
// processor dependent initialization for i486
+extern void reg_mask_init();
+
void Compile::pd_compiler2_init() {
guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" );
// QQQ presumably all 64bit cpu's support this. Seems like the ifdef could
@@ -58,4 +60,5 @@ void Compile::pd_compiler2_init() {
OptoReg::invalidate(i);
}
}
+ reg_mask_init();
}
diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad
index 663e2efb5fc..c167012f120 100644
--- a/src/hotspot/cpu/x86/x86_64.ad
+++ b/src/hotspot/cpu/x86/x86_64.ad
@@ -169,135 +169,94 @@ alloc_class chunk0(R10, R10_H,
// Empty register class.
reg_class no_reg();
-// Class for all pointer registers (including RSP and RBP)
-reg_class any_reg_with_rbp(RAX, RAX_H,
- RDX, RDX_H,
- RBP, RBP_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- RSP, RSP_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R12, R12_H,
- R13, R13_H,
- R14, R14_H,
- R15, R15_H);
+// Class for all pointer/long registers
+reg_class all_reg(RAX, RAX_H,
+ RDX, RDX_H,
+ RBP, RBP_H,
+ RDI, RDI_H,
+ RSI, RSI_H,
+ RCX, RCX_H,
+ RBX, RBX_H,
+ RSP, RSP_H,
+ R8, R8_H,
+ R9, R9_H,
+ R10, R10_H,
+ R11, R11_H,
+ R12, R12_H,
+ R13, R13_H,
+ R14, R14_H,
+ R15, R15_H);
-// Class for all pointer registers (including RSP, but excluding RBP)
-reg_class any_reg_no_rbp(RAX, RAX_H,
- RDX, RDX_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- RSP, RSP_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R12, R12_H,
- R13, R13_H,
- R14, R14_H,
- R15, R15_H);
+// Class for all int registers
+reg_class all_int_reg(RAX
+ RDX,
+ RBP,
+ RDI,
+ RSI,
+ RCX,
+ RBX,
+ R8,
+ R9,
+ R10,
+ R11,
+ R12,
+ R13,
+ R14);
-// Dynamic register class that selects at runtime between register classes
-// any_reg_no_rbp and any_reg_with_rbp (depending on the value of the flag PreserveFramePointer).
-// Equivalent to: return PreserveFramePointer ? any_reg_no_rbp : any_reg_with_rbp;
-reg_class_dynamic any_reg(any_reg_no_rbp, any_reg_with_rbp, %{ PreserveFramePointer %});
+// Class for all pointer registers
+reg_class any_reg %{
+ return _ANY_REG_mask;
+%}
// Class for all pointer registers (excluding RSP)
-reg_class ptr_reg_with_rbp(RAX, RAX_H,
- RDX, RDX_H,
- RBP, RBP_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
+reg_class ptr_reg %{
+ return _PTR_REG_mask;
+%}
// Class for all pointer registers (excluding RSP and RBP)
-reg_class ptr_reg_no_rbp(RAX, RAX_H,
- RDX, RDX_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Dynamic register class that selects between ptr_reg_no_rbp and ptr_reg_with_rbp.
-reg_class_dynamic ptr_reg(ptr_reg_no_rbp, ptr_reg_with_rbp, %{ PreserveFramePointer %});
+reg_class ptr_reg_no_rbp %{
+ return _PTR_REG_NO_RBP_mask;
+%}
// Class for all pointer registers (excluding RAX and RSP)
-reg_class ptr_no_rax_reg_with_rbp(RDX, RDX_H,
- RBP, RBP_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Class for all pointer registers (excluding RAX, RSP, and RBP)
-reg_class ptr_no_rax_reg_no_rbp(RDX, RDX_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Dynamic register class that selects between ptr_no_rax_reg_no_rbp and ptr_no_rax_reg_with_rbp.
-reg_class_dynamic ptr_no_rax_reg(ptr_no_rax_reg_no_rbp, ptr_no_rax_reg_with_rbp, %{ PreserveFramePointer %});
+reg_class ptr_no_rax_reg %{
+ return _PTR_NO_RAX_REG_mask;
+%}
// Class for all pointer registers (excluding RAX, RBX, and RSP)
-reg_class ptr_no_rax_rbx_reg_with_rbp(RDX, RDX_H,
- RBP, RBP_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
+reg_class ptr_no_rax_rbx_reg %{
+ return _PTR_NO_RAX_RBX_REG_mask;
+%}
-// Class for all pointer registers (excluding RAX, RBX, RSP, and RBP)
-reg_class ptr_no_rax_rbx_reg_no_rbp(RDX, RDX_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
+// Class for all long registers (excluding RSP)
+reg_class long_reg %{
+ return _LONG_REG_mask;
+%}
-// Dynamic register class that selects between ptr_no_rax_rbx_reg_no_rbp and ptr_no_rax_rbx_reg_with_rbp.
-reg_class_dynamic ptr_no_rax_rbx_reg(ptr_no_rax_rbx_reg_no_rbp, ptr_no_rax_rbx_reg_with_rbp, %{ PreserveFramePointer %});
+// Class for all long registers (excluding RAX, RDX and RSP)
+reg_class long_no_rax_rdx_reg %{
+ return _LONG_NO_RAX_RDX_REG_mask;
+%}
+
+// Class for all long registers (excluding RCX and RSP)
+reg_class long_no_rcx_reg %{
+ return _LONG_NO_RCX_REG_mask;
+%}
+
+// Class for all int registers (excluding RSP)
+reg_class int_reg %{
+ return _INT_REG_mask;
+%}
+
+// Class for all int registers (excluding RAX, RDX, and RSP)
+reg_class int_no_rax_rdx_reg %{
+ return _INT_NO_RAX_RDX_REG_mask;
+%}
+
+// Class for all int registers (excluding RCX and RSP)
+reg_class int_no_rcx_reg %{
+ return _INT_NO_RCX_REG_mask;
+%}
// Singleton class for RAX pointer register
reg_class ptr_rax_reg(RAX, RAX_H);
@@ -317,96 +276,6 @@ reg_class ptr_rsp_reg(RSP, RSP_H);
// Singleton class for TLS pointer
reg_class ptr_r15_reg(R15, R15_H);
-// Class for all long registers (excluding RSP)
-reg_class long_reg_with_rbp(RAX, RAX_H,
- RDX, RDX_H,
- RBP, RBP_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Class for all long registers (excluding RSP and RBP)
-reg_class long_reg_no_rbp(RAX, RAX_H,
- RDX, RDX_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Dynamic register class that selects between long_reg_no_rbp and long_reg_with_rbp.
-reg_class_dynamic long_reg(long_reg_no_rbp, long_reg_with_rbp, %{ PreserveFramePointer %});
-
-// Class for all long registers (excluding RAX, RDX and RSP)
-reg_class long_no_rax_rdx_reg_with_rbp(RBP, RBP_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Class for all long registers (excluding RAX, RDX, RSP, and RBP)
-reg_class long_no_rax_rdx_reg_no_rbp(RDI, RDI_H,
- RSI, RSI_H,
- RCX, RCX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Dynamic register class that selects between long_no_rax_rdx_reg_no_rbp and long_no_rax_rdx_reg_with_rbp.
-reg_class_dynamic long_no_rax_rdx_reg(long_no_rax_rdx_reg_no_rbp, long_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %});
-
-// Class for all long registers (excluding RCX and RSP)
-reg_class long_no_rcx_reg_with_rbp(RBP, RBP_H,
- RDI, RDI_H,
- RSI, RSI_H,
- RAX, RAX_H,
- RDX, RDX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Class for all long registers (excluding RCX, RSP, and RBP)
-reg_class long_no_rcx_reg_no_rbp(RDI, RDI_H,
- RSI, RSI_H,
- RAX, RAX_H,
- RDX, RDX_H,
- RBX, RBX_H,
- R8, R8_H,
- R9, R9_H,
- R10, R10_H,
- R11, R11_H,
- R13, R13_H,
- R14, R14_H);
-
-// Dynamic register class that selects between long_no_rcx_reg_no_rbp and long_no_rcx_reg_with_rbp.
-reg_class_dynamic long_no_rcx_reg(long_no_rcx_reg_no_rbp, long_no_rcx_reg_with_rbp, %{ PreserveFramePointer %});
-
// Singleton class for RAX long register
reg_class long_rax_reg(RAX, RAX_H);
@@ -416,96 +285,6 @@ reg_class long_rcx_reg(RCX, RCX_H);
// Singleton class for RDX long register
reg_class long_rdx_reg(RDX, RDX_H);
-// Class for all int registers (excluding RSP)
-reg_class int_reg_with_rbp(RAX,
- RDX,
- RBP,
- RDI,
- RSI,
- RCX,
- RBX,
- R8,
- R9,
- R10,
- R11,
- R13,
- R14);
-
-// Class for all int registers (excluding RSP and RBP)
-reg_class int_reg_no_rbp(RAX,
- RDX,
- RDI,
- RSI,
- RCX,
- RBX,
- R8,
- R9,
- R10,
- R11,
- R13,
- R14);
-
-// Dynamic register class that selects between int_reg_no_rbp and int_reg_with_rbp.
-reg_class_dynamic int_reg(int_reg_no_rbp, int_reg_with_rbp, %{ PreserveFramePointer %});
-
-// Class for all int registers (excluding RCX and RSP)
-reg_class int_no_rcx_reg_with_rbp(RAX,
- RDX,
- RBP,
- RDI,
- RSI,
- RBX,
- R8,
- R9,
- R10,
- R11,
- R13,
- R14);
-
-// Class for all int registers (excluding RCX, RSP, and RBP)
-reg_class int_no_rcx_reg_no_rbp(RAX,
- RDX,
- RDI,
- RSI,
- RBX,
- R8,
- R9,
- R10,
- R11,
- R13,
- R14);
-
-// Dynamic register class that selects between int_no_rcx_reg_no_rbp and int_no_rcx_reg_with_rbp.
-reg_class_dynamic int_no_rcx_reg(int_no_rcx_reg_no_rbp, int_no_rcx_reg_with_rbp, %{ PreserveFramePointer %});
-
-// Class for all int registers (excluding RAX, RDX, and RSP)
-reg_class int_no_rax_rdx_reg_with_rbp(RBP,
- RDI,
- RSI,
- RCX,
- RBX,
- R8,
- R9,
- R10,
- R11,
- R13,
- R14);
-
-// Class for all int registers (excluding RAX, RDX, RSP, and RBP)
-reg_class int_no_rax_rdx_reg_no_rbp(RDI,
- RSI,
- RCX,
- RBX,
- R8,
- R9,
- R10,
- R11,
- R13,
- R14);
-
-// Dynamic register class that selects between int_no_rax_rdx_reg_no_rbp and int_no_rax_rdx_reg_with_rbp.
-reg_class_dynamic int_no_rax_rdx_reg(int_no_rax_rdx_reg_no_rbp, int_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %});
-
// Singleton class for RAX int register
reg_class int_rax_reg(RAX);
@@ -529,12 +308,123 @@ reg_class int_rdi_reg(RDI);
//----------SOURCE BLOCK-------------------------------------------------------
// This is a block of C++ code which provides values, functions, and
// definitions necessary in the rest of the architecture description
+source_hpp %{
+
+extern RegMask _ANY_REG_mask;
+extern RegMask _PTR_REG_mask;
+extern RegMask _PTR_REG_NO_RBP_mask;
+extern RegMask _PTR_NO_RAX_REG_mask;
+extern RegMask _PTR_NO_RAX_RBX_REG_mask;
+extern RegMask _LONG_REG_mask;
+extern RegMask _LONG_NO_RAX_RDX_REG_mask;
+extern RegMask _LONG_NO_RCX_REG_mask;
+extern RegMask _INT_REG_mask;
+extern RegMask _INT_NO_RAX_RDX_REG_mask;
+extern RegMask _INT_NO_RCX_REG_mask;
+
+extern RegMask _STACK_OR_PTR_REG_mask;
+extern RegMask _STACK_OR_LONG_REG_mask;
+extern RegMask _STACK_OR_INT_REG_mask;
+
+inline const RegMask& STACK_OR_PTR_REG_mask() { return _STACK_OR_PTR_REG_mask; }
+inline const RegMask& STACK_OR_LONG_REG_mask() { return _STACK_OR_LONG_REG_mask; }
+inline const RegMask& STACK_OR_INT_REG_mask() { return _STACK_OR_INT_REG_mask; }
+
+%}
+
source %{
#define RELOC_IMM64 Assembler::imm_operand
#define RELOC_DISP32 Assembler::disp32_operand
#define __ _masm.
+RegMask _ANY_REG_mask;
+RegMask _PTR_REG_mask;
+RegMask _PTR_REG_NO_RBP_mask;
+RegMask _PTR_NO_RAX_REG_mask;
+RegMask _PTR_NO_RAX_RBX_REG_mask;
+RegMask _LONG_REG_mask;
+RegMask _LONG_NO_RAX_RDX_REG_mask;
+RegMask _LONG_NO_RCX_REG_mask;
+RegMask _INT_REG_mask;
+RegMask _INT_NO_RAX_RDX_REG_mask;
+RegMask _INT_NO_RCX_REG_mask;
+RegMask _STACK_OR_PTR_REG_mask;
+RegMask _STACK_OR_LONG_REG_mask;
+RegMask _STACK_OR_INT_REG_mask;
+
+static bool need_r12_heapbase() {
+ return UseCompressedOops || UseCompressedClassPointers || UseZGC;
+}
+
+void reg_mask_init() {
+ // _ALL_REG_mask is generated by adlc from the all_reg register class below.
+ // We derive a number of subsets from it.
+ _ANY_REG_mask = _ALL_REG_mask;
+
+ if (PreserveFramePointer) {
+ _ANY_REG_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()));
+ _ANY_REG_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()->next()));
+ }
+ if (need_r12_heapbase()) {
+ _ANY_REG_mask.Remove(OptoReg::as_OptoReg(r12->as_VMReg()));
+ _ANY_REG_mask.Remove(OptoReg::as_OptoReg(r12->as_VMReg()->next()));
+ }
+
+ _PTR_REG_mask = _ANY_REG_mask;
+ _PTR_REG_mask.Remove(OptoReg::as_OptoReg(rsp->as_VMReg()));
+ _PTR_REG_mask.Remove(OptoReg::as_OptoReg(rsp->as_VMReg()->next()));
+ _PTR_REG_mask.Remove(OptoReg::as_OptoReg(r15->as_VMReg()));
+ _PTR_REG_mask.Remove(OptoReg::as_OptoReg(r15->as_VMReg()->next()));
+
+ _STACK_OR_PTR_REG_mask = _PTR_REG_mask;
+ _STACK_OR_PTR_REG_mask.OR(STACK_OR_STACK_SLOTS_mask());
+
+ _PTR_REG_NO_RBP_mask = _PTR_REG_mask;
+ _PTR_REG_NO_RBP_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()));
+ _PTR_REG_NO_RBP_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()->next()));
+
+ _PTR_NO_RAX_REG_mask = _PTR_REG_mask;
+ _PTR_NO_RAX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()));
+ _PTR_NO_RAX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()->next()));
+
+ _PTR_NO_RAX_RBX_REG_mask = _PTR_NO_RAX_REG_mask;
+ _PTR_NO_RAX_RBX_REG_mask.Remove(OptoReg::as_OptoReg(rbx->as_VMReg()));
+ _PTR_NO_RAX_RBX_REG_mask.Remove(OptoReg::as_OptoReg(rbx->as_VMReg()->next()));
+
+ _LONG_REG_mask = _PTR_REG_mask;
+ _STACK_OR_LONG_REG_mask = _LONG_REG_mask;
+ _STACK_OR_LONG_REG_mask.OR(STACK_OR_STACK_SLOTS_mask());
+
+ _LONG_NO_RAX_RDX_REG_mask = _LONG_REG_mask;
+ _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()));
+ _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()->next()));
+ _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rdx->as_VMReg()));
+ _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rdx->as_VMReg()->next()));
+
+ _LONG_NO_RCX_REG_mask = _LONG_REG_mask;
+ _LONG_NO_RCX_REG_mask.Remove(OptoReg::as_OptoReg(rcx->as_VMReg()));
+ _LONG_NO_RCX_REG_mask.Remove(OptoReg::as_OptoReg(rcx->as_VMReg()->next()));
+
+ _INT_REG_mask = _ALL_INT_REG_mask;
+ if (PreserveFramePointer) {
+ _INT_REG_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()));
+ }
+ if (need_r12_heapbase()) {
+ _INT_REG_mask.Remove(OptoReg::as_OptoReg(r12->as_VMReg()));
+ }
+
+ _STACK_OR_INT_REG_mask = _INT_REG_mask;
+ _STACK_OR_INT_REG_mask.OR(STACK_OR_STACK_SLOTS_mask());
+
+ _INT_NO_RAX_RDX_REG_mask = _INT_REG_mask;
+ _INT_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()));
+ _INT_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rdx->as_VMReg()));
+
+ _INT_NO_RCX_REG_mask = _INT_REG_mask;
+ _INT_NO_RCX_REG_mask.Remove(OptoReg::as_OptoReg(rcx->as_VMReg()));
+}
+
static bool generate_vzeroupper(Compile* C) {
return (VM_Version::supports_vzeroupper() && (C->max_vector_size() > 16 || C->clear_upper_avx() == true)) ? true: false; // Generate vzeroupper
}
diff --git a/src/hotspot/share/adlc/formsopt.hpp b/src/hotspot/share/adlc/formsopt.hpp
index 113489696a5..4ea99bf1d17 100644
--- a/src/hotspot/share/adlc/formsopt.hpp
+++ b/src/hotspot/share/adlc/formsopt.hpp
@@ -242,9 +242,6 @@ public:
char* code_snippet() {
return _code_snippet;
}
- void set_stack_version(bool flag) {
- assert(false, "User defined register classes are not allowed to spill to the stack.");
- }
void declare_register_masks(FILE* fp);
void build_register_masks(FILE* fp) {
// We do not need to generate register masks because we select at runtime
From 92f19f92bb79f922a3d8e61c10d81b7d0c75760d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20Lid=C3=A9n?=
Date: Wed, 20 Feb 2019 13:43:01 +0100
Subject: [PATCH 036/109] 8219331: ZGC: Unify TLAB retire/remap handling
Reviewed-by: stefank
---
src/hotspot/share/gc/z/zInitialize.cpp | 6 +--
src/hotspot/share/gc/z/zMark.cpp | 19 +++-----
src/hotspot/share/gc/z/zRelocate.cpp | 12 ++---
...atTLAB.cpp => zThreadLocalAllocBuffer.cpp} | 45 ++++++++++++-------
...atTLAB.hpp => zThreadLocalAllocBuffer.hpp} | 19 ++++----
5 files changed, 52 insertions(+), 49 deletions(-)
rename src/hotspot/share/gc/z/{zStatTLAB.cpp => zThreadLocalAllocBuffer.cpp} (59%)
rename src/hotspot/share/gc/z/{zStatTLAB.hpp => zThreadLocalAllocBuffer.hpp} (73%)
diff --git a/src/hotspot/share/gc/z/zInitialize.cpp b/src/hotspot/share/gc/z/zInitialize.cpp
index b2656f1a11c..55e55db34ef 100644
--- a/src/hotspot/share/gc/z/zInitialize.cpp
+++ b/src/hotspot/share/gc/z/zInitialize.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
#include "gc/z/zLargePages.hpp"
#include "gc/z/zNUMA.hpp"
#include "gc/z/zStat.hpp"
-#include "gc/z/zStatTLAB.hpp"
+#include "gc/z/zThreadLocalAllocBuffer.hpp"
#include "gc/z/zTracer.hpp"
#include "logging/log.hpp"
#include "runtime/vm_version.hpp"
@@ -46,7 +46,7 @@ ZInitialize::ZInitialize(ZBarrierSet* barrier_set) {
ZNUMA::initialize();
ZCPU::initialize();
ZStatValue::initialize();
- ZStatTLAB::initialize();
+ ZThreadLocalAllocBuffer::initialize();
ZTracer::initialize();
ZLargePages::initialize();
ZBarrierSet::set_barrier_set(barrier_set);
diff --git a/src/hotspot/share/gc/z/zMark.cpp b/src/hotspot/share/gc/z/zMark.cpp
index 861e74608c3..0bcb701aea7 100644
--- a/src/hotspot/share/gc/z/zMark.cpp
+++ b/src/hotspot/share/gc/z/zMark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,9 +32,9 @@
#include "gc/z/zPageTable.inline.hpp"
#include "gc/z/zRootsIterator.hpp"
#include "gc/z/zStat.hpp"
-#include "gc/z/zStatTLAB.hpp"
#include "gc/z/zTask.hpp"
#include "gc/z/zThread.hpp"
+#include "gc/z/zThreadLocalAllocBuffer.hpp"
#include "gc/z/zUtils.inline.hpp"
#include "gc/z/zWorkers.inline.hpp"
#include "logging/log.hpp"
@@ -119,18 +119,13 @@ void ZMark::prepare_mark() {
}
class ZMarkRootsIteratorClosure : public ZRootsIteratorClosure {
-private:
- static void fixup_address(HeapWord** p) {
- *p = (HeapWord*)ZAddress::good_or_null((uintptr_t)*p);
- }
-
public:
ZMarkRootsIteratorClosure() {
- ZStatTLAB::reset();
+ ZThreadLocalAllocBuffer::reset_statistics();
}
~ZMarkRootsIteratorClosure() {
- ZStatTLAB::publish();
+ ZThreadLocalAllocBuffer::publish_statistics();
}
virtual void do_thread(Thread* thread) {
@@ -140,11 +135,7 @@ public:
ZThreadLocalData::set_address_bad_mask(thread, ZAddressBadMask);
// Retire TLAB
- if (UseTLAB && thread->is_Java_thread()) {
- thread->tlab().addresses_do(fixup_address);
- thread->tlab().retire(ZStatTLAB::get());
- thread->tlab().resize();
- }
+ ZThreadLocalAllocBuffer::retire(thread);
}
virtual void do_oop(oop* p) {
diff --git a/src/hotspot/share/gc/z/zRelocate.cpp b/src/hotspot/share/gc/z/zRelocate.cpp
index 9fbe1c873f5..82ffb780896 100644
--- a/src/hotspot/share/gc/z/zRelocate.cpp
+++ b/src/hotspot/share/gc/z/zRelocate.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,17 +31,13 @@
#include "gc/z/zRelocationSet.inline.hpp"
#include "gc/z/zRootsIterator.hpp"
#include "gc/z/zTask.hpp"
+#include "gc/z/zThreadLocalAllocBuffer.hpp"
#include "gc/z/zWorkers.hpp"
ZRelocate::ZRelocate(ZWorkers* workers) :
_workers(workers) {}
class ZRelocateRootsIteratorClosure : public ZRootsIteratorClosure {
-private:
- static void remap_address(HeapWord** p) {
- *p = (HeapWord*)ZAddress::good_or_null((uintptr_t)*p);
- }
-
public:
virtual void do_thread(Thread* thread) {
ZRootsIteratorClosure::do_thread(thread);
@@ -50,9 +46,7 @@ public:
ZThreadLocalData::set_address_bad_mask(thread, ZAddressBadMask);
// Remap TLAB
- if (UseTLAB && thread->is_Java_thread()) {
- thread->tlab().addresses_do(remap_address);
- }
+ ZThreadLocalAllocBuffer::remap(thread);
}
virtual void do_oop(oop* p) {
diff --git a/src/hotspot/share/gc/z/zStatTLAB.cpp b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.cpp
similarity index 59%
rename from src/hotspot/share/gc/z/zStatTLAB.cpp
rename to src/hotspot/share/gc/z/zThreadLocalAllocBuffer.cpp
index 4ca29962e34..1e13cdec983 100644
--- a/src/hotspot/share/gc/z/zStatTLAB.cpp
+++ b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -21,19 +21,23 @@
* questions.
*/
-#include "gc/z/zStatTLAB.hpp"
+#include "precompiled.hpp"
+#include "gc/z/zAddress.inline.hpp"
+#include "gc/z/zThreadLocalAllocBuffer.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/thread.hpp"
-ZPerWorker* ZStatTLAB::_stats = NULL;
+ZPerWorker* ZThreadLocalAllocBuffer::_stats = NULL;
-void ZStatTLAB::initialize() {
+void ZThreadLocalAllocBuffer::initialize() {
if (UseTLAB) {
assert(_stats == NULL, "Already initialized");
_stats = new ZPerWorker();
- reset();
+ reset_statistics();
}
}
-void ZStatTLAB::reset() {
+void ZThreadLocalAllocBuffer::reset_statistics() {
if (UseTLAB) {
ZPerWorkerIterator iter(_stats);
for (ThreadLocalAllocStats* stats; iter.next(&stats);) {
@@ -42,15 +46,7 @@ void ZStatTLAB::reset() {
}
}
-ThreadLocalAllocStats* ZStatTLAB::get() {
- if (UseTLAB) {
- return _stats->addr();
- }
-
- return NULL;
-}
-
-void ZStatTLAB::publish() {
+void ZThreadLocalAllocBuffer::publish_statistics() {
if (UseTLAB) {
ThreadLocalAllocStats total;
@@ -62,3 +58,22 @@ void ZStatTLAB::publish() {
total.publish();
}
}
+
+static void fixup_address(HeapWord** p) {
+ *p = (HeapWord*)ZAddress::good_or_null((uintptr_t)*p);
+}
+
+void ZThreadLocalAllocBuffer::retire(Thread* thread) {
+ if (UseTLAB && thread->is_Java_thread()) {
+ ThreadLocalAllocStats* const stats = _stats->addr();
+ thread->tlab().addresses_do(fixup_address);
+ thread->tlab().retire(stats);
+ thread->tlab().resize();
+ }
+}
+
+void ZThreadLocalAllocBuffer::remap(Thread* thread) {
+ if (UseTLAB && thread->is_Java_thread()) {
+ thread->tlab().addresses_do(fixup_address);
+ }
+}
diff --git a/src/hotspot/share/gc/z/zStatTLAB.hpp b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp
similarity index 73%
rename from src/hotspot/share/gc/z/zStatTLAB.hpp
rename to src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp
index efbd3db4a65..cc708164822 100644
--- a/src/hotspot/share/gc/z/zStatTLAB.hpp
+++ b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -21,22 +21,25 @@
* questions.
*/
-#ifndef SHARE_GC_Z_ZSTATTLAB_HPP
-#define SHARE_GC_Z_ZSTATTLAB_HPP
+#ifndef SHARE_GC_Z_ZTHREADLOCALALLOCBUFFER_HPP
+#define SHARE_GC_Z_ZTHREADLOCALALLOCBUFFER_HPP
#include "gc/shared/threadLocalAllocBuffer.hpp"
#include "gc/z/zValue.hpp"
#include "memory/allocation.hpp"
-class ZStatTLAB : public AllStatic {
+class ZThreadLocalAllocBuffer : public AllStatic {
private:
static ZPerWorker* _stats;
public:
static void initialize();
- static void reset();
- static ThreadLocalAllocStats* get();
- static void publish();
+
+ static void reset_statistics();
+ static void publish_statistics();
+
+ static void retire(Thread* thread);
+ static void remap(Thread* thread);
};
-#endif // SHARE_GC_Z_ZSTATTLAB_HPP
+#endif // SHARE_GC_Z_ZTHREADLOCALALLOCBUFFER_HPP
From 3df5e4fabbda7dfc4c43d8402b58614945774081 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20Lid=C3=A9n?=
Date: Wed, 20 Feb 2019 13:43:02 +0100
Subject: [PATCH 037/109] 8219332: ZGC: Improve ZRootsIteratorClosure
abstraction
Reviewed-by: stefank
---
src/hotspot/share/gc/z/zMark.cpp | 2 --
src/hotspot/share/gc/z/zRelocate.cpp | 2 --
src/hotspot/share/gc/z/zRootsIterator.cpp | 32 +++++++++++++++--------
src/hotspot/share/gc/z/zRootsIterator.hpp | 4 +--
4 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/src/hotspot/share/gc/z/zMark.cpp b/src/hotspot/share/gc/z/zMark.cpp
index 0bcb701aea7..09249e53b38 100644
--- a/src/hotspot/share/gc/z/zMark.cpp
+++ b/src/hotspot/share/gc/z/zMark.cpp
@@ -129,8 +129,6 @@ public:
}
virtual void do_thread(Thread* thread) {
- ZRootsIteratorClosure::do_thread(thread);
-
// Update thread local address bad mask
ZThreadLocalData::set_address_bad_mask(thread, ZAddressBadMask);
diff --git a/src/hotspot/share/gc/z/zRelocate.cpp b/src/hotspot/share/gc/z/zRelocate.cpp
index 82ffb780896..cc76e263c88 100644
--- a/src/hotspot/share/gc/z/zRelocate.cpp
+++ b/src/hotspot/share/gc/z/zRelocate.cpp
@@ -40,8 +40,6 @@ ZRelocate::ZRelocate(ZWorkers* workers) :
class ZRelocateRootsIteratorClosure : public ZRootsIteratorClosure {
public:
virtual void do_thread(Thread* thread) {
- ZRootsIteratorClosure::do_thread(thread);
-
// Update thread local address bad mask
ZThreadLocalData::set_address_bad_mask(thread, ZAddressBadMask);
diff --git a/src/hotspot/share/gc/z/zRootsIterator.cpp b/src/hotspot/share/gc/z/zRootsIterator.cpp
index 654d53a6fe6..2658da70df0 100644
--- a/src/hotspot/share/gc/z/zRootsIterator.cpp
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp
@@ -135,29 +135,38 @@ void ZParallelWeakOopsDo::weak_oops_do(BoolObjectClosure* is_alive, ZRoots
}
}
-class ZCodeBlobClosure : public CodeBlobToOopClosure {
+class ZRootsIteratorCodeBlobClosure : public CodeBlobToOopClosure {
private:
BarrierSetNMethod* _bs;
public:
- ZCodeBlobClosure(OopClosure* cl) :
+ ZRootsIteratorCodeBlobClosure(OopClosure* cl) :
CodeBlobToOopClosure(cl, true /* fix_relocations */),
_bs(BarrierSet::barrier_set()->barrier_set_nmethod()) {}
virtual void do_code_blob(CodeBlob* cb) {
nmethod* const nm = cb->as_nmethod_or_null();
- if (nm == NULL || nm->test_set_oops_do_mark()) {
- return;
+ if (nm != NULL && !nm->test_set_oops_do_mark()) {
+ CodeBlobToOopClosure::do_code_blob(cb);
+ _bs->disarm(nm);
}
- CodeBlobToOopClosure::do_code_blob(cb);
- _bs->disarm(nm);
}
};
-void ZRootsIteratorClosure::do_thread(Thread* thread) {
- ZCodeBlobClosure code_cl(this);
- thread->oops_do(this, ClassUnloading ? &code_cl : NULL);
-}
+class ZRootsIteratorThreadClosure : public ThreadClosure {
+private:
+ ZRootsIteratorClosure* _cl;
+
+public:
+ ZRootsIteratorThreadClosure(ZRootsIteratorClosure* cl) :
+ _cl(cl) {}
+
+ virtual void do_thread(Thread* thread) {
+ ZRootsIteratorCodeBlobClosure code_cl(_cl);
+ thread->oops_do(_cl, ClassUnloading ? &code_cl : NULL);
+ _cl->do_thread(thread);
+ }
+};
ZRootsIterator::ZRootsIterator() :
_universe(this),
@@ -227,7 +236,8 @@ void ZRootsIterator::do_system_dictionary(ZRootsIteratorClosure* cl) {
void ZRootsIterator::do_threads(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsThreads);
ResourceMark rm;
- Threads::possibly_parallel_threads_do(true, cl);
+ ZRootsIteratorThreadClosure thread_cl(cl);
+ Threads::possibly_parallel_threads_do(true, &thread_cl);
}
void ZRootsIterator::do_code_cache(ZRootsIteratorClosure* cl) {
diff --git a/src/hotspot/share/gc/z/zRootsIterator.hpp b/src/hotspot/share/gc/z/zRootsIterator.hpp
index 0cd6dd1db55..d5146397747 100644
--- a/src/hotspot/share/gc/z/zRootsIterator.hpp
+++ b/src/hotspot/share/gc/z/zRootsIterator.hpp
@@ -31,9 +31,9 @@
#include "runtime/thread.hpp"
#include "utilities/globalDefinitions.hpp"
-class ZRootsIteratorClosure : public OopClosure, public ThreadClosure {
+class ZRootsIteratorClosure : public OopClosure {
public:
- virtual void do_thread(Thread* thread);
+ virtual void do_thread(Thread* thread) {}
};
typedef OopStorage::ParState ZOopStorageIterator;
From 865c33112c3be23e126e3c51259c2881e9088271 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20Lid=C3=A9n?=
Date: Wed, 20 Feb 2019 13:43:28 +0100
Subject: [PATCH 038/109] 8218767: ZGC: Do not assume that r12 is a special
register in C2
Reviewed-by: eosterlund, rkennke
---
src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp | 2 +-
src/hotspot/cpu/x86/gc/z/z_x86_64.ad | 3 +--
src/hotspot/cpu/x86/x86_64.ad | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
index c51519fa746..114d76372b3 100644
--- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
@@ -359,7 +359,7 @@ void ZBarrierSetAssembler::generate_c1_load_barrier_runtime_stub(StubAssembler*
// ZBarrierSetRuntime::load_barrier_on_weak_oop_field_preloaded().
static address generate_load_barrier_stub(StubCodeGenerator* cgen, Register raddr, DecoratorSet decorators) {
// Don't generate stub for invalid registers
- if (raddr == rsp || raddr == r12 || raddr == r15) {
+ if (raddr == rsp || raddr == r15) {
return NULL;
}
diff --git a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad
index d3d6d32b20f..e92d24696e0 100644
--- a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad
+++ b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad
@@ -26,9 +26,8 @@ source %{
#include "gc/z/zBarrierSetAssembler.hpp"
static void z_load_barrier_slow_reg(MacroAssembler& _masm, Register dst, Address src, bool weak) {
- assert(dst != r12, "Invalid register");
- assert(dst != r15, "Invalid register");
assert(dst != rsp, "Invalid register");
+ assert(dst != r15, "Invalid register");
const address stub = weak ? ZBarrierSet::assembler()->load_barrier_weak_slow_stub(dst)
: ZBarrierSet::assembler()->load_barrier_slow_stub(dst);
diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad
index c167012f120..20f435d5c28 100644
--- a/src/hotspot/cpu/x86/x86_64.ad
+++ b/src/hotspot/cpu/x86/x86_64.ad
@@ -354,7 +354,7 @@ RegMask _STACK_OR_LONG_REG_mask;
RegMask _STACK_OR_INT_REG_mask;
static bool need_r12_heapbase() {
- return UseCompressedOops || UseCompressedClassPointers || UseZGC;
+ return UseCompressedOops || UseCompressedClassPointers;
}
void reg_mask_init() {
From f4ac0a2e0f6327a9b43f987b501b31ac878d6bfb Mon Sep 17 00:00:00 2001
From: Harold Seigel
Date: Wed, 20 Feb 2019 08:10:40 -0500
Subject: [PATCH 039/109] 8167548: [TESTBUG] Logging tests put log files in
source tree
Create log files in temp directory, instead of cwd.
Reviewed-by: coleenp, dholmes
---
src/hotspot/share/logging/logFileOutput.cpp | 9 +++++++
src/hotspot/share/logging/logFileOutput.hpp | 1 +
test/hotspot/gtest/logging/logTestFixture.cpp | 13 +++++-----
.../gtest/logging/logTestUtils.inline.hpp | 26 ++++++++++++++++++-
.../gtest/logging/test_logConfiguration.cpp | 15 +++++------
.../gtest/logging/test_logFileOutput.cpp | 20 ++++++--------
.../logging/test_logTagSetDescriptions.cpp | 5 ++--
7 files changed, 60 insertions(+), 29 deletions(-)
diff --git a/src/hotspot/share/logging/logFileOutput.cpp b/src/hotspot/share/logging/logFileOutput.cpp
index de3e4ddb93d..81a42822b45 100644
--- a/src/hotspot/share/logging/logFileOutput.cpp
+++ b/src/hotspot/share/logging/logFileOutput.cpp
@@ -51,6 +51,14 @@ LogFileOutput::LogFileOutput(const char* name)
_file_name = make_file_name(name + strlen(Prefix), _pid_str, _vm_start_time_str);
}
+const char* LogFileOutput::cur_log_file_name() {
+ if (strlen(_archive_name) == 0) {
+ return _file_name;
+ } else {
+ return _archive_name;
+ }
+}
+
void LogFileOutput::set_file_name_parameters(jlong vm_start_time) {
int res = jio_snprintf(_pid_str, sizeof(_pid_str), "%d", os::current_process_id());
assert(res > 0, "PID buffer too small");
@@ -234,6 +242,7 @@ bool LogFileOutput::initialize(const char* options, outputStream* errstream) {
_file_count_max_digits = number_of_digits(_file_count - 1);
_archive_name_len = 2 + strlen(_file_name) + _file_count_max_digits;
_archive_name = NEW_C_HEAP_ARRAY(char, _archive_name_len, mtLogging);
+ _archive_name[0] = 0;
}
log_trace(logging)("Initializing logging to file '%s' (filecount: %u"
diff --git a/src/hotspot/share/logging/logFileOutput.hpp b/src/hotspot/share/logging/logFileOutput.hpp
index b8d366cb288..5301816313d 100644
--- a/src/hotspot/share/logging/logFileOutput.hpp
+++ b/src/hotspot/share/logging/logFileOutput.hpp
@@ -92,6 +92,7 @@ class LogFileOutput : public LogFileStreamOutput {
return _name;
}
+ const char* cur_log_file_name();
static const char* const Prefix;
static void set_file_name_parameters(jlong start_time);
};
diff --git a/test/hotspot/gtest/logging/logTestFixture.cpp b/test/hotspot/gtest/logging/logTestFixture.cpp
index 5c0bd00c2bb..bc153b76fb9 100644
--- a/test/hotspot/gtest/logging/logTestFixture.cpp
+++ b/test/hotspot/gtest/logging/logTestFixture.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,11 +33,12 @@
#include "utilities/ostream.hpp"
LogTestFixture::LogTestFixture() : _n_snapshots(0), _configuration_snapshot(NULL) {
- // Set up TestLogFileName to include PID, testcase name and test name
- int ret = jio_snprintf(_filename, sizeof(_filename), "testlog.pid%d.%s.%s.log",
- os::current_process_id(),
- ::testing::UnitTest::GetInstance()->current_test_info()->test_case_name(),
- ::testing::UnitTest::GetInstance()->current_test_info()->name());
+
+ // Set up TestLogFileName to include temp_dir, PID, testcase name and test name.
+ const testing::TestInfo* test_info = ::testing::UnitTest::GetInstance()->current_test_info();
+ int ret = jio_snprintf(_filename, sizeof(_filename), "%s%stestlog.pid%d.%s.%s.log",
+ os::get_temp_directory(), os::file_separator(), os::current_process_id(),
+ test_info->test_case_name(), test_info->name());
EXPECT_GT(ret, 0) << "_filename buffer issue";
TestLogFileName = _filename;
diff --git a/test/hotspot/gtest/logging/logTestUtils.inline.hpp b/test/hotspot/gtest/logging/logTestUtils.inline.hpp
index 5e97882b975..c1bc288a38d 100644
--- a/test/hotspot/gtest/logging/logTestUtils.inline.hpp
+++ b/test/hotspot/gtest/logging/logTestUtils.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -88,6 +88,30 @@ static inline void init_log_file(const char* filename, const char* options = "")
guarantee(success, "Failed to disable logging to file '%s'", filename);
}
+static const char* tmp_dir = os::get_temp_directory();
+static const char* file_sep = os::file_separator();
+
+// Prepend filename with the temp directory and pid and return the result as a
+// resource allocated string.
+static inline char* prepend_temp_dir(const char* filename) {
+ size_t temp_file_len = strlen(tmp_dir) + strlen(file_sep) + strlen(filename) + 28;
+ char* temp_file = NEW_RESOURCE_ARRAY(char, temp_file_len);
+ int ret = jio_snprintf(temp_file, temp_file_len, "%s%spid%d.%s",
+ tmp_dir, file_sep,
+ os::current_process_id(), filename);
+ return temp_file;
+}
+
+// Prepend filename with specified prefix and the temp directory and return the
+// result as a malloc allocated string. This is used by test_logFileOutput.cpp.
+static inline char* prepend_prefix_temp_dir(const char* prefix, const char* filename) {
+ size_t temp_file_len = strlen(prefix) + strlen(tmp_dir) + strlen(file_sep) + strlen(filename) + 1;
+ char* temp_file = (char*)os::malloc(temp_file_len, mtLogging);
+ int ret = jio_snprintf(temp_file, temp_file_len, "%s%s%s%s",
+ prefix, tmp_dir, file_sep, filename);
+ return temp_file;
+}
+
// Read a complete line from fp and return it as a resource allocated string.
// Returns NULL on EOF.
static inline char* read_line(FILE* fp) {
diff --git a/test/hotspot/gtest/logging/test_logConfiguration.cpp b/test/hotspot/gtest/logging/test_logConfiguration.cpp
index 4a9b311199a..cce867f43ec 100644
--- a/test/hotspot/gtest/logging/test_logConfiguration.cpp
+++ b/test/hotspot/gtest/logging/test_logConfiguration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -403,16 +403,15 @@ TEST_VM_F(LogConfigurationTest, output_name_normalization) {
// Make sure prefixes are ignored when used within quotes
// (this should create a log with "file=" in its filename)
- int ret = jio_snprintf(buf, sizeof(buf), "\"file=%s\"", TestLogFileName);
- ASSERT_NE(-1, ret);
- set_log_config(buf, "logging=trace");
+ // Note that the filename cannot contain directories because
+ // it is being prefixed with "file=".
+ const char* leafFileName = "\"file=leaf_file_name\"";
+ set_log_config(leafFileName, "logging=trace");
EXPECT_TRUE(is_described("#3: ")) << "prefix within quotes not ignored as it should be";
- set_log_config(buf, "all=off");
+ set_log_config(leafFileName, "all=off");
// Remove the extra log file created
- ret = jio_snprintf(buf, sizeof(buf), "file=%s", TestLogFileName);
- ASSERT_NE(-1, ret);
- delete_file(buf);
+ delete_file("file=leaf_file_name");
}
static size_t count_occurrences(const char* haystack, const char* needle) {
diff --git a/test/hotspot/gtest/logging/test_logFileOutput.cpp b/test/hotspot/gtest/logging/test_logFileOutput.cpp
index 24cdf83c15d..20e3d07e894 100644
--- a/test/hotspot/gtest/logging/test_logFileOutput.cpp
+++ b/test/hotspot/gtest/logging/test_logFileOutput.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
-static const char* name = "file=testlog.pid%p.%t.log";
+static const char* name = prepend_prefix_temp_dir("file=", "testlog.pid%p.%t.log");
// Test parsing a bunch of valid file output options
TEST_VM(LogFileOutput, parse_valid) {
@@ -46,11 +46,6 @@ TEST_VM(LogFileOutput, parse_valid) {
// Override LogOutput's vm_start time to get predictable file name
LogFileOutput::set_file_name_parameters(0);
- char expected_filename[1 * K];
- int ret = jio_snprintf(expected_filename, sizeof(expected_filename),
- "testlog.pid%d.1970-01-01_01-00-00.log",
- os::current_process_id());
- ASSERT_GT(ret, 0) << "Buffer too small";
for (size_t i = 0; i < ARRAY_SIZE(valid_options); i++) {
ResourceMark rm;
@@ -60,8 +55,8 @@ TEST_VM(LogFileOutput, parse_valid) {
EXPECT_STREQ(name, fo.name());
EXPECT_TRUE(fo.initialize(valid_options[i], &ss))
<< "Did not accept valid option(s) '" << valid_options[i] << "': " << ss.as_string();
+ remove(fo.cur_log_file_name());
}
- remove(expected_filename);
}
}
@@ -105,11 +100,11 @@ TEST_VM(LogFileOutput, filesize_overflow) {
}
TEST_VM(LogFileOutput, startup_rotation) {
+ ResourceMark rm;
const size_t rotations = 5;
- const char* filename = "start-rotate-test";
+ const char* filename = prepend_temp_dir("start-rotate-test");
char* rotated_file[rotations];
- ResourceMark rm;
for (size_t i = 0; i < rotations; i++) {
size_t len = strlen(filename) + 3;
rotated_file[i] = NEW_RESOURCE_ARRAY(char, len);
@@ -142,8 +137,9 @@ TEST_VM(LogFileOutput, startup_rotation) {
}
TEST_VM(LogFileOutput, startup_truncation) {
- const char* filename = "start-truncate-test";
- const char* archived_filename = "start-truncate-test.0";
+ ResourceMark rm;
+ const char* filename = prepend_temp_dir("start-truncate-test");
+ const char* archived_filename = prepend_temp_dir("start-truncate-test.0");
delete_file(filename);
delete_file(archived_filename);
diff --git a/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp b/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp
index bc2d8232335..7cb37ff4349 100644
--- a/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp
+++ b/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,8 @@ TEST_VM(LogTagSetDescriptions, describe) {
}
TEST_VM(LogTagSetDescriptions, command_line_help) {
- const char* filename = "logtagset_descriptions";
+ ResourceMark rm;
+ const char* filename = prepend_temp_dir("logtagset_descriptions");
FILE* fp = fopen(filename, "w+");
ASSERT_NE((void*)NULL, fp);
fileStream stream(fp);
From eaab45a8b8235892cb280f9e5d3ee36fe51193d2 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl
Date: Wed, 20 Feb 2019 14:30:33 +0100
Subject: [PATCH 040/109] 8219096: Merge print_termination_stats code with
current logging
Reviewed-by: lkorinth, kbarrett
---
src/hotspot/share/gc/g1/g1Allocator.cpp | 20 +++++--
src/hotspot/share/gc/g1/g1Allocator.hpp | 3 +-
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 52 ++++---------------
src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 10 ----
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp | 5 ++
src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp | 8 +++
.../share/gc/g1/g1ParScanThreadState.cpp | 10 ++--
.../share/gc/g1/g1ParScanThreadState.hpp | 5 +-
.../jtreg/gc/g1/TestGCLogMessages.java | 4 ++
9 files changed, 53 insertions(+), 64 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1Allocator.cpp b/src/hotspot/share/gc/g1/g1Allocator.cpp
index 05fd6fbb841..00440f97217 100644
--- a/src/hotspot/share/gc/g1/g1Allocator.cpp
+++ b/src/hotspot/share/gc/g1/g1Allocator.cpp
@@ -321,16 +321,26 @@ void G1PLABAllocator::flush_and_retire_stats() {
}
}
-void G1PLABAllocator::waste(size_t& wasted, size_t& undo_wasted) {
- wasted = 0;
- undo_wasted = 0;
+size_t G1PLABAllocator::waste() const {
+ size_t result = 0;
for (uint state = 0; state < InCSetState::Num; state++) {
PLAB * const buf = _alloc_buffers[state];
if (buf != NULL) {
- wasted += buf->waste();
- undo_wasted += buf->undo_waste();
+ result += buf->waste();
}
}
+ return result;
+}
+
+size_t G1PLABAllocator::undo_waste() const {
+ size_t result = 0;
+ for (uint state = 0; state < InCSetState::Num; state++) {
+ PLAB * const buf = _alloc_buffers[state];
+ if (buf != NULL) {
+ result += buf->undo_waste();
+ }
+ }
+ return result;
}
bool G1ArchiveAllocator::_archive_check_enabled = false;
diff --git a/src/hotspot/share/gc/g1/g1Allocator.hpp b/src/hotspot/share/gc/g1/g1Allocator.hpp
index 25f0e2f9599..1d3c210d9e9 100644
--- a/src/hotspot/share/gc/g1/g1Allocator.hpp
+++ b/src/hotspot/share/gc/g1/g1Allocator.hpp
@@ -155,7 +155,8 @@ private:
public:
G1PLABAllocator(G1Allocator* allocator);
- void waste(size_t& wasted, size_t& undo_wasted);
+ size_t waste() const;
+ size_t undo_waste() const;
// Allocate word_sz words in dest, either directly into the regions or by
// allocating a new PLAB. Returns the address of the allocated memory, NULL if
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
index 39670c99870..a715e597455 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
@@ -3299,27 +3299,22 @@ public:
G1GCPhaseTimes* p = _g1h->g1_policy()->phase_times();
p->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
+
+ p->record_or_add_thread_work_item(G1GCPhaseTimes::ObjCopy,
+ worker_id,
+ pss->lab_waste_words() * HeapWordSize,
+ G1GCPhaseTimes::ObjCopyLABWaste);
+ p->record_or_add_thread_work_item(G1GCPhaseTimes::ObjCopy,
+ worker_id,
+ pss->lab_undo_waste_words() * HeapWordSize,
+ G1GCPhaseTimes::ObjCopyLABUndoWaste);
+
p->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec);
p->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, evac_term_attempts);
}
assert(pss->queue_is_empty(), "should be empty");
- if (log_is_enabled(Debug, gc, task, stats)) {
- MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
- size_t lab_waste;
- size_t lab_undo_waste;
- pss->waste(lab_waste, lab_undo_waste);
- _g1h->print_termination_stats(worker_id,
- (os::elapsedTime() - start_sec) * 1000.0, /* elapsed time */
- strong_roots_sec * 1000.0, /* strong roots time */
- term_sec * 1000.0, /* evac term time */
- evac_term_attempts, /* evac term attempts */
- lab_waste, /* alloc buffer waste */
- lab_undo_waste /* undo waste */
- );
- }
-
// Close the inner scope so that the ResourceMark and HandleMark
// destructors are executed here and are included as part of the
// "GC Worker Time".
@@ -3328,31 +3323,6 @@ public:
}
};
-void G1CollectedHeap::print_termination_stats_hdr() {
- log_debug(gc, task, stats)("GC Termination Stats");
- log_debug(gc, task, stats)(" elapsed --strong roots-- -------termination------- ------waste (KiB)------");
- log_debug(gc, task, stats)("thr ms ms %% ms %% attempts total alloc undo");
- log_debug(gc, task, stats)("--- --------- --------- ------ --------- ------ -------- ------- ------- -------");
-}
-
-void G1CollectedHeap::print_termination_stats(uint worker_id,
- double elapsed_ms,
- double strong_roots_ms,
- double term_ms,
- size_t term_attempts,
- size_t alloc_buffer_waste,
- size_t undo_waste) const {
- log_debug(gc, task, stats)
- ("%3d %9.2f %9.2f %6.2f "
- "%9.2f %6.2f " SIZE_FORMAT_W(8) " "
- SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7),
- worker_id, elapsed_ms, strong_roots_ms, strong_roots_ms * 100 / elapsed_ms,
- term_ms, term_ms * 100 / elapsed_ms, term_attempts,
- (alloc_buffer_waste + undo_waste) * HeapWordSize / K,
- alloc_buffer_waste * HeapWordSize / K,
- undo_waste * HeapWordSize / K);
-}
-
void G1CollectedHeap::complete_cleaning(BoolObjectClosure* is_alive,
bool class_unloading_occurred) {
uint num_workers = workers()->active_workers();
@@ -3763,8 +3733,6 @@ void G1CollectedHeap::evacuate_collection_set(G1ParScanThreadStateSet* per_threa
G1RootProcessor root_processor(this, n_workers);
G1ParTask g1_par_task(this, per_thread_states, _task_queues, &root_processor, n_workers);
- print_termination_stats_hdr();
-
workers()->run_task(&g1_par_task);
end_par_time_sec = os::elapsedTime();
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
index 7e76807fc69..8f2e8203133 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
@@ -738,16 +738,6 @@ private:
void pre_evacuate_collection_set();
void post_evacuate_collection_set(G1EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* pss);
- // Print the header for the per-thread termination statistics.
- static void print_termination_stats_hdr();
- // Print actual per-thread termination statistics.
- void print_termination_stats(uint worker_id,
- double elapsed_ms,
- double strong_roots_ms,
- double term_ms,
- size_t term_attempts,
- size_t alloc_buffer_waste,
- size_t undo_waste) const;
// Update object copying statistics.
void record_obj_copy_mem_stats();
diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
index b469d1cf2e8..4cc36acf5e1 100644
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
@@ -107,6 +107,11 @@ G1GCPhaseTimes::G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads) :
_update_rs_skipped_cards = new WorkerDataArray(max_gc_threads, "Skipped Cards:");
_gc_par_phases[UpdateRS]->link_thread_work_items(_update_rs_skipped_cards, UpdateRSSkippedCards);
+ _obj_copy_lab_waste = new WorkerDataArray(max_gc_threads, "LAB Waste");
+ _gc_par_phases[ObjCopy]->link_thread_work_items(_obj_copy_lab_waste, ObjCopyLABWaste);
+ _obj_copy_lab_undo_waste = new WorkerDataArray(max_gc_threads, "LAB Undo Waste");
+ _gc_par_phases[ObjCopy]->link_thread_work_items(_obj_copy_lab_undo_waste, ObjCopyLABUndoWaste);
+
_termination_attempts = new WorkerDataArray(max_gc_threads, "Termination Attempts:");
_gc_par_phases[Termination]->link_thread_work_items(_termination_attempts);
diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
index 1f3fcd529ac..1b849403d60 100644
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
@@ -93,6 +93,11 @@ class G1GCPhaseTimes : public CHeapObj {
UpdateRSSkippedCards
};
+ enum GCObjCopyWorkItems {
+ ObjCopyLABWaste,
+ ObjCopyLABUndoWaste
+ };
+
enum GCOptCSetWorkItems {
OptCSetScannedCards,
OptCSetClaimedCards,
@@ -114,6 +119,9 @@ class G1GCPhaseTimes : public CHeapObj {
WorkerDataArray* _scan_rs_claimed_cards;
WorkerDataArray* _scan_rs_skipped_cards;
+ WorkerDataArray* _obj_copy_lab_waste;
+ WorkerDataArray* _obj_copy_lab_undo_waste;
+
WorkerDataArray* _opt_cset_scanned_cards;
WorkerDataArray* _opt_cset_claimed_cards;
WorkerDataArray* _opt_cset_skipped_cards;
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
index 88b21177f10..bfdfd03bd23 100644
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -106,8 +106,12 @@ G1ParScanThreadState::~G1ParScanThreadState() {
delete[] _oops_into_optional_regions;
}
-void G1ParScanThreadState::waste(size_t& wasted, size_t& undo_wasted) {
- _plab_allocator->waste(wasted, undo_wasted);
+size_t G1ParScanThreadState::lab_waste_words() const {
+ return _plab_allocator->waste();
+}
+
+size_t G1ParScanThreadState::lab_undo_waste_words() const {
+ return _plab_allocator->undo_waste();
}
#ifdef ASSERT
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp
index cc1e2aa9b48..d850eb65b1f 100644
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp
@@ -127,9 +127,8 @@ public:
G1EvacuationRootClosures* closures() { return _closures; }
uint worker_id() { return _worker_id; }
- // Returns the current amount of waste due to alignment or not being able to fit
- // objects within LABs and the undo waste.
- virtual void waste(size_t& wasted, size_t& undo_wasted);
+ size_t lab_waste_words() const;
+ size_t lab_undo_waste_words() const;
size_t* surviving_young_words() {
// We add one to hide entry 0 which accumulates surviving words for
diff --git a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
index 8c0a2baff50..b1423e632f5 100644
--- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
+++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
@@ -106,6 +106,10 @@ public class TestGCLogMessages {
new LogMessageWithLevel("Scanned Cards", Level.DEBUG),
new LogMessageWithLevel("Claimed Cards", Level.DEBUG),
new LogMessageWithLevel("Skipped Cards", Level.DEBUG),
+ // Object Copy
+ new LogMessageWithLevel("Object Copy", Level.DEBUG),
+ new LogMessageWithLevel("Scanned Cards", Level.DEBUG),
+ new LogMessageWithLevel("Claimed Cards", Level.DEBUG),
// Ext Root Scan
new LogMessageWithLevel("Thread Roots", Level.TRACE),
new LogMessageWithLevel("Universe Roots", Level.TRACE),
From 50316d71641107ad060d28afe3606711064d19ae Mon Sep 17 00:00:00 2001
From: Zhengyu Gu
Date: Wed, 20 Feb 2019 08:31:40 -0500
Subject: [PATCH 041/109] 8219244: NMT: Change ThreadSafepointState's
allocation type from mtInternal to mtThread
Reviewed-by: coleenp, minqi
---
src/hotspot/share/runtime/safepoint.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/runtime/safepoint.hpp b/src/hotspot/share/runtime/safepoint.hpp
index 4d2bf520c63..2779395af9f 100644
--- a/src/hotspot/share/runtime/safepoint.hpp
+++ b/src/hotspot/share/runtime/safepoint.hpp
@@ -197,7 +197,7 @@ public:
assert(!SafepointSynchronize::is_at_safepoint(), __VA_ARGS__)
// State class for a thread suspended at a safepoint
-class ThreadSafepointState: public CHeapObj {
+class ThreadSafepointState: public CHeapObj {
private:
// At polling page safepoint (NOT a poll return safepoint):
volatile bool _at_poll_safepoint;
From 2e8fc8328a439c760e3bc7a7208ff6e0eda30525 Mon Sep 17 00:00:00 2001
From: Robbin Ehn
Date: Wed, 20 Feb 2019 14:44:58 +0100
Subject: [PATCH 042/109] 8219441: test_logMessageTest missing static storage
Reviewed-by: shade
---
test/hotspot/gtest/logging/test_logMessageTest.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/hotspot/gtest/logging/test_logMessageTest.cpp b/test/hotspot/gtest/logging/test_logMessageTest.cpp
index 5540b6c5424..8aba848c9ab 100644
--- a/test/hotspot/gtest/logging/test_logMessageTest.cpp
+++ b/test/hotspot/gtest/logging/test_logMessageTest.cpp
@@ -39,6 +39,8 @@ protected:
~LogMessageTest();
};
+Log(logging) LogMessageTest::_log;
+
const char* LogMessageTest::_level_filename[] = {
NULL, // LogLevel::Off
#define LOG_LEVEL(name, printname) "multiline-" #printname ".log",
From 2cc6f5951c7485ff8e7adf0647203dc6ec08e3f9 Mon Sep 17 00:00:00 2001
From: Zhengyu Gu
Date: Wed, 20 Feb 2019 10:22:46 -0500
Subject: [PATCH 043/109] 8219370: NMT: Move synchronization primitives from
mtInternal to mtSynchronizer
Reviewed-by: dholmes, rehn
---
src/hotspot/os/posix/os_posix.hpp | 6 +++---
src/hotspot/os/solaris/os_solaris.hpp | 6 +++---
src/hotspot/os/windows/os_windows.hpp | 6 +++---
src/hotspot/share/memory/allocation.hpp | 1 +
src/hotspot/share/runtime/monitorChunk.cpp | 4 ++--
src/hotspot/share/runtime/monitorChunk.hpp | 2 +-
src/hotspot/share/runtime/mutex.hpp | 2 +-
src/hotspot/share/runtime/semaphore.hpp | 2 +-
8 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/src/hotspot/os/posix/os_posix.hpp b/src/hotspot/os/posix/os_posix.hpp
index 40501fdf488..64f257e265e 100644
--- a/src/hotspot/os/posix/os_posix.hpp
+++ b/src/hotspot/os/posix/os_posix.hpp
@@ -177,7 +177,7 @@ private:
* These event objects are type-stable and immortal - we never delete them.
* Events are associated with a thread for the lifetime of the thread.
*/
-class PlatformEvent : public CHeapObj {
+class PlatformEvent : public CHeapObj {
private:
double cachePad[4]; // Increase odds that _mutex is sole occupant of cache line
volatile int _event; // Event count/permit: -1, 0 or 1
@@ -212,7 +212,7 @@ class PlatformEvent : public CHeapObj {
// API updates of course). But Parker methods use fastpaths that break that
// level of encapsulation - so combining the two remains a future project.
-class PlatformParker : public CHeapObj {
+class PlatformParker : public CHeapObj {
protected:
enum {
REL_INDEX = 0,
@@ -230,7 +230,7 @@ class PlatformParker : public CHeapObj {
};
// Platform specific implementation that underpins VM Monitor/Mutex class
-class PlatformMonitor : public CHeapObj {
+class PlatformMonitor : public CHeapObj {
private:
pthread_mutex_t _mutex; // Native mutex for locking
pthread_cond_t _cond; // Native condition variable for blocking
diff --git a/src/hotspot/os/solaris/os_solaris.hpp b/src/hotspot/os/solaris/os_solaris.hpp
index 84200b26a3e..a350d95185c 100644
--- a/src/hotspot/os/solaris/os_solaris.hpp
+++ b/src/hotspot/os/solaris/os_solaris.hpp
@@ -281,7 +281,7 @@ class Solaris {
};
-class PlatformEvent : public CHeapObj {
+class PlatformEvent : public CHeapObj {
private:
double CachePad[4]; // increase odds that _mutex is sole occupant of cache line
volatile int _Event;
@@ -317,7 +317,7 @@ class PlatformEvent : public CHeapObj {
void unpark();
};
-class PlatformParker : public CHeapObj {
+class PlatformParker : public CHeapObj {
protected:
mutex_t _mutex[1];
cond_t _cond[1];
@@ -336,7 +336,7 @@ class PlatformParker : public CHeapObj {
};
// Platform specific implementation that underpins VM Monitor/Mutex class
-class PlatformMonitor : public CHeapObj {
+class PlatformMonitor : public CHeapObj {
private:
mutex_t _mutex; // Native mutex for locking
cond_t _cond; // Native condition variable for blocking
diff --git a/src/hotspot/os/windows/os_windows.hpp b/src/hotspot/os/windows/os_windows.hpp
index b3dd578bb8d..a8d50a8bb5b 100644
--- a/src/hotspot/os/windows/os_windows.hpp
+++ b/src/hotspot/os/windows/os_windows.hpp
@@ -148,7 +148,7 @@ private:
static volatile intptr_t _crash_mux;
};
-class PlatformEvent : public CHeapObj {
+class PlatformEvent : public CHeapObj {
private:
double CachePad [4] ; // increase odds that _Event is sole occupant of cache line
volatile int _Event ;
@@ -174,7 +174,7 @@ class PlatformEvent : public CHeapObj {
-class PlatformParker : public CHeapObj {
+class PlatformParker : public CHeapObj {
protected:
HANDLE _ParkEvent ;
@@ -188,7 +188,7 @@ class PlatformParker : public CHeapObj {
} ;
// Platform specific implementation that underpins VM Monitor/Mutex class
-class PlatformMonitor : public CHeapObj {
+class PlatformMonitor : public CHeapObj {
private:
CRITICAL_SECTION _mutex; // Native mutex for locking
CONDITION_VARIABLE _cond; // Native condition variable for blocking
diff --git a/src/hotspot/share/memory/allocation.hpp b/src/hotspot/share/memory/allocation.hpp
index 2906efce442..17273c08c7e 100644
--- a/src/hotspot/share/memory/allocation.hpp
+++ b/src/hotspot/share/memory/allocation.hpp
@@ -132,6 +132,7 @@ class AllocatedObj {
f(mtArguments, "Arguments") \
f(mtModule, "Module") \
f(mtSafepoint, "Safepoint") \
+ f(mtSynchronizer, "Synchronization") \
f(mtNone, "Unknown") \
//end
diff --git a/src/hotspot/share/runtime/monitorChunk.cpp b/src/hotspot/share/runtime/monitorChunk.cpp
index a7e0237d8ec..32c5069087e 100644
--- a/src/hotspot/share/runtime/monitorChunk.cpp
+++ b/src/hotspot/share/runtime/monitorChunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
MonitorChunk::MonitorChunk(int number_on_monitors) {
_number_of_monitors = number_on_monitors;
- _monitors = NEW_C_HEAP_ARRAY(BasicObjectLock, number_on_monitors, mtInternal);
+ _monitors = NEW_C_HEAP_ARRAY(BasicObjectLock, number_on_monitors, mtSynchronizer);
_next = NULL;
}
diff --git a/src/hotspot/share/runtime/monitorChunk.hpp b/src/hotspot/share/runtime/monitorChunk.hpp
index 9a59cf04353..0c2f2dfae02 100644
--- a/src/hotspot/share/runtime/monitorChunk.hpp
+++ b/src/hotspot/share/runtime/monitorChunk.hpp
@@ -30,7 +30,7 @@
// Data structure for holding monitors for one activation during
// deoptimization.
-class MonitorChunk: public CHeapObj {
+class MonitorChunk: public CHeapObj {
private:
int _number_of_monitors;
BasicObjectLock* _monitors;
diff --git a/src/hotspot/share/runtime/mutex.hpp b/src/hotspot/share/runtime/mutex.hpp
index 932249ec538..91751c6d212 100644
--- a/src/hotspot/share/runtime/mutex.hpp
+++ b/src/hotspot/share/runtime/mutex.hpp
@@ -39,7 +39,7 @@
// TODO: Check if _name[MONITOR_NAME_LEN] should better get replaced by const char*.
static const int MONITOR_NAME_LEN = 64;
-class Monitor : public CHeapObj {
+class Monitor : public CHeapObj {
public:
// A special lock: Is a lock where you are guaranteed not to block while you are
diff --git a/src/hotspot/share/runtime/semaphore.hpp b/src/hotspot/share/runtime/semaphore.hpp
index 73e94587e49..f94a41cf12b 100644
--- a/src/hotspot/share/runtime/semaphore.hpp
+++ b/src/hotspot/share/runtime/semaphore.hpp
@@ -40,7 +40,7 @@
class JavaThread;
// Implements the limited, platform independent Semaphore API.
-class Semaphore : public CHeapObj {
+class Semaphore : public CHeapObj {
SemaphoreImpl _impl;
// Prevent copying and assignment of Semaphore instances.
From 96e4678510a8284dfd9e4b37db0dfefc110e75cd Mon Sep 17 00:00:00 2001
From: Roman Kennke
Date: Wed, 20 Feb 2019 16:29:29 +0100
Subject: [PATCH 044/109] 8203232: Shenandoah: Resolve oops in SATB filter
Reviewed-by: shade
---
.../share/gc/shenandoah/shenandoahBarrierSet.cpp | 2 +-
.../share/gc/shenandoah/shenandoahHeap.hpp | 1 +
.../share/gc/shenandoah/shenandoahHeap.inline.hpp | 7 ++++++-
.../gc/shenandoah/shenandoahSATBMarkQueueSet.cpp | 15 ++++++++-------
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
index 25ded749c54..167961a3ccb 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
@@ -335,7 +335,7 @@ void ShenandoahBarrierSet::enqueue(oop obj) {
// Filter marked objects before hitting the SATB queues. The same predicate would
// be used by SATBMQ::filter to eliminate already marked objects downstream, but
// filtering here helps to avoid wasteful SATB queueing work to begin with.
- if (!_heap->requires_marking(obj)) return;
+ if (!_heap->requires_marking(obj)) return;
Thread* thr = Thread::current();
if (thr->is_Java_thread()) {
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
index aba966e0270..cf4edaa562e 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
@@ -676,6 +676,7 @@ public:
void reset_mark_bitmap();
// SATB barriers hooks
+ template
inline bool requires_marking(const void* entry) const;
void force_satb_flush_all_threads();
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
index 16f86beec53..fe5396393ad 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
@@ -316,8 +316,13 @@ inline oop ShenandoahHeap::evacuate_object(oop p, Thread* thread) {
}
}
+template
inline bool ShenandoahHeap::requires_marking(const void* entry) const {
- return !_marking_context->is_marked(oop(entry));
+ oop obj = oop(entry);
+ if (RESOLVE) {
+ obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
+ }
+ return !_marking_context->is_marked(obj);
}
template
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp
index eb4fd1791c0..1f7d333d7fb 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp
@@ -49,12 +49,9 @@ SATBMarkQueue& ShenandoahSATBMarkQueueSet::satb_queue_for_thread(JavaThread* con
return ShenandoahThreadLocalData::satb_mark_queue(t);
}
-static inline bool discard_entry(const void* entry, ShenandoahHeap* heap) {
- return !heap->requires_marking(entry);
-}
-
+template
class ShenandoahSATBMarkQueueFilterFn {
- ShenandoahHeap* _heap;
+ ShenandoahHeap* const _heap;
public:
ShenandoahSATBMarkQueueFilterFn(ShenandoahHeap* heap) : _heap(heap) {}
@@ -62,13 +59,17 @@ public:
// Return true if entry should be filtered out (removed), false if
// it should be retained.
bool operator()(const void* entry) const {
- return discard_entry(entry, _heap);
+ return !_heap->requires_marking(entry);
}
};
void ShenandoahSATBMarkQueueSet::filter(SATBMarkQueue* queue) {
assert(_heap != NULL, "SATB queue set not initialized");
- apply_filter(ShenandoahSATBMarkQueueFilterFn(_heap), queue);
+ if (_heap->has_forwarded_objects()) {
+ apply_filter(ShenandoahSATBMarkQueueFilterFn(_heap), queue);
+ } else {
+ apply_filter(ShenandoahSATBMarkQueueFilterFn(_heap), queue);
+ }
}
bool ShenandoahSATBMarkQueue::should_enqueue_buffer() {
From ea42bbcd2483554f721090b5efb18f1fb25c8f6d Mon Sep 17 00:00:00 2001
From: Mikael Vidstedt
Date: Wed, 20 Feb 2019 09:43:01 -0800
Subject: [PATCH 045/109] 8219142: Remove unused JIMAGE_ResourcePath
Reviewed-by: dholmes, alanb
---
src/hotspot/share/classfile/classLoader.cpp | 3 -
.../share/native/libjimage/imageFile.cpp | 61 +------------------
.../share/native/libjimage/imageFile.hpp | 5 +-
.../share/native/libjimage/jimage.cpp | 28 +--------
.../share/native/libjimage/jimage.hpp | 19 +-----
5 files changed, 4 insertions(+), 112 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp
index e511a834cf8..ed1dbdca4d8 100644
--- a/src/hotspot/share/classfile/classLoader.cpp
+++ b/src/hotspot/share/classfile/classLoader.cpp
@@ -101,7 +101,6 @@ static JImagePackageToModule_t JImagePackageToModule = NULL;
static JImageFindResource_t JImageFindResource = NULL;
static JImageGetResource_t JImageGetResource = NULL;
static JImageResourceIterator_t JImageResourceIterator = NULL;
-static JImage_ResourcePath_t JImageResourcePath = NULL;
// Globals
@@ -1094,8 +1093,6 @@ void ClassLoader::load_jimage_library() {
guarantee(JImageGetResource != NULL, "function JIMAGE_GetResource not found");
JImageResourceIterator = CAST_TO_FN_PTR(JImageResourceIterator_t, os::dll_lookup(handle, "JIMAGE_ResourceIterator"));
guarantee(JImageResourceIterator != NULL, "function JIMAGE_ResourceIterator not found");
- JImageResourcePath = CAST_TO_FN_PTR(JImage_ResourcePath_t, os::dll_lookup(handle, "JIMAGE_ResourcePath"));
- guarantee(JImageResourcePath != NULL, "function JIMAGE_ResourcePath not found");
}
jboolean ClassLoader::decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg) {
diff --git a/src/java.base/share/native/libjimage/imageFile.cpp b/src/java.base/share/native/libjimage/imageFile.cpp
index 90ca70d694f..95479894977 100644
--- a/src/java.base/share/native/libjimage/imageFile.cpp
+++ b/src/java.base/share/native/libjimage/imageFile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -481,65 +481,6 @@ u4 ImageFileReader::find_location_index(const char* path, u8 *size) const {
return 0; // not found
}
-// Assemble the location path from the string fragments indicated in the location attributes.
-void ImageFileReader::location_path(ImageLocation& location, char* path, size_t max) const {
- // Manage the image string table.
- ImageStrings strings(_string_bytes, _header.strings_size(_endian));
- // Position to first character of the path buffer.
- char* next = path;
- // Temp for string length.
- size_t length;
- // Get module string.
- const char* module = location.get_attribute(ImageLocation::ATTRIBUTE_MODULE, strings);
- // If module string is not empty string.
- if (*module != '\0') {
- // Get length of module name.
- length = strlen(module);
- // Make sure there is no buffer overflow.
- assert(next - path + length + 2 < max && "buffer overflow");
- // Append '/module/'.
- *next++ = '/';
- strncpy(next, module, length); next += length;
- *next++ = '/';
- }
- // Get parent (package) string.
- const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
- // If parent string is not empty string.
- if (*parent != '\0') {
- // Get length of module string.
- length = strlen(parent);
- // Make sure there is no buffer overflow.
- assert(next - path + length + 1 < max && "buffer overflow");
- // Append 'patent/' .
- strncpy(next, parent, length); next += length;
- *next++ = '/';
- }
- // Get base name string.
- const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
- // Get length of base name.
- length = strlen(base);
- // Make sure there is no buffer overflow.
- assert(next - path + length < max && "buffer overflow");
- // Append base name.
- strncpy(next, base, length); next += length;
- // Get extension string.
- const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
- // If extension string is not empty string.
- if (*extension != '\0') {
- // Get length of extension string.
- length = strlen(extension);
- // Make sure there is no buffer overflow.
- assert(next - path + length + 1 < max && "buffer overflow");
- // Append '.extension' .
- *next++ = '.';
- strncpy(next, extension, length); next += length;
- }
- // Make sure there is no buffer overflow.
- assert((size_t)(next - path) < max && "buffer overflow");
- // Terminate string.
- *next = '\0';
-}
-
// Verify that a found location matches the supplied path (without copying.)
bool ImageFileReader::verify_location(ImageLocation& location, const char* path) const {
// Manage the image string table.
diff --git a/src/java.base/share/native/libjimage/imageFile.hpp b/src/java.base/share/native/libjimage/imageFile.hpp
index 699f2fffe76..2e080295ca8 100644
--- a/src/java.base/share/native/libjimage/imageFile.hpp
+++ b/src/java.base/share/native/libjimage/imageFile.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -564,9 +564,6 @@ public:
// ImageFileReader::NOT_FOUND otherwise.
u4 find_location_index(const char* path, u8 *size) const;
- // Assemble the location path.
- void location_path(ImageLocation& location, char* path, size_t max) const;
-
// Verify that a found location matches the supplied path.
bool verify_location(ImageLocation& location, const char* path) const;
diff --git a/src/java.base/share/native/libjimage/jimage.cpp b/src/java.base/share/native/libjimage/jimage.cpp
index 2d8fc02c9d1..5c901944e79 100644
--- a/src/java.base/share/native/libjimage/jimage.cpp
+++ b/src/java.base/share/native/libjimage/jimage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -215,29 +215,3 @@ JIMAGE_ResourceIterator(JImageFile* image,
}
}
}
-
-/*
- * JIMAGE_ResourcePath- Given an open image file, a location reference, a buffer
- * and a maximum buffer size, copy the path of the resource into the buffer.
- * Returns false if not a valid location reference.
- *
- * Ex.
- * JImageLocationRef location = ...
- * char path[JIMAGE_MAX_PATH];
- * (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
- */
-extern "C" JNIEXPORT bool
-JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
- char* path, size_t max) {
- ImageFileReader* imageFile = (ImageFileReader*) image;
-
- u4 offset = (u4) locationRef;
- if (offset >= imageFile->locations_size()) {
- return false;
- }
-
- ImageLocation location(imageFile->get_location_offset_data(offset));
- imageFile->location_path(location, path, max);
-
- return true;
-}
diff --git a/src/java.base/share/native/libjimage/jimage.hpp b/src/java.base/share/native/libjimage/jimage.hpp
index 37dfb5de344..31e47bd67fe 100644
--- a/src/java.base/share/native/libjimage/jimage.hpp
+++ b/src/java.base/share/native/libjimage/jimage.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -191,20 +191,3 @@ JIMAGE_ResourceIterator(JImageFile* jimage,
typedef void (*JImageResourceIterator_t)(JImageFile* jimage,
JImageResourceVisitor_t visitor, void* arg);
-
-/*
- * JIMAGE_ResourcePath- Given an open image file, a location reference, a buffer
- * and a maximum buffer size, copy the path of the resource into the buffer.
- * Returns false if not a valid location reference.
- *
- * Ex.
- * JImageLocationRef location = ...
- * char path[JIMAGE_MAX_PATH];
- * (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
- */
-extern "C" JNIEXPORT bool
-JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
- char* path, size_t max);
-
-typedef bool (*JImage_ResourcePath_t)(JImageFile* jimage, JImageLocationRef location,
- char* buffer, jlong size);
From 1d7db01371bb28717acd4e79910b92dd9d2d8259 Mon Sep 17 00:00:00 2001
From: Xue-Lei Andrew Fan
Date: Wed, 20 Feb 2019 10:20:48 -0800
Subject: [PATCH 046/109] 8219389: Delegated task created by SSLEngine throws
BufferUnderflowException
Reviewed-by: ascarpino
---
.../share/classes/sun/security/ssl/ClientHello.java | 9 ++-------
.../share/classes/sun/security/ssl/HandshakeContext.java | 8 +++++++-
.../classes/sun/security/ssl/PostHandshakeContext.java | 8 +++++++-
.../ssl/interop/ClientHelloBufferUnderflowException.java | 8 ++++++--
4 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/java.base/share/classes/sun/security/ssl/ClientHello.java b/src/java.base/share/classes/sun/security/ssl/ClientHello.java
index de50313e511..53b74223bfb 100644
--- a/src/java.base/share/classes/sun/security/ssl/ClientHello.java
+++ b/src/java.base/share/classes/sun/security/ssl/ClientHello.java
@@ -803,13 +803,8 @@ final class ClientHello {
shc.sslConfig.getEnabledExtensions(
SSLHandshake.CLIENT_HELLO);
- ClientHelloMessage chm;
- try {
- chm = new ClientHelloMessage(shc, message, enabledExtensions);
- } catch (Exception e) {
- throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
- "ClientHelloMessage failure", e);
- }
+ ClientHelloMessage chm =
+ new ClientHelloMessage(shc, message, enabledExtensions);
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
SSLLogger.fine("Consuming ClientHello handshake message", chm);
}
diff --git a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java
index a95c691b943..83f4fcee670 100644
--- a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java
+++ b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
package sun.security.ssl;
import java.io.IOException;
+import java.nio.BufferOverflowException;
+import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.security.AlgorithmConstraints;
import java.security.CryptoPrimitive;
@@ -443,6 +445,10 @@ abstract class HandshakeContext implements ConnectionContext {
throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
"Unsupported handshake message: " +
SSLHandshake.nameOf(handshakeType), unsoe);
+ } catch (BufferUnderflowException | BufferOverflowException be) {
+ throw conContext.fatal(Alert.DECODE_ERROR,
+ "Illegal handshake message: " +
+ SSLHandshake.nameOf(handshakeType), be);
}
// update handshake hash after handshake message consumption.
diff --git a/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java b/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java
index 3b4044d8a4c..a3dda5b87c1 100644
--- a/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java
+++ b/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
package sun.security.ssl;
import java.io.IOException;
+import java.nio.BufferOverflowException;
+import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -74,6 +76,10 @@ final class PostHandshakeContext extends HandshakeContext {
throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
"Unsupported post-handshake message: " +
SSLHandshake.nameOf(handshakeType), unsoe);
+ } catch (BufferUnderflowException | BufferOverflowException be) {
+ throw conContext.fatal(Alert.DECODE_ERROR,
+ "Illegal handshake message: " +
+ SSLHandshake.nameOf(handshakeType), be);
}
}
}
diff --git a/test/jdk/javax/net/ssl/interop/ClientHelloBufferUnderflowException.java b/test/jdk/javax/net/ssl/interop/ClientHelloBufferUnderflowException.java
index 70ef8ba57d7..69778aa0045 100644
--- a/test/jdk/javax/net/ssl/interop/ClientHelloBufferUnderflowException.java
+++ b/test/jdk/javax/net/ssl/interop/ClientHelloBufferUnderflowException.java
@@ -28,7 +28,7 @@
/*
* @test
- * @bug 8215790
+ * @bug 8215790 8219389
* @summary Verify exception
* @modules java.base/sun.security.util
* @run main/othervm ClientHelloBufferUnderflowException
@@ -45,12 +45,15 @@ public class ClientHelloBufferUnderflowException extends ClientHelloInterOp {
try {
(new ClientHelloBufferUnderflowException()).run();
} catch (SSLHandshakeException e) {
- System.out.println("Correct exception thrown");
+ System.out.println("Correct exception thrown: " + e);
+ return;
} catch (Exception e) {
System.out.println("Failed: Exception not SSLHandShakeException");
System.out.println(e.getMessage());
throw e;
}
+
+ throw new Exception("No expected exception");
}
@Override
@@ -76,6 +79,7 @@ public class ClientHelloBufferUnderflowException extends ClientHelloInterOp {
} catch (Exception e) {
// ignore
}
+
return bytes;
}
}
From dd7e50dc01df7fd8cd5e666bf43a7e96a533f3db Mon Sep 17 00:00:00 2001
From: Harold Seigel
Date: Wed, 20 Feb 2019 13:21:36 -0500
Subject: [PATCH 047/109] 8214719: Deprecate -Xverify:none option
Deprecate -Xverify:none and -noverify and remove them from tests
Reviewed-by: dholmes, mikael
---
src/hotspot/share/classfile/verifier.hpp | 2 +-
src/hotspot/share/runtime/arguments.cpp | 3 +-
.../com/sun/tools/example/debug/tty/TTY.java | 2 +-
.../TestLinkageErrorInGenerateOopMap.java | 6 +-
.../privateMethods/TestInvokeErrors.java | 4 +-
.../jtreg/runtime/appcds/VerifierTest.java | 56 ++++++++++++++++---
.../clone/invokevirtual/HasLocalClone.jasm | 4 +-
.../clone/invokevirtual/NoLocalClone.jasm | 4 +-
.../invokevirtual/NoLocalCloneAbstr.jasm | 4 +-
.../TestStaticandInstance.java | 6 +-
.../ClassUnloadTest.sh | 4 +-
.../tools/javac/lambda/MethodReference66.java | 4 +-
12 files changed, 70 insertions(+), 29 deletions(-)
diff --git a/src/hotspot/share/classfile/verifier.hpp b/src/hotspot/share/classfile/verifier.hpp
index 2f4fa513703..cf025345aee 100644
--- a/src/hotspot/share/classfile/verifier.hpp
+++ b/src/hotspot/share/classfile/verifier.hpp
@@ -49,7 +49,7 @@ class Verifier : AllStatic {
// Return false if the class is loaded by the bootstrap loader,
// or if defineClass was called requesting skipping verification
- // -Xverify:all/none override this value
+ // -Xverify:all overrides this value
static bool should_verify_for(oop class_loader, bool should_verify_class);
// Relax certain access checks to enable some broken 1.1 apps to run on 1.2.
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index ec4443619f5..f88d51296ab 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -555,13 +555,13 @@ static SpecialFlag const special_jvm_flags[] = {
{ "UseImplicitStableValues", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
+ // These entries will generate build errors. Their purpose is to test the macros.
{ "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
{ "dep > exp ", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(8) },
{ "obs > exp ", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(8) },
{ "not deprecated or obsolete", JDK_Version::undefined(), JDK_Version::undefined(), JDK_Version::jdk(9) },
{ "dup option", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
{ "dup option", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
- { "BytecodeVerificationRemote", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::undefined() },
#endif
{ NULL, JDK_Version(0), JDK_Version(0) }
@@ -2749,6 +2749,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
+ warning("Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.");
} else if (is_bad_option(option, args->ignoreUnrecognized, "verification")) {
return JNI_EINVAL;
}
diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java
index 822d08bab64..6e15ba29c2e 100644
--- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java
+++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java
@@ -931,7 +931,7 @@ public class TTY implements EventNotifier {
// Old-style options (These should remain in place as long as
// the standard VM accepts them)
token.equals("-noasyncgc") || token.equals("-prof") ||
- token.equals("-verify") || token.equals("-noverify") ||
+ token.equals("-verify") ||
token.equals("-verifyremote") ||
token.equals("-verbosegc") ||
token.startsWith("-ms") || token.startsWith("-mx") ||
diff --git a/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java b/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java
index 52b523b612a..c79cf8aa8f0 100644
--- a/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java
+++ b/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,9 @@ public class TestLinkageErrorInGenerateOopMap {
public static void main(String args[]) throws Exception {
if (args.length == 0) {
// Spawn new VM instance to execute test
- String[] flags = {"-noverify", "-XX:-TieredCompilation",
+ String[] flags = {"-XX:-BytecodeVerificationRemote",
+ "-XX:-BytecodeVerificationLocal",
+ "-XX:-TieredCompilation",
"-XX:CompileCommand=dontinline,compiler/linkage/OSRWithBadOperandStack.m*",
"compiler.linkage.TestLinkageErrorInGenerateOopMap", "run"};
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flags);
diff --git a/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java b/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java
index 43cc0b635b0..9f422b14dba 100644
--- a/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java
+++ b/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
* MissingMethodWithSuper.jcod
* MissingNestHost.jcod
* @run main TestInvokeErrors true
- * @run main/othervm -Xverify:none TestInvokeErrors false
+ * @run main/othervm -XX:-BytecodeVerificationRemote -XX:-BytecodeVerificationLocal TestInvokeErrors false
*/
public class TestInvokeErrors {
diff --git a/test/hotspot/jtreg/runtime/appcds/VerifierTest.java b/test/hotspot/jtreg/runtime/appcds/VerifierTest.java
index 2898be97373..a796baceff2 100644
--- a/test/hotspot/jtreg/runtime/appcds/VerifierTest.java
+++ b/test/hotspot/jtreg/runtime/appcds/VerifierTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@ public class VerifierTest implements Opcodes {
// Test verification settings for dumping & runtime
static final String VFY_ALL = "-Xverify:all";
static final String VFY_REMOTE = "-Xverify:remote"; // default
- static final String VFY_NONE = "-Xverify:none";
+ static final String VFY_NONE = "-XX:-BytecodeVerificationRemote, -XX:-BytecodeVerificationLocal";
static final String ERR =
"ERROR: class VerifierTestC was loaded unexpectedly";
@@ -140,7 +140,7 @@ public class VerifierTest implements Opcodes {
{"app", VFY_ALL, VFY_REMOTE, VFY_ERR },
{"app", VFY_ALL, VFY_ALL, VFY_ERR },
{"app", VFY_ALL, VFY_NONE, ERR },
- // Dump app/ext with -Xverify:none
+ // Dump app/ext with verifier turned off
{"app", VFY_NONE, VFY_REMOTE, VFY_ERR},
{"app", VFY_NONE, VFY_ALL, MAP_FAIL},
{"app", VFY_NONE, VFY_NONE, ERR },
@@ -152,7 +152,7 @@ public class VerifierTest implements Opcodes {
{"noApp", VFY_ALL, VFY_REMOTE, VFY_ERR},
{"noApp", VFY_ALL, VFY_ALL, VFY_ERR},
{"noApp", VFY_ALL, VFY_NONE, ERR},
- // Dump sys only with -Xverify:none
+ // Dump sys only with verifier turned off
{"noApp", VFY_NONE, VFY_REMOTE, VFY_ERR},
{"noApp", VFY_NONE, VFY_ALL, VFY_ERR},
{"noApp", VFY_NONE, VFY_NONE, ERR},
@@ -186,8 +186,19 @@ public class VerifierTest implements Opcodes {
" with " + dump_setting +
", run with " + runtime_setting);
if (!dump_setting.equals(prev_dump_setting)) {
+ String dump_arg1;
+ String dump_arg2;
+ // Need to break this into two separate arguments.
+ if (dump_setting.equals(VFY_NONE)) {
+ dump_arg1 = "-XX:-BytecodeVerificationRemote";
+ dump_arg2 = "-XX:-BytecodeVerificationLocal";
+ } else {
+ // Redundant args should be harmless.
+ dump_arg1 = dump_arg2 = dump_setting;
+ }
+
OutputAnalyzer dumpOutput = TestCommon.dump(
- jar, dump_list, dump_setting,
+ jar, dump_list, dump_arg1, dump_arg2,
CDS_LOGGING,
// FIXME: the following options are for working around a GC
// issue - assert failure when dumping archive with the -Xverify:all
@@ -198,8 +209,17 @@ public class VerifierTest implements Opcodes {
dumpOutput.shouldContain(VFY_INFO_MESSAGE);
}
}
+ String runtime_arg1;
+ String runtime_arg2;
+ if (runtime_setting.equals(VFY_NONE)) {
+ runtime_arg1 = "-XX:-BytecodeVerificationRemote";
+ runtime_arg2 = "-XX:-BytecodeVerificationLocal";
+ } else {
+ // Redundant args should be harmless.
+ runtime_arg1 = runtime_arg2 = runtime_setting;
+ }
TestCommon.run("-cp", jar,
- runtime_setting,
+ runtime_arg1, runtime_arg2,
"VerifierTest0")
.ifNoMappingFailure(output -> checkRuntimeOutput(output, expected_output_str));
prev_dump_setting = dump_setting;
@@ -229,7 +249,7 @@ public class VerifierTest implements Opcodes {
{"app", VFY_ALL, VFY_REMOTE, PASS_RESULT },
{"app", VFY_ALL, VFY_ALL, PASS_RESULT },
{"app", VFY_ALL, VFY_NONE, PASS_RESULT },
- // Dump app/ext with -Xverify:none
+ // Dump app/ext with verifier turned off
{"app", VFY_NONE, VFY_REMOTE, PASS_RESULT},
{"app", VFY_NONE, VFY_ALL, MAP_FAIL},
{"app", VFY_NONE, VFY_NONE, PASS_RESULT },
@@ -244,8 +264,17 @@ public class VerifierTest implements Opcodes {
" with " + dump_setting +
", run with " + runtime_setting);
if (!dump_setting.equals(prev_dump_setting)) {
+ String dump_arg1;
+ String dump_arg2;
+ if (dump_setting.equals(VFY_NONE)) {
+ dump_arg1 = "-XX:-BytecodeVerificationRemote";
+ dump_arg2 = "-XX:-BytecodeVerificationLocal";
+ } else {
+ // Redundant args should be harmless.
+ dump_arg1 = dump_arg2 = dump_setting;
+ }
OutputAnalyzer dumpOutput = TestCommon.dump(
- jar, appClasses, dump_setting,
+ jar, appClasses, dump_arg1, dump_arg2,
CDS_LOGGING,
// FIXME: the following options are for working around a GC
// issue - assert failure when dumping archive with the -Xverify:all
@@ -256,8 +285,17 @@ public class VerifierTest implements Opcodes {
dumpOutput.shouldContain(VFY_INFO_MESSAGE);
}
}
+ String runtime_arg1;
+ String runtime_arg2;
+ if (runtime_setting.equals(VFY_NONE)) {
+ runtime_arg1 = "-XX:-BytecodeVerificationRemote";
+ runtime_arg2 = "-XX:-BytecodeVerificationLocal";
+ } else {
+ // Redundant args should be harmless.
+ runtime_arg1 = runtime_arg2 = runtime_setting;
+ }
TestCommon.run("-cp", jar,
- runtime_setting,
+ runtime_arg1, runtime_arg2,
"Hi")
.ifNoMappingFailure(output -> checkRuntimeOutput(output, expected_output_str));
prev_dump_setting = dump_setting;
diff --git a/test/hotspot/jtreg/runtime/clone/invokevirtual/HasLocalClone.jasm b/test/hotspot/jtreg/runtime/clone/invokevirtual/HasLocalClone.jasm
index 7c86e318c1a..f744343d59d 100644
--- a/test/hotspot/jtreg/runtime/clone/invokevirtual/HasLocalClone.jasm
+++ b/test/hotspot/jtreg/runtime/clone/invokevirtual/HasLocalClone.jasm
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
* @summary Check that invokevirtual of clone() finds the clone() method that
* is local to the calling class.
* @compile DefMethClone.jasm SuperClass.jasm I1.java HasLocalClone.jasm
- * @run main/othervm -noverify HasLocalClone
+ * @run main/othervm -XX:-BytecodeVerificationRemote -XX:-BytecodeVerificationLocal HasLocalClone
*/
// The below .jasm code implements the following java code:
diff --git a/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalClone.jasm b/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalClone.jasm
index 990790c3d47..a815904007f 100644
--- a/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalClone.jasm
+++ b/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalClone.jasm
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
* @summary Check that invokevirtual of clone() calls java.lang.Object.clone()
* even if a superinterface has a default method named clone().
* @compile DefMethClone.jasm SuperClass.jasm I1.java NoLocalClone.jasm
- * @run main/othervm -noverify NoLocalClone
+ * @run main/othervm -XX:-BytecodeVerificationRemote -XX:-BytecodeVerificationLocal NoLocalClone
*/
// The below .jasm code implements the following java code:
diff --git a/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalCloneAbstr.jasm b/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalCloneAbstr.jasm
index b8dab0ccbca..8eff46e9dc9 100644
--- a/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalCloneAbstr.jasm
+++ b/test/hotspot/jtreg/runtime/clone/invokevirtual/NoLocalCloneAbstr.jasm
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
* @summary Check that invokevirtual of clone() calls java.lang.Object.clone()
* even if a superinterface has an abstract method named clone().
* @compile DefMethClone.jasm SuperClass.jasm I1Abstr.java NoLocalCloneAbstr.jasm
- * @run main/othervm -noverify NoLocalCloneAbstr
+ * @run main/othervm -XX:-BytecodeVerificationRemote -XX:-BytecodeVerificationLocal NoLocalCloneAbstr
*/
// The below .jasm code implements the following java code:
diff --git a/test/hotspot/jtreg/runtime/lambda-features/TestStaticandInstance.java b/test/hotspot/jtreg/runtime/lambda-features/TestStaticandInstance.java
index 0bb42e8013b..b69a2916897 100644
--- a/test/hotspot/jtreg/runtime/lambda-features/TestStaticandInstance.java
+++ b/test/hotspot/jtreg/runtime/lambda-features/TestStaticandInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
* @bug 8087342
* @summary Test linkresolver search static, instance and overpass duplicates
* @modules java.base/jdk.internal.org.objectweb.asm
- * @run main/othervm -Xverify:none TestStaticandInstance
+ * @run main/othervm -XX:-BytecodeVerificationRemote -XX:-BytecodeVerificationLocal TestStaticandInstance
*/
@@ -94,7 +94,7 @@ interface I {
default int q() { return 3; } // trigger defmeth processing: C gets AME overpass
}
-// C gets static, private and AME overpass m()I with -Xverify:none
+// C gets static, private and AME overpass m()I with the verifier turned off
class C implements I {
static int m() { return 1;} // javac with "n()" and patch to "m()"
private int m() { return 2;} // javac with public and patch to private
diff --git a/test/jdk/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh b/test/jdk/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
index b428a59bb28..71923152da4 100644
--- a/test/jdk/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
+++ b/test/jdk/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -80,5 +80,5 @@ $JAR ${TESTTOOLVMOPTS} -cfm "${TESTCLASSES}"/ClassUnloadTest.jar "${MANIFEST}" \
# Finally we run the test
(cd "${TESTCLASSES}"; \
- $JAVA ${TESTVMOPTS} -Xverify:none -Xlog:class+unload \
+ $JAVA ${TESTVMOPTS} -Xlog:class+unload \
-javaagent:ClassUnloadTest.jar ClassUnloadTest "${OTHERDIR}" Bar.jar)
diff --git a/test/langtools/tools/javac/lambda/MethodReference66.java b/test/langtools/tools/javac/lambda/MethodReference66.java
index 6f4b80c92ef..d0e4974f365 100644
--- a/test/langtools/tools/javac/lambda/MethodReference66.java
+++ b/test/langtools/tools/javac/lambda/MethodReference66.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8009299
* @summary Javac crashes when compiling method reference to static interface method
- * @run main/othervm -Xverify:none MethodReference66
+ * @run main/othervm MethodReference66
*/
public class MethodReference66 {
From 315b7d03999e420d496a5bc269c4c779adf8417c Mon Sep 17 00:00:00 2001
From: Brian Burkhalter
Date: Wed, 20 Feb 2019 10:57:22 -0800
Subject: [PATCH 048/109] 5029431: (bf) Add absolute bulk put and get methods
Reviewed-by: alanb, darcy, chegar, rriggs
---
.../java/nio/Direct-X-Buffer.java.template | 73 ++++++-
.../java/nio/Heap-X-Buffer.java.template | 22 ++-
.../classes/java/nio/X-Buffer.java.template | 186 +++++++++++++++++-
.../jdk/java/nio/Buffer/Basic-X.java.template | 68 ++++++-
test/jdk/java/nio/Buffer/Basic.java | 8 +-
test/jdk/java/nio/Buffer/BasicByte.java | 68 ++++++-
test/jdk/java/nio/Buffer/BasicChar.java | 68 ++++++-
test/jdk/java/nio/Buffer/BasicDouble.java | 68 ++++++-
test/jdk/java/nio/Buffer/BasicFloat.java | 68 ++++++-
test/jdk/java/nio/Buffer/BasicInt.java | 68 ++++++-
test/jdk/java/nio/Buffer/BasicLong.java | 68 ++++++-
test/jdk/java/nio/Buffer/BasicShort.java | 68 ++++++-
12 files changed, 804 insertions(+), 29 deletions(-)
diff --git a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
index a756e7d87e9..d7bf85a6e4b 100644
--- a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@ package java.nio;
import java.io.FileDescriptor;
import java.lang.ref.Reference;
+import java.util.Objects;
import jdk.internal.misc.VM;
import jdk.internal.ref.Cleaner;
import sun.nio.ch.DirectBuffer;
@@ -325,6 +326,40 @@ class Direct$Type$Buffer$RW$$BO$
#end[rw]
}
+ public $Type$Buffer get(int index, $type$[] dst, int offset, int length) {
+#if[rw]
+ if (((long)length << $LG_BYTES_PER_VALUE$) > Bits.JNI_COPY_TO_ARRAY_THRESHOLD) {
+ Objects.checkFromIndexSize(index, length, limit());
+ Objects.checkFromIndexSize(offset, length, dst.length);
+
+ long dstOffset = ARRAY_BASE_OFFSET + ((long)offset << $LG_BYTES_PER_VALUE$);
+ try {
+#if[!byte]
+ if (order() != ByteOrder.nativeOrder())
+ UNSAFE.copySwapMemory(null,
+ ix(index),
+ dst,
+ dstOffset,
+ (long)length << $LG_BYTES_PER_VALUE$,
+ (long)1 << $LG_BYTES_PER_VALUE$);
+ else
+#end[!byte]
+ UNSAFE.copyMemory(null,
+ ix(index),
+ dst,
+ dstOffset,
+ (long)length << $LG_BYTES_PER_VALUE$);
+ } finally {
+ Reference.reachabilityFence(this);
+ }
+ } else {
+ super.get(index, dst, offset, length);
+ }
+ return this;
+#else[rw]
+ throw new ReadOnlyBufferException();
+#end[rw]
+ }
#end[rw]
public $Type$Buffer put($type$ x) {
@@ -440,6 +475,42 @@ class Direct$Type$Buffer$RW$$BO$
#end[rw]
}
+ public $Type$Buffer put(int index, $type$[] src, int offset, int length) {
+#if[rw]
+ if (((long)length << $LG_BYTES_PER_VALUE$) > Bits.JNI_COPY_FROM_ARRAY_THRESHOLD) {
+ Objects.checkFromIndexSize(index, length, limit());
+ Objects.checkFromIndexSize(offset, length, src.length);
+
+
+ long srcOffset = ARRAY_BASE_OFFSET + ((long)offset << $LG_BYTES_PER_VALUE$);
+ try {
+#if[!byte]
+ if (order() != ByteOrder.nativeOrder())
+ UNSAFE.copySwapMemory(src,
+ srcOffset,
+ null,
+ ix(index),
+ (long)length << $LG_BYTES_PER_VALUE$,
+ (long)1 << $LG_BYTES_PER_VALUE$);
+ else
+#end[!byte]
+ UNSAFE.copyMemory(src,
+ srcOffset,
+ null,
+ ix(index),
+ (long)length << $LG_BYTES_PER_VALUE$);
+ } finally {
+ Reference.reachabilityFence(this);
+ }
+ } else {
+ super.put(index, src, offset, length);
+ }
+ return this;
+#else[rw]
+ throw new ReadOnlyBufferException();
+#end[rw]
+ }
+
public $Type$Buffer compact() {
#if[rw]
int pos = position();
diff --git a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
index 7f2a2597ba3..8875e535feb 100644
--- a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@ package java.nio;
#end[rw]
*/
+import java.util.Objects;
+
class Heap$Type$Buffer$RW$
extends {#if[ro]?Heap}$Type$Buffer
{
@@ -181,6 +183,13 @@ class Heap$Type$Buffer$RW$
return this;
}
+ public $Type$Buffer get(int index, $type$[] dst, int offset, int length) {
+ Objects.checkFromIndexSize(index, length, limit());
+ Objects.checkFromIndexSize(offset, length, dst.length);
+ System.arraycopy(hb, ix(index), dst, offset, length);
+ return this;
+ }
+
public boolean isDirect() {
return false;
}
@@ -250,6 +259,17 @@ class Heap$Type$Buffer$RW$
#end[rw]
}
+ public $Type$Buffer put(int index, $type$[] src, int offset, int length) {
+#if[rw]
+ Objects.checkFromIndexSize(index, length, limit());
+ Objects.checkFromIndexSize(offset, length, src.length);
+ System.arraycopy(src, offset, hb, ix(index), length);
+ return this;
+#else[rw]
+ throw new ReadOnlyBufferException();
+#end[rw]
+ }
+
public $Type$Buffer compact() {
#if[rw]
System.arraycopy(hb, ix(position()), hb, ix(0), remaining());
diff --git a/src/java.base/share/classes/java/nio/X-Buffer.java.template b/src/java.base/share/classes/java/nio/X-Buffer.java.template
index 8e0465a570e..e130450da73 100644
--- a/src/java.base/share/classes/java/nio/X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@ import java.util.stream.StreamSupport;
import java.util.stream.$Streamtype$Stream;
#end[streamableType]
+import java.util.Objects;
import jdk.internal.util.ArraysSupport;
/**
@@ -50,11 +51,11 @@ import jdk.internal.util.ArraysSupport;
* {@link #put($type$) put} methods that read and write
* single $type$s;
*
- *
Relative {@link #get($type$[]) bulk get}
+ *
Absolute and relative {@link #get($type$[]) bulk get}
* methods that transfer contiguous sequences of $type$s from this buffer
* into an array; {#if[!byte]?and}
*
- *
Relative {@link #put($type$[]) bulk put}
+ *
Absolute and relative {@link #put($type$[]) bulk put}
* methods that transfer contiguous sequences of $type$s from $a$
* $type$ array{#if[char]?, a string,} or some other $type$
* buffer into this buffer;{#if[!byte]? and}
@@ -436,7 +437,6 @@ public abstract class $Type$Buffer
* @return The number of characters added to the buffer, or
* -1 if this source of characters is at its end
* @throws IOException if an I/O error occurs
- * @throws NullPointerException if target is null
* @throws ReadOnlyBufferException if target is a read only buffer
* @since 1.5
*/
@@ -764,6 +764,89 @@ public abstract class $Type$Buffer
return get(dst, 0, dst.length);
}
+ /**
+ * Absolute bulk get method.
+ *
+ *
This method transfers {@code length} $type$s from this
+ * buffer into the given array, starting at the given index in this
+ * buffer and at the given offset in the array. The position of this
+ * buffer is unchanged.
+ *
+ *
An invocation of this method of the form
+ * src.get(index, dst, offset, length)
+ * has exactly the same effect as the following loop except that it first
+ * checks the consistency of the supplied parameters and it is potentially
+ * much more efficient:
+ *
+ *
{@code
+ * for (int i = offset, j = index; i < offset + length; i++, j++)
+ * dst[i] = src.get(j);
+ * }
+ *
+ * @param index
+ * The index in this buffer from which the first $type$ will be
+ * read; must be non-negative and less than {@code limit()}
+ *
+ * @param dst
+ * The destination array
+ *
+ * @param offset
+ * The offset within the array of the first $type$ to be
+ * written; must be non-negative and less than
+ * {@code dst.length}
+ *
+ * @param length
+ * The number of $type$s to be written to the given array;
+ * must be non-negative and no larger than the smaller of
+ * {@code limit() - index} and {@code dst.length - offset}
+ *
+ * @return This buffer
+ *
+ * @throws IndexOutOfBoundsException
+ * If the preconditions on the {@code index}, {@code offset}, and
+ * {@code length} parameters do not hold
+ *
+ * @since 13
+ */
+ public $Type$Buffer get(int index, $type$[] dst, int offset, int length) {
+ Objects.checkFromIndexSize(index, length, limit());
+ Objects.checkFromIndexSize(offset, length, dst.length);
+ int end = offset + length;
+ for (int i = offset, j = index; i < end; i++, j++)
+ dst[i] = get(j);
+ return this;
+ }
+
+ /**
+ * Absolute bulk get method.
+ *
+ *
This method transfers $type$s from this buffer into the given
+ * destination array. The position of this buffer is unchanged. An
+ * invocation of this method of the form
+ * src.get(index, dst) behaves in exactly the same
+ * way as the invocation:
+ *
+ *
+ * src.get(index, dst, 0, dst.length)
+ *
+ * @param index
+ * The index in this buffer from which the first $type$ will be
+ * read; must be non-negative and less than {@code limit()}
+ *
+ * @param dst
+ * The destination array
+ *
+ * @return This buffer
+ *
+ * @throws IndexOutOfBoundsException
+ * If {@code index} is negative, not smaller than {@code limit()},
+ * or {@code limit() - index < dst.length}
+ *
+ * @since 13
+ */
+ public $Type$Buffer get(int index, $type$[] dst) {
+ return get(index, dst, 0, dst.length);
+ }
// -- Bulk put operations --
@@ -842,7 +925,7 @@ public abstract class $Type$Buffer
*
*
{@code
* for (int i = off; i < off + len; i++)
- * dst.put(a[i]);
+ * dst.put(src[i]);
* }
*
* except that it first checks that there is sufficient space in this
@@ -853,12 +936,12 @@ public abstract class $Type$Buffer
*
* @param offset
* The offset within the array of the first $type$ to be read;
- * must be non-negative and no larger than {@code array.length}
+ * must be non-negative and no larger than {@code src.length}
*
* @param length
* The number of $type$s to be read from the given array;
* must be non-negative and no larger than
- * {@code array.length - offset}
+ * {@code src.length - offset}
*
* @return This buffer
*
@@ -908,6 +991,95 @@ public abstract class $Type$Buffer
return put(src, 0, src.length);
}
+ /**
+ * Absolute bulk put method (optional operation).
+ *
+ *
This method transfers {@code length} $type$s from the given
+ * array, starting at the given offset in the array and at the given index
+ * in this buffer. The position of this buffer is unchanged.
+ *
+ *
An invocation of this method of the form
+ * dst.put(index, src, offset, length)
+ * has exactly the same effect as the following loop except that it first
+ * checks the consistency of the supplied parameters and it is potentially
+ * much more efficient:
+ *
+ *
{@code
+ * for (int i = offset, j = index; i < offset + length; i++, j++)
+ * dst.put(j, src[i]);
+ * }
+ *
+ * @param index
+ * The index in this buffer at which the first $type$ will be
+ * written; must be non-negative and less than {@code limit()}
+ *
+ * @param src
+ * The array from which $type$s are to be read
+ *
+ * @param offset
+ * The offset within the array of the first $type$ to be read;
+ * must be non-negative and less than {@code src.length}
+ *
+ * @param length
+ * The number of $type$s to be read from the given array;
+ * must be non-negative and no larger than the smaller of
+ * {@code limit() - index} and {@code src.length - offset}
+ *
+ * @return This buffer
+ *
+ * @throws IndexOutOfBoundsException
+ * If the preconditions on the {@code index}, {@code offset}, and
+ * {@code length} parameters do not hold
+ *
+ * @throws ReadOnlyBufferException
+ * If this buffer is read-only
+ *
+ * @since 13
+ */
+ public $Type$Buffer put(int index, $type$[] src, int offset, int length) {
+ if (isReadOnly())
+ throw new ReadOnlyBufferException();
+ Objects.checkFromIndexSize(index, length, limit());
+ Objects.checkFromIndexSize(offset, length, src.length);
+ int end = offset + length;
+ for (int i = offset, j = index; i < end; i++, j++)
+ this.put(j, src[i]);
+ return this;
+ }
+
+ /**
+ * Absolute bulk put method (optional operation).
+ *
+ *
This method copies $type$s into this buffer from the given source
+ * array. The position of this buffer is unchanged. An invocation of this
+ * method of the form dst.put(index, src)
+ * behaves in exactly the same way as the invocation:
+ *
+ *
+ * dst.put(index, src, 0, src.length);
+ *
+ * @param index
+ * The index in this buffer at which the first $type$ will be
+ * written; must be non-negative and less than {@code limit()}
+ *
+ * @param src
+ * The array from which $type$s are to be read
+ *
+ * @return This buffer
+ *
+ * @throws IndexOutOfBoundsException
+ * If {@code index} is negative, not smaller than {@code limit()},
+ * or {@code limit() - index < src.length}
+ *
+ * @throws ReadOnlyBufferException
+ * If this buffer is read-only
+ *
+ * @since 13
+ */
+ public $Type$Buffer put(int index, $type$[] src) {
+ return put(index, src, 0, src.length);
+ }
+
#if[char]
/**
diff --git a/test/jdk/java/nio/Buffer/Basic-X.java.template b/test/jdk/java/nio/Buffer/Basic-X.java.template
index d578b1366d3..bfbb8dda097 100644
--- a/test/jdk/java/nio/Buffer/Basic-X.java.template
+++ b/test/jdk/java/nio/Buffer/Basic-X.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class Basic$Type$
}
}
+ private static void absBulkGet($Type$Buffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ $type$[] a = new $type$[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)(($type$)ic(i)));
+ }
+ }
+
private static void relPut($Type$Buffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class Basic$Type$
}
}
+ private static void absBulkPutArray($Type$Buffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ $type$[] a = new $type$[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = ($type$)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset($Type$Buffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class Basic$Type$
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class Basic$Type$
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class Basic$Type$
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
#if[char]
bulkPutString(b);
@@ -612,6 +648,26 @@ public class Basic$Type$
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, ($type$[])null, 0, 42));
+
+ $type$[] tmpa = new $type$[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class Basic$Type$
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put($Type$Buffer) should not change source position
final $Type$Buffer src = $Type$Buffer.allocate(1);
@@ -903,6 +960,13 @@ public class Basic$Type$
b.position(6);
ck(b, b.subSequence(0,3).toString().equals("ghi"));
+ // absolute bulk get
+ char[] c = new char[end + 1 - (start - 1) + 1]; // [start - 1, end + 1]
+ b.limit(end + 2);
+ b.get(start - 1, c, 0, c.length);
+ for (int i = 0; i < c.length; i++)
+ ck(b, c[i], s.charAt(start - 1 + i));
+
// The index, relative to the position, must be non-negative and
// smaller than remaining().
catchIndexOutOfBounds(b, () -> b.charAt(-1));
diff --git a/test/jdk/java/nio/Buffer/Basic.java b/test/jdk/java/nio/Buffer/Basic.java
index 7d5f85e532d..92d8a6042d3 100644
--- a/test/jdk/java/nio/Buffer/Basic.java
+++ b/test/jdk/java/nio/Buffer/Basic.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,9 @@
/* @test
* @summary Unit test for buffers
* @bug 4413135 4414911 4416536 4416562 4418782 4471053 4472779 4490253 4523725
- * 4526177 4463011 4660660 4661219 4663521 4782970 4804304 4938424 6231529
- * 6221101 6234263 6535542 6591971 6593946 6795561 7190219 7199551 8065556
- * 8149469
+ * 4526177 4463011 4660660 4661219 4663521 4782970 4804304 4938424 5029431
+ * 6231529 6221101 6234263 6535542 6591971 6593946 6795561 7190219 7199551
+ * 8065556 8149469
* @modules java.base/java.nio:open
* java.base/jdk.internal.misc
* @author Mark Reinhold
diff --git a/test/jdk/java/nio/Buffer/BasicByte.java b/test/jdk/java/nio/Buffer/BasicByte.java
index 039dde39eb0..a2ea7d02cb4 100644
--- a/test/jdk/java/nio/Buffer/BasicByte.java
+++ b/test/jdk/java/nio/Buffer/BasicByte.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class BasicByte
}
}
+ private static void absBulkGet(ByteBuffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ byte[] a = new byte[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)((byte)ic(i)));
+ }
+ }
+
private static void relPut(ByteBuffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class BasicByte
}
}
+ private static void absBulkPutArray(ByteBuffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ byte[] a = new byte[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = (byte)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset(ByteBuffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class BasicByte
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class BasicByte
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class BasicByte
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
@@ -612,6 +648,26 @@ public class BasicByte
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, (byte[])null, 0, 42));
+
+ byte[] tmpa = new byte[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class BasicByte
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put(ByteBuffer) should not change source position
final ByteBuffer src = ByteBuffer.allocate(1);
@@ -920,6 +977,13 @@ public class BasicByte
+
+
+
+
+
+
+
diff --git a/test/jdk/java/nio/Buffer/BasicChar.java b/test/jdk/java/nio/Buffer/BasicChar.java
index a059aa9c3bb..91d43ce8881 100644
--- a/test/jdk/java/nio/Buffer/BasicChar.java
+++ b/test/jdk/java/nio/Buffer/BasicChar.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class BasicChar
}
}
+ private static void absBulkGet(CharBuffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ char[] a = new char[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)((char)ic(i)));
+ }
+ }
+
private static void relPut(CharBuffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class BasicChar
}
}
+ private static void absBulkPutArray(CharBuffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ char[] a = new char[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = (char)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset(CharBuffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class BasicChar
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class BasicChar
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class BasicChar
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
bulkPutString(b);
@@ -612,6 +648,26 @@ public class BasicChar
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, (char[])null, 0, 42));
+
+ char[] tmpa = new char[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class BasicChar
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put(CharBuffer) should not change source position
final CharBuffer src = CharBuffer.allocate(1);
@@ -903,6 +960,13 @@ public class BasicChar
b.position(6);
ck(b, b.subSequence(0,3).toString().equals("ghi"));
+ // absolute bulk get
+ char[] c = new char[end + 1 - (start - 1) + 1]; // [start - 1, end + 1]
+ b.limit(end + 2);
+ b.get(start - 1, c, 0, c.length);
+ for (int i = 0; i < c.length; i++)
+ ck(b, c[i], s.charAt(start - 1 + i));
+
// The index, relative to the position, must be non-negative and
// smaller than remaining().
catchIndexOutOfBounds(b, () -> b.charAt(-1));
diff --git a/test/jdk/java/nio/Buffer/BasicDouble.java b/test/jdk/java/nio/Buffer/BasicDouble.java
index 41dc5379057..570130902ed 100644
--- a/test/jdk/java/nio/Buffer/BasicDouble.java
+++ b/test/jdk/java/nio/Buffer/BasicDouble.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class BasicDouble
}
}
+ private static void absBulkGet(DoubleBuffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ double[] a = new double[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)((double)ic(i)));
+ }
+ }
+
private static void relPut(DoubleBuffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class BasicDouble
}
}
+ private static void absBulkPutArray(DoubleBuffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ double[] a = new double[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = (double)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset(DoubleBuffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class BasicDouble
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class BasicDouble
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class BasicDouble
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
@@ -612,6 +648,26 @@ public class BasicDouble
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, (double[])null, 0, 42));
+
+ double[] tmpa = new double[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class BasicDouble
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put(DoubleBuffer) should not change source position
final DoubleBuffer src = DoubleBuffer.allocate(1);
@@ -920,6 +977,13 @@ public class BasicDouble
+
+
+
+
+
+
+
diff --git a/test/jdk/java/nio/Buffer/BasicFloat.java b/test/jdk/java/nio/Buffer/BasicFloat.java
index 8f1d950d19c..4abe3381884 100644
--- a/test/jdk/java/nio/Buffer/BasicFloat.java
+++ b/test/jdk/java/nio/Buffer/BasicFloat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class BasicFloat
}
}
+ private static void absBulkGet(FloatBuffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ float[] a = new float[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)((float)ic(i)));
+ }
+ }
+
private static void relPut(FloatBuffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class BasicFloat
}
}
+ private static void absBulkPutArray(FloatBuffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ float[] a = new float[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = (float)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset(FloatBuffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class BasicFloat
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class BasicFloat
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class BasicFloat
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
@@ -612,6 +648,26 @@ public class BasicFloat
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, (float[])null, 0, 42));
+
+ float[] tmpa = new float[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class BasicFloat
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put(FloatBuffer) should not change source position
final FloatBuffer src = FloatBuffer.allocate(1);
@@ -920,6 +977,13 @@ public class BasicFloat
+
+
+
+
+
+
+
diff --git a/test/jdk/java/nio/Buffer/BasicInt.java b/test/jdk/java/nio/Buffer/BasicInt.java
index 71632f407ef..fc53901b5a0 100644
--- a/test/jdk/java/nio/Buffer/BasicInt.java
+++ b/test/jdk/java/nio/Buffer/BasicInt.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class BasicInt
}
}
+ private static void absBulkGet(IntBuffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ int[] a = new int[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)((int)ic(i)));
+ }
+ }
+
private static void relPut(IntBuffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class BasicInt
}
}
+ private static void absBulkPutArray(IntBuffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ int[] a = new int[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = (int)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset(IntBuffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class BasicInt
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class BasicInt
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class BasicInt
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
@@ -612,6 +648,26 @@ public class BasicInt
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, (int[])null, 0, 42));
+
+ int[] tmpa = new int[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class BasicInt
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put(IntBuffer) should not change source position
final IntBuffer src = IntBuffer.allocate(1);
@@ -920,6 +977,13 @@ public class BasicInt
+
+
+
+
+
+
+
diff --git a/test/jdk/java/nio/Buffer/BasicLong.java b/test/jdk/java/nio/Buffer/BasicLong.java
index a7310c3c66d..5feb0d3cfce 100644
--- a/test/jdk/java/nio/Buffer/BasicLong.java
+++ b/test/jdk/java/nio/Buffer/BasicLong.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class BasicLong
}
}
+ private static void absBulkGet(LongBuffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ long[] a = new long[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)((long)ic(i)));
+ }
+ }
+
private static void relPut(LongBuffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class BasicLong
}
}
+ private static void absBulkPutArray(LongBuffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ long[] a = new long[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = (long)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset(LongBuffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class BasicLong
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class BasicLong
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class BasicLong
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
@@ -612,6 +648,26 @@ public class BasicLong
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, (long[])null, 0, 42));
+
+ long[] tmpa = new long[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class BasicLong
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put(LongBuffer) should not change source position
final LongBuffer src = LongBuffer.allocate(1);
@@ -920,6 +977,13 @@ public class BasicLong
+
+
+
+
+
+
+
diff --git a/test/jdk/java/nio/Buffer/BasicShort.java b/test/jdk/java/nio/Buffer/BasicShort.java
index 5d94bf2b15f..846bcb97a4d 100644
--- a/test/jdk/java/nio/Buffer/BasicShort.java
+++ b/test/jdk/java/nio/Buffer/BasicShort.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,18 @@ public class BasicShort
}
}
+ private static void absBulkGet(ShortBuffer b) {
+ int n = b.capacity();
+ int len = n - 7*2;
+ short[] a = new short[n + 7];
+ b.position(42);
+ b.get(7, a, 7, len);
+ ck(b, b.position() == 42);
+ for (int i = 0; i < len; i++) {
+ ck(b, (long)a[i + 7], (long)((short)ic(i)));
+ }
+ }
+
private static void relPut(ShortBuffer b) {
int n = b.capacity();
b.clear();
@@ -136,6 +148,20 @@ public class BasicShort
}
}
+ private static void absBulkPutArray(ShortBuffer b) {
+ int n = b.capacity();
+ b.clear();
+ int lim = n - 7;
+ int len = lim - 7;
+ b.limit(lim);
+ short[] a = new short[len + 7];
+ for (int i = 0; i < len; i++)
+ a[i + 7] = (short)ic(i);
+ b.position(42);
+ b.put(7, a, 7, len);
+ ck(b, b.position() == 42);
+ }
+
//6231529
private static void callReset(ShortBuffer b) {
b.position(0);
@@ -452,6 +478,10 @@ public class BasicShort
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
+ private static void catchNullArgument(Buffer b, Runnable thunk) {
+ tryCatch(b, NullPointerException.class, thunk);
+ }
+
private static void catchIllegalArgument(Buffer b, Runnable thunk) {
tryCatch(b, IllegalArgumentException.class, thunk);
}
@@ -476,7 +506,10 @@ public class BasicShort
if (ex.isAssignableFrom(x.getClass())) {
caught = true;
} else {
- fail(x.getMessage() + " not expected");
+ String s = x.getMessage();
+ if (s == null)
+ s = x.getClass().getName();
+ fail(s + " not expected");
}
}
if (!caught) {
@@ -513,6 +546,9 @@ public class BasicShort
bulkPutBuffer(b);
relGet(b);
+ absBulkPutArray(b);
+ absBulkGet(b);
+
@@ -612,6 +648,26 @@ public class BasicShort
}
}
+ // Exceptions in absolute bulk operations
+
+ catchNullArgument(b, () -> b.get(7, null, 0, 42));
+ catchNullArgument(b, () -> b.put(7, (short[])null, 0, 42));
+
+ short[] tmpa = new short[42];
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.get(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.get(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.get(b.limit() - 41, tmpa, 0, 42));
+
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, -1, 42));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 42, 1));
+ catchIndexOutOfBounds(b, () -> b.put(7, tmpa, 41, -1));
+ catchIndexOutOfBounds(b, () -> b.put(-1, tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit(), tmpa, 0, 1));
+ catchIndexOutOfBounds(b, () -> b.put(b.limit() - 41, tmpa, 0, 42));
+
// Values
b.clear();
@@ -819,6 +875,7 @@ public class BasicShort
catchReadOnlyBuffer(b, () -> absPut(rb));
catchReadOnlyBuffer(b, () -> bulkPutArray(rb));
catchReadOnlyBuffer(b, () -> bulkPutBuffer(rb));
+ catchReadOnlyBuffer(b, () -> absBulkPutArray(rb));
// put(ShortBuffer) should not change source position
final ShortBuffer src = ShortBuffer.allocate(1);
@@ -920,6 +977,13 @@ public class BasicShort
+
+
+
+
+
+
+
From 9d263d4bc10311599b7c81aebada64bcc18a95ab Mon Sep 17 00:00:00 2001
From: Valerie Peng
Date: Wed, 20 Feb 2019 19:16:45 +0000
Subject: [PATCH 049/109] 8216597: SIGBUS in
Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo after JDK-6913047
Changed variable declaration type to byte* from long* to fix SIGBUS error
Reviewed-by: ascarpino
---
.../classes/sun/security/pkcs11/P11Key.java | 4 +--
.../share/native/libj2pkcs11/p11_keymgmt.c | 29 ++++++++++---------
2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java
index ba0ede3878e..57f93a1e505 100644
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -106,7 +106,7 @@ abstract class P11Key implements Key, Length {
static {
PrivilegedAction getKeyExtractionProp =
() -> System.getProperty(
- "sun.security.pkcs11.disableKeyExtraction", "true");
+ "sun.security.pkcs11.disableKeyExtraction", "false");
String disableKeyExtraction =
AccessController.doPrivileged(getKeyExtractionProp);
DISABLE_NATIVE_KEYS_EXTRACTION =
diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c
index aef5de2921a..d41b8176005 100644
--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c
+++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -151,14 +151,14 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo
unsigned int i = 0U;
unsigned long totalDataSize = 0UL, attributesCount = 0UL;
unsigned long totalCkAttributesSize = 0UL, totalNativeKeyInfoArraySize = 0UL;
- unsigned long* wrappedKeySizePtr = NULL;
+ jbyte* wrappedKeySizePtr = NULL;
jbyte* nativeKeyInfoArrayRawCkAttributes = NULL;
jbyte* nativeKeyInfoArrayRawCkAttributesPtr = NULL;
jbyte* nativeKeyInfoArrayRawDataPtr = NULL;
CK_MECHANISM ckMechanism;
char iv[16] = {0x0};
CK_ULONG ckWrappedKeyLength = 0U;
- unsigned long* wrappedKeySizeWrappedKeyArrayPtr = NULL;
+ jbyte* wrappedKeySizeWrappedKeyArrayPtr = NULL;
CK_BYTE_PTR wrappedKeyBufferPtr = NULL;
CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
CK_OBJECT_CLASS class;
@@ -234,7 +234,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo
// * sizes are expressed in bytes and data type is unsigned long
totalCkAttributesSize = attributesCount * sizeof(CK_ATTRIBUTE);
TRACE1("DEBUG: GetNativeKeyInfo attributesCount = %lu\n", attributesCount);
- TRACE1("DEBUG: GetNativeKeyInfo sizeof CK_ATTRIBUTE = %lu\n", sizeof(CK_ATTRIBUTE));
+ TRACE1("DEBUG: GetNativeKeyInfo sizeof CK_ATTRIBUTE = %zu\n", sizeof(CK_ATTRIBUTE));
TRACE1("DEBUG: GetNativeKeyInfo totalCkAttributesSize = %lu\n", totalCkAttributesSize);
TRACE1("DEBUG: GetNativeKeyInfo totalDataSize = %lu\n", totalDataSize);
@@ -254,8 +254,8 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo
goto cleanup;
}
- wrappedKeySizePtr = (unsigned long*)(nativeKeyInfoArrayRaw +
- sizeof(unsigned long)*2 + totalCkAttributesSize + totalDataSize);
+ wrappedKeySizePtr = nativeKeyInfoArrayRaw +
+ sizeof(unsigned long)*2 + totalCkAttributesSize + totalDataSize;
memcpy(nativeKeyInfoArrayRaw, &totalCkAttributesSize, sizeof(unsigned long));
memcpy(nativeKeyInfoArrayRaw + sizeof(unsigned long) + totalCkAttributesSize,
@@ -330,15 +330,15 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo
memcpy(nativeKeyInfoWrappedKeyArrayRaw, nativeKeyInfoArrayRaw,
totalNativeKeyInfoArraySize);
wrappedKeySizeWrappedKeyArrayPtr =
- (unsigned long*)(nativeKeyInfoWrappedKeyArrayRaw +
+ nativeKeyInfoWrappedKeyArrayRaw +
sizeof(unsigned long)*2 + totalCkAttributesSize +
- totalDataSize);
+ totalDataSize;
memcpy(wrappedKeySizeWrappedKeyArrayPtr, &ckWrappedKeyLength, sizeof(unsigned long));
TRACE1("DEBUG: GetNativeKeyInfo 1st C_WrapKey wrappedKeyLength = %lu\n", ckWrappedKeyLength);
wrappedKeyBufferPtr =
- (unsigned char*)wrappedKeySizeWrappedKeyArrayPtr +
- sizeof(unsigned long);
+ (CK_BYTE_PTR) (wrappedKeySizeWrappedKeyArrayPtr +
+ sizeof(unsigned long));
rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, &ckMechanism,
jLongToCKULong(jWrappingKeyHandle),ckObjectHandle,
wrappedKeyBufferPtr, &ckWrappedKeyLength);
@@ -414,7 +414,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_createNativeKey
jbyte* nativeKeyInfoArrayRawCkAttributesPtr = NULL;
jbyte* nativeKeyInfoArrayRawDataPtr = NULL;
unsigned long totalDataSize = 0UL;
- unsigned long* wrappedKeySizePtr = NULL;
+ jbyte* wrappedKeySizePtr = NULL;
unsigned int i = 0U;
CK_MECHANISM ckMechanism;
char iv[16] = {0x0};
@@ -443,8 +443,8 @@ Java_sun_security_pkcs11_wrapper_PKCS11_createNativeKey
sizeof(unsigned long));
TRACE1("DEBUG: createNativeKey totalDataSize = %lu\n", totalDataSize);
- wrappedKeySizePtr = (unsigned long*)(nativeKeyInfoArrayRaw +
- sizeof(unsigned long)*2 + totalCkAttributesSize + totalDataSize);
+ wrappedKeySizePtr = nativeKeyInfoArrayRaw +
+ sizeof(unsigned long)*2 + totalCkAttributesSize + totalDataSize;
memcpy(&ckWrappedKeyLength, wrappedKeySizePtr, sizeof(unsigned long));
TRACE1("DEBUG: createNativeKey wrappedKeyLength = %lu\n", ckWrappedKeyLength);
@@ -470,7 +470,8 @@ Java_sun_security_pkcs11_wrapper_PKCS11_createNativeKey
jMechanismToCKMechanism(env, jWrappingMech, &ckMechanism);
rv = (*ckpFunctions->C_UnwrapKey)(ckSessionHandle, &ckMechanism,
jLongToCKULong(jWrappingKeyHandle),
- (CK_BYTE_PTR)(wrappedKeySizePtr + 1), ckWrappedKeyLength,
+ (CK_BYTE_PTR)(wrappedKeySizePtr + sizeof(unsigned long)),
+ ckWrappedKeyLength,
(CK_ATTRIBUTE_PTR)nativeKeyInfoArrayRawCkAttributes,
jLongToCKULong(nativeKeyInfoCkAttributesCount),
&ckObjectHandle);
From 6559dfbda0cc7a1360d4d90423e0bcfb8e4e7643 Mon Sep 17 00:00:00 2001
From: Igor Ignatyev
Date: Wed, 20 Feb 2019 11:32:53 -0800
Subject: [PATCH 050/109] 8219395: integrate gcov w/ run-test
Reviewed-by: erikj
---
make/RunTests.gmk | 18 ++++++++++---
make/autoconf/jdk-options.m4 | 2 +-
make/conf/jib-profiles.js | 49 +++++++++++++++++++++++++++++++++++-
3 files changed, 63 insertions(+), 6 deletions(-)
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
index 3fccf3cd5b2..d9409e546d5 100644
--- a/make/RunTests.gmk
+++ b/make/RunTests.gmk
@@ -112,6 +112,9 @@ GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
$(GTEST_LAUNCHER_DIRS)))
+COV_ENVIRONMENT :=
+JTREG_COV_OPTIONS :=
+
ifeq ($(TEST_OPTS_JCOV), true)
JCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/jcov-output
JCOV_GRABBER_LOG := $(JCOV_OUTPUT_DIR)/grabber.log
@@ -122,12 +125,18 @@ ifeq ($(TEST_OPTS_JCOV), true)
# Replace our normal test JDK with the JCov image.
JDK_UNDER_TEST := $(JCOV_IMAGE_DIR)
- JCOV_ENVIRONMENT := JAVA_TOOL_OPTIONS="$(JCOV_MEM_OPTIONS)" \
+ COV_ENVIRONMENT += JAVA_TOOL_OPTIONS="$(JCOV_MEM_OPTIONS)" \
_JAVA_OPTIONS="$(JCOV_MEM_OPTIONS)"
- JTREG_JCOV_OPTIONS := -e:JAVA_TOOL_OPTIONS='$(JCOV_MEM_OPTIONS)' \
+ JTREG_COV_OPTIONS += -e:JAVA_TOOL_OPTIONS='$(JCOV_MEM_OPTIONS)' \
-e:_JAVA_OPTIONS='$(JCOV_MEM_OPTIONS)'
endif
+ifeq ($(GCOV_ENABLED), true)
+ GCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/gcov-output
+ COV_ENVIRONMENT += GCOV_PREFIX="$(GCOV_OUTPUT_DIR)"
+ JTREG_COV_OPTIONS += -e:GCOV_PREFIX="$(GCOV_OUTPUT_DIR)"
+endif
+
################################################################################
# Optionally create AOT libraries for specified modules before running tests.
# Note, this could not be done during JDK build time.
@@ -170,6 +179,7 @@ define SetupAotModuleBody
$$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@))
$$(call MakeTargetDir)
$$(call ExecuteWithLog, $$@, \
+ $((COV_ENVIRONMENT) \
$$(FIXPATH) $$(JDK_UNDER_TEST)/bin/jaotc \
$$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
)
@@ -907,7 +917,7 @@ define SetupRunJtregTestBody
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
- $$(JCOV_ENVIRONMENT) \
+ $$(COV_ENVIRONMENT) \
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
$$($1_JTREG_BASIC_OPTIONS) \
@@ -917,7 +927,7 @@ define SetupRunJtregTestBody
-workDir:$$($1_TEST_SUPPORT_DIR) \
$$(JTREG_OPTIONS) \
$$(JTREG_FAILURE_HANDLER_OPTIONS) \
- $$(JTREG_JCOV_OPTIONS) \
+ $$(JTREG_COV_OPTIONS) \
$$($1_TEST_NAME) \
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4
index 5ee34aeeeee..ec410c86cc0 100644
--- a/make/autoconf/jdk-options.m4
+++ b/make/autoconf/jdk-options.m4
@@ -364,7 +364,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
################################################################################
#
-# Gcov coverage data for hotspot
+# Native and Java code coverage
#
AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
[
diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js
index aea5f6a7ba0..a880c36ddd6 100644
--- a/make/conf/jib-profiles.js
+++ b/make/conf/jib-profiles.js
@@ -521,6 +521,15 @@ var getJibProfilesProfiles = function (input, common, data) {
profiles[maketestName].default_make_targets = [ "test-make" ];
});
+ // Generate -gcov profiles
+ [ "linux-x64", "macosx-x64" ].forEach(function (name) {
+ var gcovName = name + "-gcov";
+ profiles[gcovName] = clone(profiles[name]);
+ profiles[gcovName].default_make_targets = ["product-bundles", "test-bundles"];
+ profiles[gcovName].configure_args = concat(profiles[gcovName].configure_args,
+ ["--enable-native-coverage", "--disable-warnings-as-errors"]);
+ });
+
// Profiles for building the zero jvm variant. These are used for verification.
var zeroProfiles = {
"linux-x64-zero": {
@@ -772,6 +781,40 @@ var getJibProfilesProfiles = function (input, common, data) {
};
});
+ // Artifacts of gcov (native-code-coverage) profiles
+ [ "linux-x64", "macosx-x64" ].forEach(function (name) {
+ var o = artifactData[name]
+ var pf = o.platform
+ var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
+ var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
+ var gcovName = name + "-gcov";
+ profiles[gcovName].artifacts = {
+ jdk: {
+ local: "bundles/\\(jdk.*bin." + jdk_suffix + "\\)",
+ remote: [
+ "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov." + jdk_suffix,
+ ],
+ subdir: jdk_subdir,
+ exploded: "images/jdk",
+ },
+ test: {
+ local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
+ remote: [
+ "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov-tests.tar.gz",
+ ],
+ exploded: "images/test"
+ },
+ jdk_symbols: {
+ local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
+ remote: [
+ "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov-symbols.tar.gz",
+ ],
+ subdir: jdk_subdir,
+ exploded: "images/jdk"
+ },
+ };
+ });
+
// Profiles used to run tests.
var testOnlyProfiles = {
"run-test": {
@@ -798,6 +841,10 @@ var getJibProfilesProfiles = function (input, common, data) {
} else {
testedProfileTest = testedProfile + ".test";
}
+ var testOnlyMake = [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ];
+ if (testedProfile.endsWith("-gcov")) {
+ testOnlyMake = concat(testOnlyMake, "GCOV_ENABLED=true")
+ }
var testOnlyProfilesPrebuilt = {
"run-test-prebuilt": {
target_os: input.build_os,
@@ -807,7 +854,7 @@ var getJibProfilesProfiles = function (input, common, data) {
testedProfileTest
],
src: "src.conf",
- make_args: [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ],
+ make_args: testOnlyMake,
environment: {
"BOOT_JDK": common.boot_jdk_home,
"JDK_IMAGE_DIR": input.get(testedProfileJDK, "home_path"),
From 6f5c0097560118a51786cd7f22a3e9e88e07ec38 Mon Sep 17 00:00:00 2001
From: Lin Zang
Date: Wed, 20 Feb 2019 11:36:02 -0800
Subject: [PATCH 051/109] =?UTF-8?q?8215622:=20Add=20dump=20to=20file=20sup?=
=?UTF-8?q?port=20for=20jmap=20=E2=80=93histo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add "file=" to jmap "histo" jmap, Hotspot support in attachListener.cpp:heap_inspection.
Reviewed-by: phh, sspitsyn
---
src/hotspot/share/services/attachListener.cpp | 37 ++++++++--
src/hotspot/share/services/attachListener.hpp | 2 +-
.../sun/tools/attach/VirtualMachineImpl.java | 6 +-
.../sun/tools/attach/VirtualMachineImpl.java | 6 +-
.../sun/tools/attach/VirtualMachineImpl.java | 6 +-
.../sun/tools/attach/VirtualMachineImpl.java | 4 +-
.../sun/tools/attach/VirtualMachineImpl.java | 4 +-
.../share/classes/sun/tools/jmap/JMap.java | 74 +++++++++++++------
.../util/logging/TestLoggerWeakRefLeak.java | 6 +-
test/jdk/sun/tools/jmap/BasicJMapTest.java | 72 +++++++++++++++++-
10 files changed, 166 insertions(+), 51 deletions(-)
diff --git a/src/hotspot/share/services/attachListener.cpp b/src/hotspot/share/services/attachListener.cpp
index 81b0fa19c54..fe296b22d04 100644
--- a/src/hotspot/share/services/attachListener.cpp
+++ b/src/hotspot/share/services/attachListener.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -257,19 +257,40 @@ jint dump_heap(AttachOperation* op, outputStream* out) {
// See also: ClassHistogramDCmd class
//
// Input arguments :-
-// arg0: "-live" or "-all"
+// arg0: Name of the dump file or NULL
+// arg1: "-live" or "-all"
static jint heap_inspection(AttachOperation* op, outputStream* out) {
bool live_objects_only = true; // default is true to retain the behavior before this change is made
- const char* arg0 = op->arg(0);
- if (arg0 != NULL && (strlen(arg0) > 0)) {
- if (strcmp(arg0, "-all") != 0 && strcmp(arg0, "-live") != 0) {
- out->print_cr("Invalid argument to inspectheap operation: %s", arg0);
+ outputStream* os = out; // if path not specified or path is NULL, use out
+ fileStream* fs = NULL;
+ const char* path = op->arg(0);
+ if (path != NULL) {
+ if (path[0] == '\0') {
+ out->print_cr("No dump file specified");
+ } else {
+ // create file
+ fs = new (ResourceObj::C_HEAP, mtInternal) fileStream(path);
+ if (fs == NULL) {
+ out->print_cr("Failed to allocate space for file: %s", path);
+ return JNI_ERR;
+ }
+ os = fs;
+ }
+ }
+ const char* arg1 = op->arg(1);
+ if (arg1 != NULL && (strlen(arg1) > 0)) {
+ if (strcmp(arg1, "-all") != 0 && strcmp(arg1, "-live") != 0) {
+ out->print_cr("Invalid argument to inspectheap operation: %s", arg1);
return JNI_ERR;
}
- live_objects_only = strcmp(arg0, "-live") == 0;
+ live_objects_only = strcmp(arg1, "-live") == 0;
}
- VM_GC_HeapInspection heapop(out, live_objects_only /* request full gc */);
+ VM_GC_HeapInspection heapop(os, live_objects_only /* request full gc */);
VMThread::execute(&heapop);
+ if (os != NULL && os != out) {
+ out->print_cr("Heap inspection file created: %s", path);
+ delete fs;
+ }
return JNI_OK;
}
diff --git a/src/hotspot/share/services/attachListener.hpp b/src/hotspot/share/services/attachListener.hpp
index c59ac76981b..2b653639689 100644
--- a/src/hotspot/share/services/attachListener.hpp
+++ b/src/hotspot/share/services/attachListener.hpp
@@ -106,7 +106,7 @@ class AttachOperation: public CHeapObj {
enum {
name_length_max = 16, // maximum length of name
arg_length_max = 1024, // maximum length of argument
- arg_count_max = 3 // maximum number of arguments
+ arg_count_max = 4 // maximum number of arguments
};
// name of special operation that can be enqueued when all
diff --git a/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java b/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java
index 8d2edb831f8..8541bf88186 100644
--- a/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java
+++ b/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2018, SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -138,7 +138,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
* Execute the given command in the target VM.
*/
InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException {
- assert args.length <= 3; // includes null
+ assert args.length <= 4; // includes null
// did we detach?
synchronized (this) {
@@ -166,7 +166,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
writeString(s, PROTOCOL_VERSION);
writeString(s, cmd);
- for (int i=0; i<3; i++) {
+ for (int i = 0; i < 4; i++) {
if (i < args.length && args[i] != null) {
writeString(s, (String)args[i]);
} else {
diff --git a/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java b/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java
index debfef00a34..0966f182dfd 100644
--- a/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java
+++ b/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -143,7 +143,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
* Execute the given command in the target VM.
*/
InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException {
- assert args.length <= 3; // includes null
+ assert args.length <= 4; // includes null
// did we detach?
synchronized (this) {
@@ -171,7 +171,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
writeString(s, PROTOCOL_VERSION);
writeString(s, cmd);
- for (int i=0; i<3; i++) {
+ for (int i = 0; i < 4; i++) {
if (i < args.length && args[i] != null) {
writeString(s, (String)args[i]);
} else {
diff --git a/src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java b/src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java
index 0ca39214e4d..64beabcba64 100644
--- a/src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java
+++ b/src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
* Execute the given command in the target VM.
*/
InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException {
- assert args.length <= 3; // includes null
+ assert args.length <= 4; // includes null
// did we detach?
synchronized (this) {
@@ -167,7 +167,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
writeString(s, PROTOCOL_VERSION);
writeString(s, cmd);
- for (int i=0; i<3; i++) {
+ for (int i = 0; i < 4; i++) {
if (i < args.length && args[i] != null) {
writeString(s, (String)args[i]);
} else {
diff --git a/src/jdk.attach/solaris/classes/sun/tools/attach/VirtualMachineImpl.java b/src/jdk.attach/solaris/classes/sun/tools/attach/VirtualMachineImpl.java
index 269fbc7ad0a..6948a969504 100644
--- a/src/jdk.attach/solaris/classes/sun/tools/attach/VirtualMachineImpl.java
+++ b/src/jdk.attach/solaris/classes/sun/tools/attach/VirtualMachineImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -126,7 +126,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
* Execute the given command in the target VM.
*/
InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException {
- assert args.length <= 3; // includes null
+ assert args.length <= 4; // includes null
// first check that we are still attached
int door;
diff --git a/src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java b/src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java
index a6f2279ecfc..7e839a7a64a 100644
--- a/src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java
+++ b/src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
InputStream execute(String cmd, Object ... args)
throws AgentLoadException, IOException
{
- assert args.length <= 3; // includes null
+ assert args.length <= 4; // includes null
// create a pipe using a random name
Random rnd = new Random();
diff --git a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
index 393834c2414..8611a335506 100644
--- a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
+++ b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -145,22 +145,52 @@ public class JMap {
vm.detach();
}
+ private static String parseFileName(String opt) {
+ // opt starts with "file="
+ if (opt.length() > 5) {
+ // pass whole "file=" string
+ String filename = opt.substring(5);
+ try {
+ // Get the canonical path - important to avoid just
+ // passing a "heap.bin" and having the dump created
+ // in the target VM working directory rather than the
+ // directory where jmap is executed.
+ return new File(filename).getCanonicalPath();
+ } catch (IOException ioe) {
+ return null;
+ }
+ }
+ // no filename
+ return null;
+ }
+
private static void histo(String pid, String options)
throws AttachNotSupportedException, IOException,
UnsupportedEncodingException {
String liveopt = "-all";
- if (options.isEmpty() || options.equals("all")) {
- // pass
- }
- else if (options.equals("live")) {
- liveopt = "-live";
- }
- else {
- usage(1);
+ String filename = null;
+ String subopts[] = options.split(",");
+
+ for (int i = 0; i < subopts.length; i++) {
+ String subopt = subopts[i];
+ if (subopt.equals("") || subopt.equals("all")) {
+ // pass
+ } else if (subopt.equals("live")) {
+ liveopt = "-live";
+ } else if (subopt.startsWith("file=")) {
+ filename = parseFileName(subopt);
+ if (filename == null) {
+ usage(1); // invalid options or no filename
+ }
+ } else {
+ usage(1);
+ }
}
+ System.out.flush();
+
// inspectHeap is not the same as jcmd GC.class_histogram
- executeCommandForPid(pid, "inspectheap", liveopt);
+ executeCommandForPid(pid, "inspectheap", filename, liveopt);
}
private static void dump(String pid, String options)
@@ -176,10 +206,7 @@ public class JMap {
if (subopt.equals("live")) {
liveopt = "-live";
} else if (subopt.startsWith("file=")) {
- // file= - check that is specified
- if (subopt.length() > 5) {
- filename = subopt.substring(5);
- }
+ filename = parseFileName(subopt);
}
}
@@ -187,11 +214,6 @@ public class JMap {
usage(1); // invalid options or no filename
}
- // get the canonical path - important to avoid just passing
- // a "heap.bin" and having the dump created in the target VM
- // working directory rather than the directory where jmap
- // is executed.
- filename = new File(filename).getCanonicalPath();
// dumpHeap is not the same as jcmd GC.heap_dump
executeCommandForPid(pid, "dumpheap", filename, liveopt);
}
@@ -246,21 +268,27 @@ public class JMap {
System.err.println(" to connect to running process and print class loader statistics");
System.err.println(" jmap -finalizerinfo ");
System.err.println(" to connect to running process and print information on objects awaiting finalization");
- System.err.println(" jmap -histo[:live] ");
+ System.err.println(" jmap -histo[:[]] ");
System.err.println(" to connect to running process and print histogram of java object heap");
- System.err.println(" if the \"live\" suboption is specified, only count live objects");
System.err.println(" jmap -dump:");
System.err.println(" to connect to running process and dump java heap");
System.err.println(" jmap -? -h --help");
System.err.println(" to print this help message");
System.err.println("");
System.err.println(" dump-options:");
- System.err.println(" live dump only live objects; if not specified,");
- System.err.println(" all objects in the heap are dumped.");
+ System.err.println(" live dump only live objects");
+ System.err.println(" all dump all objects in the heap (default if one of \"live\" or \"all\" is not specified");
System.err.println(" format=b binary format");
System.err.println(" file= dump heap to ");
System.err.println("");
System.err.println(" Example: jmap -dump:live,format=b,file=heap.bin ");
+ System.err.println("");
+ System.err.println(" histo-options:");
+ System.err.println(" live count only live objects");
+ System.err.println(" all count all objects in the heap (default if one of \"live\" or \"all\" is not specified)");
+ System.err.println(" file= dump data to ");
+ System.err.println("");
+ System.err.println(" Example: jmap -histo:live,file=/tmp/histo.data ");
System.exit(exit);
}
}
diff --git a/test/jdk/java/util/logging/TestLoggerWeakRefLeak.java b/test/jdk/java/util/logging/TestLoggerWeakRefLeak.java
index d33b6d32429..0929b5341ff 100644
--- a/test/jdk/java/util/logging/TestLoggerWeakRefLeak.java
+++ b/test/jdk/java/util/logging/TestLoggerWeakRefLeak.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -123,7 +123,7 @@ public class TestLoggerWeakRefLeak {
}
/**
- * 'vm.heapHisto("-live")' will request a full GC
+ * 'vm.heapHisto("", "-live")' will request a full GC
*/
private static int getInstanceCountFromHeapHisto() throws AttachNotSupportedException, Exception {
int instanceCount = 0;
@@ -131,7 +131,7 @@ public class TestLoggerWeakRefLeak {
HotSpotVirtualMachine vm = (HotSpotVirtualMachine) VirtualMachine
.attach(Long.toString(ProcessTools.getProcessId()));
try {
- try (InputStream heapHistoStream = vm.heapHisto("-live");
+ try (InputStream heapHistoStream = vm.heapHisto("", "-live");
BufferedReader in = new BufferedReader(new InputStreamReader(heapHistoStream))) {
String inputLine;
while ((inputLine = in.readLine()) != null) {
diff --git a/test/jdk/sun/tools/jmap/BasicJMapTest.java b/test/jdk/sun/tools/jmap/BasicJMapTest.java
index d1982248893..88d95164087 100644
--- a/test/jdk/sun/tools/jmap/BasicJMapTest.java
+++ b/test/jdk/sun/tools/jmap/BasicJMapTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,15 +50,22 @@ public class BasicJMapTest {
public static void main(String[] args) throws Exception {
testHisto();
testHistoLive();
+ testHistoAll();
+ testHistoToFile();
+ testHistoLiveToFile();
+ testHistoAllToFile();
testFinalizerInfo();
testClstats();
testDump();
testDumpLive();
+ testDumpAll();
}
private static void testHisto() throws Exception {
- OutputAnalyzer output = jmap("-histo");
+ OutputAnalyzer output = jmap("-histo:");
output.shouldHaveExitValue(0);
+ OutputAnalyzer output1 = jmap("-histo");
+ output1.shouldHaveExitValue(0);
}
private static void testHistoLive() throws Exception {
@@ -66,6 +73,50 @@ public class BasicJMapTest {
output.shouldHaveExitValue(0);
}
+ private static void testHistoAll() throws Exception {
+ OutputAnalyzer output = jmap("-histo:all");
+ output.shouldHaveExitValue(0);
+ }
+
+ private static void testHistoToFile() throws Exception {
+ histoToFile(false);
+ }
+
+ private static void testHistoLiveToFile() throws Exception {
+ histoToFile(true);
+ }
+
+ private static void testHistoAllToFile() throws Exception {
+ boolean explicitAll = true;
+ histoToFile(false, explicitAll);
+ }
+
+ private static void histoToFile(boolean live) throws Exception {
+ boolean explicitAll = false;
+ histoToFile(live, explicitAll);
+ }
+
+ private static void histoToFile(boolean live, boolean explicitAll) throws Exception {
+ if (live == true && explicitAll == true) {
+ fail("Illegal argument setting for jmap -histo");
+ }
+ File file = new File("jmap.histo.file" + System.currentTimeMillis() + ".histo");
+ if (file.exists()) {
+ file.delete();
+ }
+ OutputAnalyzer output;
+ if (live) {
+ output = jmap("-histo:live,file=" + file.getName());
+ } else if (explicitAll == true) {
+ output = jmap("-histo:all,file=" + file.getName());
+ } else {
+ output = jmap("-histo:file=" + file.getName());
+ }
+ output.shouldHaveExitValue(0);
+ output.shouldContain("Heap inspection file created");
+ file.delete();
+ }
+
private static void testFinalizerInfo() throws Exception {
OutputAnalyzer output = jmap("-finalizerinfo");
output.shouldHaveExitValue(0);
@@ -84,7 +135,20 @@ public class BasicJMapTest {
dump(true);
}
+ private static void testDumpAll() throws Exception {
+ boolean explicitAll = true;
+ dump(false, explicitAll);
+ }
+
private static void dump(boolean live) throws Exception {
+ boolean explicitAll = false;
+ dump(live, explicitAll);
+ }
+
+ private static void dump(boolean live, boolean explicitAll) throws Exception {
+ if (live == true && explicitAll == true) {
+ fail("Illegal argument setting for jmap -dump");
+ }
File dump = new File("jmap.dump." + System.currentTimeMillis() + ".hprof");
if (dump.exists()) {
dump.delete();
@@ -92,6 +156,8 @@ public class BasicJMapTest {
OutputAnalyzer output;
if (live) {
output = jmap("-dump:live,format=b,file=" + dump.getName());
+ } else if (explicitAll == true) {
+ output = jmap("-dump:all,format=b,file=" + dump.getName());
} else {
output = jmap("-dump:format=b,file=" + dump.getName());
}
@@ -121,7 +187,7 @@ public class BasicJMapTest {
launcher.addToolArg(Long.toString(ProcessTools.getProcessId()));
processBuilder.command(launcher.getCommand());
- System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
+ System.out.println(Arrays.toString(processBuilder.command().toArray()));
OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
System.out.println(output.getOutput());
From 4128d632878dbc59c62f2e20dafb7a5c79510b62 Mon Sep 17 00:00:00 2001
From: Igor Ignatyev
Date: Wed, 20 Feb 2019 11:51:23 -0800
Subject: [PATCH 052/109] 8219476: cleanup hotspot ProblemList
Reviewed-by: jwilhelm
---
test/hotspot/jtreg/ProblemList-graal.txt | 2 +-
test/hotspot/jtreg/ProblemList.txt | 6 +++---
test/jdk/ProblemList-Xcomp.txt | 1 -
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/test/hotspot/jtreg/ProblemList-graal.txt b/test/hotspot/jtreg/ProblemList-graal.txt
index 8ac75093329..57ff1c1d6cc 100644
--- a/test/hotspot/jtreg/ProblemList-graal.txt
+++ b/test/hotspot/jtreg/ProblemList-graal.txt
@@ -226,4 +226,4 @@ org.graalvm.compiler.core.test.deopt.CompiledMethodTest 8202955
org.graalvm.compiler.hotspot.test.ReservedStackAccessTest 8213567 windows-all
-org.graalvm.compiler.hotspot.test.CheckGraalIntrinsics 8218698
+org.graalvm.compiler.hotspot.test.CheckGraalIntrinsics 8218074
diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt
index 172aef141bd..2056fb7206b 100644
--- a/test/hotspot/jtreg/ProblemList.txt
+++ b/test/hotspot/jtreg/ProblemList.txt
@@ -57,9 +57,9 @@ compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all
compiler/runtime/Test8168712.java 8211769,8211771 generic-ppc64,generic-ppc64le,linux-s390x
-applications/ctw/modules/java_desktop.java 8189604 windows-all
-applications/ctw/modules/java_desktop_2.java 8189604 windows-all
-applications/ctw/modules/jdk_jconsole.java 8189604 windows-all
+applications/ctw/modules/java_desktop.java 8205016 windows-all
+applications/ctw/modules/java_desktop_2.java 8205016 windows-all
+applications/ctw/modules/jdk_jconsole.java 8205016 windows-all
#############################################################################
diff --git a/test/jdk/ProblemList-Xcomp.txt b/test/jdk/ProblemList-Xcomp.txt
index 71061225523..3345c52ee97 100644
--- a/test/jdk/ProblemList-Xcomp.txt
+++ b/test/jdk/ProblemList-Xcomp.txt
@@ -28,5 +28,4 @@
#############################################################################
java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all
-java/util/concurrent/CountDownLatch/Basic.java 8195057 generic-all
java/util/stream/test/org/openjdk/tests/java/util/stream/StreamLinkTest.java 8216317 solaris-all
From 16e097968079a2c4f6b7aa96f43fc3d13636076a Mon Sep 17 00:00:00 2001
From: Harold Seigel
Date: Wed, 20 Feb 2019 16:20:53 -0500
Subject: [PATCH 053/109] 8218995: Deprecate the -XX:FailOverToOldVerifier
option
Deprecate the option and change affected tests so that they no longer need the option.
Reviewed-by: dholmes, lfoltan
---
src/hotspot/share/runtime/arguments.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index f88d51296ab..27985cb64d8 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -529,6 +529,7 @@ static SpecialFlag const special_jvm_flags[] = {
{ "InitialRAMFraction", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() },
{ "UseMembar", JDK_Version::jdk(10), JDK_Version::jdk(12), JDK_Version::undefined() },
{ "CompilationPolicyChoice", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::undefined() },
+ { "FailOverToOldVerifier", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::undefined() },
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
{ "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
From b578cf83c9d1e2e2e4547dd24a59844152cfc508 Mon Sep 17 00:00:00 2001
From: Jesper Wilhelmsson
Date: Thu, 21 Feb 2019 01:06:53 +0100
Subject: [PATCH 054/109] Added tag jdk-13+9 for changeset c081f3ea6b93
---
.hgtags | 1 +
1 file changed, 1 insertion(+)
diff --git a/.hgtags b/.hgtags
index ca498024215..f502fc81248 100644
--- a/.hgtags
+++ b/.hgtags
@@ -544,3 +544,4 @@ b5f05fe4a6f8b3996a000c20078b356d991ca8ec jdk-13+6
b5f7bb57de2f797be34f6c75d45c3245ad37ab97 jdk-12+31
a535ba736cabc6886acdff36de3a096c46e5ddc5 jdk-13+8
4ce47bc1fb92cf94c6e3d1f49d582f02dcb851ab jdk-12+32
+c081f3ea6b9300265a4a34e38f970b1e3ddaae9f jdk-13+9
From 431b49663a60676d79dd0a951e03f499795b8caa Mon Sep 17 00:00:00 2001
From: Jonathan Gibbons
Date: Wed, 20 Feb 2019 16:15:02 -0800
Subject: [PATCH 055/109] 8218998: Add metadata to generated API documentation
files
Reviewed-by: hannesw
---
.../html/AbstractModuleIndexWriter.java | 26 +-
.../html/AbstractPackageIndexWriter.java | 14 +-
.../formats/html/AllClassesFrameWriter.java | 5 +-
.../formats/html/AllClassesIndexWriter.java | 4 +-
.../formats/html/AllPackagesIndexWriter.java | 4 +-
.../html/AnnotationTypeWriterImpl.java | 7 +-
.../doclets/formats/html/ClassUseWriter.java | 6 +-
.../doclets/formats/html/ClassWriterImpl.java | 7 +-
.../html/ConstantsSummaryWriterImpl.java | 4 +-
.../formats/html/DeprecatedListWriter.java | 5 +-
.../formats/html/DocFilesHandlerImpl.java | 4 +-
.../formats/html/FrameOutputWriter.java | 4 +-
.../doclets/formats/html/HelpWriter.java | 4 +-
.../formats/html/HtmlDocletWriter.java | 77 +++-
.../formats/html/IndexRedirectWriter.java | 2 +
.../formats/html/ModuleFrameWriter.java | 8 +-
.../formats/html/ModuleIndexFrameWriter.java | 4 +-
.../formats/html/ModuleIndexWriter.java | 4 +-
.../html/ModulePackageIndexFrameWriter.java | 7 +-
.../formats/html/ModuleWriterImpl.java | 3 +-
.../formats/html/PackageFrameWriter.java | 9 +-
.../formats/html/PackageIndexFrameWriter.java | 7 +-
.../formats/html/PackageIndexWriter.java | 4 +-
.../formats/html/PackageTreeWriter.java | 4 +-
.../formats/html/PackageUseWriter.java | 7 +-
.../formats/html/PackageWriterImpl.java | 7 +-
.../html/SerializedFormWriterImpl.java | 4 +-
.../formats/html/SingleIndexWriter.java | 4 +-
.../formats/html/SourceToHTMLConverter.java | 8 +-
.../formats/html/SplitIndexWriter.java | 5 +-
.../doclets/formats/html/TreeWriter.java | 4 +-
.../doclets/formats/html/markup/Head.java | 28 +-
.../doclet/testMetadata/TestMetadata.java | 357 ++++++++++++++++++
33 files changed, 565 insertions(+), 82 deletions(-)
create mode 100644 test/langtools/jdk/javadoc/doclet/testMetadata/TestMetadata.java
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
index c996e489bf0..794d7ceb5f4 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@ import java.util.SortedMap;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@@ -124,11 +123,13 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
* methods from the sub-class in order to generate Frame or Non
* Frame format.
*
- * @param title the title of the window.
+ * @param title the title of the window
+ * @param description the content for the description META tag
* @param includeScript boolean set true if windowtitle script is to be included
* @throws DocFileIOException if there is a problem building the module index file
*/
- protected void buildModuleIndexFile(String title, boolean includeScript) throws DocFileIOException {
+ protected void buildModuleIndexFile(String title, String description, boolean includeScript)
+ throws DocFileIOException {
String windowOverview = resources.getText(title);
Content body = getBody(includeScript, getWindowTitle(windowOverview));
Content header = HtmlTree.HEADER();
@@ -142,8 +143,11 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
body.addContent(header);
body.addContent(main);
body.addContent(footer);
- printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title,
- configuration.doctitle), includeScript, body);
+ printHtmlDocument(
+ configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle),
+ description,
+ includeScript,
+ body);
}
/**
@@ -152,11 +156,12 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
* Frame format.
*
* @param title the title of the window.
+ * @param description the content for the description META tag
* @param includeScript boolean set true if windowtitle script is to be included
* @param mdle the name of the module being documented
* @throws DocFileIOException if there is an exception building the module packages index file
*/
- protected void buildModulePackagesIndexFile(String title,
+ protected void buildModulePackagesIndexFile(String title, String description,
boolean includeScript, ModuleElement mdle) throws DocFileIOException {
String windowOverview = resources.getText(title);
Content body = getBody(includeScript, getWindowTitle(windowOverview));
@@ -171,8 +176,11 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
body.addContent(header);
body.addContent(main);
body.addContent(footer);
- printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title,
- configuration.doctitle), includeScript, body);
+ printHtmlDocument(
+ configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle),
+ description,
+ includeScript,
+ body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
index 783eaa5c3a8..7ffd97c38dc 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@ import java.util.*;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@@ -109,11 +108,13 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
* methods from the sub-class in order to generate Frame or Non
* Frame format.
*
- * @param title the title of the window.
+ * @param title the title of the window
+ * @param description the content for the description META tag
* @param includeScript boolean set true if windowtitle script is to be included
* @throws DocFileIOException if there is a problem building the package index file
*/
- protected void buildPackageIndexFile(String title, boolean includeScript) throws DocFileIOException {
+ protected void buildPackageIndexFile(String title, String description, boolean includeScript)
+ throws DocFileIOException {
String windowOverview = resources.getText(title);
Content body = getBody(includeScript, getWindowTitle(windowOverview));
Content header = HtmlTree.HEADER();
@@ -127,8 +128,9 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
body.addContent(header);
body.addContent(main);
body.addContent(footer);
- printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title,
- configuration.doctitle), includeScript, body);
+ printHtmlDocument(
+ configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle),
+ description, includeScript, body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java
index 973b97e358e..2f4a3914448 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@@ -122,7 +121,7 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
HtmlTree div = HtmlTree.DIV(HtmlStyle.indexContainer, ul);
htmlTree.addContent(div);
body.addContent(htmlTree);
- printHtmlDocument(null, false, body);
+ printHtmlDocument(null, "all classes (frame)", false, body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
index be90f49cfc6..3d5ba0dbbc0 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -117,7 +117,7 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
footer.addContent(navBar.getContent(false));
addBottom(footer);
bodyTree.addContent(footer);
- printHtmlDocument(null, true, bodyTree);
+ printHtmlDocument(null, "class index", true, bodyTree);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
index dc0f9ed6cac..d07013c6d2d 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -105,7 +105,7 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
footer.addContent(navBar.getContent(false));
addBottom(footer);
bodyTree.addContent(footer);
- printHtmlDocument(null, true, bodyTree);
+ printHtmlDocument(null, "package index", true, bodyTree);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
index 632c5ad7ddf..5baa77fae64 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -152,8 +152,11 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
+ String description = getDescription("declaration", annotationType);
printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType),
- true, contentTree);
+ description,
+ true,
+ contentTree);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
index 55b74b70d0f..42624d22891 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -241,7 +240,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
footer.addContent(navBar.getContent(false));
addBottom(footer);
body.addContent(footer);
- printHtmlDocument(null, true, body);
+ String description = getDescription("use", typeElement);
+ printHtmlDocument(null, description, true, body);
}
/**
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 771291276b6..bfa9b0820db 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -177,8 +177,11 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
*/
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
+ String description = getDescription("declaration", typeElement);
printHtmlDocument(configuration.metakeywords.getMetaKeywords(typeElement),
- true, contentTree);
+ description,
+ true,
+ contentTree);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
index cc9c6de6b0a..b0c08ee17f8 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -328,6 +328,6 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
*/
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
- printHtmlDocument(null, true, contentTree);
+ printHtmlDocument(null, "summary of constants", true, contentTree);
}
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
index 987c69f103e..14ad271c9b3 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -308,7 +308,8 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
htmlTree.addContent(navBar.getContent(false));
addBottom(htmlTree);
body.addContent(htmlTree);
- printHtmlDocument(null, true, body);
+ String description = "deprecated elements";
+ printHtmlDocument(null, description, true, body);
}
/**
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 192425bf705..dae6d154f27 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, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -197,7 +197,7 @@ public class DocFilesHandlerImpl implements DocFilesHandler {
footer.addContent(navBar.getContent(false));
docletWriter.addBottom(footer);
htmlContent.addContent(footer);
- docletWriter.printHtmlDocument(Collections.emptyList(), false, localTagsContent, htmlContent);
+ docletWriter.printHtmlDocument(Collections.emptyList(), null, false, localTagsContent, htmlContent);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java
index 89b15451b3d..0e52298c46e 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,6 +128,8 @@ public class FrameOutputWriter extends HtmlDocletWriter {
Head head = new Head(path, configuration.docletVersion)
.setTimestamp(!configuration.notimestamp)
.setTitle(title)
+ .setDescription("frames")
+ .setGenerator(getGenerator(getClass()))
.setCharset(configuration.charset)
.setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets())
.addDefaultScript(false)
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
index fab5fe64847..9ce70ff5d13 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -100,7 +100,7 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree.addContent(navBar.getContent(false));
addBottom(htmlTree);
body.addContent(htmlTree);
- printHtmlDocument(null, true, body);
+ printHtmlDocument(null, "help", true, body);
}
/**
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 3311cfa5b0b..df8b211b05c 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@ import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.Name;
import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.QualifiedNameable;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.DeclaredType;
@@ -421,14 +422,18 @@ public class HtmlDocletWriter {
* @param metakeywords Array of String keywords for META tag. Each element
* of the array is assigned to a separate META tag.
* Pass in null for no array
+ * @param description the content for the description META tag.
* @param includeScript true if printing windowtitle script
* false for files that appear in the left-hand frames
* @param body the body htmltree to be included in the document
* @throws DocFileIOException if there is a problem writing the file
*/
- public void printHtmlDocument(List metakeywords, boolean includeScript,
- Content body) throws DocFileIOException {
- printHtmlDocument(metakeywords, includeScript, new ContentBuilder(), body);
+ public void printHtmlDocument(List metakeywords,
+ String description,
+ boolean includeScript,
+ Content body)
+ throws DocFileIOException {
+ printHtmlDocument(metakeywords, description, includeScript, new ContentBuilder(), body);
}
/**
@@ -437,24 +442,31 @@ public class HtmlDocletWriter {
* @param metakeywords Array of String keywords for META tag. Each element
* of the array is assigned to a separate META tag.
* Pass in null for no array
+ * @param description the content for the description META tag.
* @param includeScript true if printing windowtitle script
* false for files that appear in the left-hand frames
- * @param extraContent any additional content to be included in the HEAD element
+ * @param extraHeadContent any additional content to be included in the HEAD element
* @param body the body htmltree to be included in the document
* @throws DocFileIOException if there is a problem writing the file
*/
- public void printHtmlDocument(List metakeywords, boolean includeScript, Content extraContent,
- Content body) throws DocFileIOException {
+ public void printHtmlDocument(List metakeywords,
+ String description,
+ boolean includeScript,
+ Content extraHeadContent,
+ Content body)
+ throws DocFileIOException {
Content htmlComment = contents.newPage;
Head head = new Head(path, configuration.docletVersion)
.setTimestamp(!configuration.notimestamp)
+ .setDescription(description)
+ .setGenerator(getGenerator(getClass()))
.setTitle(winTitle)
.setCharset(configuration.charset)
.addKeywords(metakeywords)
.setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets())
.setUseModuleDirectories(configuration.useModuleDirectories)
.setIndex(configuration.createindex, mainBodyScript)
- .addContent(extraContent);
+ .addContent(extraHeadContent);
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
@@ -2110,6 +2122,55 @@ public class HtmlDocletWriter {
return new TableHeader(contents.packageLabel, contents.descriptionLabel);
}
+ /**
+ * Generates a string for use in a description meta element,
+ * based on an element and its enclosing elements
+ * @param prefix a prefix for the string
+ * @param elem the element
+ * @return the description
+ */
+ static String getDescription(String prefix, Element elem) {
+ LinkedList chain = new LinkedList<>();
+ for (Element e = elem; e != null; e = e.getEnclosingElement()) {
+ // ignore unnamed enclosing elements
+ if (e.getSimpleName().length() == 0 && e != elem) {
+ break;
+ }
+ chain.addFirst(e);
+ }
+ StringBuilder sb = new StringBuilder();
+ for (Element e: chain) {
+ CharSequence name;
+ switch (e.getKind()) {
+ case MODULE:
+ case PACKAGE:
+ name = ((QualifiedNameable) e).getQualifiedName();
+ if (name.length() == 0) {
+ name = "";
+ }
+ break;
+
+ default:
+ name = e.getSimpleName();
+ break;
+ }
+
+ if (sb.length() == 0) {
+ sb.append(prefix).append(": ");
+ } else {
+ sb.append(", ");
+ }
+ sb.append(e.getKind().toString().toLowerCase(Locale.US).replace("_", " "))
+ .append(": ")
+ .append(name);
+ }
+ return sb.toString();
+ }
+
+ static String getGenerator(Class> clazz) {
+ return "javadoc/" + clazz.getSimpleName();
+ }
+
/**
* Returns an HtmlTree for the SCRIPT tag.
*
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java
index fccaf03e5f8..c4724ecdb44 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java
@@ -79,6 +79,8 @@ public class IndexRedirectWriter extends HtmlDocletWriter {
Content htmlComment = contents.newPage;
Head head = new Head(path, configuration.docletVersion)
.setTimestamp(true)
+ .setDescription("index redirect")
+ .setGenerator(getGenerator(getClass()))
.setStylesheets(configuration.getMainStylesheet(), Collections.emptyList()) // avoid reference to default stylesheet
.addDefaultScript(false);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
index 345264ce7fb..bc6cb06bea1 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
@@ -111,7 +110,10 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
htmlTree.addContent(div);
body.addContent(htmlTree);
mdlgen.printHtmlDocument(
- configuration.metakeywords.getMetaKeywordsForModule(moduleElement), false, body);
+ configuration.metakeywords.getMetaKeywordsForModule(moduleElement),
+ "module summary (frame)",
+ false,
+ body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
index b6a2e8ff2e3..f096330fd4a 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.MODULE_OVERVIEW_FRAME;
ModuleIndexFrameWriter modulegen = new ModuleIndexFrameWriter(configuration, filename);
- modulegen.buildModuleIndexFile("doclet.Window_Overview", false);
+ modulegen.buildModuleIndexFile("doclet.Window_Overview", "module overview (frame)", false);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java
index 8d10365aad6..e7caabe3804 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.overviewSummary(configuration.frames);
ModuleIndexWriter mdlgen = new ModuleIndexWriter(configuration, filename);
- mdlgen.buildModuleIndexFile("doclet.Window_Overview_Summary", true);
+ mdlgen.buildModuleIndexFile("doclet.Window_Overview_Summary", "module index", true);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
index 28cf5ea110c..be5eb67c346 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,10 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
public static void generate(HtmlConfiguration configuration, ModuleElement mdle) throws DocFileIOException {
DocPath filename = configuration.docPaths.moduleFrame(mdle);
ModulePackageIndexFrameWriter modpackgen = new ModulePackageIndexFrameWriter(configuration, filename);
- modpackgen.buildModulePackagesIndexFile("doclet.Window_Overview", false, mdle);
+ modpackgen.buildModulePackagesIndexFile("doclet.Window_Overview",
+ getDescription("module package index", mdle) + " (frame)",
+ false,
+ mdle);
}
/**
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 e167ba87b66..9f5e8a4e083 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -915,6 +915,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
printHtmlDocument(configuration.metakeywords.getMetaKeywordsForModule(mdle),
+ getDescription("declaration", mdle),
true, contentTree);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java
index 4cfadf5b129..ac1269a70c7 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
/**
* Generate a package summary page for the left-hand bottom frame. Construct
- * the PackageFrameWriter object and then uses it generate the file.
+ * the PackageFrameWriter object and then use it generate the file.
*
* @param configuration the current configuration of the doclet.
* @param packageElement The package for which "pacakge-frame.html" is to be generated.
@@ -111,7 +111,10 @@ public class PackageFrameWriter extends HtmlDocletWriter {
htmlTree.addContent(div);
body.addContent(htmlTree);
packgen.printHtmlDocument(
- configuration.metakeywords.getMetaKeywords(packageElement), false, body);
+ configuration.metakeywords.getMetaKeywords(packageElement),
+ getDescription("package summary (frame)", packageElement),
+ false,
+ body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
index 8005d435451..ecbf34fd4e3 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -70,7 +69,9 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.OVERVIEW_FRAME;
PackageIndexFrameWriter packgen = new PackageIndexFrameWriter(configuration, filename);
- packgen.buildPackageIndexFile("doclet.Window_Overview", false);
+ packgen.buildPackageIndexFile("doclet.Window_Overview",
+ "package index (frame)",
+ false);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
index 7e36de51c20..793bcdba7c9 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.overviewSummary(configuration.frames);
PackageIndexWriter packgen = new PackageIndexWriter(configuration, filename);
- packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true);
+ packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", "package index", true);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java
index 02dd11e6bc7..359a8bb953a 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -121,7 +121,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
footer.addContent(navBar.getContent(false));
addBottom(footer);
body.addContent(footer);
- printHtmlDocument(null, true, body);
+ printHtmlDocument(null, getDescription("tree", packageElement), true, body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
index 3d370e8262b..6bdb9472fc2 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,10 @@ public class PackageUseWriter extends SubWriterHolderWriter {
footer.addContent(navBar.getContent(false));
addBottom(footer);
body.addContent(footer);
- printHtmlDocument(null, true, body);
+ printHtmlDocument(null,
+ getDescription("use", packageElement),
+ true,
+ body);
}
/**
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 cd139a3c060..f651592dbd7 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -316,7 +316,10 @@ public class PackageWriterImpl extends HtmlDocletWriter
*/
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
+ String description = getDescription("declaration", packageElement);
printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageElement),
- true, contentTree);
+ description,
+ true,
+ contentTree);
}
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java
index 4a93f1fd9af..b11367ef32f 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -255,7 +255,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
*/
@Override
public void printDocument(Content serializedTree) throws DocFileIOException {
- printHtmlDocument(null, true, serializedTree);
+ printHtmlDocument(null, "serialized forms", true, serializedTree);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java
index cc16512350f..c2361d3710a 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -121,7 +121,7 @@ public class SingleIndexWriter extends AbstractIndexWriter {
addBottom(htmlTree);
body.addContent(htmlTree);
createSearchIndexFiles();
- printHtmlDocument(null, true, body);
+ printHtmlDocument(null, "index", true, body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java
index 4369b457918..0720a2802b4 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -196,7 +196,7 @@ public class SourceToHTMLConverter {
addBlankLines(pre);
Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
body.addContent(HtmlTree.MAIN(div));
- writeToFile(body, outputdir.resolve(configuration.docPaths.forClass(te)));
+ writeToFile(body, outputdir.resolve(configuration.docPaths.forClass(te)), te);
} catch (IOException e) {
String message = resources.getText("doclet.exception.read.file", fo.getName());
throw new SimpleDocletException(message, e);
@@ -209,11 +209,13 @@ public class SourceToHTMLConverter {
* @param body the documentation content to be written to the file.
* @param path the path for the file.
*/
- private void writeToFile(Content body, DocPath path) throws DocFileIOException {
+ private void writeToFile(Content body, DocPath path, TypeElement te) throws DocFileIOException {
Head head = new Head(path, configuration.docletVersion)
// .setTimestamp(!configuration.notimestamp) // temporary: compatibility!
.setTitle(resources.getText("doclet.Window_Source_title"))
// .setCharset(configuration.charset) // temporary: compatibility!
+ .setDescription(HtmlDocletWriter.getDescription("source", te))
+ .setGenerator(HtmlDocletWriter.getGenerator(getClass()))
.addDefaultScript(false)
.setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets());
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java
index 0bdc62f2607..b03b9018e5e 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -144,7 +144,8 @@ public class SplitIndexWriter extends AbstractIndexWriter {
footer.addContent(navBar.getContent(false));
addBottom(footer);
body.addContent(footer);
- printHtmlDocument(null, true, body);
+ String description = "index: " + unicode;
+ printHtmlDocument(null, description, true, body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java
index f0158355fa4..b5d3b026e38 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -127,7 +127,7 @@ public class TreeWriter extends AbstractTreeWriter {
htmlTree.addContent(navBar.getContent(false));
addBottom(htmlTree);
body.addContent(htmlTree);
- printHtmlDocument(null, true, body);
+ printHtmlDocument(null, "class tree", true, body);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java
index b86a6c6d834..08b657b79ad 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,8 @@ public class Head {
private String title;
private String charset;
private final List keywords;
+ private String description;
+ private String generator;
private boolean showTimestamp;
private boolean useModuleDirectories;
private DocFile mainStylesheetFile;
@@ -110,6 +112,22 @@ public class Head {
return this;
}
+ /**
+ * Sets the content for the description META element.
+ */
+ public Head setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Sets the content for the generator META element.
+ */
+ public Head setGenerator(String generator) {
+ this.generator = generator;
+ return this;
+ }
+
/**
* Adds a list of keywords to appear in META [@code keywords} elements.
*
@@ -245,6 +263,14 @@ public class Head {
tree.addContent(HtmlTree.META("dc.created", dateFormat.format(now)));
}
+ if (description != null) {
+ tree.addContent(HtmlTree.META("description", description));
+ }
+
+ if (generator != null) {
+ tree.addContent(HtmlTree.META("generator", generator));
+ }
+
for (String k : keywords) {
tree.addContent(HtmlTree.META("keywords", k));
}
diff --git a/test/langtools/jdk/javadoc/doclet/testMetadata/TestMetadata.java b/test/langtools/jdk/javadoc/doclet/testMetadata/TestMetadata.java
new file mode 100644
index 00000000000..865a210e77f
--- /dev/null
+++ b/test/langtools/jdk/javadoc/doclet/testMetadata/TestMetadata.java
@@ -0,0 +1,357 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8218998
+ * @summary Add metadata to generated API documentation files
+ * @library /tools/lib ../../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ * jdk.compiler/com.sun.tools.javac.main
+ * jdk.javadoc/jdk.javadoc.internal.api
+ * jdk.javadoc/jdk.javadoc.internal.tool
+ * @build toolbox.ToolBox toolbox.JavacTask javadoc.tester.*
+ * @run main TestMetadata
+ */
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
+
+import javadoc.tester.JavadocTester;
+
+public class TestMetadata extends JavadocTester {
+ public static void main(String... args) throws Exception {
+ TestMetadata tester = new TestMetadata();
+ tester.runTests();
+ }
+
+ enum Frames { NO_FRAMES, FRAMES };
+ enum Index { SINGLE, SPLIT };
+ enum Source { PACKAGES, MODULES };
+
+ final ToolBox tb = new ToolBox();
+ final Set allGeneratorsFound = new HashSet<>();
+
+ public void runTests() throws Exception {
+ for (Source s : Source.values()) {
+ Path src = genSource(s);
+ for (Frames f : Frames.values()) {
+ for (Index i : Index.values()) {
+ List args = new ArrayList<>();
+ args.add("-d");
+ args.add(String.format("out-%s-%s-%s", s, f, i));
+ args.add("-use");
+ if (s != Source.MODULES) {
+ args.add("-linksource"); // broken, with modules: JDK-8219060
+ }
+ args.add(f == Frames.NO_FRAMES ? "--no-frames" : "--frames");
+ if (i == Index.SPLIT) {
+ args.add("-splitIndex");
+ }
+ if (s == Source.PACKAGES) {
+ args.add("-sourcepath");
+ args.add(src.toString());
+ args.add("pA");
+ args.add("pB");
+ } else {
+ args.add("--module-source-path");
+ args.add(src.toString());
+ args.add("--module");
+ args.add("mA,mB");
+ }
+ javadoc(args.toArray(new String[args.size()]));
+ checkExit(Exit.OK);
+ checkMetadata();
+
+ // spot check the descriptions for declarations
+ switch (s) {
+ case PACKAGES:
+ checkOutput("pA/package-summary.html", true,
+ "");
+ checkOutput("pA/CA.html", true,
+ "");
+ break;
+
+ case MODULES:
+ checkOutput("mA/module-summary.html", true,
+ "");
+ checkOutput("mA/pA/package-summary.html", true,
+ "");
+ checkOutput("mA/pA/CA.html", true,
+ "");
+ break;
+ }
+ }
+ }
+ }
+
+ checking ("all generators");
+ if (allGeneratorsFound.equals(allGenerators)) {
+ passed("all generators found");
+ } else {
+ Set notFound = new TreeSet<>(allGenerators);
+ notFound.removeAll(allGeneratorsFound);
+ failed("not found: " + notFound);
+ }
+
+ printSummary();
+ }
+
+ final Pattern nl = Pattern.compile("[\\r\\n]+");
+ final Pattern contentPattern = Pattern.compile("content=\"([^\"]+)\">");
+ final Pattern generatorPattern = Pattern.compile("content=\"javadoc/([^\"]+)\">");
+ final Set allGenerators = Set.of(
+ "AllClassesFrameWriter",
+ "AllClassesIndexWriter",
+ "AllPackagesIndexWriter",
+ "AnnotationTypeWriterImpl",
+ "ClassUseWriter",
+ "ClassWriterImpl",
+ "ConstantsSummaryWriterImpl",
+ "DeprecatedListWriter",
+ "DocFileWriter",
+ "FrameOutputWriter",
+ "HelpWriter",
+ "IndexRedirectWriter",
+ "ModuleFrameWriter",
+ "ModuleIndexFrameWriter",
+ "ModuleIndexWriter",
+ "ModulePackageIndexFrameWriter",
+ "ModuleWriterImpl",
+ "PackageFrameWriter",
+ "PackageIndexFrameWriter",
+ "PackageIndexWriter",
+ "PackageTreeWriter",
+ "PackageUseWriter",
+ "PackageWriterImpl",
+ "SerializedFormWriterImpl",
+ "SingleIndexWriter",
+ "SourceToHTMLConverter",
+ "SplitIndexWriter",
+ "TreeWriter"
+ );
+
+ void checkMetadata() throws IOException {
+ Path outputDirPath = outputDir.toPath();
+ for (Path p : tb.findFiles(".html", outputDirPath)) {
+ checkMetadata(outputDirPath.relativize(p));
+ }
+ }
+
+ void checkMetadata(Path p) {
+ checking("Check generator: " + p);
+
+ List generators = nl.splitAsStream(readOutputFile(p.toString()))
+ .filter(s -> s.contains(" descriptions = nl.splitAsStream(readOutputFile(p.toString()))
+ .filter(s -> s.contains("\nExtra");
+ break;
+
+ case MODULES:
+ new ModuleBuilder(tb, "mA")
+ .exports("pA")
+ .classes("/** Package mA/pA. */ package pA;")
+ .classes("/** Class mA/pA.CA. */ package pA; public class CA { }")
+ .write(src);
+ new ModuleBuilder(tb, "mB")
+ .exports("pB")
+ .classes("/** Package mB/pB. */ package pB;")
+ .classes("/** Class mB/pB.CB. */ package pB; public class CB { }")
+ .write(src);
+ break;
+ }
+
+ return src;
+ }
+}
+
From e2054e3c5d25bdd3766d178922528d8fc0c7e6b0 Mon Sep 17 00:00:00 2001
From: David Holmes
Date: Wed, 20 Feb 2019 19:41:43 -0500
Subject: [PATCH 056/109] 8217765: Internal Error (javaCalls.cpp:61)
guarantee(thread->can_call_java()) failed
Reviewed-by: rehn, redestad, coleenp
---
src/hotspot/share/oops/instanceKlass.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 05ff886e958..5ad8b9116db 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -183,8 +183,14 @@ bool InstanceKlass::has_nest_member(InstanceKlass* k, TRAPS) const {
if (name == k->name()) {
log_trace(class, nestmates)("- Found it at nest_members[%d] => cp[%d]", i, cp_index);
- // names match so check actual klass - this may trigger class loading if
- // it doesn't match (but that should be impossible)
+ // Names match so check actual klass - this may trigger class loading if
+ // it doesn't match (though that should be impossible). But to be safe we
+ // have to check for a compiler thread executing here.
+ if (!THREAD->can_call_java() && !_constants->tag_at(cp_index).is_klass()) {
+ log_trace(class, nestmates)("- validation required resolution in an unsuitable thread");
+ return false;
+ }
+
Klass* k2 = _constants->klass_at(cp_index, CHECK_false);
if (k2 == k) {
log_trace(class, nestmates)("- class is listed as a nest member");
@@ -296,7 +302,7 @@ InstanceKlass* InstanceKlass::nest_host(Symbol* validationException, TRAPS) {
error);
}
- if (validationException != NULL) {
+ if (validationException != NULL && THREAD->can_call_java()) {
ResourceMark rm(THREAD);
Exceptions::fthrow(THREAD_AND_LOCATION,
validationException,
From e6f6863cbcf5e913c1035a7834907689f5889747 Mon Sep 17 00:00:00 2001
From: Xue-Lei Andrew Fan
Date: Wed, 20 Feb 2019 18:46:30 -0800
Subject: [PATCH 057/109] 8168069: X509TrustManagerImpl causes ClassLoader
leaks with unparseable extensions
Reviewed-by: mullan
---
.../sun/security/ssl/SSLContextImpl.java | 49 ++++++++++++++-----
.../security/x509/CertificateExtensions.java | 9 ++--
.../ssl/SSLContextImpl/BadKSProvider.java | 18 ++++---
.../ssl/SSLContextImpl/BadTSProvider.java | 16 ++----
4 files changed, 56 insertions(+), 36 deletions(-)
diff --git a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
index f7b1095ace2..0572079d8d2 100644
--- a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
+++ b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
@@ -921,29 +921,45 @@ public abstract class SSLContextImpl extends SSLContextSpi {
static {
Exception reserved = null;
- TrustManager[] tmMediator;
+ TrustManager[] tmMediator = null;
try {
tmMediator = getTrustManagers();
} catch (Exception e) {
reserved = e;
- tmMediator = new TrustManager[0];
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,defaultctx")) {
+ SSLLogger.warning(
+ "Failed to load default trust managers", e);
+ }
}
- trustManagers = tmMediator;
+ KeyManager[] kmMediator = null;
if (reserved == null) {
- KeyManager[] kmMediator;
try {
kmMediator = getKeyManagers();
} catch (Exception e) {
reserved = e;
- kmMediator = new KeyManager[0];
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,defaultctx")) {
+ SSLLogger.warning(
+ "Failed to load default key managers", e);
+ }
}
- keyManagers = kmMediator;
- } else {
- keyManagers = new KeyManager[0];
}
- reservedException = reserved;
+ if (reserved != null) {
+ trustManagers = new TrustManager[0];
+ keyManagers = new KeyManager[0];
+
+ // Important note: please don't reserve the original exception
+ // object, which may be not garbage collection friendly as
+ // 'reservedException' is a static filed.
+ reservedException =
+ new KeyManagementException(reserved.getMessage());
+ } else {
+ trustManagers = tmMediator;
+ keyManagers = kmMediator;
+
+ reservedException = null;
+ }
}
private static TrustManager[] getTrustManagers() throws Exception {
@@ -1071,21 +1087,30 @@ public abstract class SSLContextImpl extends SSLContextSpi {
private static final class DefaultSSLContextHolder {
private static final SSLContextImpl sslContext;
- static Exception reservedException = null;
+ private static final Exception reservedException;
static {
+ Exception reserved = null;
SSLContextImpl mediator = null;
if (DefaultManagersHolder.reservedException != null) {
- reservedException = DefaultManagersHolder.reservedException;
+ reserved = DefaultManagersHolder.reservedException;
} else {
try {
mediator = new DefaultSSLContext();
} catch (Exception e) {
- reservedException = e;
+ // Important note: please don't reserve the original
+ // exception object, which may be not garbage collection
+ // friendly as 'reservedException' is a static filed.
+ reserved = new KeyManagementException(e.getMessage());
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,defaultctx")) {
+ SSLLogger.warning(
+ "Failed to load default SSLContext", e);
+ }
}
}
sslContext = mediator;
+ reservedException = reserved;
}
}
diff --git a/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java b/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java
index e76a8b331f3..1ccf0267888 100644
--- a/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java
+++ b/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -355,7 +355,7 @@ public class CertificateExtensions implements CertAttrSet {
class UnparseableExtension extends Extension {
private String name;
- private Throwable why;
+ private String exceptionDescription;
public UnparseableExtension(Extension ext, Throwable why) {
super(ext);
@@ -371,12 +371,13 @@ class UnparseableExtension extends Extension {
// If we cannot find the name, just ignore it
}
- this.why = why;
+ this.exceptionDescription = why.toString();
}
@Override public String toString() {
return super.toString() +
- "Unparseable " + name + "extension due to\n" + why + "\n\n" +
+ "Unparseable " + name + "extension due to\n" +
+ exceptionDescription + "\n\n" +
new HexDumpEncoder().encodeBuffer(getExtensionValue());
}
}
diff --git a/test/jdk/sun/security/ssl/SSLContextImpl/BadKSProvider.java b/test/jdk/sun/security/ssl/SSLContextImpl/BadKSProvider.java
index 9fdc0797f94..74bf432dc5e 100644
--- a/test/jdk/sun/security/ssl/SSLContextImpl/BadKSProvider.java
+++ b/test/jdk/sun/security/ssl/SSLContextImpl/BadKSProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -21,14 +21,16 @@
* questions.
*/
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
/*
* @test
- * @bug 4919147
+ * @bug 4919147 8168069
* @summary Support for token-based KeyStores
* @run main/othervm BadKSProvider
- *
- * SunJSSE does not support dynamic system properties, no way to re-use
- * system properties in samevm/agentvm mode.
*/
import java.io.*;
@@ -176,16 +178,16 @@ public class BadKSProvider {
// catching the exception is ok,
// but let's try to confirm it is the right exception.
//
- // XXX this test must be updated if the exception message changes
+ // Note: this test must be updated if the exception message changes
Throwable cause = se.getCause();
- if (cause instanceof java.security.NoSuchAlgorithmException == false) {
+ if (!(cause instanceof java.security.NoSuchAlgorithmException)) {
se.printStackTrace();
throw new Exception("Unexpected exception" + se);
}
cause = cause.getCause();
- if (cause instanceof java.security.NoSuchProviderException == false) {
+ if (!(cause instanceof java.security.KeyManagementException)) {
se.printStackTrace();
throw new Exception("Unexpected exception" + se);
}
diff --git a/test/jdk/sun/security/ssl/SSLContextImpl/BadTSProvider.java b/test/jdk/sun/security/ssl/SSLContextImpl/BadTSProvider.java
index 28d13157431..0e0b8772fd7 100644
--- a/test/jdk/sun/security/ssl/SSLContextImpl/BadTSProvider.java
+++ b/test/jdk/sun/security/ssl/SSLContextImpl/BadTSProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
/*
* @test
- * @bug 4919147
+ * @bug 4919147 8168069
* @summary Support for token-based KeyStores
* @run main/othervm BadTSProvider
*/
@@ -175,12 +175,10 @@ public class BadTSProvider {
new BadTSProvider();
throw new SecurityException("expected no-such-provider exception");
} catch (SocketException se) {
-
// catching the exception is ok,
// but let's try to confirm it is the right exception.
//
- // XXX this test must be updated if the exception message changes
-
+ // Note: this test must be updated if the exception message changes
Throwable cause = se.getCause();
if (!(cause instanceof NoSuchAlgorithmException)) {
se.printStackTrace();
@@ -188,13 +186,7 @@ public class BadTSProvider {
}
cause = cause.getCause();
- if (!(cause instanceof KeyStoreException)) {
- se.printStackTrace();
- throw new Exception("Unexpected exception" + se);
- }
-
- cause = cause.getCause();
- if (!(cause instanceof NoSuchProviderException)) {
+ if (!(cause instanceof KeyManagementException)) {
se.printStackTrace();
throw new Exception("Unexpected exception" + se);
}
From dcf38e3cfed2df3f58b6c46abdb10246f8382d30 Mon Sep 17 00:00:00 2001
From: Priya Lakshmi Muthuswamy
Date: Thu, 21 Feb 2019 11:26:39 +0530
Subject: [PATCH 058/109] 8213354: Support package-specific stylesheets
Reviewed-by: jjg
---
.../html/AnnotationTypeWriterImpl.java | 6 +-
.../doclets/formats/html/ClassWriterImpl.java | 6 +-
.../formats/html/DocFilesHandlerImpl.java | 11 ++-
.../formats/html/HtmlConfiguration.java | 2 +
.../formats/html/HtmlDocletWriter.java | 17 ++++
.../formats/html/PackageWriterImpl.java | 5 +-
.../doclets/toolkit/DocFilesHandler.java | 4 +
.../TestPackageSpecificStylesheet.java | 96 +++++++++++++++++++
8 files changed, 137 insertions(+), 10 deletions(-)
create mode 100644 test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
index 5baa77fae64..c69d76d5f23 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
@@ -153,10 +153,10 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
String description = getDescription("declaration", annotationType);
+ PackageElement pkg = utils.containingPackage(this.annotationType);
+ Content stylesheetContent = getLocalStylesheetContent(pkg);
printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType),
- description,
- true,
- contentTree);
+ description, true, stylesheetContent, contentTree);
}
/**
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 bfa9b0820db..917d96a1815 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
@@ -178,10 +178,10 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
String description = getDescription("declaration", typeElement);
+ PackageElement pkg = utils.containingPackage(typeElement);
+ Content stylesheetContent = getLocalStylesheetContent(pkg);
printHtmlDocument(configuration.metakeywords.getMetaKeywords(typeElement),
- description,
- true,
- contentTree);
+ description, true, stylesheetContent, contentTree);
}
/**
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 dae6d154f27..a012f0f5a42 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
@@ -31,7 +31,6 @@ import com.sun.source.doctree.StartElementTree;
import com.sun.source.doctree.TextTree;
import com.sun.source.util.DocTreeFactory;
import com.sun.tools.doclint.HtmlTag;
-import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -125,6 +124,16 @@ public class DocFilesHandlerImpl implements DocFilesHandler {
}
}
+ public List getStylesheets() throws DocFileIOException {
+ List stylesheets = new ArrayList();
+ for (DocFile srcdir : DocFile.list(configuration, location, source)) {
+ for (DocFile srcFile : srcdir.list()) {
+ if (srcFile.getName().endsWith(".css"))
+ stylesheets.add(DocPaths.DOC_FILES.resolve(srcFile.getName()));
+ }
+ }
+ return stylesheets;
+ }
private void copyDirectory(DocFile srcdir, final DocPath dstDocPath,
boolean first) throws DocFileIOException {
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
index 932fc97e7bc..d034d99461d 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
@@ -240,6 +240,8 @@ public class HtmlConfiguration extends BaseConfiguration {
public DocPaths docPaths;
+ public Map> localStylesheetMap = new HashMap<>();
+
/**
* Creates an object to hold the configuration for a doclet.
*
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 df8b211b05c..39f04b2a88d 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
@@ -2219,4 +2219,21 @@ public class HtmlDocletWriter {
Script getMainBodyScript() {
return mainBodyScript;
}
+
+ Content getLocalStylesheetContent(Element element) throws DocFileIOException {
+ Content stylesheetContent = new ContentBuilder();
+ List localStylesheets = configuration.localStylesheetMap.get(element);
+ if (localStylesheets == null) {
+ DocFilesHandlerImpl docFilesHandler = (DocFilesHandlerImpl)configuration
+ .getWriterFactory().getDocFilesHandler(element);
+ localStylesheets = docFilesHandler.getStylesheets();
+ configuration.localStylesheetMap.put(element, localStylesheets);
+ }
+ for (DocPath stylesheet : localStylesheets) {
+ stylesheetContent.addContent(HtmlTree.LINK("stylesheet",
+ "text/css", stylesheet.getPath(), "Style"));
+ }
+ return stylesheetContent;
+ }
+
}
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 f651592dbd7..bcf2aebdfc5 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
@@ -317,9 +317,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
@Override
public void printDocument(Content contentTree) throws DocFileIOException {
String description = getDescription("declaration", packageElement);
+ Content stylesheetContent = getLocalStylesheetContent(packageElement);
printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageElement),
- description,
- true,
- contentTree);
+ description, true, stylesheetContent, contentTree);
}
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/DocFilesHandler.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/DocFilesHandler.java
index 181d856710a..92788ebda12 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/DocFilesHandler.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/DocFilesHandler.java
@@ -26,6 +26,9 @@
package jdk.javadoc.internal.doclets.toolkit;
+import java.util.List;
+
+import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
/**
* The interface for copying doc-files to the output.
*
@@ -37,4 +40,5 @@ package jdk.javadoc.internal.doclets.toolkit;
public interface DocFilesHandler {
void copyDocFiles() throws DocletException;
+ List getStylesheets() throws DocletException;
}
diff --git a/test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java b/test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java
new file mode 100644
index 00000000000..7cecf1b5323
--- /dev/null
+++ b/test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8213354
+ * @summary Support package-specific stylesheets
+ * @library /tools/lib ../../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
+ * @run main TestPackageSpecificStylesheet
+ */
+
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import builder.ClassBuilder;
+import toolbox.ToolBox;
+
+import javadoc.tester.JavadocTester;
+
+public class TestPackageSpecificStylesheet extends JavadocTester {
+
+ final ToolBox tb;
+
+ public static void main(String... args) throws Exception {
+ TestPackageSpecificStylesheet tester = new TestPackageSpecificStylesheet();
+ tester.runTests(m -> new Object[]{Paths.get(m.getName())});
+ }
+
+ TestPackageSpecificStylesheet() {
+ tb = new ToolBox();
+ }
+
+ @Test
+ public void test(Path base) throws Exception {
+ Path srcDir = base.resolve("src");
+ Path outDir = base.resolve("out");
+
+ new ClassBuilder(tb, "pkg.A")
+ .setComments("test span style")
+ .setModifiers("public", "class")
+ .write(srcDir);
+
+ Path docFilesDir = Files.createDirectories(srcDir.resolve("pkg").resolve("doc-files"));
+ Path stylesheet = docFilesDir.resolve("spanstyle.css");
+ Files.createFile(stylesheet);
+ Files.write(stylesheet, List.of("span{ color:blue; }"));
+
+ new ClassBuilder(tb, "pkg2.B")
+ .setModifiers("public", "class")
+ .write(srcDir);
+
+ javadoc("-d", outDir.toString(),
+ "-sourcepath", srcDir.toString(),
+ "pkg", "pkg2");
+
+ checkExit(Exit.OK);
+
+ checkOutput("pkg/A.html", true,
+ "");
+
+ checkOutput("pkg/package-summary.html", true,
+ "");
+
+ checkOutput("pkg2/B.html", false,
+ "");
+
+ }
+}
From 4f60b8d9e26b602e05a994729e5d4dd33d66637a Mon Sep 17 00:00:00 2001
From: Matthias Baesken
Date: Wed, 20 Feb 2019 17:29:30 +0100
Subject: [PATCH 059/109] 8219460: ppc: adjust
NativeGeneralJump::insert_unconditional to stack allocated MacroAssembler
Reviewed-by: mdoerr
---
src/hotspot/cpu/ppc/nativeInst_ppc.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp
index 626167281e0..052ca1ba77e 100644
--- a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp
+++ b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, 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
@@ -362,8 +362,8 @@ void NativeJump::verify() {
void NativeGeneralJump::insert_unconditional(address code_pos, address entry) {
CodeBuffer cb(code_pos, BytesPerInstWord + 1);
- MacroAssembler* a = new MacroAssembler(&cb);
- a->b(entry);
+ MacroAssembler a(&cb);
+ a.b(entry);
ICache::ppc64_flush_icache_bytes(code_pos, NativeGeneralJump::instruction_size);
}
From 6f24f8aad6834e6b5c6a6930978c405632aa64e2 Mon Sep 17 00:00:00 2001
From: Jesper Wilhelmsson
Date: Thu, 21 Feb 2019 01:04:46 +0100
Subject: [PATCH 060/109] Added tag jdk-12+33 for changeset b67884871b5f
---
.hgtags | 1 +
1 file changed, 1 insertion(+)
diff --git a/.hgtags b/.hgtags
index 0deec91eab8..c130ac5425b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -535,3 +535,4 @@ f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27
6c377af36a5c4203f16aed8a5e4c2ecc08fcd8bd jdk-12+30
b5f7bb57de2f797be34f6c75d45c3245ad37ab97 jdk-12+31
4ce47bc1fb92cf94c6e3d1f49d582f02dcb851ab jdk-12+32
+b67884871b5fff79c5ef3eb8ac74dd48d71ea9b1 jdk-12+33
From 55f23fea5c285ef1c8cd2d34f4f1ac5329076824 Mon Sep 17 00:00:00 2001
From: Roman Kennke
Date: Thu, 21 Feb 2019 09:48:07 +0100
Subject: [PATCH 061/109] 8219486: Missing reg_mask_init() breaks x86_32 build
Reviewed-by: vlivanov, dlong
---
src/hotspot/cpu/x86/c2_init_x86.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/cpu/x86/c2_init_x86.cpp b/src/hotspot/cpu/x86/c2_init_x86.cpp
index 81f1e4e50c3..3cf187bceb6 100644
--- a/src/hotspot/cpu/x86/c2_init_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_init_x86.cpp
@@ -29,7 +29,7 @@
// processor dependent initialization for i486
-extern void reg_mask_init();
+LP64_ONLY(extern void reg_mask_init();)
void Compile::pd_compiler2_init() {
guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" );
@@ -60,5 +60,5 @@ void Compile::pd_compiler2_init() {
OptoReg::invalidate(i);
}
}
- reg_mask_init();
+ LP64_ONLY(reg_mask_init();)
}
From 4aac63bb93adc4fce5447055360586edd3bb466a Mon Sep 17 00:00:00 2001
From: Gary Adams
Date: Thu, 21 Feb 2019 05:06:41 -0500
Subject: [PATCH 062/109] 8219388: Misleading log message "issuspended002a
debuggee launched"
Reviewed-by: cjplummer, phh
---
.../nsk/jdi/ClassType/invokeMethod/invokemethod001.java | 4 ++--
.../nsk/jdi/ClassType/newInstance/newinstance001.java | 4 ++--
.../nsk/jdi/ClassType/newInstance/newinstance002.java | 4 ++--
.../vmTestbase/nsk/jdi/ClassType/setValue/setvalue001.java | 4 ++--
.../vmTestbase/nsk/jdi/ClassType/setValue/setvalue002.java | 4 ++--
.../vmTestbase/nsk/jdi/ClassType/setValue/setvalue003.java | 4 ++--
.../vmTestbase/nsk/jdi/ClassType/setValue/setvalue004.java | 4 ++--
.../vmTestbase/nsk/jdi/ClassType/setValue/setvalue005.java | 4 ++--
.../nsk/jdi/LocalVariable/isVisible/isvisible001.java | 4 ++--
.../vmTestbase/nsk/jdi/Locatable/location/location001.java | 4 ++--
.../vmTestbase/nsk/jdi/Locatable/location/location004.java | 4 ++--
.../vmTestbase/nsk/jdi/Locatable/location/location005.java | 4 ++--
.../vmTestbase/nsk/jdi/Location/codeIndex/codeindex001.java | 4 ++--
.../nsk/jdi/Location/declaringType/declaringtype001.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/Location/equals/equals001.java | 4 ++--
.../vmTestbase/nsk/jdi/Location/hashCode/hashcode001.java | 4 ++--
.../vmTestbase/nsk/jdi/Location/lineNumber/linenumber001.java | 4 ++--
.../nsk/jdi/Location/lineNumber_s/linenumber_s001.java | 4 ++--
.../vmTestbase/nsk/jdi/Location/sourceName/sourcename001.java | 4 ++--
.../nsk/jdi/Location/sourceName_s/sourcename_s001.java | 4 ++--
.../vmTestbase/nsk/jdi/Location/sourcePath/sourcepath001.java | 4 ++--
.../nsk/jdi/Location/sourcePath_s/sourcepath_s001.java | 4 ++--
.../nsk/jdi/Method/allLineLocations/alllinelocations001.java | 4 ++--
.../nsk/jdi/Method/allLineLocations/alllinelocations002.java | 4 ++--
.../Method/allLineLocations_ss/alllinelocations_ss001.java | 4 ++--
.../Method/locationOfCodeIndex/locationofcodeindex001.java | 4 ++--
.../nsk/jdi/Method/locationsOfLine/locationsofline001.java | 4 ++--
.../Method/locationsOfLine_ssi/locationsofline_ssi001.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/Mirror/toString/tostring001.java | 4 ++--
.../nsk/jdi/Mirror/virtualMachine/virtualmachine001.java | 4 ++--
.../disableCollection/disablecollection001.java | 4 ++--
.../nsk/jdi/ObjectReference/entryCount/entrycount001.java | 4 ++--
.../vmTestbase/nsk/jdi/ObjectReference/equals/equals001.java | 4 ++--
.../nsk/jdi/ObjectReference/getValue/getvalue001.java | 4 ++--
.../nsk/jdi/ObjectReference/getValue/getvalue002.java | 4 ++--
.../nsk/jdi/ObjectReference/getValue/getvalue003.java | 4 ++--
.../nsk/jdi/ObjectReference/getValue/getvalue004.java | 4 ++--
.../nsk/jdi/ObjectReference/getValues/getvalues001.java | 4 ++--
.../nsk/jdi/ObjectReference/getValues/getvalues002.java | 4 ++--
.../nsk/jdi/ObjectReference/getValues/getvalues003.java | 4 ++--
.../nsk/jdi/ObjectReference/hashCode/hashcode001.java | 4 ++--
.../nsk/jdi/ObjectReference/invokeMethod/invokemethod001.java | 4 ++--
.../nsk/jdi/ObjectReference/isCollected/iscollected001.java | 4 ++--
.../nsk/jdi/ObjectReference/owningThread/owningthread001.java | 4 ++--
.../jdi/ObjectReference/referenceType/referencetype001.java | 4 ++--
.../jdi/ObjectReference/referenceType/referencetype002.java | 4 ++--
.../jdi/ObjectReference/referenceType/referencetype003.java | 4 ++--
.../jdi/ObjectReference/referenceType/referencetype004.java | 4 ++--
.../jdi/ObjectReference/referenceType/referencetype005.java | 4 ++--
.../jdi/ObjectReference/referenceType/referencetype006.java | 4 ++--
.../jdi/ObjectReference/referenceType/referencetype007.java | 4 ++--
.../nsk/jdi/ObjectReference/setValue/setvalue001.java | 4 ++--
.../nsk/jdi/ObjectReference/uniqueID/uniqueid001.java | 4 ++--
.../baseDirectory/directory001.java | 4 ++--
.../bootClassPath/bootpath001.java | 4 ++--
.../nsk/jdi/PrimitiveValue/doubleValue/doublevalue002.java | 4 ++--
.../ReferenceType/allLineLocations/alllinelocations001.java | 4 ++--
.../allLineLocations_ss/alllinelocations_ss001.java | 4 ++--
.../jdi/ReferenceType/availableStrata/availablestrata001.java | 4 ++--
.../jdi/ReferenceType/defaultStratum/defaultstratum001.java | 4 ++--
.../ReferenceType/locationsOfLine_i/locationsofline_i001.java | 4 ++--
.../locationsOfLine_ssi/locationsofline_ssi001.java | 4 ++--
.../nsk/jdi/ReferenceType/sourceNames/sourcenames001.java | 4 ++--
.../nsk/jdi/ReferenceType/sourcePaths/sourcepaths001.java | 4 ++--
.../vmTestbase/nsk/jdi/StackFrame/location/location001.java | 4 ++--
.../nsk/jdi/StackFrame/setValue/setvalue003/setvalue003.java | 4 ++--
.../nsk/jdi/StackFrame/thisObject/thisobject001.java | 4 ++--
.../nsk/jdi/StackFrame/thisObject/thisobject002.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/StackFrame/thread/thread001.java | 4 ++--
.../StackFrame/visibleVariableByName/visiblevarbyname001.java | 4 ++--
.../StackFrame/visibleVariableByName/visiblevarbyname002.java | 4 ++--
.../jdi/StackFrame/visibleVariables/visiblevariables001.java | 4 ++--
.../jdi/StackFrame/visibleVariables/visiblevariables002.java | 4 ++--
.../vmTestbase/nsk/jdi/ThreadGroupReference/name/name001.java | 4 ++--
.../nsk/jdi/ThreadGroupReference/parent/parent001.java | 4 ++--
.../nsk/jdi/ThreadGroupReference/resume/resume001.java | 4 ++--
.../nsk/jdi/ThreadGroupReference/suspend/suspend001.java | 4 ++--
.../ThreadGroupReference/threadGroups/threadgroups001.java | 4 ++--
.../nsk/jdi/ThreadGroupReference/threads/threads001.java | 4 ++--
.../ThreadReference/currentContendedMonitor/currentcm001.java | 4 ++--
.../vmTestbase/nsk/jdi/ThreadReference/frame/frame001.java | 4 ++--
.../nsk/jdi/ThreadReference/frameCount/framecount001.java | 4 ++--
.../vmTestbase/nsk/jdi/ThreadReference/frames/frames001.java | 4 ++--
.../nsk/jdi/ThreadReference/frames_ii/frames_ii001.java | 4 ++--
.../nsk/jdi/ThreadReference/frames_ii/frames_ii002.java | 4 ++--
.../nsk/jdi/ThreadReference/interrupt/interrupt001.java | 2 +-
.../jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001.java | 4 ++--
.../nsk/jdi/ThreadReference/isSuspended/issuspended002.java | 4 ++--
.../vmTestbase/nsk/jdi/ThreadReference/name/name001.java | 4 ++--
.../vmTestbase/nsk/jdi/ThreadReference/resume/resume001.java | 4 ++--
.../vmTestbase/nsk/jdi/ThreadReference/stop/stop001.java | 4 ++--
.../nsk/jdi/ThreadReference/suspend/suspend001.java | 4 ++--
.../nsk/jdi/ThreadReference/suspendCount/suspendcount001.java | 4 ++--
.../nsk/jdi/ThreadReference/threadGroup/threadgroup001.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/Value/_itself_/value001.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/Value/type/type002/type002.java | 4 ++--
.../nsk/jdi/VirtualMachine/allThreads/allthreads001.java | 4 ++--
.../VirtualMachine/canGetBytecodes/cangetbytecodes001.java | 4 ++--
.../canGetCurrentContendedMonitor/cangccm001.java | 4 ++--
.../canGetMonitorInfo/cangetmonitorinfo001.java | 4 ++--
.../VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001.java | 4 ++--
.../canGetSourceDebugExtension/cangetsde001.java | 4 ++--
.../canGetSyntheticAttribute/cangetattr001.java | 4 ++--
.../nsk/jdi/VirtualMachine/description/description001.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose001.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose004.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose005.java | 2 +-
.../nsk/jdi/VirtualMachine/eventQueue/eventqueue001.java | 4 ++--
.../VirtualMachine/eventRequestManager/eventrmanager001.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit001.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit002.java | 4 ++--
.../getDefaultStratum/getdefaultstratum001.java | 4 ++--
.../jtreg/vmTestbase/nsk/jdi/VirtualMachine/name/name001.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/process/process001.java | 4 ++--
.../setDefaultStratum/setdefaultstratum001.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/suspend/suspend001.java | 4 ++--
.../topLevelThreadGroups/toplevelgroups001.java | 4 ++--
.../vmTestbase/nsk/jdi/VirtualMachine/version/version001.java | 4 ++--
.../connectedVirtualMachines/convm001.java | 4 ++--
.../connectedVirtualMachines/convm002.java | 4 ++--
.../connectedVirtualMachines/convm003.java | 4 ++--
.../nsk/jdi/VoidValue/equals/equals001/equals001.java | 4 ++--
.../nsk/jdi/VoidValue/hashCode/hashcode001/hashcode001.java | 4 ++--
125 files changed, 248 insertions(+), 248 deletions(-)
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001.java
index 4b5023c92b5..d5d6e844430 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@ public class invokemethod001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("location001a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001.java
index 7121131fb20..daa9a055515 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -170,7 +170,7 @@ public class newinstance001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance002.java
index fa9a0ee42e9..4e1816553fa 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@ public class newinstance002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue001.java
index 50b922da99a..c106fb9b8f9 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class setvalue001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue002.java
index 53cf83cc054..dcc542e9757 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -150,7 +150,7 @@ public class setvalue002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue003.java
index 359b2f6c288..d590f664d7e 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue003.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -143,7 +143,7 @@ public class setvalue003 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue004.java
index d1f713b35f8..5e14fb6fa4b 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue004.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue004.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -135,7 +135,7 @@ public class setvalue004 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue005.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue005.java
index 4049cf5f30d..2a3d6ae46a7 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue005.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/setValue/setvalue005.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,7 @@ public class setvalue005 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/isVisible/isvisible001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/isVisible/isvisible001.java
index a9c33447685..9d5dba92c75 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/isVisible/isvisible001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/isVisible/isvisible001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@ public class isvisible001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location001.java
index eb866638863..5ccf4daf10a 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@ public class location001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("location001a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location004.java
index 2244b482bdf..cd13257cde0 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location004.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location004.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@ public class location004 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location005.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location005.java
index 8026a291753..c41331ea2ec 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location005.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location005.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@ public class location005 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/codeIndex/codeindex001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/codeIndex/codeindex001.java
index 45496e2d35e..f71934c0468 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/codeIndex/codeindex001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/codeIndex/codeindex001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@ public class codeindex001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/declaringType/declaringtype001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/declaringType/declaringtype001.java
index 814e721038f..484644e9773 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/declaringType/declaringtype001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/declaringType/declaringtype001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -137,7 +137,7 @@ public class declaringtype001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/equals/equals001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/equals/equals001.java
index e6b9a29f461..7c91c74a667 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/equals/equals001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/equals/equals001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -136,7 +136,7 @@ public class equals001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/hashCode/hashcode001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/hashCode/hashcode001.java
index a27efc606da..6ce0d7d1444 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/hashCode/hashcode001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/hashCode/hashcode001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -136,7 +136,7 @@ public class hashcode001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber/linenumber001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber/linenumber001.java
index f032c1b612e..c3effdf6ca5 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber/linenumber001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber/linenumber001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -129,7 +129,7 @@ public class linenumber001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber_s/linenumber_s001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber_s/linenumber_s001.java
index ede865ba146..eca38d521b9 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber_s/linenumber_s001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/lineNumber_s/linenumber_s001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ public class linenumber_s001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName/sourcename001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName/sourcename001.java
index 0918f7e2ad6..8b8f08e3d56 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName/sourcename001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName/sourcename001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -135,7 +135,7 @@ public class sourcename001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName_s/sourcename_s001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName_s/sourcename_s001.java
index 0146c1608fd..2770989b0f2 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName_s/sourcename_s001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourceName_s/sourcename_s001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@ public class sourcename_s001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath/sourcepath001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath/sourcepath001.java
index 4244bfb03bb..a50fa645ca7 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath/sourcepath001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath/sourcepath001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class sourcepath001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath_s/sourcepath_s001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath_s/sourcepath_s001.java
index c118d88e325..b2201c2bd53 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath_s/sourcepath_s001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Location/sourcePath_s/sourcepath_s001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class sourcepath_s001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations001.java
index fb414a818c1..f20181e8381 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,7 @@ public class alllinelocations001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations002.java
index 4c930d67b87..982b25b12ef 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations/alllinelocations002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -127,7 +127,7 @@ public class alllinelocations002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations_ss/alllinelocations_ss001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations_ss/alllinelocations_ss001.java
index fb1704acf15..0970bdfab26 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations_ss/alllinelocations_ss001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/allLineLocations_ss/alllinelocations_ss001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -127,7 +127,7 @@ public class alllinelocations_ss001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationOfCodeIndex/locationofcodeindex001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationOfCodeIndex/locationofcodeindex001.java
index 94a9e7f4c57..932c9db718b 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationOfCodeIndex/locationofcodeindex001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationOfCodeIndex/locationofcodeindex001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class locationofcodeindex001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine/locationsofline001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine/locationsofline001.java
index 7b068c0537d..a186fe08397 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine/locationsofline001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine/locationsofline001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,7 @@ public class locationsofline001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsofline_ssi001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsofline_ssi001.java
index 96d54ca02d3..23f8e7fb7ed 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsofline_ssi001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsofline_ssi001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@ public class locationsofline_ssi001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/toString/tostring001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/toString/tostring001.java
index d30aa02dcc0..34430a1d25e 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/toString/tostring001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/toString/tostring001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@ public class tostring001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/virtualMachine/virtualmachine001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/virtualMachine/virtualmachine001.java
index d87f3b49a49..9a9d48139bb 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/virtualMachine/virtualmachine001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Mirror/virtualMachine/virtualmachine001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@ public class virtualmachine001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/disableCollection/disablecollection001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/disableCollection/disablecollection001.java
index 6b39a826dc7..4b3d05c0ba2 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/disableCollection/disablecollection001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/disableCollection/disablecollection001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@ public class disablecollection001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/entryCount/entrycount001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/entryCount/entrycount001.java
index d0611900c49..e5ebcdf1947 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/entryCount/entrycount001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/entryCount/entrycount001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@ public class entrycount001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/equals/equals001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/equals/equals001.java
index 17114974c6b..be7a3bd8bf2 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/equals/equals001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/equals/equals001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@ public class equals001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue001.java
index 78e1025d742..99ba34ca25b 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -154,7 +154,7 @@ public class getvalue001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue002.java
index 1b2823d67af..dfab92cd3c5 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -158,7 +158,7 @@ public class getvalue002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue003.java
index a7b5c7b76d6..07ea746db4f 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue003.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -135,7 +135,7 @@ public class getvalue003 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue004.java
index 5738559236a..e0ee7ba4b99 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue004.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue004.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -135,7 +135,7 @@ public class getvalue004 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues001.java
index 6ce38a9093f..7a942a4bfed 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class getvalues001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues002.java
index 66ad17e7cfd..20519e40824 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class getvalues002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues003.java
index b3570ee878f..07599022a17 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValues/getvalues003.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@ public class getvalues003{
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/hashCode/hashcode001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/hashCode/hashcode001.java
index 4c11d1c4fd4..44b424ce012 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/hashCode/hashcode001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/hashCode/hashcode001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@ public class hashcode001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod001.java
index 3d7deae4328..381703f5983 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -162,7 +162,7 @@ public class invokemethod001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/isCollected/iscollected001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/isCollected/iscollected001.java
index 2463fbfa27f..0d4c20dcbad 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/isCollected/iscollected001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/isCollected/iscollected001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,7 @@ public class iscollected001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread001.java
index ea173534720..6f1260d23a8 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -136,7 +136,7 @@ public class owningthread001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype001.java
index 7ce032b664d..fe644433874 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class referencetype001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype002.java
index 4ef42b72d1e..1cb532f088f 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -137,7 +137,7 @@ public class referencetype002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype003.java
index 93b6c27b15c..92755a1f9a2 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype003.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -137,7 +137,7 @@ public class referencetype003 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype004.java
index 57c93a4d16f..1c6e4508745 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype004.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype004.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -138,7 +138,7 @@ public class referencetype004 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype005.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype005.java
index 812493427dd..dfcc40188a2 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype005.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype005.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class referencetype005 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype006.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype006.java
index afced747cf2..f47a33c3122 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype006.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype006.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class referencetype006 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype007.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype007.java
index b7a5604ff15..fac06204a2e 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype007.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referenceType/referencetype007.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -138,7 +138,7 @@ public class referencetype007 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue001.java
index a8d975b14b6..9abde1197a1 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@ public class setvalue001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/uniqueID/uniqueid001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/uniqueID/uniqueid001.java
index 22d6546ed11..ad5e91ed09f 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/uniqueID/uniqueid001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/uniqueID/uniqueid001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@ public class uniqueid001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/baseDirectory/directory001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/baseDirectory/directory001.java
index e9f45a67b32..52bed498021 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/baseDirectory/directory001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/baseDirectory/directory001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ public class directory001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/bootClassPath/bootpath001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/bootClassPath/bootpath001.java
index 26c826a51f7..7c63fc918c5 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/bootClassPath/bootpath001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/bootClassPath/bootpath001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,7 @@ public class bootpath001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PrimitiveValue/doubleValue/doublevalue002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PrimitiveValue/doubleValue/doublevalue002.java
index e134c9316fc..4b5faa73119 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PrimitiveValue/doubleValue/doublevalue002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PrimitiveValue/doubleValue/doublevalue002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ public class doublevalue002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations/alllinelocations001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations/alllinelocations001.java
index f38a6b23fdd..5664a332d8b 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations/alllinelocations001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations/alllinelocations001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,7 @@ public class alllinelocations001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/alllinelocations_ss001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/alllinelocations_ss001.java
index 9672ba1f813..d5dc58b9432 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/alllinelocations_ss001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/alllinelocations_ss001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ public class alllinelocations_ss001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/availableStrata/availablestrata001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/availableStrata/availablestrata001.java
index ff5c08b2614..deffb640805 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/availableStrata/availablestrata001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/availableStrata/availablestrata001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@ public class availablestrata001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/defaultStratum/defaultstratum001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/defaultStratum/defaultstratum001.java
index 68be4efc6d7..0fc565751fb 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/defaultStratum/defaultstratum001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/defaultStratum/defaultstratum001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class defaultstratum001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_i/locationsofline_i001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_i/locationsofline_i001.java
index 356d1c0ee5b..bbec3a46158 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_i/locationsofline_i001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_i/locationsofline_i001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -127,7 +127,7 @@ public class locationsofline_i001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsofline_ssi001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsofline_ssi001.java
index 849b6d50777..9816e45900c 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsofline_ssi001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsofline_ssi001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class locationsofline_ssi001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourcenames001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourcenames001.java
index 2871d7134c5..0163b4fed15 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourcenames001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourcenames001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@ public class sourcenames001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcepaths001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcepaths001.java
index 7961d33699e..b7b2b5922b9 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcepaths001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcepaths001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@ public class sourcepaths001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/location/location001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/location/location001.java
index 10da14bfd46..62251b89c9e 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/location/location001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/location/location001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -160,7 +160,7 @@ public class location001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("location001a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue003/setvalue003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue003/setvalue003.java
index cced0e3b6e6..cd1a7fc14be 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue003/setvalue003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue003/setvalue003.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -247,7 +247,7 @@ public class setvalue003 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject001.java
index 88bbe8ade80..fd27c4297c5 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -156,7 +156,7 @@ public class thisobject001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject002.java
index c6429cd6d1d..054e273cede 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,7 @@ public class thisobject002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thread/thread001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thread/thread001.java
index 1c0389e6042..616048d618a 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thread/thread001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thread/thread001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@ public class thread001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("location001a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname001.java
index eb53cb45ee4..33af470b981 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -158,7 +158,7 @@ public class visiblevarbyname001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname002.java
index d4390327881..25e5f9d452a 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -149,7 +149,7 @@ public class visiblevarbyname002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables001.java
index 2cf89f29d51..471a213b86f 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@ public class visiblevariables001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables002.java
index 2a9693baa3a..16feb11b013 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -150,7 +150,7 @@ public class visiblevariables002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/name/name001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/name/name001.java
index ea71477890e..0d928783ead 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/name/name001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/name/name001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -154,7 +154,7 @@ public class name001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/parent/parent001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/parent/parent001.java
index 88029ff011f..02deb3031bf 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/parent/parent001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/parent/parent001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -156,7 +156,7 @@ public class parent001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/resume/resume001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/resume/resume001.java
index 98e93f6d4c5..348c5c9447f 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/resume/resume001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/resume/resume001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@ public class resume001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/suspend/suspend001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/suspend/suspend001.java
index f837b6273e6..637aedccc44 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/suspend/suspend001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/suspend/suspend001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@ public class suspend001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threadGroups/threadgroups001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threadGroups/threadgroups001.java
index fff2e4452bc..d66d8f500b4 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threadGroups/threadgroups001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threadGroups/threadgroups001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -151,7 +151,7 @@ public class threadgroups001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threads/threads001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threads/threads001.java
index f9c6ef75346..872fe114925 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threads/threads001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadGroupReference/threads/threads001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -151,7 +151,7 @@ public class threads001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/currentContendedMonitor/currentcm001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/currentContendedMonitor/currentcm001.java
index 6033e10f9bf..b1d2c5b00fa 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/currentContendedMonitor/currentcm001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/currentContendedMonitor/currentcm001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -144,7 +144,7 @@ public class currentcm001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frame/frame001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frame/frame001.java
index d2ca672840e..337b38e28fe 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frame/frame001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frame/frame001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -170,7 +170,7 @@ public class frame001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frameCount/framecount001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frameCount/framecount001.java
index 421f4d1d5be..fe36b643e45 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frameCount/framecount001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frameCount/framecount001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -161,7 +161,7 @@ public class framecount001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames/frames001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames/frames001.java
index 371259bf661..cc75403caf6 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames/frames001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames/frames001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -175,7 +175,7 @@ public class frames001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii001.java
index f6545c2900a..7196e9b464c 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -176,7 +176,7 @@ public class frames_ii001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii002.java
index fccd88a299e..1a7a28f86c5 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@ public class frames_ii002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001.java
index a24d0c75c64..8598df31f67 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001.java
@@ -153,7 +153,7 @@ public class interrupt001 {
pipe = debuggee.createIOPipe();
debuggee.redirectStderr(out);
- log2("interrupt002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
try {
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001.java
index 99491e0ac97..61b7b7e5207 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@ public class isatbreakpoint001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002.java
index 7265b49891b..bc9e860a053 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@ public class issuspended002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/name/name001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/name/name001.java
index b493b04fa40..bd1b2b3f32f 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/name/name001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/name/name001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@ public class name001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/resume/resume001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/resume/resume001.java
index 58ab1a1c4c2..df7e338b186 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/resume/resume001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/resume/resume001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@ public class resume001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/stop/stop001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/stop/stop001.java
index 4b911b9c9d2..5dafaecb743 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/stop/stop001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/stop/stop001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -154,7 +154,7 @@ public class stop001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspend/suspend001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspend/suspend001.java
index ff6038e7f8d..ec85df6b8b3 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspend/suspend001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspend/suspend001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@ public class suspend001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspendCount/suspendcount001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspendCount/suspendcount001.java
index b9e1babdef2..b3678efb96a 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspendCount/suspendcount001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspendCount/suspendcount001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@ public class suspendcount001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/threadGroup/threadgroup001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/threadGroup/threadgroup001.java
index 1e28a71b542..d6443894715 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/threadGroup/threadgroup001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/threadGroup/threadgroup001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -161,7 +161,7 @@ public class threadgroup001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/_itself_/value001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/_itself_/value001.java
index 10b56b0b9bd..22a70e3e047 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/_itself_/value001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/_itself_/value001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -146,7 +146,7 @@ public class value001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/type/type002/type002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/type/type002/type002.java
index eef6e254b6f..d3c6ce7e77c 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/type/type002/type002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Value/type/type002/type002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -196,7 +196,7 @@ public class type002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001.java
index 160c167857a..c150bb2c897 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,7 @@ public class allthreads001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("location001a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetBytecodes/cangetbytecodes001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetBytecodes/cangetbytecodes001.java
index 28150c40e6c..136a7bc6a9c 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetBytecodes/cangetbytecodes001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetBytecodes/cangetbytecodes001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@ public class cangetbytecodes001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001.java
index ef952d40baf..ba7adb4306d 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -151,7 +151,7 @@ public class cangccm001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001.java
index 0ed84379297..e6df399d448 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@ public class cangetmonitorinfo001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001.java
index f5f0ddafe2a..36d09e2c1c4 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -151,7 +151,7 @@ public class cangetinfo001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSourceDebugExtension/cangetsde001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSourceDebugExtension/cangetsde001.java
index c066b52031e..3409b9f4a57 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSourceDebugExtension/cangetsde001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSourceDebugExtension/cangetsde001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -123,7 +123,7 @@ public class cangetsde001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSyntheticAttribute/cangetattr001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSyntheticAttribute/cangetattr001.java
index a84bea5e342..0b9d413e64b 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSyntheticAttribute/cangetattr001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetSyntheticAttribute/cangetattr001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@ public class cangetattr001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/description/description001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/description/description001.java
index 44cb99fd423..f64a028a2ee 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/description/description001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/description/description001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ public class description001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose001.java
index f2c6030b188..cfb22e400ac 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@ public class dispose001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002.java
index f0350242bc4..90f9651c999 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -150,7 +150,7 @@ public class dispose002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003.java
index 2dfa63c8466..855ea9634e1 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -143,7 +143,7 @@ public class dispose003 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose004.java
index 9b061269a7d..3604a0ee822 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose004.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose004.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -144,7 +144,7 @@ public class dispose004 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose005.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose005.java
index 1ad0414ca8c..ed4dfd1a815 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose005.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose005.java
@@ -192,7 +192,7 @@ public class dispose005 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventQueue/eventqueue001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventQueue/eventqueue001.java
index a7b0863989a..7ad965372d1 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventQueue/eventqueue001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventQueue/eventqueue001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@ public class eventqueue001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventRequestManager/eventrmanager001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventRequestManager/eventrmanager001.java
index da3484d5e55..804485f3c7b 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventRequestManager/eventrmanager001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/eventRequestManager/eventrmanager001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@ public class eventrmanager001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit001.java
index 79ad6f2e42e..95309fa0284 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -136,7 +136,7 @@ public class exit001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit002.java
index d63b13519da..f848ad89afe 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/exit/exit002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -135,7 +135,7 @@ public class exit002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/getDefaultStratum/getdefaultstratum001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/getDefaultStratum/getdefaultstratum001.java
index a36f5eee74a..d13cf01f8e3 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/getDefaultStratum/getdefaultstratum001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/getDefaultStratum/getdefaultstratum001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class getdefaultstratum001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/name/name001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/name/name001.java
index 148ada355ef..ba373bd76db 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/name/name001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/name/name001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ public class name001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/process/process001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/process/process001.java
index a744c49f6af..1e9efa792b0 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/process/process001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/process/process001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class process001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setdefaultstratum001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setdefaultstratum001.java
index 99263fb0695..3bb646db69d 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setdefaultstratum001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setdefaultstratum001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class setdefaultstratum001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/suspend/suspend001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/suspend/suspend001.java
index c263333bce0..b03b8b89fb5 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/suspend/suspend001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/suspend/suspend001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,7 @@ public class suspend001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/topLevelThreadGroups/toplevelgroups001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/topLevelThreadGroups/toplevelgroups001.java
index 022cd43cb70..25abf9badc8 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/topLevelThreadGroups/toplevelgroups001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/topLevelThreadGroups/toplevelgroups001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public class toplevelgroups001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/version/version001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/version/version001.java
index cbd1220561a..55553e64857 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/version/version001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/version/version001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ public class version001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm001.java
index a1ab73fefa4..82e71b3796b 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -143,7 +143,7 @@ public class convm001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm002.java
index 841bb370eaa..5ba9cb19f53 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm002.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -145,7 +145,7 @@ public class convm002 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm003.java
index 4b53a61d03e..ca4700b54c0 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm003.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@ public class convm003 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("issuspended002a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/equals/equals001/equals001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/equals/equals001/equals001.java
index 97b07c7383d..281bdfa30c0 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/equals/equals001/equals001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/equals/equals001/equals001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@ public class equals001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/hashCode/hashcode001/hashcode001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/hashCode/hashcode001/hashcode001.java
index 213c8cb37b4..4d6b5f4cf25 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/hashCode/hashcode001/hashcode001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidValue/hashCode/hashcode001/hashcode001.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@ public class hashcode001 {
IOPipe pipe = new IOPipe(debuggee);
debuggee.redirectStderr(out);
- log2("setvalue003a debuggee launched");
+ log2(debuggeeName + " debuggee launched");
debuggee.resume();
String line = pipe.readln();
From a38277e67bc65532e89f5abaaec38f8321f0b906 Mon Sep 17 00:00:00 2001
From: Yasumasa Suenaga
Date: Thu, 21 Feb 2019 21:02:39 +0900
Subject: [PATCH 063/109] 8219414: SA: jhsdb jsnap throws
UnmappedAddressException with core generated by gcore
Reviewed-by: cjplummer, jgeorge
---
src/hotspot/os/linux/globals_linux.hpp | 7 ++++++-
src/hotspot/os/linux/os_linux.cpp | 15 ++++++++-------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/hotspot/os/linux/globals_linux.hpp b/src/hotspot/os/linux/globals_linux.hpp
index cef31620f3b..8a30e25f855 100644
--- a/src/hotspot/os/linux/globals_linux.hpp
+++ b/src/hotspot/os/linux/globals_linux.hpp
@@ -70,7 +70,12 @@
diagnostic(bool, DumpPrivateMappingsInCore, true, \
"If true, sets bit 2 of /proc/PID/coredump_filter, thus " \
"resulting in file-backed private mappings of the process to "\
- "be dumped into the corefile, if UseSharedSpaces is true.") \
+ "be dumped into the corefile.") \
+ \
+ diagnostic(bool, DumpSharedMappingsInCore, true, \
+ "If true, sets bit 3 of /proc/PID/coredump_filter, thus " \
+ "resulting in file-backed shared mappings of the process to " \
+ "be dumped into the corefile.") \
\
diagnostic(bool, UseCpuAllocPath, false, \
"Use CPU_ALLOC code path in os::active_processor_count ")
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index 9244cbbae6c..1a485a94f75 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -131,6 +131,7 @@
enum CoredumpFilterBit {
FILE_BACKED_PVT_BIT = 1 << 2,
+ FILE_BACKED_SHARED_BIT = 1 << 3,
LARGEPAGES_BIT = 1 << 6,
DAX_SHARED_BIT = 1 << 8
};
@@ -1357,8 +1358,8 @@ void os::shutdown() {
void os::abort(bool dump_core, void* siginfo, const void* context) {
os::shutdown();
if (dump_core) {
-#if INCLUDE_CDS
- if (UseSharedSpaces && DumpPrivateMappingsInCore) {
+#ifndef ZERO
+ if (DumpPrivateMappingsInCore) {
ClassLoader::close_jrt_image();
}
#endif
@@ -3432,8 +3433,6 @@ bool os::Linux::hugetlbfs_sanity_check(bool warn, size_t page_size) {
return result;
}
-// Set the coredump_filter bits to include largepages in core dump (bit 6)
-//
// From the coredump_filter documentation:
//
// - (bit 0) anonymous private memory
@@ -5131,11 +5130,13 @@ jint os::init_2(void) {
set_coredump_filter(DAX_SHARED_BIT);
}
-#if INCLUDE_CDS
- if (UseSharedSpaces && DumpPrivateMappingsInCore) {
+ if (DumpPrivateMappingsInCore) {
set_coredump_filter(FILE_BACKED_PVT_BIT);
}
-#endif
+
+ if (DumpSharedMappingsInCore) {
+ set_coredump_filter(FILE_BACKED_SHARED_BIT);
+ }
return JNI_OK;
}
From ace0b7a8039c0a7fcf499335be4f388e3915393e Mon Sep 17 00:00:00 2001
From: Aleksey Shipilev
Date: Thu, 21 Feb 2019 15:52:42 +0100
Subject: [PATCH 064/109] 8219524: Shenandoah misreports "committed" size in
MemoryMXBean
Reviewed-by: rkennke, zgu
---
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp | 4 ++++
src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp | 1 +
src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp | 8 +++++++-
.../jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java | 6 ++++++
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
index 2161eebb715..d594503d51f 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
@@ -2639,6 +2639,10 @@ GrowableArray ShenandoahHeap::memory_pools() {
return memory_pools;
}
+MemoryUsage ShenandoahHeap::memory_usage() {
+ return _memory_pool->get_memory_usage();
+}
+
void ShenandoahHeap::enter_evacuation() {
_oom_evac_handler.enter_evacuation();
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
index cf4edaa562e..56ce8b5d213 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
@@ -511,6 +511,7 @@ public:
GrowableArray memory_managers();
GrowableArray memory_pools();
+ MemoryUsage memory_usage();
GCTracer* tracer();
GCTimer* gc_timer() const;
CollectorPolicy* collector_policy() const;
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp
index 36071ef6d40..135459e5718 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp
@@ -26,7 +26,7 @@
ShenandoahMemoryPool::ShenandoahMemoryPool(ShenandoahHeap* heap) :
CollectedMemoryPool("Shenandoah",
- heap->capacity(),
+ heap->initial_capacity(),
heap->max_capacity(),
true /* support_usage_threshold */),
_heap(heap) {}
@@ -37,9 +37,15 @@ MemoryUsage ShenandoahMemoryPool::get_memory_usage() {
size_t used = used_in_bytes();
size_t committed = _heap->committed();
+ // These asserts can never fail: max is stable, and all updates to other values never overflow max.
assert(initial <= max, "initial: " SIZE_FORMAT ", max: " SIZE_FORMAT, initial, max);
assert(used <= max, "used: " SIZE_FORMAT ", max: " SIZE_FORMAT, used, max);
assert(committed <= max, "committed: " SIZE_FORMAT ", max: " SIZE_FORMAT, committed, max);
+
+ // Committed and used are updated concurrently and independently. They can momentarily break
+ // the assert below, which would also fail in downstream code. To avoid that, adjust values
+ // to make sense under the race. See JDK-8207200.
+ committed = MAX2(used, committed);
assert(used <= committed, "used: " SIZE_FORMAT ", committed: " SIZE_FORMAT, used, committed);
return MemoryUsage(initial, used, committed, max);
diff --git a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java
index 0d6647eeec5..d27d57cacd9 100644
--- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java
+++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java
@@ -52,8 +52,10 @@ public class TestMemoryMXBeans {
public static void testMemoryBean(long initSize, long maxSize) {
MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
long heapInit = memoryMXBean.getHeapMemoryUsage().getInit();
+ long heapCommitted = memoryMXBean.getHeapMemoryUsage().getCommitted();
long heapMax = memoryMXBean.getHeapMemoryUsage().getMax();
long nonHeapInit = memoryMXBean.getNonHeapMemoryUsage().getInit();
+ long nonHeapCommitted = memoryMXBean.getNonHeapMemoryUsage().getCommitted();
long nonHeapMax = memoryMXBean.getNonHeapMemoryUsage().getMax();
if (initSize > 0 && heapInit != initSize) {
@@ -62,5 +64,9 @@ public class TestMemoryMXBeans {
if (maxSize > 0 && heapMax != maxSize) {
throw new IllegalStateException("Max heap size is wrong: " + heapMax + " vs " + maxSize);
}
+ if (initSize > 0 && maxSize > 0 && initSize != maxSize && heapCommitted == heapMax) {
+ throw new IllegalStateException("Init committed heap size is wrong: " + heapCommitted +
+ " (init: " + initSize + ", max: " + maxSize + ")");
+ }
}
}
From e84f0388f59dd1a24481d766191e1e365eae693f Mon Sep 17 00:00:00 2001
From: Coleen Phillimore
Date: Thu, 21 Feb 2019 09:21:21 -0500
Subject: [PATCH 065/109] 8153413: Exceptions::_throw always logs exceptions,
penalizing performance
Construct exception string into Event message directly add if (log_is_enabled) for logging.
Reviewed-by: ysuenaga, dholmes
---
src/hotspot/share/utilities/events.cpp | 21 +++++++++++++++++++--
src/hotspot/share/utilities/events.hpp | 17 ++++++++++++++++-
src/hotspot/share/utilities/exceptions.cpp | 10 ++++------
3 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/src/hotspot/share/utilities/events.cpp b/src/hotspot/share/utilities/events.cpp
index bdd0a7ae29d..e4b80ac65ef 100644
--- a/src/hotspot/share/utilities/events.cpp
+++ b/src/hotspot/share/utilities/events.cpp
@@ -36,7 +36,7 @@
EventLog* Events::_logs = NULL;
StringEventLog* Events::_messages = NULL;
-ExtendedStringEventLog* Events::_exceptions = NULL;
+ExceptionsEventLog* Events::_exceptions = NULL;
StringEventLog* Events::_redefinitions = NULL;
UnloadingEventLog* Events::_class_unloading = NULL;
StringEventLog* Events::_deopt_messages = NULL;
@@ -67,7 +67,7 @@ void Events::print() {
void Events::init() {
if (LogEvents) {
_messages = new StringEventLog("Events");
- _exceptions = new ExtendedStringEventLog("Internal exceptions");
+ _exceptions = new ExceptionsEventLog("Internal exceptions");
_redefinitions = new StringEventLog("Classes redefined");
_class_unloading = new UnloadingEventLog("Classes unloaded");
_deopt_messages = new StringEventLog("Deoptimization events");
@@ -112,3 +112,20 @@ void UnloadingEventLog::log(Thread* thread, InstanceKlass* ik) {
st.print("Unloading class " INTPTR_FORMAT " ", p2i(ik));
ik->name()->print_value_on(&st);
}
+
+void ExceptionsEventLog::log(Thread* thread, Handle h_exception, const char* message, const char* file, int line) {
+ if (!should_log()) return;
+
+ double timestamp = fetch_timestamp();
+ MutexLockerEx ml(&_mutex, Mutex::_no_safepoint_check_flag);
+ int index = compute_log_index();
+ _records[index].thread = thread;
+ _records[index].timestamp = timestamp;
+ stringStream st = _records[index].data.stream();
+ st.print("Exception <");
+ h_exception->print_value_on(&st);
+ st.print("%s%s> (" INTPTR_FORMAT ") \n"
+ "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
+ message ? ": " : "", message ? message : "",
+ p2i(h_exception()), file, line, p2i(thread));
+}
diff --git a/src/hotspot/share/utilities/events.hpp b/src/hotspot/share/utilities/events.hpp
index e32b410f23e..14a5833d73f 100644
--- a/src/hotspot/share/utilities/events.hpp
+++ b/src/hotspot/share/utilities/events.hpp
@@ -183,6 +183,14 @@ class UnloadingEventLog : public EventLogBase {
void log(Thread* thread, InstanceKlass* ik);
};
+// Event log for exceptions
+class ExceptionsEventLog : public ExtendedStringEventLog {
+ public:
+ ExceptionsEventLog(const char* name, int count = LogEventsBufferEntries) : ExtendedStringEventLog(name, count) {}
+
+ void log(Thread* thread, Handle h_exception, const char* message, const char* file, int line);
+};
+
class Events : AllStatic {
friend class EventLog;
@@ -195,7 +203,7 @@ class Events : AllStatic {
// A log for internal exception related messages, like internal
// throws and implicit exceptions.
- static ExtendedStringEventLog* _exceptions;
+ static ExceptionsEventLog* _exceptions;
// Deoptization related messages
static StringEventLog* _deopt_messages;
@@ -216,6 +224,7 @@ class Events : AllStatic {
// Log exception related message
static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ static void log_exception(Thread* thread, Handle h_exception, const char* message, const char* file, int line);
static void log_redefinition(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
@@ -245,6 +254,12 @@ inline void Events::log_exception(Thread* thread, const char* format, ...) {
}
}
+inline void Events::log_exception(Thread* thread, Handle h_exception, const char* message, const char* file, int line) {
+ if (LogEvents) {
+ _exceptions->log(thread, h_exception, message, file, line);
+ }
+}
+
inline void Events::log_redefinition(Thread* thread, const char* format, ...) {
if (LogEvents) {
va_list ap;
diff --git a/src/hotspot/share/utilities/exceptions.cpp b/src/hotspot/share/utilities/exceptions.cpp
index 95e1cd6a2c0..99f3acc72ab 100644
--- a/src/hotspot/share/utilities/exceptions.cpp
+++ b/src/hotspot/share/utilities/exceptions.cpp
@@ -131,15 +131,17 @@ void Exceptions::_throw_oop(Thread* thread, const char* file, int line, oop exce
}
void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {
- ResourceMark rm;
+ ResourceMark rm(thread);
assert(h_exception() != NULL, "exception should not be NULL");
// tracing (do this up front - so it works during boot strapping)
+ // Note, the print_value_string() argument is not called unless logging is enabled!
log_info(exceptions)("Exception <%s%s%s> (" INTPTR_FORMAT ") \n"
"thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
h_exception->print_value_string(),
message ? ": " : "", message ? message : "",
p2i(h_exception()), file, line, p2i(thread));
+
// for AbortVMOnException flag
Exceptions::debug_check_abort(h_exception, message);
@@ -162,11 +164,7 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc
thread->set_pending_exception(h_exception(), file, line);
// vm log
- if (LogEvents){
- Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]",
- h_exception->print_value_string(), message ? ": " : "", message ? message : "",
- p2i(h_exception()), file, line);
- }
+ Events::log_exception(thread, h_exception, message, file, line);
}
From 7fd7a118da90a88e883465512f9ee24ea6a04332 Mon Sep 17 00:00:00 2001
From: Roland Westrelin
Date: Mon, 18 Feb 2019 17:41:31 +0100
Subject: [PATCH 066/109] 8219335: "failed: unexpected type" assert failure in
ConnectionGraph::split_unique_types() with unsafe accesses
Reviewed-by: thartmann, kvn
---
src/hotspot/share/opto/escape.cpp | 12 +++
.../MaybeOffHeapUnsafeAccessToNewObject.java | 74 +++++++++++++++++++
2 files changed, 86 insertions(+)
create mode 100644 test/hotspot/jtreg/compiler/unsafe/MaybeOffHeapUnsafeAccessToNewObject.java
diff --git a/src/hotspot/share/opto/escape.cpp b/src/hotspot/share/opto/escape.cpp
index 4be774f0e4d..483fe63e7da 100644
--- a/src/hotspot/share/opto/escape.cpp
+++ b/src/hotspot/share/opto/escape.cpp
@@ -1726,6 +1726,18 @@ void ConnectionGraph::adjust_scalar_replaceable_state(JavaObjectNode* jobj) {
// access its field since the field value is unknown after it.
//
Node* n = field->ideal_node();
+
+ // Test for an unsafe access that was parsed as maybe off heap
+ // (with a CheckCastPP to raw memory).
+ assert(n->is_AddP(), "expect an address computation");
+ if (n->in(AddPNode::Base)->is_top() &&
+ n->in(AddPNode::Address)->Opcode() == Op_CheckCastPP) {
+ assert(n->in(AddPNode::Address)->bottom_type()->isa_rawptr(), "raw address so raw cast expected");
+ assert(_igvn->type(n->in(AddPNode::Address)->in(1))->isa_oopptr(), "cast pattern at unsafe access expected");
+ jobj->set_scalar_replaceable(false);
+ return;
+ }
+
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
Node* u = n->fast_out(i);
if (u->is_LoadStore() || (u->is_Mem() && u->as_Mem()->is_mismatched_access())) {
diff --git a/test/hotspot/jtreg/compiler/unsafe/MaybeOffHeapUnsafeAccessToNewObject.java b/test/hotspot/jtreg/compiler/unsafe/MaybeOffHeapUnsafeAccessToNewObject.java
new file mode 100644
index 00000000000..a866bdf0e5d
--- /dev/null
+++ b/test/hotspot/jtreg/compiler/unsafe/MaybeOffHeapUnsafeAccessToNewObject.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2019, 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 8219335
+ * @summary "failed: unexpected type" assert failure in ConnectionGraph::split_unique_types() with unsafe accesses
+ *
+ * @modules java.base/jdk.internal.misc
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation -Xcomp -XX:CompileOnly=MaybeOffHeapUnsafeAccessToNewObject::test1 -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline MaybeOffHeapUnsafeAccessToNewObject
+ */
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+public class MaybeOffHeapUnsafeAccessToNewObject {
+ public volatile int f_int = -1;
+
+
+ public static Unsafe unsafe = Unsafe.getUnsafe();
+ public static final long f_int_off;
+
+ static {
+ Field f_int_field = null;
+ try {
+ f_int_field = MaybeOffHeapUnsafeAccessToNewObject.class.getField("f_int");
+ } catch (Exception e) {
+ System.out.println("reflection failed " + e);
+ e.printStackTrace();
+ }
+ f_int_off = unsafe.objectFieldOffset(f_int_field);
+ }
+
+ static public void main(String[] args) {
+ MaybeOffHeapUnsafeAccessToNewObject o = new MaybeOffHeapUnsafeAccessToNewObject();
+ test1();
+ }
+
+ static Object test1_helper1(Object t) {
+ return t;
+ }
+
+ static long test1_helper2(long off) {
+ return off;
+ }
+
+ static int test1() {
+ MaybeOffHeapUnsafeAccessToNewObject t = new MaybeOffHeapUnsafeAccessToNewObject();
+ Object o = test1_helper1(t);
+ long off = test1_helper2(f_int_off);
+ return unsafe.getInt(o, off);
+ }
+
+}
From e58a4da301c6a7216fbefff7836f9837019e26dc Mon Sep 17 00:00:00 2001
From: Daniel Fuchs
Date: Thu, 21 Feb 2019 16:57:47 +0000
Subject: [PATCH 067/109] 8216363: NullPointerException in
java.util.logging.Handler#isLoggable
The implementation is changed to match the spec: isLoggable(null) returns false.
Reviewed-by: mchung, lancea
---
.../classes/java/util/logging/Handler.java | 5 +-
.../java/util/logging/MemoryHandler.java | 4 +-
.../java/util/logging/StreamHandler.java | 4 +-
.../util/logging/IsLoggableHandlerTest.java | 96 +++++++++++++++++++
4 files changed, 103 insertions(+), 6 deletions(-)
create mode 100644 test/jdk/java/util/logging/IsLoggableHandlerTest.java
diff --git a/src/java.logging/share/classes/java/util/logging/Handler.java b/src/java.logging/share/classes/java/util/logging/Handler.java
index 635bcf01fd2..9a4a595dbef 100644
--- a/src/java.logging/share/classes/java/util/logging/Handler.java
+++ b/src/java.logging/share/classes/java/util/logging/Handler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -329,12 +329,13 @@ public abstract class Handler {
* handler from logging the {@code LogRecord}. It will return false if
* the {@code LogRecord} is null.
*
- * @param record a {@code LogRecord}
+ * @param record a {@code LogRecord} (may be null).
* @return true if the {@code LogRecord} would be logged.
*
*/
public boolean isLoggable(LogRecord record) {
final int levelValue = getLevel().intValue();
+ if (record == null) return false;
if (record.getLevel().intValue() < levelValue || levelValue == offValue) {
return false;
}
diff --git a/src/java.logging/share/classes/java/util/logging/MemoryHandler.java b/src/java.logging/share/classes/java/util/logging/MemoryHandler.java
index 34053937630..9807fd87c91 100644
--- a/src/java.logging/share/classes/java/util/logging/MemoryHandler.java
+++ b/src/java.logging/share/classes/java/util/logging/MemoryHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -270,7 +270,7 @@ public class MemoryHandler extends Handler {
* check whether the {@code LogRecord} would result in a "push" of the
* buffer contents. It will return false if the {@code LogRecord} is null.
*
- * @param record a {@code LogRecord}
+ * @param record a {@code LogRecord} (may be null).
* @return true if the {@code LogRecord} would be logged.
*
*/
diff --git a/src/java.logging/share/classes/java/util/logging/StreamHandler.java b/src/java.logging/share/classes/java/util/logging/StreamHandler.java
index 954231472b1..4c730c97c6f 100644
--- a/src/java.logging/share/classes/java/util/logging/StreamHandler.java
+++ b/src/java.logging/share/classes/java/util/logging/StreamHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -225,7 +225,7 @@ public class StreamHandler extends Handler {
* whether it satisfies any {@code Filter}. It will also return false if
* no output stream has been assigned yet or the LogRecord is null.
*
- * @param record a {@code LogRecord}
+ * @param record a {@code LogRecord} (may be null).
* @return true if the {@code LogRecord} would be logged.
*
*/
diff --git a/test/jdk/java/util/logging/IsLoggableHandlerTest.java b/test/jdk/java/util/logging/IsLoggableHandlerTest.java
new file mode 100644
index 00000000000..167cfdae189
--- /dev/null
+++ b/test/jdk/java/util/logging/IsLoggableHandlerTest.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8216363
+ * @summary Test that Handler.isLoggable(null) returns false
+ * @run main/othervm IsLoggableHandlerTest
+ */
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.FileHandler;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.MemoryHandler;
+import java.util.logging.StreamHandler;
+import java.util.stream.Stream;
+
+public class IsLoggableHandlerTest {
+
+
+ public static void main(String... args) throws IOException {
+ String userDir = System.getProperty("user.dir", ".");
+ File logfile = new File(userDir, "IsLoggableHandlerTest_" + UUID.randomUUID() + ".log");
+ try {
+ System.out.println("Dummy logfile: " + logfile.getAbsolutePath());
+ Handler h = new CustomHandler();
+ testIsLoggable(h);
+ testIsLoggable(new MemoryHandler(h, 1, Level.ALL));
+ testIsLoggable(new StreamHandler(System.out, new java.util.logging.SimpleFormatter()));
+ testIsLoggable(new FileHandler(logfile.getAbsolutePath()));
+ testIsLoggable(new ConsoleHandler());
+ } finally {
+ if (logfile.canRead()) {
+ try {
+ System.out.println("Deleting dummy logfile: " + logfile.getAbsolutePath());
+ logfile.delete();
+ } catch (Throwable t) {
+ System.out.println("Warning: failed to delete dummy logfile: " + t);
+ t.printStackTrace();
+ }
+ }
+ }
+ }
+
+ public static void testIsLoggable(Handler h) {
+ System.out.println("Testing " + h.getClass().getName());
+ // should not throw NPE but return false
+ if (h.isLoggable(null)) {
+ throw new AssertionError(h.getClass().getName()
+ + ": null record should not be loggable");
+ }
+ h.setLevel(Level.ALL);
+ // should still not throw NPE but return false
+ if (h.isLoggable(null)) {
+ throw new AssertionError(h.getClass().getName()
+ + ": null record should not be loggable");
+ }
+ // should not throw NPE
+ h.publish(null);
+ }
+
+ public static final class CustomHandler extends Handler {
+ @Override
+ public void publish(LogRecord record) { }
+ @Override
+ public void flush() { }
+ @Override
+ public void close() throws SecurityException { }
+ }
+
+
+}
From 86e513bd4820f7be196808232378554e9fc21039 Mon Sep 17 00:00:00 2001
From: Naoto Sato
Date: Thu, 21 Feb 2019 10:26:56 -0800
Subject: [PATCH 068/109] 8218960: CONFIG level logging statements printed in
CLDRCalendarDataProviderImpl.java even when default log Level is INFO
Reviewed-by: nishjain, rriggs
---
.../cldr/CLDRCalendarDataProviderImpl.java | 5 +-
.../locale/provider/CalendarDataUtility.java | 6 +-
.../provider/LocaleServiceProviderPool.java | 6 +-
.../CheckLoggingFromLocaleProvider.java | 63 +++++++++++++++++++
4 files changed, 73 insertions(+), 7 deletions(-)
create mode 100644 test/jdk/sun/util/locale/provider/CheckLoggingFromLocaleProvider.java
diff --git a/src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java b/src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java
index 472767f9879..388af637e54 100644
--- a/src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java
+++ b/src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,8 @@ public class CLDRCalendarDataProviderImpl extends CalendarDataProviderImpl {
String region = locale.getCountry();
if (region.isEmpty()) {
- return 0;
+ // Use "US" as default
+ region = "US";
}
Integer val = map.get(region);
diff --git a/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java b/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java
index e9c73f9192b..41b9ba3e9a7 100644
--- a/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java
+++ b/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -256,7 +256,9 @@ public class CalendarDataUtility {
default:
throw new InternalError("invalid requestID: " + requestID);
}
- return (value != 0) ? value : null;
+
+ assert value != 0;
+ return value;
}
}
}
diff --git a/src/java.base/share/classes/sun/util/locale/provider/LocaleServiceProviderPool.java b/src/java.base/share/classes/sun/util/locale/provider/LocaleServiceProviderPool.java
index 3a0409b3c06..3a19f36afae 100644
--- a/src/java.base/share/classes/sun/util/locale/provider/LocaleServiceProviderPool.java
+++ b/src/java.base/share/classes/sun/util/locale/provider/LocaleServiceProviderPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -283,8 +283,8 @@ public final class LocaleServiceProviderPool {
return providersObj;
} else if (isObjectProvider) {
config(LocaleServiceProviderPool.class,
- "A locale sensitive service provider returned null for a localized objects, which should not happen. provider: "
- + lsp + " locale: " + locale);
+ "A locale sensitive service object provider returned null, " +
+ "which should not happen. Provider: " + lsp + " Locale: " + locale);
}
}
}
diff --git a/test/jdk/sun/util/locale/provider/CheckLoggingFromLocaleProvider.java b/test/jdk/sun/util/locale/provider/CheckLoggingFromLocaleProvider.java
new file mode 100644
index 00000000000..cd6620557de
--- /dev/null
+++ b/test/jdk/sun/util/locale/provider/CheckLoggingFromLocaleProvider.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8218960
+ * @modules java.base/sun.util.locale.provider
+ * @modules java.logging
+ * @summary Check that no CONFIG messages are logged on instantiating
+ * SimpleDateFormat with the language-only locale.
+ * @run main CheckLoggingFromLocaleProvider
+ */
+import java.text.*;
+import java.util.*;
+import java.util.logging.*;
+import sun.util.locale.provider.*;
+
+public class CheckLoggingFromLocaleProvider extends StreamHandler {
+
+ @Override
+ public boolean isLoggable(LogRecord lr) {
+ if (lr.getLevel() == Level.CONFIG &&
+ lr.getLoggerName().equals(
+ LocaleServiceProviderPool.class.getCanonicalName())) {
+ throw new RuntimeException("CONFIG message was logged in " +
+ lr.getLoggerName() + ". Message: " + lr.getMessage());
+ }
+ return false;
+ }
+
+ public CheckLoggingFromLocaleProvider() {
+ setLevel(Level.CONFIG);
+ Logger l = LogManager.getLogManager().getLogger("");
+ l.setLevel(Level.CONFIG);
+ l.addHandler(this);
+
+ new SimpleDateFormat("", Locale.ENGLISH);
+ }
+
+ public static void main(String[] args) {
+ new CheckLoggingFromLocaleProvider();
+ }
+}
From bf2d27c5a4743091aa76569ef7b6743fa072282e Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Thu, 21 Feb 2019 10:29:16 -0800
Subject: [PATCH 069/109] 8219254: Update explicit uses of latest source/target
in langtools tests to a property 8219256: Update javac diags tests to use
properties
Co-authored-by: Jonathan Gibbons
Reviewed-by: jjg, jlahoda, darcy, iignatyev
---
test/langtools/TEST.ROOT | 2 +-
.../tools/javac/6330997/T6330997.java | 6 +--
.../tools/javac/ConditionalWithVoid.java | 2 +-
test/langtools/tools/javac/diags/Example.java | 49 ++++++++++++++++++-
.../diags/examples/BreakAmbiguousTarget.java | 4 +-
.../diags/examples/BreakExprNotImmediate.java | 4 +-
.../diags/examples/BreakMissingValue.java | 4 +-
.../BreakOutsideSwitchExpression.java | 4 +-
.../ContinueOutsideSwitchExpression.java | 4 +-
.../IncompatibleTypesInSwitchExpression.java | 4 +-
.../diags/examples/MultipleCaseLabels.java | 4 +-
.../javac/diags/examples/NotExhaustive.java | 4 +-
.../diags/examples/PreviewFeatureUse.java | 4 +-
.../javac/diags/examples/PreviewFilename.java | 4 +-
.../examples/PreviewFilenameAdditional.java | 4 +-
.../examples/PreviewPlural/PreviewPlural.java | 4 +-
.../ReturnOutsideSwitchExpression.java | 4 +-
.../diags/examples/RuleCompletesNormally.java | 4 +-
.../SwitchCaseUnexpectedStatement.java | 4 +-
.../SwitchExpressionCompletesNormally.java | 4 +-
.../diags/examples/SwitchExpressionEmpty.java | 4 +-
.../SwitchExpressionTargetCantBeVoid.java | 4 +-
.../diags/examples/SwitchExpressions.java | 4 +-
.../diags/examples/SwitchMixingCaseTypes.java | 4 +-
.../javac/diags/examples/SwitchRules.java | 4 +-
.../javac/expswitch/ExpSwitchNestingTest.java | 5 +-
.../lambda/BadSwitchExpressionLambda.java | 2 +-
.../tools/javac/parser/JavacParserTest.java | 10 ++--
.../javac/preview/classReaderTest/Client.java | 4 +-
.../javac/switchexpr/BlockExpression.java | 4 +-
.../switchexpr/BooleanNumericNonNumeric.java | 2 +-
.../tools/javac/switchexpr/BreakTest.java | 5 +-
.../langtools/tools/javac/switchexpr/CRT.java | 6 ++-
.../javac/switchexpr/DefiniteAssignment1.java | 4 +-
.../javac/switchexpr/DefiniteAssignment2.java | 2 +-
.../tools/javac/switchexpr/EmptySwitch.java | 4 +-
.../switchexpr/ExhaustiveEnumSwitch.java | 4 +-
.../javac/switchexpr/ExpressionSwitch.java | 2 +-
.../switchexpr/ExpressionSwitchBreaks1.java | 4 +-
.../switchexpr/ExpressionSwitchBreaks2.java | 2 +-
.../switchexpr/ExpressionSwitchBugs.java | 4 +-
.../switchexpr/ExpressionSwitchBugsInGen.java | 4 +-
.../ExpressionSwitchCodeFromJLS.java | 4 +-
.../javac/switchexpr/ExpressionSwitchDA.java | 4 +-
.../switchexpr/ExpressionSwitchEmbedding.java | 4 +-
.../ExpressionSwitchFallThrough.java | 4 +-
.../ExpressionSwitchFallThrough1.java | 4 +-
.../switchexpr/ExpressionSwitchFlow.java | 2 +-
.../ExpressionSwitchInExpressionSwitch.java | 2 +-
.../switchexpr/ExpressionSwitchInfer.java | 2 +-
.../ExpressionSwitchIntersectionTypes.java | 4 +-
.../ExpressionSwitchNotExhaustive.java | 2 +-
.../ExpressionSwitchUnreachable.java | 2 +-
.../javac/switchexpr/ParseIncomplete.java | 5 +-
.../javac/switchexpr/ParserRecovery.java | 2 +-
.../SwitchExpressionIsNotAConstant.java | 4 +-
.../SwitchExpressionScopesIsolated.java | 2 +-
.../SwitchExpressionSimpleVisitorTest.java | 4 +-
.../tools/javac/switchexpr/TryCatch.java | 4 +-
.../tools/javac/switchextra/CaseTest.java | 25 +++++-----
.../switchextra/MultipleLabelsExpression.java | 2 +-
.../switchextra/MultipleLabelsStatement.java | 2 +-
.../javac/switchextra/RuleParsingTest.java | 9 ++--
.../SwitchArrowBrokenConstant.java | 2 +-
.../switchextra/SwitchStatementArrow.java | 2 +-
.../switchextra/SwitchStatementBroken.java | 2 +-
.../switchextra/SwitchStatementBroken2.java | 2 +-
.../SwitchStatementScopesIsolated.java | 2 +-
68 files changed, 183 insertions(+), 131 deletions(-)
diff --git a/test/langtools/TEST.ROOT b/test/langtools/TEST.ROOT
index f9dcfd9e360..db2d21f0b07 100644
--- a/test/langtools/TEST.ROOT
+++ b/test/langtools/TEST.ROOT
@@ -15,7 +15,7 @@ keys=intermittent randomness
groups=TEST.groups
# Minimum jtreg version
-requiredVersion=4.2 b13
+requiredVersion=4.2 b14
# Use new module options
useNewOptions=true
diff --git a/test/langtools/tools/javac/6330997/T6330997.java b/test/langtools/tools/javac/6330997/T6330997.java
index 297d448c24e..8ddf40e4557 100644
--- a/test/langtools/tools/javac/6330997/T6330997.java
+++ b/test/langtools/tools/javac/6330997/T6330997.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,8 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.compiler/com.sun.tools.javac.util
* @clean T1 T2
- * @compile -source 12 -target 13 T1.java
- * @compile -source 12 -target 13 T2.java
+ * @compile T1.java
+ * @compile T2.java
* @run main/othervm T6330997
*/
diff --git a/test/langtools/tools/javac/ConditionalWithVoid.java b/test/langtools/tools/javac/ConditionalWithVoid.java
index 93a918d1c1c..710f2753c64 100644
--- a/test/langtools/tools/javac/ConditionalWithVoid.java
+++ b/test/langtools/tools/javac/ConditionalWithVoid.java
@@ -4,7 +4,7 @@
* @summary The compiler was allowing void types in its parsing of conditional expressions.
* @author tball
*
- * @compile/fail/ref=ConditionalWithVoid.out --enable-preview -source 13 -XDrawDiagnostics ConditionalWithVoid.java
+ * @compile/fail/ref=ConditionalWithVoid.out --enable-preview -source ${jdk.version} -XDrawDiagnostics ConditionalWithVoid.java
*/
public class ConditionalWithVoid {
public void test(Object o, String s) {
diff --git a/test/langtools/tools/javac/diags/Example.java b/test/langtools/tools/javac/diags/Example.java
index 8cadd96a4c3..14cfa488141 100644
--- a/test/langtools/tools/javac/diags/Example.java
+++ b/test/langtools/tools/javac/diags/Example.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -288,7 +288,7 @@ class Example implements Comparable {
opts.add("-d");
opts.add(classesDir.getPath());
if (options != null)
- opts.addAll(options);
+ opts.addAll(evalProperties(options));
if (procFiles.size() > 0) {
List pOpts = new ArrayList<>(Arrays.asList("-d", classesDir.getPath()));
@@ -355,6 +355,51 @@ class Example implements Comparable {
}
}
+ private static List evalProperties(List args) {
+ boolean fast = true;
+ for (String arg : args) {
+ fast = fast && (arg.indexOf("${") == -1);
+ }
+ if (fast) {
+ return args;
+ }
+ List newArgs = new ArrayList<>();
+ for (String arg : args) {
+ newArgs.add(evalProperties(arg));
+ }
+ return newArgs;
+ }
+
+ private static final Pattern namePattern = Pattern.compile("\\$\\{([A-Za-z0-9._]+)\\}");
+ private static final String jdkVersion = Integer.toString(Runtime.version().feature());
+
+ private static String evalProperties(String arg) {
+ Matcher m = namePattern.matcher(arg);
+ StringBuilder sb = null;
+ while (m.find()) {
+ if (sb == null) {
+ sb = new StringBuilder();
+ }
+ String propName = m.group(1);
+ String propValue;
+ switch (propName) {
+ case "jdk.version":
+ propValue = jdkVersion;
+ break;
+ default:
+ propValue = System.getProperty(propName);
+ break;
+ }
+ m.appendReplacement(sb, propValue != null ? propValue : m.group(0).replace("$", "\\$"));
+ }
+ if (sb == null) {
+ return arg;
+ } else {
+ m.appendTail(sb);
+ return sb.toString();
+ }
+ }
+
void createAnnotationServicesFile(File dir, List procFiles) throws IOException {
File servicesDir = new File(new File(dir, "META-INF"), "services");
servicesDir.mkdirs();
diff --git a/test/langtools/tools/javac/diags/examples/BreakAmbiguousTarget.java b/test/langtools/tools/javac/diags/examples/BreakAmbiguousTarget.java
index c28960a8fbb..1eb668e126c 100644
--- a/test/langtools/tools/javac/diags/examples/BreakAmbiguousTarget.java
+++ b/test/langtools/tools/javac/diags/examples/BreakAmbiguousTarget.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.break.ambiguous.target
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class BreakAmbiguousTarget {
void m(int i, int j) {
diff --git a/test/langtools/tools/javac/diags/examples/BreakExprNotImmediate.java b/test/langtools/tools/javac/diags/examples/BreakExprNotImmediate.java
index 0eb1ab3799e..4296521fa93 100644
--- a/test/langtools/tools/javac/diags/examples/BreakExprNotImmediate.java
+++ b/test/langtools/tools/javac/diags/examples/BreakExprNotImmediate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
// key: compiler.note.note
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
// run: backdoor
class BreakExprNotImmediate {
diff --git a/test/langtools/tools/javac/diags/examples/BreakMissingValue.java b/test/langtools/tools/javac/diags/examples/BreakMissingValue.java
index 0ea668ba305..ecc9f68e960 100644
--- a/test/langtools/tools/javac/diags/examples/BreakMissingValue.java
+++ b/test/langtools/tools/javac/diags/examples/BreakMissingValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.break.missing.value
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class BreakMissingValue {
int t(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/BreakOutsideSwitchExpression.java b/test/langtools/tools/javac/diags/examples/BreakOutsideSwitchExpression.java
index f980c5e4720..aa7d7d2fcd4 100644
--- a/test/langtools/tools/javac/diags/examples/BreakOutsideSwitchExpression.java
+++ b/test/langtools/tools/javac/diags/examples/BreakOutsideSwitchExpression.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.break.outside.switch.expression
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class BreakOutsideSwitchExpression {
int t(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/ContinueOutsideSwitchExpression.java b/test/langtools/tools/javac/diags/examples/ContinueOutsideSwitchExpression.java
index f5d1d278dcc..c7ae16d6a89 100644
--- a/test/langtools/tools/javac/diags/examples/ContinueOutsideSwitchExpression.java
+++ b/test/langtools/tools/javac/diags/examples/ContinueOutsideSwitchExpression.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.continue.outside.switch.expression
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class ContinueOutsideSwitchExpression {
int t(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/IncompatibleTypesInSwitchExpression.java b/test/langtools/tools/javac/diags/examples/IncompatibleTypesInSwitchExpression.java
index bba166c3eb1..56e3d32eb75 100644
--- a/test/langtools/tools/javac/diags/examples/IncompatibleTypesInSwitchExpression.java
+++ b/test/langtools/tools/javac/diags/examples/IncompatibleTypesInSwitchExpression.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
// key: compiler.misc.inconvertible.types
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class IncompatibleTypesInSwitchExpression {
diff --git a/test/langtools/tools/javac/diags/examples/MultipleCaseLabels.java b/test/langtools/tools/javac/diags/examples/MultipleCaseLabels.java
index 0db0884115c..57be2f20126 100644
--- a/test/langtools/tools/javac/diags/examples/MultipleCaseLabels.java
+++ b/test/langtools/tools/javac/diags/examples/MultipleCaseLabels.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
// key: compiler.misc.feature.multiple.case.labels
// key: compiler.warn.preview.feature.use.plural
-// options: --enable-preview -source 13 -Xlint:preview
+// options: --enable-preview -source ${jdk.version} -Xlint:preview
class MultipleCaseLabels {
void m(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/NotExhaustive.java b/test/langtools/tools/javac/diags/examples/NotExhaustive.java
index 846bc9cdeb5..8f4e2be47bf 100644
--- a/test/langtools/tools/javac/diags/examples/NotExhaustive.java
+++ b/test/langtools/tools/javac/diags/examples/NotExhaustive.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.not.exhaustive
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class NotExhaustive {
int t(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java b/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java
index 3dbb2270c4e..99a7596cb0e 100644
--- a/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java
+++ b/test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
//key: compiler.warn.preview.feature.use.plural
//key: compiler.misc.feature.diamond
//key: compiler.misc.feature.lambda
-//options: -Xlint:preview -XDforcePreview -source 13 --enable-preview
+//options: -Xlint:preview -XDforcePreview -source ${jdk.version} --enable-preview
import java.util.ArrayList;
diff --git a/test/langtools/tools/javac/diags/examples/PreviewFilename.java b/test/langtools/tools/javac/diags/examples/PreviewFilename.java
index 04edcdf8715..b424851311a 100644
--- a/test/langtools/tools/javac/diags/examples/PreviewFilename.java
+++ b/test/langtools/tools/javac/diags/examples/PreviewFilename.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: -XDforcePreview -source 13 --enable-preview
+// options: -XDforcePreview -source ${jdk.version} --enable-preview
import java.util.ArrayList;
import java.util.List;
diff --git a/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java b/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java
index 3d5430de389..60ee874a8c5 100644
--- a/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java
+++ b/test/langtools/tools/javac/diags/examples/PreviewFilenameAdditional.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.note.preview.filename.additional
// key: compiler.warn.preview.feature.use
// key: compiler.misc.feature.diamond
-// options: -Xlint:preview -Xmaxwarns 1 -XDforcePreview -source 13 --enable-preview
+// options: -Xlint:preview -Xmaxwarns 1 -XDforcePreview -source ${jdk.version} --enable-preview
import java.util.ArrayList;
diff --git a/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java b/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java
index e9b92af8ded..abd93b5e3ce 100644
--- a/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java
+++ b/test/langtools/tools/javac/diags/examples/PreviewPlural/PreviewPlural.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
// key: compiler.note.preview.plural
// key: compiler.note.preview.recompile
-// options: -XDforcePreview -source 13 --enable-preview
+// options: -XDforcePreview -source ${jdk.version} --enable-preview
import java.util.ArrayList;
diff --git a/test/langtools/tools/javac/diags/examples/ReturnOutsideSwitchExpression.java b/test/langtools/tools/javac/diags/examples/ReturnOutsideSwitchExpression.java
index 9811287efc9..4db3dcdfa5a 100644
--- a/test/langtools/tools/javac/diags/examples/ReturnOutsideSwitchExpression.java
+++ b/test/langtools/tools/javac/diags/examples/ReturnOutsideSwitchExpression.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.return.outside.switch.expression
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class ReturnOutsideSwitchExpression {
int t(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/RuleCompletesNormally.java b/test/langtools/tools/javac/diags/examples/RuleCompletesNormally.java
index bb876ac9de2..69fe3325061 100644
--- a/test/langtools/tools/javac/diags/examples/RuleCompletesNormally.java
+++ b/test/langtools/tools/javac/diags/examples/RuleCompletesNormally.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.rule.completes.normally
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class RuleCompletesNormally {
public String convert(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/SwitchCaseUnexpectedStatement.java b/test/langtools/tools/javac/diags/examples/SwitchCaseUnexpectedStatement.java
index d3509b0756b..025343b385a 100644
--- a/test/langtools/tools/javac/diags/examples/SwitchCaseUnexpectedStatement.java
+++ b/test/langtools/tools/javac/diags/examples/SwitchCaseUnexpectedStatement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.switch.case.unexpected.statement
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class ReturnOutsideSwitchExpression {
void t(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/SwitchExpressionCompletesNormally.java b/test/langtools/tools/javac/diags/examples/SwitchExpressionCompletesNormally.java
index f3fef28165a..49daf1f1011 100644
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressionCompletesNormally.java
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressionCompletesNormally.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.switch.expression.completes.normally
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class SwitchExpressionCompletesNormally {
public String convert(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/SwitchExpressionEmpty.java b/test/langtools/tools/javac/diags/examples/SwitchExpressionEmpty.java
index 61c1d43cc04..8998ef0244f 100644
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressionEmpty.java
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressionEmpty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.switch.expression.empty
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class BreakOutsideSwitchExpression {
String t(E e) {
diff --git a/test/langtools/tools/javac/diags/examples/SwitchExpressionTargetCantBeVoid.java b/test/langtools/tools/javac/diags/examples/SwitchExpressionTargetCantBeVoid.java
index 96a52cdcf87..26d7cbd3aff 100644
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressionTargetCantBeVoid.java
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressionTargetCantBeVoid.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
// key: compiler.misc.switch.expression.target.cant.be.void
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class SwitchExpressionTargetCantBeVoid {
diff --git a/test/langtools/tools/javac/diags/examples/SwitchExpressions.java b/test/langtools/tools/javac/diags/examples/SwitchExpressions.java
index e386b651bd0..596814bfd64 100644
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressions.java
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
// key: compiler.misc.feature.switch.expressions
// key: compiler.warn.preview.feature.use.plural
-// options: --enable-preview -source 13 -Xlint:preview
+// options: --enable-preview -source ${jdk.version} -Xlint:preview
class SwitchExpressions {
int m(int i) {
diff --git a/test/langtools/tools/javac/diags/examples/SwitchMixingCaseTypes.java b/test/langtools/tools/javac/diags/examples/SwitchMixingCaseTypes.java
index dcfcbbf0fc4..1c9747af7b5 100644
--- a/test/langtools/tools/javac/diags/examples/SwitchMixingCaseTypes.java
+++ b/test/langtools/tools/javac/diags/examples/SwitchMixingCaseTypes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
// key: compiler.err.switch.mixing.case.types
// key: compiler.note.preview.filename
// key: compiler.note.preview.recompile
-// options: --enable-preview -source 13
+// options: --enable-preview -source ${jdk.version}
class SwitchMixingCaseTypes {
diff --git a/test/langtools/tools/javac/diags/examples/SwitchRules.java b/test/langtools/tools/javac/diags/examples/SwitchRules.java
index fe99b8366bd..5604cf4e821 100644
--- a/test/langtools/tools/javac/diags/examples/SwitchRules.java
+++ b/test/langtools/tools/javac/diags/examples/SwitchRules.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
// key: compiler.misc.feature.switch.rules
// key: compiler.warn.preview.feature.use.plural
-// options: --enable-preview -source 13 -Xlint:preview
+// options: --enable-preview -source ${jdk.version} -Xlint:preview
class SwitchExpressions {
void m(int i) {
diff --git a/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java b/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java
index 84270313db0..9e65902c455 100644
--- a/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java
+++ b/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,8 @@ public class ExpSwitchNestingTest extends JavacTemplateTestBase {
}
}
- private static String[] PREVIEW_OPTIONS = {"--enable-preview", "-source", "13"};
+ private static String[] PREVIEW_OPTIONS = {"--enable-preview", "-source",
+ Integer.toString(Runtime.version().feature())};
private void program(String... constructs) {
String s = "class C { static boolean cond = false; static int x = 0; void m() { # } }";
diff --git a/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.java b/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.java
index 14fe01726d7..9ad491c37d1 100644
--- a/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.java
+++ b/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Adding switch expressions
- * @compile/fail/ref=BadSwitchExpressionLambda.out -XDrawDiagnostics --enable-preview -source 13 BadSwitchExpressionLambda.java
+ * @compile/fail/ref=BadSwitchExpressionLambda.out -XDrawDiagnostics --enable-preview -source ${jdk.version} BadSwitchExpressionLambda.java
*/
class BadSwitchExpressionLambda {
diff --git a/test/langtools/tools/javac/parser/JavacParserTest.java b/test/langtools/tools/javac/parser/JavacParserTest.java
index 6844282258f..20e8f745efb 100644
--- a/test/langtools/tools/javac/parser/JavacParserTest.java
+++ b/test/langtools/tools/javac/parser/JavacParserTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -88,14 +88,14 @@ import com.sun.source.util.TreePathScanner;
public class JavacParserTest extends TestCase {
static final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
static final JavaFileManager fm = tool.getStandardFileManager(null, null, null);
+ public static final String SOURCE_VERSION =
+ Integer.toString(Runtime.version().feature());
private JavacParserTest(){}
public static void main(String... args) throws Exception {
- try {
+ try (fm) {
new JavacParserTest().run(args);
- } finally {
- fm.close();
}
}
@@ -1096,7 +1096,7 @@ public class JavacParserTest extends TestCase {
String expectedErrors = "Test.java:1:178: compiler.err.switch.case.unexpected.statement\n";
StringWriter out = new StringWriter();
JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(out, fm, null,
- Arrays.asList("-XDrawDiagnostics", "--enable-preview", "-source", "13"),
+ Arrays.asList("-XDrawDiagnostics", "--enable-preview", "-source", SOURCE_VERSION),
null, Arrays.asList(new MyFileObject(code)));
CompilationUnitTree cut = ct.parse().iterator().next();
diff --git a/test/langtools/tools/javac/preview/classReaderTest/Client.java b/test/langtools/tools/javac/preview/classReaderTest/Client.java
index 4c122887033..74bb99327d6 100644
--- a/test/langtools/tools/javac/preview/classReaderTest/Client.java
+++ b/test/langtools/tools/javac/preview/classReaderTest/Client.java
@@ -2,9 +2,9 @@
* @test /nodynamiccopyright/
* @bug 8199194
* @summary smoke test for --enabled-preview classreader support
- * @compile -XDforcePreview --enable-preview -source 13 Bar.java
+ * @compile -XDforcePreview --enable-preview -source ${jdk.version} Bar.java
* @compile/fail/ref=Client.nopreview.out -Xlint:preview -XDrawDiagnostics Client.java
- * @compile/fail/ref=Client.preview.out -Werror -Xlint:preview -XDrawDiagnostics --enable-preview -source 13 Client.java
+ * @compile/fail/ref=Client.preview.out -Werror -Xlint:preview -XDrawDiagnostics --enable-preview -source ${jdk.version} Client.java
*/
public class Client {
diff --git a/test/langtools/tools/javac/switchexpr/BlockExpression.java b/test/langtools/tools/javac/switchexpr/BlockExpression.java
index 0534ccb180c..3411a01d3d6 100644
--- a/test/langtools/tools/javac/switchexpr/BlockExpression.java
+++ b/test/langtools/tools/javac/switchexpr/BlockExpression.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Verify rule cases with expression statements and throw statements work.
- * @compile --enable-preview -source 13 BlockExpression.java
+ * @compile --enable-preview -source ${jdk.version} BlockExpression.java
* @run main/othervm --enable-preview BlockExpression
*/
diff --git a/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.java b/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.java
index 2f5aac13fce..76f757fce4c 100644
--- a/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.java
+++ b/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify the type of a conditional expression with nested switch expression is computed properly
- * @compile/fail/ref=BooleanNumericNonNumeric.out -XDrawDiagnostics --enable-preview -source 13 BooleanNumericNonNumeric.java
+ * @compile/fail/ref=BooleanNumericNonNumeric.out -XDrawDiagnostics --enable-preview -source ${jdk.version} BooleanNumericNonNumeric.java
*/
public class BooleanNumericNonNumeric {
diff --git a/test/langtools/tools/javac/switchexpr/BreakTest.java b/test/langtools/tools/javac/switchexpr/BreakTest.java
index ea8b22580e5..92676c58c87 100644
--- a/test/langtools/tools/javac/switchexpr/BreakTest.java
+++ b/test/langtools/tools/javac/switchexpr/BreakTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,12 +61,13 @@ public class BreakTest {
public static void main(String[] args) throws Exception {
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+ String sourceVersion = Integer.toString(Runtime.version().feature());
assert tool != null;
DiagnosticListener noErrors = d -> {};
StringWriter out = new StringWriter();
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
- List.of("-XDdev", "--enable-preview", "-source", "13"), null,
+ List.of("-XDdev", "--enable-preview", "-source", sourceVersion), null,
Arrays.asList(new MyFileObject(CODE)));
List labels = new ArrayList<>();
new TreePathScanner() {
diff --git a/test/langtools/tools/javac/switchexpr/CRT.java b/test/langtools/tools/javac/switchexpr/CRT.java
index efaf656d822..b16b2265250 100644
--- a/test/langtools/tools/javac/switchexpr/CRT.java
+++ b/test/langtools/tools/javac/switchexpr/CRT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,8 @@ public class CRT {
new CRT().run();
}
+ private static final String SOURCE_VERSION = Integer.toString(Runtime.version().feature());
+
private ToolBox tb = new ToolBox();
private void run() throws Exception {
@@ -151,7 +153,7 @@ public class CRT {
new JavacTask(tb)
.options("-Xjcov",
"--enable-preview",
- "-source", "13")
+ "-source", SOURCE_VERSION)
.outdir(classes)
.sources("public class Test {\n" +
code +
diff --git a/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java b/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java
index d58c23bbb59..6e12f39f1bc 100644
--- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java
+++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8214031
* @summary Verify that definite assignment when true works (legal code)
- * @compile --enable-preview --source 13 DefiniteAssignment1.java
+ * @compile --enable-preview --source ${jdk.version} DefiniteAssignment1.java
* @run main/othervm --enable-preview DefiniteAssignment1
*/
public class DefiniteAssignment1 {
diff --git a/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java b/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java
index 706b83d5ab8..bfd358f8c1a 100644
--- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java
+++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8214031
* @summary Verify that definite assignment when true works (illegal code)
- * @compile/fail/ref=DefiniteAssignment2.out --enable-preview --source 13 -XDrawDiagnostics DefiniteAssignment2.java
+ * @compile/fail/ref=DefiniteAssignment2.out --enable-preview --source ${jdk.version} -XDrawDiagnostics DefiniteAssignment2.java
*/
public class DefiniteAssignment2 {
diff --git a/test/langtools/tools/javac/switchexpr/EmptySwitch.java b/test/langtools/tools/javac/switchexpr/EmptySwitch.java
index bf26578ea1b..553d9031024 100644
--- a/test/langtools/tools/javac/switchexpr/EmptySwitch.java
+++ b/test/langtools/tools/javac/switchexpr/EmptySwitch.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Verify than an empty switch expression is rejected.
- * @compile/fail/ref=EmptySwitch.out --enable-preview -source 13 -XDrawDiagnostics EmptySwitch.java
+ * @compile/fail/ref=EmptySwitch.out --enable-preview -source ${jdk.version} -XDrawDiagnostics EmptySwitch.java
*/
public class EmptySwitch {
diff --git a/test/langtools/tools/javac/switchexpr/ExhaustiveEnumSwitch.java b/test/langtools/tools/javac/switchexpr/ExhaustiveEnumSwitch.java
index bbe728a5300..7b38e291a6b 100644
--- a/test/langtools/tools/javac/switchexpr/ExhaustiveEnumSwitch.java
+++ b/test/langtools/tools/javac/switchexpr/ExhaustiveEnumSwitch.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Verify that an switch expression over enum can be exhaustive without default.
- * @compile --enable-preview -source 13 ExhaustiveEnumSwitch.java
+ * @compile --enable-preview -source ${jdk.version} ExhaustiveEnumSwitch.java
* @compile ExhaustiveEnumSwitchExtra.java
* @run main/othervm --enable-preview ExhaustiveEnumSwitch
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java
index 67c0fbb61d7..8acb340a9ab 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java
@@ -3,7 +3,7 @@
* @bug 8206986
* @summary Check expression switch works.
* @compile/fail/ref=ExpressionSwitch-old.out -source 9 -Xlint:-options -XDrawDiagnostics ExpressionSwitch.java
- * @compile --enable-preview -source 13 ExpressionSwitch.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitch.java
* @run main/othervm --enable-preview ExpressionSwitch
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java
index 198350e8862..f17b845a804 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Verify behavior of various kinds of breaks.
- * @compile --enable-preview -source 13 ExpressionSwitchBreaks1.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchBreaks1.java
* @run main/othervm --enable-preview ExpressionSwitchBreaks1
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java
index 66e9023b4ef..c9a5ba8fdd5 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Check behavior for invalid breaks.
- * @compile/fail/ref=ExpressionSwitchBreaks2.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchBreaks2.java
+ * @compile/fail/ref=ExpressionSwitchBreaks2.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchBreaks2.java
*/
public class ExpressionSwitchBreaks2 {
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java
index 873f9d1b59a..e26957e79b9 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986 8214114 8214529
* @summary Verify various corner cases with nested switch expressions.
- * @compile --enable-preview -source 13 ExpressionSwitchBugs.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchBugs.java
* @run main/othervm --enable-preview ExpressionSwitchBugs
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugsInGen.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugsInGen.java
index 9dd0c5e4b63..731a7d05441 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugsInGen.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugsInGen.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8214031
* @summary Verify various corner cases with nested switch expressions.
- * @compile --enable-preview -source 13 ExpressionSwitchBugsInGen.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchBugsInGen.java
* @run main/othervm --enable-preview ExpressionSwitchBugsInGen
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchCodeFromJLS.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchCodeFromJLS.java
index f9564bafc86..b6547c2eb2e 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchCodeFromJLS.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchCodeFromJLS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Check switch expressions
- * @compile --enable-preview -source 13 ExpressionSwitchCodeFromJLS.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchCodeFromJLS.java
* @run main/othervm --enable-preview ExpressionSwitchCodeFromJLS
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java
index 9815b27dd48..d54780c691e 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Check definite (un)assignment for in switch expressions.
- * @compile --enable-preview -source 13 ExpressionSwitchDA.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchDA.java
* @run main/othervm --enable-preview ExpressionSwitchDA
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java
index 997b69ce927..f868e58ea36 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8214031 8214114
* @summary Verify switch expressions embedded in various statements work properly.
- * @compile --enable-preview -source 13 ExpressionSwitchEmbedding.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchEmbedding.java
* @run main/othervm --enable-preview ExpressionSwitchEmbedding
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java
index f51e51ad9a0..e4d9fa37397 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Check fall through in switch expressions.
- * @compile --enable-preview -source 13 ExpressionSwitchFallThrough.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchFallThrough.java
* @run main/othervm --enable-preview ExpressionSwitchFallThrough
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java
index 2f60e88c7e5..e4db669707a 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Check fall through in switch expressions.
- * @compile --enable-preview -source 13 ExpressionSwitchFallThrough1.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchFallThrough1.java
* @run main/othervm --enable-preview ExpressionSwitchFallThrough1
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java
index f5cd71af5cb..9125b23e08d 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8212982
* @summary Verify a compile-time error is produced if switch expression does not provide a value
- * @compile/fail/ref=ExpressionSwitchFlow.out --enable-preview -source 13 -XDrawDiagnostics ExpressionSwitchFlow.java
+ * @compile/fail/ref=ExpressionSwitchFlow.out --enable-preview -source ${jdk.version} -XDrawDiagnostics ExpressionSwitchFlow.java
*/
public class ExpressionSwitchFlow {
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java
index 6d57ffa16ea..76c262dc19b 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Check switch expressions embedded in switch expressions.
- * @compile --enable-preview -source 13 ExpressionSwitchInExpressionSwitch.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchInExpressionSwitch.java
* @run main/othervm --enable-preview ExpressionSwitchInExpressionSwitch
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java
index 8b6d32535eb..72bd01f7e3c 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Check types inferred for switch expressions.
- * @compile/fail/ref=ExpressionSwitchInfer.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchInfer.java
+ * @compile/fail/ref=ExpressionSwitchInfer.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchInfer.java
*/
import java.util.ArrayList;
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchIntersectionTypes.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchIntersectionTypes.java
index a1f13b83d76..f02853cee56 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchIntersectionTypes.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchIntersectionTypes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8206986
* @summary Verify behavior when an intersection type is inferred for switch expression.
- * @compile --enable-preview -source 13 ExpressionSwitchIntersectionTypes.java
+ * @compile --enable-preview -source ${jdk.version} ExpressionSwitchIntersectionTypes.java
* @run main/othervm --enable-preview ExpressionSwitchIntersectionTypes
*/
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java
index 8f4ea2e80c6..0f611e0e2ff 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify behavior of not exhaustive switch expressions.
- * @compile/fail/ref=ExpressionSwitchNotExhaustive.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchNotExhaustive.java
+ * @compile/fail/ref=ExpressionSwitchNotExhaustive.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchNotExhaustive.java
*/
public class ExpressionSwitchNotExhaustive {
diff --git a/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java b/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java
index 978e49e1088..88c6dfe031c 100644
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify reachability in switch expressions.
- * @compile/fail/ref=ExpressionSwitchUnreachable.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchUnreachable.java
+ * @compile/fail/ref=ExpressionSwitchUnreachable.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchUnreachable.java
*/
public class ExpressionSwitchUnreachable {
diff --git a/test/langtools/tools/javac/switchexpr/ParseIncomplete.java b/test/langtools/tools/javac/switchexpr/ParseIncomplete.java
index 159ba634d96..b5b886f2cb9 100644
--- a/test/langtools/tools/javac/switchexpr/ParseIncomplete.java
+++ b/test/langtools/tools/javac/switchexpr/ParseIncomplete.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,13 +61,14 @@ public class ParseIncomplete {
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
assert tool != null;
DiagnosticListener noErrors = d -> {};
+ String sourceVersion = Integer.toString(Runtime.version().feature());
for (int i = 0; i < CODE.length(); i++) {
String code = CODE.substring(0, i + 1);
StringWriter out = new StringWriter();
try {
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
- List.of("-XDdev", "--enable-preview", "-source", "13"), null,
+ List.of("-XDdev", "--enable-preview", "-source", sourceVersion), null,
Arrays.asList(new MyFileObject(code)));
ct.parse().iterator().next();
} catch (Throwable t) {
diff --git a/test/langtools/tools/javac/switchexpr/ParserRecovery.java b/test/langtools/tools/javac/switchexpr/ParserRecovery.java
index 7c197c288b8..f3f657a5006 100644
--- a/test/langtools/tools/javac/switchexpr/ParserRecovery.java
+++ b/test/langtools/tools/javac/switchexpr/ParserRecovery.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify the parser handles broken input gracefully.
- * @compile/fail/ref=ParserRecovery.out -XDrawDiagnostics --enable-preview -source 13 ParserRecovery.java
+ * @compile/fail/ref=ParserRecovery.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ParserRecovery.java
*/
public class ParserRecovery {
diff --git a/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java b/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java
index 1cae5e7ade9..b2ec637ba42 100644
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
* @bug 8214113
* @summary Verify the switch expression's type does not have a constant attached,
* and so the switch expression is not elided.
- * @compile --enable-preview --source 13 SwitchExpressionIsNotAConstant.java
+ * @compile --enable-preview --source ${jdk.version} SwitchExpressionIsNotAConstant.java
* @run main/othervm --enable-preview SwitchExpressionIsNotAConstant
*/
public class SwitchExpressionIsNotAConstant {
diff --git a/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java b/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java
index 295a1dc9119..66d842e3f6e 100644
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify that scopes in rule cases are isolated.
- * @compile/fail/ref=SwitchExpressionScopesIsolated.out -XDrawDiagnostics --enable-preview -source 13 SwitchExpressionScopesIsolated.java
+ * @compile/fail/ref=SwitchExpressionScopesIsolated.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchExpressionScopesIsolated.java
*/
public class SwitchExpressionScopesIsolated {
diff --git a/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java b/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java
index 4df450874c6..116c59297bb 100644
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@ public class SwitchExpressionSimpleVisitorTest {
StringWriter out = new StringWriter();
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
- List.of("--enable-preview", "-source", "13"), null,
+ List.of("--enable-preview", "-source", Integer.toString(Runtime.version().feature())), null,
Arrays.asList(new MyFileObject(code)));
return ct.parse().iterator().next();
}
diff --git a/test/langtools/tools/javac/switchexpr/TryCatch.java b/test/langtools/tools/javac/switchexpr/TryCatch.java
index 768292b3b5d..cc8aadf5998 100644
--- a/test/langtools/tools/javac/switchexpr/TryCatch.java
+++ b/test/langtools/tools/javac/switchexpr/TryCatch.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
* @test
* @bug 8214114
* @summary Verify try-catch inside a switch expression works properly.
- * @compile --enable-preview -source 13 TryCatch.java
+ * @compile --enable-preview -source ${jdk.version} TryCatch.java
* @run main/othervm --enable-preview TryCatch
*/
public class TryCatch {
diff --git a/test/langtools/tools/javac/switchextra/CaseTest.java b/test/langtools/tools/javac/switchextra/CaseTest.java
index 99315e79213..b678582c25d 100644
--- a/test/langtools/tools/javac/switchextra/CaseTest.java
+++ b/test/langtools/tools/javac/switchextra/CaseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -47,12 +47,13 @@ import com.sun.source.util.TreePathScanner;
public class CaseTest {
public static void main(String[] args) throws Exception {
- new CaseTest().testLabels();
- new CaseTest().testStatement();
- new CaseTest().testRule();
+ String sourceVersion = Integer.toString(Runtime.version().feature());
+ new CaseTest().testLabels(sourceVersion);
+ new CaseTest().testStatement(sourceVersion);
+ new CaseTest().testRule(sourceVersion);
}
- void testLabels() throws Exception {
+ void testLabels(String sourceVersion) throws Exception {
String code = "class Test {\n" +
" void t(int i) {\n" +
" switch(i) {\n" +
@@ -72,7 +73,7 @@ public class CaseTest {
.collect(Collectors.joining(",", "[", "]")));
return super.visitCase(node, p);
}
- }.scan(parse(code), null);
+ }.scan(parse(code, sourceVersion), null);
List expected = Arrays.asList("0", "[0]", "1", "[1,2]", "null", "[]");
@@ -81,7 +82,7 @@ public class CaseTest {
}
}
- void testStatement() throws Exception {
+ void testStatement(String sourceVersion) throws Exception {
String code = "class Test {\n" +
" void t(int i) {\n" +
" switch(i) {\n" +
@@ -102,10 +103,10 @@ public class CaseTest {
}
return super.visitCase(node, p);
}
- }.scan(parse(code), null);
+ }.scan(parse(code, sourceVersion), null);
}
- void testRule() throws Exception {
+ void testRule(String sourceVersion) throws Exception {
String code = "class Test {\n" +
" void t(int i) {\n" +
" switch(i) {\n" +
@@ -126,17 +127,17 @@ public class CaseTest {
}
return super.visitCase(node, p);
}
- }.scan(parse(code), null);
+ }.scan(parse(code, sourceVersion), null);
}
- private CompilationUnitTree parse(String code) throws IOException {
+ private CompilationUnitTree parse(String code, String sourceVersion) throws IOException {
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
assert tool != null;
DiagnosticListener noErrors = d -> {};
StringWriter out = new StringWriter();
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
- List.of("-XDdev", "--enable-preview", "-source", "13"), null,
+ List.of("-XDdev", "--enable-preview", "-source", sourceVersion), null,
Arrays.asList(new MyFileObject(code)));
return ct.parse().iterator().next();
}
diff --git a/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java b/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java
index 170da1b3375..9a57143c10d 100644
--- a/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java
+++ b/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java
@@ -3,7 +3,7 @@
* @bug 8206986
* @summary Verify cases with multiple labels work properly.
* @compile/fail/ref=MultipleLabelsExpression-old.out -source 9 -Xlint:-options -XDrawDiagnostics MultipleLabelsExpression.java
- * @compile --enable-preview -source 13 MultipleLabelsExpression.java
+ * @compile --enable-preview -source ${jdk.version} MultipleLabelsExpression.java
* @run main/othervm --enable-preview MultipleLabelsExpression
*/
diff --git a/test/langtools/tools/javac/switchextra/MultipleLabelsStatement.java b/test/langtools/tools/javac/switchextra/MultipleLabelsStatement.java
index b674e92b960..9477baa7579 100644
--- a/test/langtools/tools/javac/switchextra/MultipleLabelsStatement.java
+++ b/test/langtools/tools/javac/switchextra/MultipleLabelsStatement.java
@@ -3,7 +3,7 @@
* @bug 8206986
* @summary Verify cases with multiple labels work properly.
* @compile/fail/ref=MultipleLabelsStatement-old.out -source 9 -Xlint:-options -XDrawDiagnostics MultipleLabelsStatement.java
- * @compile --enable-preview -source 13 MultipleLabelsStatement.java
+ * @compile --enable-preview -source ${jdk.version} MultipleLabelsStatement.java
* @run main/othervm --enable-preview MultipleLabelsStatement
*/
diff --git a/test/langtools/tools/javac/switchextra/RuleParsingTest.java b/test/langtools/tools/javac/switchextra/RuleParsingTest.java
index afdaa929edc..affda29ba04 100644
--- a/test/langtools/tools/javac/switchextra/RuleParsingTest.java
+++ b/test/langtools/tools/javac/switchextra/RuleParsingTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,10 +48,11 @@ import com.sun.source.util.Trees;
public class RuleParsingTest {
public static void main(String[] args) throws Exception {
- new RuleParsingTest().testParseComplexExpressions();
+ String sourceVersion = Integer.toString(Runtime.version().feature());
+ new RuleParsingTest().testParseComplexExpressions(sourceVersion);
}
- void testParseComplexExpressions() throws Exception {
+ void testParseComplexExpressions(String sourceVersion) throws Exception {
String[] expressions = {
"(a)",
"a",
@@ -94,7 +95,7 @@ public class RuleParsingTest {
StringWriter out = new StringWriter();
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
- List.of("--enable-preview", "-source", "13"), null,
+ List.of("--enable-preview", "-source", sourceVersion), null,
Arrays.asList(new MyFileObject(code.toString())));
CompilationUnitTree cut = ct.parse().iterator().next();
Trees trees = Trees.instance(ct);
diff --git a/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java b/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java
index e1cec5ac34d..c8beda59080 100644
--- a/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java
+++ b/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java
@@ -3,7 +3,7 @@
* @bug 8206986
* @summary Verify reasonable errors are produced when neither ':' nor '->'
* is found are the expression of a case
- * @compile/fail/ref=SwitchArrowBrokenConstant.out -source 13 --enable-preview -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
+ * @compile/fail/ref=SwitchArrowBrokenConstant.out -source ${jdk.version} --enable-preview -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
*/
public class SwitchArrowBrokenConstant {
diff --git a/test/langtools/tools/javac/switchextra/SwitchStatementArrow.java b/test/langtools/tools/javac/switchextra/SwitchStatementArrow.java
index 599adacc97f..f8fd3092ab1 100644
--- a/test/langtools/tools/javac/switchextra/SwitchStatementArrow.java
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementArrow.java
@@ -3,7 +3,7 @@
* @bug 8206986
* @summary Verify rule cases work properly.
* @compile/fail/ref=SwitchStatementArrow-old.out -source 9 -Xlint:-options -XDrawDiagnostics SwitchStatementArrow.java
- * @compile --enable-preview -source 13 SwitchStatementArrow.java
+ * @compile --enable-preview -source ${jdk.version} SwitchStatementArrow.java
* @run main/othervm --enable-preview SwitchStatementArrow
*/
diff --git a/test/langtools/tools/javac/switchextra/SwitchStatementBroken.java b/test/langtools/tools/javac/switchextra/SwitchStatementBroken.java
index 6882c2d0e1e..d9ef86150e8 100644
--- a/test/langtools/tools/javac/switchextra/SwitchStatementBroken.java
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementBroken.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify that rule and ordinary cases cannot be mixed.
- * @compile/fail/ref=SwitchStatementBroken.out -XDrawDiagnostics --enable-preview -source 13 SwitchStatementBroken.java
+ * @compile/fail/ref=SwitchStatementBroken.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementBroken.java
*/
public class SwitchStatementBroken {
diff --git a/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.java b/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.java
index 8bb6bc018ef..2af02092254 100644
--- a/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.java
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify that not allowed types of statements cannot be used in rule case.
- * @compile/fail/ref=SwitchStatementBroken2.out -XDrawDiagnostics --enable-preview -source 13 SwitchStatementBroken2.java
+ * @compile/fail/ref=SwitchStatementBroken2.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementBroken2.java
*/
public class SwitchStatementBroken2 {
diff --git a/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.java b/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.java
index 896a4d9ca3b..88036c524d4 100644
--- a/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.java
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.java
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 8206986
* @summary Verify that scopes in rule cases are isolated.
- * @compile/fail/ref=SwitchStatementScopesIsolated.out -XDrawDiagnostics --enable-preview -source 13 SwitchStatementScopesIsolated.java
+ * @compile/fail/ref=SwitchStatementScopesIsolated.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementScopesIsolated.java
*/
public class SwitchStatementScopesIsolated {
From fa0093dc2c050d370889e83835e9ba20907307fb Mon Sep 17 00:00:00 2001
From: Jonathan Gibbons
Date: Thu, 21 Feb 2019 14:03:57 -0800
Subject: [PATCH 070/109] 8215307: Pages do not have
Reviewed-by: hannesw
---
.../formats/html/AbstractIndexWriter.java | 6 +-
.../formats/html/AbstractMemberWriter.java | 16 +--
.../html/AbstractModuleIndexWriter.java | 5 +-
.../html/AbstractPackageIndexWriter.java | 3 +-
.../formats/html/AbstractTreeWriter.java | 5 +-
.../formats/html/AllClassesFrameWriter.java | 3 +-
.../formats/html/AllClassesIndexWriter.java | 3 +-
.../formats/html/AllPackagesIndexWriter.java | 3 +-
.../html/AnnotationTypeFieldWriterImpl.java | 13 +-
...nnotationTypeOptionalMemberWriterImpl.java | 8 +-
...nnotationTypeRequiredMemberWriterImpl.java | 14 +-
.../html/AnnotationTypeWriterImpl.java | 7 +-
.../doclets/formats/html/ClassUseWriter.java | 5 +-
.../doclets/formats/html/ClassWriterImpl.java | 7 +-
.../html/ConstantsSummaryWriterImpl.java | 7 +-
.../formats/html/ConstructorWriterImpl.java | 13 +-
.../formats/html/DeprecatedListWriter.java | 5 +-
.../formats/html/EnumConstantWriterImpl.java | 14 +-
.../doclets/formats/html/FieldWriterImpl.java | 16 +--
.../doclets/formats/html/Headings.java | 134 ++++++++++++++++++
.../doclets/formats/html/HelpWriter.java | 31 ++--
.../formats/html/HtmlConfiguration.java | 11 +-
.../formats/html/HtmlSerialFieldWriter.java | 10 +-
.../formats/html/HtmlSerialMethodWriter.java | 10 +-
...HtmlConstants.java => MarkerComments.java} | 116 ++++-----------
.../formats/html/MethodWriterImpl.java | 15 +-
.../formats/html/ModuleFrameWriter.java | 5 +-
.../formats/html/ModuleIndexFrameWriter.java | 25 ++--
.../html/ModulePackageIndexFrameWriter.java | 27 ++--
.../formats/html/ModuleWriterImpl.java | 13 +-
.../formats/html/NestedClassWriterImpl.java | 11 +-
.../formats/html/PackageFrameWriter.java | 5 +-
.../formats/html/PackageIndexFrameWriter.java | 5 +-
.../formats/html/PackageTreeWriter.java | 3 +-
.../formats/html/PackageUseWriter.java | 3 +-
.../formats/html/PackageWriterImpl.java | 3 +-
.../formats/html/PropertyWriterImpl.java | 15 +-
.../html/SerializedFormWriterImpl.java | 10 +-
.../doclets/formats/html/TreeWriter.java | 3 +-
.../formats/html/markup/Navigation.java | 7 +-
.../builders/SerializedFormBuilder.java | 6 +-
.../doclets/toolkit/resources/stylesheet.css | 22 ++-
.../TestAnnotationTypes.java | 8 +-
.../doclet/testHeadings/TestHeadings.java | 21 +--
.../doclet/testHiddenTag/TestHiddenTag.java | 4 +-
.../jdk/javadoc/doclet/testHref/TestHref.java | 2 +-
.../TestHtmlLandmarkRegions.java | 12 +-
.../testHtmlVersion/TestHtmlVersion.java | 84 +++++------
.../testIndexTaglet/TestIndexTaglet.java | 6 +-
.../doclet/testInterface/TestInterface.java | 8 +-
.../javadoc/doclet/testJavaFX/TestJavaFX.java | 32 ++---
.../testModules/TestModuleServices.java | 14 +-
.../doclet/testModules/TestModules.java | 2 +-
.../TestNewLanguageFeatures.java | 6 +-
.../doclet/testOptions/TestOptions.java | 4 +-
.../doclet/testOrdering/TestOrdering.java | 90 ++++++------
.../TestBadOverride.java | 4 +-
.../TestSerializedForm.java | 12 +-
.../TestSummaryHeading.java | 4 +-
.../doclet/testSummaryTag/TestSummaryTag.java | 2 +-
.../TestSystemPropertyTaglet.java | 6 +-
.../lib/javadoc/tester/JavadocTester.java | 79 ++++++++---
.../lib/javadoc/tester/ShowHeadings.java | 102 +++++++++++++
63 files changed, 660 insertions(+), 485 deletions(-)
create mode 100644 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Headings.java
rename src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/{markup/HtmlConstants.java => MarkerComments.java} (62%)
create mode 100644 test/langtools/jdk/javadoc/lib/javadoc/tester/ShowHeadings.java
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java
index 56e6c83aa3e..4af3df20a79 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@ import java.util.*;
import java.util.zip.*;
import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
@@ -38,7 +37,6 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.util.SimpleElementVisitor9;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -170,7 +168,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
String unicode = uc.toString();
contentTree.addContent(getMarkerAnchorForIndex(unicode));
Content headContent = new StringContent(unicode);
- Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, false,
+ Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, false,
HtmlStyle.title, headContent);
contentTree.addContent(heading);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
index c57408a5fdd..2d0025ee808 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,12 +40,10 @@ import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
-import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
import jdk.javadoc.internal.doclets.toolkit.Resources;
@@ -375,18 +373,6 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
return utils.getSimpleName(member);
}
- /**
- * Get the header for the section.
- *
- * @param member the member being documented.
- * @return a header content for the section.
- */
- protected Content getHead(Element member) {
- Content memberContent = new StringContent(name(member));
- Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent);
- return heading;
- }
-
/**
* Return true if the given ProgramElement is inherited
* by the class that is being documented.
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
index 794d7ceb5f4..7927c4805ed 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java
@@ -33,7 +33,6 @@ import java.util.SortedMap;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -224,7 +223,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
* @param modules the modules to be documented
* @param text string which will be used as the heading
* @param tableSummary summary for the table
- * @param header the document tree to which the navgational links will be added
+ * @param header the document tree to which the navigational links will be added
* @param main the document tree to which the modules list will be added
*/
protected void addIndexContents(Collection modules, String text,
@@ -270,7 +269,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
protected void addConfigurationTitle(Content body) {
if (configuration.doctitle.length() > 0) {
Content title = new RawHtml(configuration.doctitle);
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.title, title);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
body.addContent(div);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
index 7ffd97c38dc..cc254f57c3c 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java
@@ -29,7 +29,6 @@ import java.util.*;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -180,7 +179,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
protected void addConfigurationTitle(Content body) {
if (configuration.doctitle.length() > 0) {
Content title = new RawHtml(configuration.doctitle);
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.title, title);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
body.addContent(div);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java
index fd310241a10..82009fea847 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@ import java.util.*;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -117,7 +116,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
if (!sset.isEmpty()) {
TypeElement firstTypeElement = sset.first();
Content headingContent = contents.getContent(heading);
- Content sectionHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+ Content sectionHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent);
HtmlTree htmlTree = HtmlTree.SECTION(sectionHeading);
addLevelInfo(!utils.isInterface(firstTypeElement) ? firstTypeElement : null,
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java
index 2f4a3914448..86931ef0010 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java
@@ -29,7 +29,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -112,7 +111,7 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
String label = resources.getText("doclet.All_Classes");
Content body = getBody(false, getWindowTitle(label));
Content htmlTree = HtmlTree.MAIN();
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.bar, contents.allClassesLabel);
htmlTree.addContent(heading);
Content ul = new HtmlTree(HtmlTag.UL);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
index 3d5ba0dbbc0..906073e7e95 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
@@ -32,7 +32,6 @@ import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -148,7 +147,7 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
}
}
Content titleContent = contents.allClassesLabel;
- Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
content.addContent(headerDiv);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
index d07013c6d2d..545dd7475b4 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
@@ -27,7 +27,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -94,7 +93,7 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
div.setStyle(HtmlStyle.allPackagesContainer);
addPackages(div);
Content titleContent = contents.allPackagesLabel;
- Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
mainTree.addContent(headerDiv);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
index db13176dd3a..4a219105603 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -72,7 +71,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(
- HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
+ MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -96,7 +95,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addAnnotationFieldDetailsMarker(Content memberDetails) {
- memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
+ memberDetails.addContent(MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
}
/**
@@ -107,7 +106,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
if (!writer.printedAnnotationFieldHeading) {
memberDetailsTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
- Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.fieldDetailsLabel);
memberDetailsTree.addContent(heading);
writer.printedAnnotationFieldHeading = true;
@@ -121,7 +120,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
Content annotationDetailsTree) {
annotationDetailsTree.addContent(links.createAnchor(name(member)));
Content annotationDocTree = writer.getMemberTreeHeader();
- Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(member));
annotationDocTree.addContent(heading);
return annotationDocTree;
@@ -188,7 +187,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.fieldSummaryLabel);
memberTree.addContent(label);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
index a324361b0df..a91f0fbc32f 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,9 +33,7 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -75,7 +73,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(
- HtmlConstants.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY);
+ MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -112,7 +110,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
*/
@Override
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.annotateTypeOptionalMemberSummaryLabel);
memberTree.addContent(label);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
index dc0955391cd..2c23eba047e 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,11 +33,9 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -75,7 +73,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(
- HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
+ MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -99,7 +97,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addAnnotationDetailsMarker(Content memberDetails) {
- memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
+ memberDetails.addContent(MarkerComments.START_OF_ANNOTATION_TYPE_DETAILS);
}
/**
@@ -110,7 +108,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
if (!writer.printedAnnotationHeading) {
memberDetailsTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL));
- Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.annotationTypeDetailsLabel);
memberDetailsTree.addContent(heading);
writer.printedAnnotationHeading = true;
@@ -126,7 +124,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
annotationDetailsTree.addContent(links.createAnchor(
simpleName + utils.signature((ExecutableElement) member)));
Content annotationDocTree = writer.getMemberTreeHeader();
- Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(simpleName);
annotationDocTree.addContent(heading);
return annotationDocTree;
@@ -193,7 +191,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.annotateTypeRequiredMemberSummaryLabel);
memberTree.addContent(label);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
index c69d76d5f23..ef68b8b194b 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
@@ -32,7 +32,6 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -95,7 +94,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true));
bodyTree.addContent(htmlTree);
- bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
+ bodyTree.addContent(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header);
if (configuration.showModules) {
@@ -118,7 +117,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_HEADER, annotationType);
Content headerContent = new StringContent(header);
- Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent);
heading.addContent(getTypeParameterLinks(linkInfo));
div.addContent(heading);
@@ -139,7 +138,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/
@Override
public void addFooter(Content contentTree) {
- contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
+ contentTree.addContent(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false));
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
index 42624d22891..655edfe5167 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
@@ -42,7 +42,6 @@ import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -325,7 +324,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
typeElement)),
getPackageLink(pkg, utils.getPackageName(pkg)));
- Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
+ Content heading = HtmlTree.HEADING(Headings.TypeUse.SUMMARY_HEADING, link);
htmlTree.addContent(heading);
addClassUse(pkg, htmlTree);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
@@ -452,7 +451,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
headContent.addContent(contents.getContent("doclet.ClassUse_Title", cltype));
headContent.addContent(new HtmlTree(HtmlTag.BR));
headContent.addContent(clname);
- Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
true, HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div);
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 917d96a1815..3ed401ae47a 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
@@ -36,7 +36,6 @@ import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.SimpleElementVisitor8;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -116,7 +115,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true));
bodyTree.addContent(htmlTree);
- bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
+ bodyTree.addContent(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header);
if (configuration.showModules) {
@@ -143,7 +142,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
//Let's not link to ourselves in the header.
linkInfo.linkToSelf = false;
Content headerContent = new StringContent(header);
- Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent);
heading.addContent(getTypeParameterLinks(linkInfo));
div.addContent(heading);
@@ -164,7 +163,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
*/
@Override
public void addFooter(Content contentTree) {
- contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
+ contentTree.addContent(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false));
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
index b0c08ee17f8..3c381de5f5d 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
@@ -36,7 +36,6 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -152,11 +151,11 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
@Override
public void addContentsList(Content contentTree, Content contentListTree) {
Content titleContent = contents.constantsSummaryTitle;
- Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent);
Content div = HtmlTree.DIV(HtmlStyle.header, pHeading);
Content headingContent = contents.contentsHeading;
- Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent);
HtmlTree section = HtmlTree.SECTION(heading);
section.addContent(contentListTree);
@@ -192,7 +191,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
pkgNameContent = getPackageLabel(parsedPackageName);
}
Content headingContent = new StringContent(".*");
- Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.ConstantsSummary.PACKAGE_HEADING, true,
pkgNameContent);
heading.addContent(headingContent);
summaryTree = HtmlTree.SECTION(heading);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
index de70a890dec..f55d78b2acc 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -98,7 +97,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
- memberSummaryTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_SUMMARY);
+ memberSummaryTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -118,11 +117,11 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
@Override
public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
- memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS);
+ memberDetailsTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_DETAILS);
Content constructorDetailsTree = writer.getMemberTreeHeader();
constructorDetailsTree.addContent(links.createAnchor(
SectionName.CONSTRUCTOR_DETAIL));
- Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.constructorDetailsLabel);
constructorDetailsTree.addContent(heading);
return constructorDetailsTree;
@@ -140,7 +139,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
}
constructorDetailsTree.addContent(links.createAnchor(writer.getAnchor(constructor)));
Content constructorDocTree = writer.getMemberTreeHeader();
- Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(constructor));
constructorDocTree.addContent(heading);
return constructorDocTree;
@@ -223,7 +222,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.constructorSummaryLabel);
memberTree.addContent(label);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
index 14ad271c9b3..e951fcd3961 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
@@ -38,7 +38,6 @@ import javax.lang.model.element.PackageElement;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -336,11 +335,11 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
*/
public Content getContentsList(DeprecatedAPIListBuilder deprapi) {
Content headContent = contents.deprecatedAPI;
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
Content headingContent = contents.contentsHeading;
- div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+ div.addContent(HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent));
Content ul = new HtmlTree(HtmlTag.UL);
for (DeprElementKind kind : DeprElementKind.values()) {
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java
index 0993f81e512..2affe50e362 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,11 +33,9 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.EnumConstantWriter;
@@ -71,7 +69,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
- memberSummaryTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_SUMMARY);
+ memberSummaryTree.addContent(MarkerComments.START_OF_ENUM_CONSTANT_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -91,11 +89,11 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
@Override
public Content getEnumConstantsDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
- memberDetailsTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_DETAILS);
+ memberDetailsTree.addContent(MarkerComments.START_OF_ENUM_CONSTANT_DETAILS);
Content enumConstantsDetailsTree = writer.getMemberTreeHeader();
enumConstantsDetailsTree.addContent(links.createAnchor(
SectionName.ENUM_CONSTANT_DETAIL));
- Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.enumConstantDetailLabel);
enumConstantsDetailsTree.addContent(heading);
return enumConstantsDetailsTree;
@@ -109,7 +107,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
Content enumConstantsDetailsTree) {
enumConstantsDetailsTree.addContent(links.createAnchor(name(enumConstant)));
Content enumConstantsTree = writer.getMemberTreeHeader();
- Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(enumConstant));
enumConstantsTree.addContent(heading);
return enumConstantsTree;
@@ -182,7 +180,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.enumConstantSummary);
memberTree.addContent(label);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java
index 36f777c7854..c6e337d7f62 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,11 +35,9 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.FieldWriter;
@@ -75,7 +73,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
- memberSummaryTree.addContent(HtmlConstants.START_OF_FIELD_SUMMARY);
+ memberSummaryTree.addContent(MarkerComments.START_OF_FIELD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -94,11 +92,11 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/
@Override
public Content getFieldDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
- memberDetailsTree.addContent(HtmlConstants.START_OF_FIELD_DETAILS);
+ memberDetailsTree.addContent(MarkerComments.START_OF_FIELD_DETAILS);
Content fieldDetailsTree = writer.getMemberTreeHeader();
fieldDetailsTree.addContent(links.createAnchor(
SectionName.FIELD_DETAIL));
- Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.fieldDetailsLabel);
fieldDetailsTree.addContent(heading);
return fieldDetailsTree;
@@ -111,7 +109,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
public Content getFieldDocTreeHeader(VariableElement field, Content fieldDetailsTree) {
fieldDetailsTree.addContent(links.createAnchor(name(field)));
Content fieldTree = writer.getMemberTreeHeader();
- Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(field));
fieldTree.addContent(heading);
return fieldTree;
@@ -186,7 +184,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.fieldSummaryLabel);
memberTree.addContent(label);
}
@@ -247,7 +245,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
? resources.getText("doclet.Fields_Inherited_From_Class")
: resources.getText("doclet.Fields_Inherited_From_Interface"));
}
- Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
+ Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Headings.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Headings.java
new file mode 100644
index 00000000000..8190ca47b26
--- /dev/null
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Headings.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.javadoc.internal.doclets.formats.html;
+
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
+
+/**
+ * Aliases for HTML heading tags (H1..H6) for different kinds of pages.
+ *
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.
+ */
+class Headings {
+ /**
+ * Standard top-level heading for the page title for all pages.
+ */
+ static final HtmlTag PAGE_TITLE_HEADING = HtmlTag.H1;
+
+ /**
+ * Standard second-level heading for sundry pages that do
+ * not have their own page group.
+ */
+ static final HtmlTag CONTENT_HEADING = HtmlTag.H2;
+
+ /**
+ * Headings for the page for a module declaration.
+ */
+ static class ModuleDeclaration {
+ static final HtmlTag SUMMARY_HEADING = HtmlTag.H2;
+ }
+
+ /**
+ * Headings for the page for a type declaration.
+ * This includes classes, interfaces, enums and annotation types.
+ */
+ static class TypeDeclaration {
+ /**
+ * Heading for the different summary lists:
+ * Field Summary, Constructor Summary, Method Summary, etc.
+ */
+ static final HtmlTag SUMMARY_HEADING = HtmlTag.H2;
+
+ /**
+ * Subheading within a summary for the inherited elements:
+ * inherited methods, etc
+ */
+ static final HtmlTag INHERITED_SUMMARY_HEADING = HtmlTag.H3;
+
+ /**
+ * Heading for the different detail lists:
+ * Field Details, Constructor Details, Method Details, etc.
+ */
+ static final HtmlTag DETAILS_HEADING = HtmlTag.H2;
+
+ /**
+ * Subheading with a Details list for an individual element.
+ */
+ static final HtmlTag MEMBER_HEADING = HtmlTag.H3;
+ }
+
+ /**
+ * Headings for the Constants Summary page.
+ */
+ static class ConstantsSummary {
+ static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
+ }
+
+ /**
+ * Headings for the Serialized Form page.
+ */
+ static class SerializedForm {
+ /**
+ * Heading for the package name, preceding a list of types.
+ */
+ static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
+
+ /**
+ * Heading for a type name within a package.
+ */
+ static final HtmlTag CLASS_HEADING = HtmlTag.H3;
+
+ /**
+ * Subheading for info within a type.
+ */
+ static final HtmlTag CLASS_SUBHEADING = HtmlTag.H4;
+
+ /**
+ * Heading for an individual member element within a type.
+ */
+ static final HtmlTag MEMBER_HEADING = HtmlTag.H5;
+ }
+
+ /**
+ * Headings for a type Use page.
+ */
+ static class TypeUse {
+ static final HtmlTag SUMMARY_HEADING = HtmlTag.H2;
+ }
+
+ /**
+ * Headings for index frames pages.
+ */
+ static class IndexFrames {
+ /** Heading for a list of module names in an index frame. */
+ static final HtmlTag MODULE_HEADING = HtmlTag.H2;
+ /** Heading for a list of package names in an index frame. */
+ static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
+ }
+}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
index 9ce70ff5d13..07c43f13540 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
@@ -25,7 +25,6 @@
package jdk.javadoc.internal.doclets.formats.html;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -113,7 +112,7 @@ public class HelpWriter extends HtmlDocletWriter {
*/
protected void addHelpFileContents(Content contentTree) {
// Heading
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false, HtmlStyle.title,
contents.getContent("doclet.help.main_heading"));
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
Content intro = HtmlTree.DIV(HtmlStyle.subTitle,
@@ -126,7 +125,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Overview
if (configuration.createoverview) {
- Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content overviewHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.overviewLabel);
htmlTree = HtmlTree.SECTION(overviewHeading);
String overviewKey = configuration.showModules
@@ -143,7 +142,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Module
if (configuration.showModules) {
- Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content moduleHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.moduleLabel);
htmlTree = HtmlTree.SECTION(moduleHead);
Content moduleIntro = contents.getContent("doclet.help.module.intro");
@@ -158,7 +157,7 @@ public class HelpWriter extends HtmlDocletWriter {
}
// Package
- Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content packageHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.packageLabel);
htmlTree = HtmlTree.SECTION(packageHead);
Content packageIntro = contents.getContent("doclet.help.package.intro");
@@ -175,7 +174,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Class/interface
- Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content classHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.class_interface.head"));
htmlTree = HtmlTree.SECTION(classHead);
Content classIntro = contents.getContent("doclet.help.class_interface.intro");
@@ -210,7 +209,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Annotation Types
- Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content aHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.annotationType);
htmlTree = HtmlTree.SECTION(aHead);
Content aIntro = contents.getContent("doclet.help.annotation_type.intro");
@@ -226,7 +225,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Enums
- Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_);
+ Content enumHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.enum_);
htmlTree = HtmlTree.SECTION(enumHead);
Content eIntro = contents.getContent("doclet.help.enum.intro");
Content enumPara = HtmlTree.P(eIntro);
@@ -241,7 +240,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Class Use
if (configuration.classuse) {
- Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content useHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.use.head"));
htmlTree = HtmlTree.SECTION(useHead);
Content useBody = contents.getContent("doclet.help.use.body");
@@ -252,7 +251,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Tree
if (configuration.createtree) {
- Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content treeHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.tree.head"));
htmlTree = HtmlTree.SECTION(treeHead);
Content treeIntro = contents.getContent("doclet.help.tree.intro",
@@ -270,7 +269,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Deprecated
if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) {
- Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content dHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.deprecatedAPI);
htmlTree = HtmlTree.SECTION(dHead);
Content deprBody = contents.getContent("doclet.help.deprecated.body",
@@ -291,7 +290,7 @@ public class HelpWriter extends HtmlDocletWriter {
indexlink = links.createLink(DocPaths.INDEX_ALL,
resources.getText("doclet.Index"));
}
- Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content indexHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.index.head"));
htmlTree = HtmlTree.SECTION(indexHead);
Content indexBody = contents.getContent("doclet.help.index.body", indexlink);
@@ -302,7 +301,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Frames
if (configuration.frames) {
- Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content frameHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.frames.head"));
htmlTree = HtmlTree.SECTION(frameHead);
Content framesBody = contents.getContent("doclet.help.frames.body");
@@ -313,7 +312,7 @@ public class HelpWriter extends HtmlDocletWriter {
}
// Serialized Form
- Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content sHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.serializedForm);
htmlTree = HtmlTree.SECTION(sHead);
Content serialBody = contents.getContent("doclet.help.serial_form.body");
@@ -322,7 +321,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Constant Field Values
- Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content constHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.constantsSummaryTitle);
htmlTree = HtmlTree.SECTION(constHead);
Content constantsBody = contents.getContent("doclet.help.constants.body",
@@ -333,7 +332,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Search
- Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content searchHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.search.head"));
htmlTree = HtmlTree.SECTION(searchHead);
Content searchBody = contents.getContent("doclet.help.search.body");
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
index d034d99461d..c8ae3447213 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,11 +41,9 @@ import com.sun.tools.doclint.DocLint;
import jdk.javadoc.doclet.Doclet;
import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlVersion;
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
-import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.Resources;
@@ -82,6 +80,11 @@ import static javax.tools.Diagnostic.Kind.*;
*/
public class HtmlConfiguration extends BaseConfiguration {
+ /**
+ * Default charset for HTML.
+ */
+ public static final String HTML_DEFAULT_CHARSET = "utf-8";
+
/**
* Argument for command line option "-header".
*/
@@ -762,7 +765,7 @@ public class HtmlConfiguration extends BaseConfiguration {
protected boolean finishOptionSettings0() throws DocletException {
if (docencoding == null) {
if (charset == null) {
- docencoding = charset = (encoding == null) ? HtmlConstants.HTML_DEFAULT_CHARSET : encoding;
+ docencoding = charset = (encoding == null) ? HTML_DEFAULT_CHARSET : encoding;
} else {
docencoding = charset;
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java
index 10688190640..65a320359c0 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@ import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -108,8 +107,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
li.setStyle(HtmlStyle.blockList);
if (serializableFieldsTree.isValid()) {
Content headingContent = new StringContent(heading);
- Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
- headingContent);
+ Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
li.addContent(serialHeading);
li.addContent(serializableFieldsTree);
}
@@ -120,7 +118,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
public void addMemberHeader(TypeElement fieldType, String fieldTypeStr,
String fieldDimensions, String fieldName, Content contentTree) {
Content nameContent = new StringContent(fieldName);
- Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent);
+ Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, nameContent);
contentTree.addContent(heading);
Content pre = new HtmlTree(HtmlTag.PRE);
if (fieldType == null) {
@@ -138,7 +136,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
@Override
public void addMemberHeader(TypeMirror fieldType, String fieldName, Content contentTree) {
Content nameContent = new StringContent(fieldName);
- Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent);
+ Content heading = HtmlTree.HEADING(HtmlTag.H5, nameContent);
contentTree.addContent(heading);
Content pre = new HtmlTree(HtmlTag.PRE);
Content fieldContent = writer.getLink(new LinkInfoImpl(
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialMethodWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialMethodWriter.java
index 070bb7f83bc..e16f853c6a4 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialMethodWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialMethodWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@ import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -95,8 +94,7 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
*/
public Content getSerializableMethods(String heading, Content serializableMethodContent) {
Content headingContent = new StringContent(heading);
- Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
- headingContent);
+ Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
Content li = HtmlTree.LI(HtmlStyle.blockList, serialHeading);
li.addContent(serializableMethodContent);
return li;
@@ -120,7 +118,9 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
* @param methodsContentTree the content tree to which the member header will be added
*/
public void addMemberHeader(ExecutableElement member, Content methodsContentTree) {
- methodsContentTree.addContent(getHead(member));
+ Content memberContent = new StringContent(name(member));
+ Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, memberContent);
+ methodsContentTree.addContent(heading);
methodsContentTree.addContent(getSignature(member));
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlConstants.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java
similarity index 62%
rename from src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlConstants.java
rename to src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java
index 32383d1b288..8131fc54ae6 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlConstants.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,12 @@
* questions.
*/
-package jdk.javadoc.internal.doclets.formats.html.markup;
+package jdk.javadoc.internal.doclets.formats.html;
-import jdk.javadoc.internal.doclets.toolkit.Content;
+import jdk.javadoc.internal.doclets.formats.html.markup.Comment;
/**
- * Stores constants for Html Doclet.
+ * Marker comments to identify regions in the generated files.
*
*
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
@@ -37,216 +37,162 @@ import jdk.javadoc.internal.doclets.toolkit.Content;
*
* @author Bhavesh Patel
*/
-public class HtmlConstants {
+public class MarkerComments {
/**
* Marker to identify start of top navigation bar.
*/
- public static final Content START_OF_TOP_NAVBAR =
+ public static final Comment START_OF_TOP_NAVBAR =
new Comment("========= START OF TOP NAVBAR =======");
/**
* Marker to identify start of bottom navigation bar.
*/
- public static final Content START_OF_BOTTOM_NAVBAR =
+ public static final Comment START_OF_BOTTOM_NAVBAR =
new Comment("======= START OF BOTTOM NAVBAR ======");
/**
* Marker to identify end of top navigation bar.
*/
- public static final Content END_OF_TOP_NAVBAR =
+ public static final Comment END_OF_TOP_NAVBAR =
new Comment("========= END OF TOP NAVBAR =========");
/**
* Marker to identify end of bottom navigation bar.
*/
- public static final Content END_OF_BOTTOM_NAVBAR =
+ public static final Comment END_OF_BOTTOM_NAVBAR =
new Comment("======== END OF BOTTOM NAVBAR =======");
/**
* Marker to identify start of module description.
*/
- public static final Content START_OF_MODULE_DESCRIPTION =
+ public static final Comment START_OF_MODULE_DESCRIPTION =
new Comment("============ MODULE DESCRIPTION ===========");
/**
* Marker to identify start of modules summary.
*/
- public static final Content START_OF_MODULES_SUMMARY =
+ public static final Comment START_OF_MODULES_SUMMARY =
new Comment("============ MODULES SUMMARY ===========");
/**
* Marker to identify start of packages summary.
*/
- public static final Content START_OF_PACKAGES_SUMMARY =
+ public static final Comment START_OF_PACKAGES_SUMMARY =
new Comment("============ PACKAGES SUMMARY ===========");
/**
* Marker to identify start of services summary.
*/
- public static final Content START_OF_SERVICES_SUMMARY =
+ public static final Comment START_OF_SERVICES_SUMMARY =
new Comment("============ SERVICES SUMMARY ===========");
/**
* Marker to identify start of class data.
*/
- public static final Content START_OF_CLASS_DATA =
+ public static final Comment START_OF_CLASS_DATA =
new Comment("======== START OF CLASS DATA ========");
/**
* Marker to identify end of class data.
*/
- public static final Content END_OF_CLASS_DATA =
+ public static final Comment END_OF_CLASS_DATA =
new Comment("========= END OF CLASS DATA =========");
/**
* Marker to identify start of nested class summary.
*/
- public static final Content START_OF_NESTED_CLASS_SUMMARY =
+ public static final Comment START_OF_NESTED_CLASS_SUMMARY =
new Comment("======== NESTED CLASS SUMMARY ========");
/**
* Marker to identify start of annotation type optional member summary.
*/
- public static final Content START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY =
+ public static final Comment START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY ===========");
/**
* Marker to identify start of annotation type required member summary.
*/
- public static final Content START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY =
+ public static final Comment START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ===========");
/**
* Marker to identify start of annotation type required member summary.
*/
- public static final Content START_OF_ANNOTATION_TYPE_FIELD_SUMMARY =
+ public static final Comment START_OF_ANNOTATION_TYPE_FIELD_SUMMARY =
new Comment("=========== ANNOTATION TYPE FIELD SUMMARY ===========");
/**
* Marker to identify start of constructor summary.
*/
- public static final Content START_OF_CONSTRUCTOR_SUMMARY =
+ public static final Comment START_OF_CONSTRUCTOR_SUMMARY =
new Comment("======== CONSTRUCTOR SUMMARY ========");
/**
* Marker to identify start of enum constants summary.
*/
- public static final Content START_OF_ENUM_CONSTANT_SUMMARY =
+ public static final Comment START_OF_ENUM_CONSTANT_SUMMARY =
new Comment("=========== ENUM CONSTANT SUMMARY ===========");
/**
* Marker to identify start of field summary.
*/
- public static final Content START_OF_FIELD_SUMMARY =
+ public static final Comment START_OF_FIELD_SUMMARY =
new Comment("=========== FIELD SUMMARY ===========");
/**
* Marker to identify start of properties summary.
*/
- public static final Content START_OF_PROPERTY_SUMMARY =
+ public static final Comment START_OF_PROPERTY_SUMMARY =
new Comment("=========== PROPERTY SUMMARY ===========");
/**
* Marker to identify start of method summary.
*/
- public static final Content START_OF_METHOD_SUMMARY =
+ public static final Comment START_OF_METHOD_SUMMARY =
new Comment("========== METHOD SUMMARY ===========");
/**
* Marker to identify start of annotation type details.
*/
- public static final Content START_OF_ANNOTATION_TYPE_DETAILS =
+ public static final Comment START_OF_ANNOTATION_TYPE_DETAILS =
new Comment("============ ANNOTATION TYPE MEMBER DETAIL ===========");
/**
* Marker to identify start of annotation type field details.
*/
- public static final Content START_OF_ANNOTATION_TYPE_FIELD_DETAILS =
+ public static final Comment START_OF_ANNOTATION_TYPE_FIELD_DETAILS =
new Comment("============ ANNOTATION TYPE FIELD DETAIL ===========");
/**
* Marker to identify start of method details.
*/
- public static final Content START_OF_METHOD_DETAILS =
+ public static final Comment START_OF_METHOD_DETAILS =
new Comment("============ METHOD DETAIL ==========");
/**
* Marker to identify start of field details.
*/
- public static final Content START_OF_FIELD_DETAILS =
+ public static final Comment START_OF_FIELD_DETAILS =
new Comment("============ FIELD DETAIL ===========");
/**
* Marker to identify start of property details.
*/
- public static final Content START_OF_PROPERTY_DETAILS =
+ public static final Comment START_OF_PROPERTY_DETAILS =
new Comment("============ PROPERTY DETAIL ===========");
/**
* Marker to identify start of constructor details.
*/
- public static final Content START_OF_CONSTRUCTOR_DETAILS =
+ public static final Comment START_OF_CONSTRUCTOR_DETAILS =
new Comment("========= CONSTRUCTOR DETAIL ========");
/**
* Marker to identify start of enum constants details.
*/
- public static final Content START_OF_ENUM_CONSTANT_DETAILS =
+ public static final Comment START_OF_ENUM_CONSTANT_DETAILS =
new Comment("============ ENUM CONSTANT DETAIL ===========");
- /**
- * Html tag for the page title heading.
- */
- public static final HtmlTag TITLE_HEADING = HtmlTag.H1;
-
- /**
- * Html tag for the class page title heading.
- */
- public static final HtmlTag CLASS_PAGE_HEADING = HtmlTag.H2;
-
- /**
- * Html tag for the content heading.
- */
- public static final HtmlTag CONTENT_HEADING = HtmlTag.H2;
-
- /**
- * Html tag for the package name heading.
- */
- public static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
-
- /**
- * Html tag for the module name heading.
- */
- public static final HtmlTag MODULE_HEADING = HtmlTag.H2;
-
- /**
- * Html tag for the member summary heading.
- */
- public static final HtmlTag SUMMARY_HEADING = HtmlTag.H3;
-
- /**
- * Html tag for the inherited member summary heading.
- */
- public static final HtmlTag INHERITED_SUMMARY_HEADING = HtmlTag.H3;
-
- /**
- * Html tag for the member details heading.
- */
- public static final HtmlTag DETAILS_HEADING = HtmlTag.H3;
-
- /**
- * Html tag for the serialized member heading.
- */
- public static final HtmlTag SERIALIZED_MEMBER_HEADING = HtmlTag.H3;
-
- /**
- * Html tag for the member heading.
- */
- public static final HtmlTag MEMBER_HEADING = HtmlTag.H4;
-
- /**
- * Default charset for HTML.
- */
- public static final String HTML_DEFAULT_CHARSET = "utf-8";
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
index 34f24698463..5c3735bc6fb 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@ import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -87,7 +86,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
- memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY);
+ memberSummaryTree.addContent(MarkerComments.START_OF_METHOD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -106,10 +105,10 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public Content getMethodDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
- memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS);
+ memberDetailsTree.addContent(MarkerComments.START_OF_METHOD_DETAILS);
Content methodDetailsTree = writer.getMemberTreeHeader();
methodDetailsTree.addContent(links.createAnchor(SectionName.METHOD_DETAIL));
- Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.methodDetailLabel);
methodDetailsTree.addContent(heading);
return methodDetailsTree;
@@ -126,7 +125,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
}
methodDetailsTree.addContent(links.createAnchor(writer.getAnchor(method)));
Content methodDocTree = writer.getMemberTreeHeader();
- Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(method));
methodDocTree.addContent(heading);
return methodDocTree;
@@ -229,7 +228,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.methodSummary);
memberTree.addContent(label);
}
@@ -295,7 +294,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
? resources.getText("doclet.Methods_Inherited_From_Class")
: resources.getText("doclet.Methods_Inherited_From_Interface"));
}
- Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
+ Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
index bc6cb06bea1..1e328498978 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
@@ -32,7 +32,6 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.ElementFilter;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -101,7 +100,7 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
DocPath moduleSummary = configuration.useModuleDirectories
? DocPaths.DOT_DOT.resolve(configuration.docPaths.moduleSummary(moduleElement))
: configuration.docPaths.moduleSummary(moduleElement);
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar,
mdlgen.links.createLink(moduleSummary, mdlLabel, "", "classFrame"));
htmlTree.addContent(heading);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
@@ -172,7 +171,7 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
continue;
}
if (!printedHeader) {
- Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
true, labelContent);
htmlTree.addContent(heading);
printedHeader = true;
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
index f096330fd4a..bcc04b7bcf2 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java
@@ -32,7 +32,6 @@ import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -57,6 +56,12 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
* @author Bhavesh Patel
*/
public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
+ /**
+ * The heading (h1 or h2) to use for the module list,
+ * set by addNavigationBarHeader depending on whether or not there
+ * is an additional initial heading.
+ */
+ private HtmlTag moduleListHeading;
/**
* Construct the ModuleIndexFrameWriter object.
@@ -83,8 +88,9 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
/**
* {@inheritDoc}
*/
+ @Override
protected void addModulesList(Content main) {
- Content heading = HtmlTree.HEADING(HtmlConstants.MODULE_HEADING, true,
+ Content heading = HtmlTree.HEADING(moduleListHeading, true,
contents.modulesLabel);
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
@@ -125,15 +131,16 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
* {@inheritDoc}
*/
protected void addNavigationBarHeader(Content header) {
- Content headerContent;
- if (configuration.packagesheader.length() > 0) {
- headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
+ String headerContent = !configuration.packagesheader.isEmpty() ? configuration.packagesheader
+ : configuration.header;
+ if (!headerContent.isEmpty()) {
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
+ HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent)));
+ header.addContent(heading);
+ moduleListHeading = Headings.IndexFrames.MODULE_HEADING;
} else {
- headerContent = new RawHtml(replaceDocRootDir(configuration.header));
+ moduleListHeading = Headings.PAGE_TITLE_HEADING;
}
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
- HtmlStyle.bar, headerContent);
- header.addContent(heading);
}
/**
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
index be5eb67c346..23de9557290 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java
@@ -33,7 +33,6 @@ import java.util.Set;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -57,6 +56,12 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
* @author Bhavesh Patel
*/
public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
+ /**
+ * The heading (h1 or h2) to use for the module packages list,
+ * set by addNavigationBarHeader depending on whether or not there
+ * is an additional initial heading.
+ */
+ private HtmlTag modulePackagesListHeading;
/**
* Construct the ModulePackageIndexFrameWriter object.
@@ -89,7 +94,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
protected void addModulePackagesList(Map> modules, String text,
String tableSummary, Content main, ModuleElement mdle) {
Content profNameContent = new StringContent(mdle.getQualifiedName().toString());
- Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+ Content heading = HtmlTree.HEADING(modulePackagesListHeading, true,
getTargetModuleLink("classFrame", profNameContent, mdle));
heading.addContent(Contents.SPACE);
heading.addContent(contents.packagesLabel);
@@ -112,7 +117,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
protected void addModulePackagesList(Set modules, String text,
String tableSummary, Content body, ModuleElement mdle) {
Content moduleNameContent = new StringContent(mdle.getQualifiedName().toString());
- Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+ Content heading = HtmlTree.HEADING(modulePackagesListHeading, true,
getTargetModuleLink("classFrame", moduleNameContent, mdle));
heading.addContent(Contents.SPACE);
heading.addContent(contents.packagesLabel);
@@ -157,15 +162,16 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
* {@inheritDoc}
*/
protected void addNavigationBarHeader(Content header) {
- Content headerContent;
- if (configuration.packagesheader.length() > 0) {
- headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
+ String headerContent = !configuration.packagesheader.isEmpty() ? configuration.packagesheader
+ : configuration.header;
+ if (!headerContent.isEmpty()) {
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
+ HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent)));
+ header.addContent(heading);
+ modulePackagesListHeading = Headings.IndexFrames.PACKAGE_HEADING;
} else {
- headerContent = new RawHtml(replaceDocRootDir(configuration.header));
+ modulePackagesListHeading = Headings.PAGE_TITLE_HEADING;
}
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
- HtmlStyle.bar, headerContent);
- header.addContent(heading);
}
/**
@@ -177,6 +183,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
/**
* Do nothing as there is no modules list on this page.
*/
+ @Override
protected void addModulesList(Content body) {
}
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 9f5e8a4e083..1098e3f1891 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
@@ -46,7 +46,6 @@ import javax.lang.model.util.ElementFilter;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -213,7 +212,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
div.addContent(annotationContent);
Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL)
? contents.openModuleLabel : contents.moduleLabel;
- Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, label);
tHeading.addContent(Contents.SPACE);
Content moduleHead = new RawHtml(heading);
@@ -461,7 +460,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Content htmltree) {
htmltree.addContent(startMarker);
htmltree.addContent(links.createAnchor(markerAnchor));
- htmltree.addContent(HtmlTree.HEADING(HtmlTag.H3, heading));
+ htmltree.addContent(HtmlTree.HEADING(Headings.ModuleDeclaration.SUMMARY_HEADING, heading));
}
/**
@@ -509,7 +508,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
contents.descriptionLabel);
HtmlTree li = new HtmlTree(HtmlTag.LI);
li.setStyle(HtmlStyle.blockList);
- addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES,
+ addSummaryHeader(MarkerComments.START_OF_MODULES_SUMMARY, SectionName.MODULES,
contents.navModules, li);
if (display(requires)) {
String text = resources.getText("doclet.Requires_Summary");
@@ -561,7 +560,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|| display(indirectPackages) || display(indirectOpenPackages)) {
HtmlTree li = new HtmlTree(HtmlTag.LI);
li.setStyle(HtmlStyle.blockList);
- addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
+ addSummaryHeader(MarkerComments.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
contents.navPackages, li);
if (display(packages)) {
addPackageSummary(li);
@@ -740,7 +739,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
if (haveProvides || haveUses) {
HtmlTree li = new HtmlTree(HtmlTag.LI);
li.setStyle(HtmlStyle.blockList);
- addSummaryHeader(HtmlConstants.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
+ addSummaryHeader(MarkerComments.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
contents.navServices, li);
TableHeader usesProvidesTableHeader =
new TableHeader(contents.typeLabel, contents.descriptionLabel);
@@ -869,7 +868,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
if (!utils.getFullBody(mdle).isEmpty()) {
Content tree = HtmlTree.SECTION();
addDeprecationInfo(tree);
- tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION);
+ tree.addContent(MarkerComments.START_OF_MODULE_DESCRIPTION);
tree.addContent(links.createAnchor(SectionName.MODULE_DESCRIPTION));
addInlineComment(mdle, tree);
moduleContentTree.addContent(tree);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
index 3eab7599a49..bbb0fa15a7d 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,10 +34,8 @@ import java.util.List;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
-import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
@@ -72,7 +70,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
- memberSummaryTree.addContent(HtmlConstants.START_OF_NESTED_CLASS_SUMMARY);
+ memberSummaryTree.addContent(MarkerComments.START_OF_NESTED_CLASS_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -91,7 +89,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.nestedClassSummary);
memberTree.addContent(label);
}
@@ -155,8 +153,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
? resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Interface")
: resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
}
- Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
- label);
+ Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);
inheritedTree.addContent(labelHeading);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java
index ac1269a70c7..7a0857b9fab 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java
@@ -30,7 +30,6 @@ import java.util.*;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -102,7 +101,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
HtmlTree body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
Content pkgNameContent = new StringContent(pkgName);
HtmlTree htmlTree = HtmlTree.MAIN();
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar,
packgen.getTargetPackageLink(packageElement, "classFrame", pkgNameContent));
htmlTree.addContent(heading);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
@@ -178,7 +177,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
continue;
}
if (!printedHeader) {
- Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
true, labelContent);
htmlTree.addContent(heading);
printedHeader = true;
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
index ecbf34fd4e3..6860d4d4cf9 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
@@ -27,7 +27,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -79,7 +78,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
*/
@Override
protected void addPackagesList(Content main) {
- Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.IndexFrames.PACKAGE_HEADING, true,
contents.packagesLabel);
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
@@ -130,7 +129,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
} else {
headerContent = new RawHtml(replaceDocRootDir(configuration.header));
}
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.bar, headerContent);
header.addContent(heading);
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java
index 359a8bb953a..98de33e8acb 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java
@@ -27,7 +27,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -101,7 +100,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
HtmlTree mainTree = HtmlTree.MAIN();
Content headContent = contents.getContent("doclet.Hierarchy_For_Package",
utils.getPackageName(packageElement));
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
if (configuration.packages.size() > 1) {
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
index 6bdb9472fc2..a0f17d28277 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
@@ -34,7 +34,6 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -252,7 +251,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
headContent.addContent(contents.getContent("doclet.ClassUse_Title", packageText));
headContent.addContent(new HtmlTree(HtmlTag.BR));
headContent.addContent(name);
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div);
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 bcf2aebdfc5..2a85edae038 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
@@ -36,7 +36,6 @@ import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -129,7 +128,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
Content annotationContent = new HtmlTree(HtmlTag.P);
addAnnotationInfo(packageElement, annotationContent);
div.addContent(annotationContent);
- Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, contents.packageLabel);
tHeading.addContent(Contents.SPACE);
Content packageHead = new StringContent(heading);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java
index d34be75791e..9a256f8763e 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -68,7 +67,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/
@Override
public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
- memberSummaryTree.addContent(HtmlConstants.START_OF_PROPERTY_SUMMARY);
+ memberSummaryTree.addContent(MarkerComments.START_OF_PROPERTY_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@@ -88,10 +87,10 @@ public class PropertyWriterImpl extends AbstractMemberWriter
@Override
public Content getPropertyDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
- memberDetailsTree.addContent(HtmlConstants.START_OF_PROPERTY_DETAILS);
+ memberDetailsTree.addContent(MarkerComments.START_OF_PROPERTY_DETAILS);
Content propertyDetailsTree = writer.getMemberTreeHeader();
propertyDetailsTree.addContent(links.createAnchor(SectionName.PROPERTY_DETAIL));
- Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.propertyDetailsLabel);
propertyDetailsTree.addContent(heading);
return propertyDetailsTree;
@@ -105,7 +104,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
Content propertyDetailsTree) {
propertyDetailsTree.addContent(links.createAnchor(name(property)));
Content propertyDocTree = writer.getMemberTreeHeader();
- Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(utils.getPropertyLabel(name(property)));
propertyDocTree.addContent(heading);
return propertyDocTree;
@@ -200,7 +199,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
- Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.propertySummaryLabel);
memberTree.addContent(label);
}
@@ -261,7 +260,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
? resources.getText("doclet.Properties_Inherited_From_Class")
: resources.getText("doclet.Properties_Inherited_From_Interface"));
}
- Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
+ Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java
index b11367ef32f..986e3618c3a 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java
@@ -29,7 +29,6 @@ import java.util.*;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -42,7 +41,7 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
/**
- * Generate the Serialized Form Information Page.
+ * Generates the Serialized Form Information Page, serialized-form.html.
*
*
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
@@ -86,7 +85,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
htmlTree.addContent(navBar.getContent(true));
bodyTree.addContent(htmlTree);
Content h1Content = new StringContent(header);
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, h1Content);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div);
@@ -120,7 +119,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
* @return a content tree for the package header
*/
public Content getPackageHeader(String packageName) {
- Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+ Content heading = HtmlTree.HEADING(Headings.SerializedForm.PACKAGE_HEADING, true,
contents.packageLabel);
heading.addContent(Contents.SPACE);
heading.addContent(packageName);
@@ -173,8 +172,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
contents.getContent(
"doclet.Class_0_extends_implements_serializable", classLink,
superClassLink);
- li.addContent(HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
- className));
+ li.addContent(HtmlTree.HEADING(Headings.SerializedForm.CLASS_HEADING, className));
return li;
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java
index b5d3b026e38..50b27b73b2d 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java
@@ -29,7 +29,6 @@ import java.util.SortedSet;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -108,7 +107,7 @@ public class TreeWriter extends AbstractTreeWriter {
public void generateTreeFile() throws DocFileIOException {
HtmlTree body = getTreeHeader();
Content headContent = contents.hierarchyForAllPackages;
- Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
+ Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
addPackageTreeLinks(div);
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java
index 56a2e16c446..f2139dfd1ad 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@ import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.formats.html.AbstractMemberWriter;
import jdk.javadoc.internal.doclets.formats.html.Contents;
import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
+import jdk.javadoc.internal.doclets.formats.html.MarkerComments;
import jdk.javadoc.internal.doclets.formats.html.SectionName;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder;
@@ -106,8 +107,8 @@ public class Navigation {
}
enum Position {
- BOTTOM(HtmlConstants.START_OF_BOTTOM_NAVBAR, HtmlConstants.END_OF_BOTTOM_NAVBAR),
- TOP(HtmlConstants.START_OF_TOP_NAVBAR, HtmlConstants.END_OF_TOP_NAVBAR);
+ BOTTOM(MarkerComments.START_OF_BOTTOM_NAVBAR, MarkerComments.END_OF_BOTTOM_NAVBAR),
+ TOP(MarkerComments.START_OF_TOP_NAVBAR, MarkerComments.END_OF_TOP_NAVBAR);
final Content startOfNav;
final Content endOfNav;
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java
index 96f1d1d2aeb..ecaa514939c 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -304,8 +304,8 @@ public class SerializedFormBuilder extends AbstractBuilder {
Content noCustomizationMsg = methodWriter.getNoCustomizationMsg(
resources.getText("doclet.Serializable_no_customization"));
classContentTree.addContent(methodWriter.getSerializableMethods(
- resources.getText("doclet.Serialized_Form_methods"),
- noCustomizationMsg));
+ resources.getText("doclet.Serialized_Form_methods"),
+ noCustomizationMsg));
}
}
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
index e46e2825f36..287dde6433d 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
@@ -296,25 +296,32 @@ ul.subNavList li {
/*
* Styles for headings.
*/
-div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+div.details ul.blockList ul.blockList ul.blockList li.blockList h3,
+div.details ul.blockList ul.blockList ul.blockListLast li.blockList h3,
+div.serializedFormContainer ul.blockList ul.blockList ul.blockList li.blockList h4 {
background-color:#dee3e9;
border:1px solid #d0d9e0;
margin:0 0 6px -8px;
padding:7px 5px;
}
-ul.blockList ul.blockList ul.blockList li.blockList h3 {
+div.details h2,
+div.summary h2 {
+ font-style: italic;
+}
+div.details h3,
+div.summary h3 {
+ font-style: normal;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h2 {
background-color:#dee3e9;
border:1px solid #d0d9e0;
margin:0 0 6px -8px;
padding:7px 5px;
}
-ul.blockList ul.blockList li.blockList h3 {
+ul.blockList ul.blockList li.blockList h2 {
padding:0;
margin:15px 0;
}
-ul.blockList li.blockList h2 {
- padding:0px 0 20px 0;
-}
/*
* Styles for page layout containers.
*/
@@ -597,7 +604,8 @@ th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited,
.docSummary {
padding:0;
}
-ul.blockList ul.blockList ul.blockList li.blockList h3 {
+ul.blockList ul.blockList ul.blockList li.blockList h3,
+ul.blockList ul.blockList ul.blockListLast li.blockList h3 {
font-style:normal;
}
div.block {
diff --git a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java
index d9af68abce3..3664f73395f 100644
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java
@@ -57,11 +57,11 @@ public class TestAnnotationTypes extends JavadocTester {
+ "