!73 updated to aarch64-shenandoah-jdk8u282-b08 (from aarch64-port/jdk8u-shenandoah)

From: @jdkboy
Reviewed-by: @jvmboy
Signed-off-by: @jvmboy
This commit is contained in:
openeuler-ci-bot 2021-02-02 20:25:22 +08:00 committed by Gitee
commit de5a6996ac
92 changed files with 2498 additions and 2914 deletions

View File

@ -1,12 +1,12 @@
From 49a2e9b6736355ccf7a836784f8fc214458c16bc Mon Sep 17 00:00:00 2001
Date: Wed, 22 Apr 2020 17:51:21 +0000
Subject: [PATCH] 6858051: Add a switch for the dynamic thread related log
From f3decab7d0e232833857aaee5bb929c5e21c735c Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:18:19 +0800
Subject: Add a switch for the dynamic thread related log
Summary: <gc>: Add a switch for the dynamic thread related log
LLT: hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-6858051
---
hotspot/src/share/vm/gc_implementation/shared/workerManager.hpp | 8 +++++---
.../share/vm/gc_implementation/shared/workerManager.hpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/shared/workerManager.hpp b/hotspot/src/share/vm/gc_implementation/shared/workerManager.hpp
@ -29,5 +29,5 @@ index 1a840cf2b..d48d60f3e 100644
return created_workers;
}
--
2.12.3
2.19.0

View File

@ -1,18 +1,18 @@
From 4ebab5f80152a4f807206f9464a261a75341c97c Mon Sep 17 00:00:00 2001
Date: Fri, 3 Apr 2020 14:14:31 +0000
Subject: [PATCH] 6858051: Create GC worker threads dynamically
From 28b440ef9821dd8cccbdead7039e0d8eb1cc939f Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:17:32 +0800
Subject: 6858051: Create GC worker threads dynamically
Summary: <gc>: Create GC worker threads dynamically
LLT: hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-6858051
---
.../parallelScavenge/gcTaskManager.cpp | 70 ++++++++++++++------
.../parallelScavenge/gcTaskManager.hpp | 12 +++-
.../parallelScavenge/gcTaskManager.cpp | 70 ++++++++++++-----
.../parallelScavenge/gcTaskManager.hpp | 12 ++-
.../parallelScavenge/gcTaskThread.cpp | 7 --
.../parallelScavenge/gcTaskThread.hpp | 6 +-
.../shared/adaptiveSizePolicy.cpp | 9 +--
.../shared/adaptiveSizePolicy.hpp | 2 +-
.../vm/gc_implementation/shared/workerManager.hpp | 77 ++++++++++++++++++++++
.../shared/workerManager.hpp | 77 +++++++++++++++++++
7 files changed, 144 insertions(+), 39 deletions(-)
create mode 100644 hotspot/src/share/vm/gc_implementation/shared/workerManager.hpp
@ -454,5 +454,5 @@ index 000000000..1a840cf2b
+};
+#endif // SHARE_VM_GC_SHARED_WORKERMANAGER_HPP
--
2.12.3
2.19.0

View File

@ -1,10 +1,11 @@
From 5462717718cd9d3bed0d866ae47fe5ab9fdcf5e6 Mon Sep 17 00:00:00 2001
Date: Fri, 28 Aug 2020 15:02:16 +0800
Subject: [PATCH] 6896810: Pin.java fails with OOME during System.out.println
From 26ad7960db3c1d445d3a3b8a47f426af0062d0ce Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:33:27 +0800
Subject: 6896810: Pin.java fails with OOME during System.out.println
Summary: <java.lang>: Pin.java fails with OOME during System.out.println
LLT: jdk8u/jdk/test/java/lang/ref/SoftReference/Pin.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-6896810 huaweijdk/jdk8u-dev#2472
Bug url: https://bugs.openjdk.java.net/browse/JDK-6896810
---
jdk/test/java/lang/ref/SoftReference/Pin.java | 1 +
1 file changed, 1 insertion(+)
@ -22,5 +23,5 @@ index dbdf9be1b..38cd56da2 100644
}
--
2.12.3
2.19.0

View File

@ -1,5 +1,19 @@
From b61da8675d9f9d30f264d85a8f19ba0c398836dc Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:54:50 +0800
Subject: 8015927: Class reference duplicates in constant pool
Summary: <javac>: Class reference duplicates in constant pool
LLT: test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8015927
---
.../com/sun/tools/javac/jvm/ClassWriter.java | 4 +-
.../classes/com/sun/tools/javac/jvm/Pool.java | 10 ++-
.../jvm/ClassRefDupInConstantPoolTest.java | 63 +++++++++++++++++++
3 files changed, 74 insertions(+), 3 deletions(-)
create mode 100644 langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
index eecd6807..11b24341 100644
index eecd6807f..11b243419 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
@@ -461,11 +461,11 @@ public class ClassWriter extends ClassFile {
@ -17,7 +31,7 @@ index eecd6807..11b24341 100644
poolbuf.appendChar(pool.put(xClassName(type)));
}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java
index 4389d08b..f87c1053 100644
index 4389d08bd..f87c10537 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java
@@ -28,6 +28,7 @@ package com.sun.tools.javac.jvm;
@ -46,7 +60,7 @@ index 4389d08b..f87c1053 100644
}
diff --git a/langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java b/langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java
new file mode 100644
index 00000000..98c7cf8d
index 000000000..98c7cf8da
--- /dev/null
+++ b/langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java
@@ -0,0 +1,63 @@
@ -113,3 +127,6 @@ index 00000000..98c7cf8d
+ }
+ }
+}
--
2.19.0

View File

@ -1,17 +1,17 @@
From 727421f7f1abdcc90ac203fa03b279090a208cd7 Mon Sep 17 00:00:00 2001
Date: Fri, 18 Oct 2019 12:06:46 +0000
Subject: [PATCH] backport of JDK-8031085
From 1767fdf19ccf9dea510371641360e1ed65965db6 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:16:23 +0800
Subject: backport of JDK-8031085
Summary: <class DateTimeFormatterBuilder.java>: DateTimeFormatter won't parse dates with custom format "yyyyMMddHHmmssSSS"
LLT: jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8031085
---
.../java/time/format/DateTimeFormatterBuilder.java | 79 ++++++++++++++++++----
.../time/format/TCKDateTimeFormatterBuilder.java | 20 +++++-
.../time/format/DateTimeFormatterBuilder.java | 79 ++++++++++++++++---
.../format/TCKDateTimeFormatterBuilder.java | 20 ++++-
2 files changed, 86 insertions(+), 13 deletions(-)
diff --git a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java
index 7e0698dfce..d57a167302 100644
index 7e0698dfc..d57a16730 100644
--- a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java
+++ b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java
@@ -664,8 +664,11 @@ public final class DateTimeFormatterBuilder {
@ -139,7 +139,7 @@ index 7e0698dfce..d57a167302 100644
if (position == length) {
// valid if whole field is optional, invalid if minimum width
diff --git a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java
index c5a017c911..f689cf6512 100644
index c5a017c91..f689cf651 100644
--- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java
+++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java
@@ -69,6 +69,7 @@ import static org.testng.Assert.assertEquals;
@ -182,5 +182,5 @@ index c5a017c911..f689cf6512 100644
+
}
--
2.12.3
2.19.0

View File

@ -1,22 +1,22 @@
From cad6af30875f8c5731b76cca494f1f1301e04c96 Mon Sep 17 00:00:00 2001
Date: Mon, 11 Nov 2019 17:16:36 +0000
Subject: [PATCH] 8033552:Fix missing missing volatile specifiers in CAS
From 0b1075c6504aa93a027b1dc84797e7ecaa0880b9 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:20:45 +0800
Subject: 8033552:Fix missing missing volatile specifiers in CAS
operations in GC code
Summary: GC:Fix missing missing volatile specifiers in CAS operations in GC code
LLT: org.openjdk.jcstress.tests.defaultValues.arrays.small.plain.StringTest
Bug url: https://bugs.openjdk.java.net/browse/JDK-8033552
---
.../vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp | 4 ++--
.../concurrentMarkSweep/cmsOopClosures.hpp | 4 ++--
.../concurrentMarkSweep/concurrentMarkSweepGeneration.cpp | 8 ++++----
.../concurrentMarkSweep/concurrentMarkSweepGeneration.hpp | 2 +-
hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp | 4 ++--
.../share/vm/gc_implementation/g1/heapRegionRemSet.cpp | 4 ++--
hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp | 2 +-
hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp | 2 +-
.../gc_implementation/parallelScavenge/parallelScavengeHeap.hpp | 2 +-
.../share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp | 2 +-
.../gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp | 3 ++-
hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp | 4 ++--
.../parallelScavenge/parallelScavengeHeap.hpp | 2 +-
.../vm/gc_implementation/parallelScavenge/psYoungGen.hpp | 2 +-
.../parallelScavenge/vmStructs_parallelgc.hpp | 3 ++-
.../share/vm/gc_implementation/shared/mutableSpace.hpp | 4 ++--
hotspot/src/share/vm/gc_interface/collectedHeap.hpp | 2 +-
hotspot/src/share/vm/memory/defNewGeneration.cpp | 2 +-
hotspot/src/share/vm/memory/defNewGeneration.hpp | 2 +-
@ -27,7 +27,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8033552
17 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp
index 5220ee1f34..2697beda2b 100644
index 5220ee1f3..2697beda2 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp
@@ -295,7 +295,7 @@ class Par_PushOrMarkClosure: public MetadataAwareOopClosure {
@ -49,10 +49,10 @@ index 5220ee1f34..2697beda2b 100644
virtual void do_oop(oop* p);
virtual void do_oop(narrowOop* p);
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index e3c0048da8..6de20cb571 100644
index d48e208c5..56fb1c451 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -3914,7 +3914,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
@@ -3920,7 +3920,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
bool _result;
CompactibleFreeListSpace* _cms_space;
char _pad_front[64]; // padding to ...
@ -61,7 +61,7 @@ index e3c0048da8..6de20cb571 100644
char _pad_back[64];
HeapWord* _restart_addr;
@@ -3953,7 +3953,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
@@ -3959,7 +3959,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
OopTaskQueue* work_queue(int i) { return task_queues()->queue(i); }
@ -70,7 +70,7 @@ index e3c0048da8..6de20cb571 100644
CMSConcMarkingTerminator* terminator() { return &_term; }
@@ -7655,7 +7655,7 @@ void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) {
@@ -7668,7 +7668,7 @@ void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) {
// Note: the local finger doesn't advance while we drain
// the stack below, but the global finger sure can and will.
@ -79,7 +79,7 @@ index e3c0048da8..6de20cb571 100644
Par_PushOrMarkClosure pushOrMarkClosure(_collector,
_span, _bit_map,
_work_queue,
@@ -7824,7 +7824,7 @@ Par_PushOrMarkClosure::Par_PushOrMarkClosure(CMSCollector* collector,
@@ -7837,7 +7837,7 @@ Par_PushOrMarkClosure::Par_PushOrMarkClosure(CMSCollector* collector,
OopTaskQueue* work_queue,
CMSMarkStack* overflow_stack,
HeapWord* finger,
@ -89,7 +89,7 @@ index e3c0048da8..6de20cb571 100644
MetadataAwareOopClosure(collector->ref_processor()),
_collector(collector),
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
index a6d06a5dc5..cf2c085dc0 100644
index c28f8d6c1..8b65d3426 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
@@ -750,7 +750,7 @@ class CMSCollector: public CHeapObj<mtGC> {
@ -102,7 +102,7 @@ index a6d06a5dc5..cf2c085dc0 100644
Mutex* _eden_chunk_lock;
HeapWord** _eden_chunk_array; // ... Eden partitioning array
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
index ad8a3562e8..8167d2b09d 100644
index ad8a3562e..8167d2b09 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
@@ -56,7 +56,7 @@ class PerRegionTable: public CHeapObj<mtGC> {
@ -124,7 +124,7 @@ index ad8a3562e8..8167d2b09d 100644
size_t OtherRegionsTable::_max_fine_entries = 0;
size_t OtherRegionsTable::_mod_max_fine_entries_mask = 0;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp
index 1439fe668e..b9020002b8 100644
index 1439fe668..b9020002b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp
@@ -376,7 +376,7 @@ size_t RSHashTable::mem_size() const {
@ -137,7 +137,7 @@ index 1439fe668e..b9020002b8 100644
void SparsePRT::add_to_expanded_list(SparsePRT* sprt) {
// We could expand multiple times in a pause -- only put on list once.
diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp
index 5cc884621a..17bd4a145a 100644
index 5cc884621..17bd4a145 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp
@@ -236,7 +236,7 @@ class SparsePRT VALUE_OBJ_CLASS_SPEC {
@ -150,7 +150,7 @@ index 5cc884621a..17bd4a145a 100644
public:
SparsePRT(HeapRegion* hr);
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp
index 5173ff94ec..bf3a207cdf 100644
index 5173ff94e..bf3a207cd 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp
@@ -177,7 +177,7 @@ class ParallelScavengeHeap : public CollectedHeap {
@ -163,7 +163,7 @@ index 5173ff94ec..bf3a207cdf 100644
void ensure_parsability(bool retire_tlabs);
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp
index e3da6bdf2b..9bb7eb8e6e 100644
index e3da6bdf2..9bb7eb8e6 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp
@@ -162,7 +162,7 @@ class PSYoungGen : public CHeapObj<mtGC> {
@ -176,7 +176,7 @@ index e3da6bdf2b..9bb7eb8e6e 100644
// Iteration.
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp
index 3c1a20284e..051bcbd800 100644
index 3c1a20284..051bcbd80 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp
@@ -26,6 +26,7 @@
@ -197,7 +197,7 @@ index 3c1a20284e..051bcbd800 100644
nonstatic_field(PSYoungGen, _reserved, MemRegion) \
nonstatic_field(PSYoungGen, _virtual_space, PSVirtualSpace*) \
diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp
index 0f1dd075d4..dbd52f24be 100644
index 0f1dd075d..dbd52f24b 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp
@@ -51,7 +51,7 @@ class MutableSpace: public ImmutableSpace {
@ -219,10 +219,10 @@ index 0f1dd075d4..dbd52f24be 100644
virtual void set_bottom(HeapWord* value) { _bottom = value; }
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
index 48fd7e7c0a..653ef5c2ed 100644
index c13d29780..88632ddc8 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
@@ -379,7 +379,7 @@ class CollectedHeap : public CHeapObj<mtInternal> {
@@ -371,7 +371,7 @@ class CollectedHeap : public CHeapObj<mtInternal> {
// These functions return the addresses of the fields that define the
// boundaries of the contiguous allocation area. (These fields should be
// physically near to one another.)
@ -232,7 +232,7 @@ index 48fd7e7c0a..653ef5c2ed 100644
return NULL;
}
diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp
index 273d8a3130..15ff6b7328 100644
index a9e1befed..e5ac4f847 100644
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp
@@ -494,7 +494,7 @@ size_t DefNewGeneration::contiguous_available() const {
@ -245,7 +245,7 @@ index 273d8a3130..15ff6b7328 100644
void DefNewGeneration::object_iterate(ObjectClosure* blk) {
diff --git a/hotspot/src/share/vm/memory/defNewGeneration.hpp b/hotspot/src/share/vm/memory/defNewGeneration.hpp
index a5c0eb3095..11359b7979 100644
index 28738619f..24d1b4c0f 100644
--- a/hotspot/src/share/vm/memory/defNewGeneration.hpp
+++ b/hotspot/src/share/vm/memory/defNewGeneration.hpp
@@ -233,7 +233,7 @@ protected:
@ -258,10 +258,10 @@ index a5c0eb3095..11359b7979 100644
// Thread-local allocation buffers
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
index 596960e473..572436a388 100644
index 7f4fc0d61..bbe6370a6 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
@@ -778,7 +778,7 @@ bool GenCollectedHeap::supports_inline_contig_alloc() const {
@@ -782,7 +782,7 @@ bool GenCollectedHeap::supports_inline_contig_alloc() const {
return _gens[0]->supports_inline_contig_alloc();
}
@ -271,7 +271,7 @@ index 596960e473..572436a388 100644
}
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
index 416ae87415..6d0dd591c3 100644
index 416ae8741..6d0dd591c 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
@@ -162,7 +162,7 @@ public:
@ -284,10 +284,10 @@ index 416ae87415..6d0dd591c3 100644
// Does this heap support heap inspection? (+PrintClassHistogram)
diff --git a/hotspot/src/share/vm/memory/generation.hpp b/hotspot/src/share/vm/memory/generation.hpp
index 63dccb70fb..47c26c83dc 100644
index ca3fe949d..ef5457890 100644
--- a/hotspot/src/share/vm/memory/generation.hpp
+++ b/hotspot/src/share/vm/memory/generation.hpp
@@ -290,7 +290,7 @@ class Generation: public CHeapObj<mtGC> {
@@ -291,7 +291,7 @@ class Generation: public CHeapObj<mtGC> {
// These functions return the addresses of the fields that define the
// boundaries of the contiguous allocation area. (These fields should be
// physicall near to one another.)
@ -297,10 +297,10 @@ index 63dccb70fb..47c26c83dc 100644
// Thread-local allocation buffers
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index 7935f8cb47..a498e01563 100644
index 60eb2682a..428e07c75 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -2926,6 +2926,7 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = {
@@ -2918,6 +2918,7 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = {
#if INCLUDE_ALL_GCS
VM_STRUCTS_PARALLELGC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
@ -308,7 +308,7 @@ index 7935f8cb47..a498e01563 100644
GENERATE_STATIC_VM_STRUCT_ENTRY)
VM_STRUCTS_CMS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
@@ -3097,6 +3098,7 @@ VMStructs::init() {
@@ -3075,6 +3076,7 @@ VMStructs::init() {
#if INCLUDE_ALL_GCS
VM_STRUCTS_PARALLELGC(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
@ -316,7 +316,7 @@ index 7935f8cb47..a498e01563 100644
CHECK_STATIC_VM_STRUCT_ENTRY);
VM_STRUCTS_CMS(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
@@ -3223,6 +3225,7 @@ VMStructs::init() {
@@ -3191,6 +3193,7 @@ VMStructs::init() {
CHECK_NO_OP));
#if INCLUDE_ALL_GCS
debug_only(VM_STRUCTS_PARALLELGC(ENSURE_FIELD_TYPE_PRESENT,
@ -325,5 +325,5 @@ index 7935f8cb47..a498e01563 100644
debug_only(VM_STRUCTS_CMS(ENSURE_FIELD_TYPE_PRESENT,
ENSURE_FIELD_TYPE_PRESENT,
--
2.12.3
2.19.0

View File

@ -1,5 +1,19 @@
From 5862fab639dfe2304f65399988c8815f52664666 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:55:53 +0800
Subject: 8040327: Eliminate AnnotatedType && 8040319: Clean up
type annotation exception index generating code in Code.java
Summary: <javac>: Find the correct exception_index in RuntimeInvisibleTypeAnnotations
LLT: langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java, langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8040327, https://bugs.openjdk.java.net/browse/JDK-8040319
---
.../javac/code/TypeAnnotationPosition.java | 23 +++++++++++++++++++
.../classes/com/sun/tools/javac/jvm/Code.java | 11 +++++----
.../classes/com/sun/tools/javac/jvm/Gen.java | 4 ++--
3 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
index c481ea5d..f1f92b6a 100644
index c481ea5d3..f1f92b6ad 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
@@ -297,6 +297,29 @@ public class TypeAnnotationPosition {
@ -33,7 +47,7 @@ index c481ea5d..f1f92b6a 100644
* Decode the binary representation for a type path and set
* the {@code location} field.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
index 738c5a1d..622a5942 100644
index 738c5a1d9..622a5942d 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
@@ -2135,14 +2135,16 @@ public class Code {
@ -68,7 +82,7 @@ index 738c5a1d..622a5942 100644
}
}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
index 4cc7fb7b..f79d3eee 100644
index 4cc7fb7bf..f79d3eeeb 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -1609,7 +1609,7 @@ public class Gen extends JCTree.Visitor {
@ -89,3 +103,6 @@ index 4cc7fb7b..f79d3eee 100644
}
}
}
--
2.19.0

View File

@ -1,6 +1,6 @@
From d4fc164f500d86fcec9302d9b71a830c34888680 Mon Sep 17 00:00:00 2001
Date: Wed, 12 Aug 2020 15:26:59 +0000
Subject: [PATCH] 8048210 8056152: fix assert fail for an InnocuousThread
From d47f002ce4b016b077b99fa5430b6ca448988b13 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:24:23 +0800
Subject: 8048210 8056152: fix assert fail for an InnocuousThread
Summary: <java.lang>: fix assert fail for an InnocuousThread
LLT: jdk8u/jdk/test/java/rmi/transport/pinLastArguments/PinLastArguments.java
@ -21,19 +21,19 @@ index 3acd9424c..e585a9c0b 100644
eraseThreadLocals();
}
@@ -81,12 +82,6 @@ public final class InnocuousThread extends Thread {
@@ -80,12 +81,6 @@ public final class InnocuousThread extends Thread {
eraseThreadLocals();
}
@Override
- @Override
- public ClassLoader getContextClassLoader() {
- // always report system class loader
- return ClassLoader.getSystemClassLoader();
- }
-
- @Override
@Override
public void setUncaughtExceptionHandler(UncaughtExceptionHandler x) {
// silently fail
}
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From e01473adc4c392aa947417cbde478161b2d741bb Mon Sep 17 00:00:00 2001
Date: Fri, 12 Jul 2019 16:10:56 +0800
Subject: [PATCH] Backport of JDK-8060463
From ea7cab470443b2545e2b56ec38571be2ed7da75b Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:36:59 +0800
Subject: Backport of JDK-8060463
Summary: ParNew:
SurvivorAlignmentInBytes greater then YoungPLABSize cause assert(obj != NULL
@ -8,15 +8,14 @@ SurvivorAlignmentInBytes greater then YoungPLABSize cause assert(obj != NULL
allocate.
LLT: hotspot/test/gc/survivorAlignment/TestPromotionLABLargeSurvivorAlignment.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8060463
---
.../parNew/parNewGeneration.cpp | 15 ++--
...estPromotionLABLargeSurvivorAlignment.java | 72 +++++++++++++++++++
2 files changed, 83 insertions(+), 4 deletions(-)
...estPromotionLABLargeSurvivorAlignment.java | 71 +++++++++++++++++++
2 files changed, 82 insertions(+), 4 deletions(-)
create mode 100644 hotspot/test/gc/survivorAlignment/TestPromotionLABLargeSurvivorAlignment.java
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index 8ef1bd2cda..67b0421ebf 100644
index 327c27e92..f05b4f177 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -233,11 +233,15 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) {
@ -52,7 +51,7 @@ index 8ef1bd2cda..67b0421ebf 100644
// even if not for this one.
diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionLABLargeSurvivorAlignment.java b/hotspot/test/gc/survivorAlignment/TestPromotionLABLargeSurvivorAlignment.java
new file mode 100644
index 0000000000..397b647489
index 000000000..093d509a4
--- /dev/null
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionLABLargeSurvivorAlignment.java
@@ -0,0 +1,71 @@
@ -128,5 +127,5 @@ index 0000000000..397b647489
+ }
+}
--
2.19.0-rc1
2.19.0

31
8080911.patch Normal file
View File

@ -0,0 +1,31 @@
From adf268747c4627968329fb223d5286f5400402b6 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:58:26 +0800
Subject: 8080911: sun/security/krb5/auto/UseCacheAndStoreKey.java timed out intermittently
Summary: <Corelib>: backport JDK-8080911
LLT: NA
Bug url: https://bugs.openjdk.java.net/browse/JDK-8080911
---
jdk/src/share/classes/sun/security/krb5/Config.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java
index ec19a3029..117acb840 100644
--- a/jdk/src/share/classes/sun/security/krb5/Config.java
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java
@@ -146,8 +146,10 @@ public class Config {
* java.security.krb5.kdc not specified, error reading configuration file.
*/
- public static synchronized void refresh() throws KrbException {
- singleton = new Config();
+ public static void refresh() throws KrbException {
+ synchronized (Config.class) {
+ singleton = new Config();
+ }
KdcComm.initStatic();
EType.initStatic();
Checksum.initStatic();
--
2.19.0

View File

@ -1,19 +1,19 @@
From 570f33e3f57acb9a8b4b7e3c378b836bef774df4 Mon Sep 17 00:00:00 2001
Date: Wed, 17 Jul 2019 11:36:31 +0000
Subject: [PATCH] Backport of JDK-8129626
From f73bb08c6d1578eae9c5f47253a81dd06e51beba Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:39:09 +0800
Subject: Backport of JDK-8129626
summary: G1: set_in_progress() and clear_started() needs a barrier on non-TSO platforms
LLT:
Bug url: https://bugs.openjdk.java.net/browse/JDK-8129626
---
.../gc_implementation/g1/concurrentMarkThread.cpp | 4 +--
.../gc_implementation/g1/concurrentMarkThread.hpp | 29 +++++++++++++---------
.../vm/gc_implementation/g1/g1CollectedHeap.cpp | 2 +-
.../g1/concurrentMarkThread.cpp | 4 +--
.../g1/concurrentMarkThread.hpp | 29 +++++++++++--------
.../gc_implementation/g1/g1CollectedHeap.cpp | 2 +-
3 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
index b56e309234..53fe0837b1 100644
index b56e30923..53fe0837b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
@@ -43,8 +43,7 @@ SurrogateLockerThread*
@ -35,7 +35,7 @@ index b56e309234..53fe0837b1 100644
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp
index caa7f429c6..5f5f70ac4d 100644
index caa7f429c..5f5f70ac4 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp
@@ -46,8 +46,14 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
@ -89,7 +89,7 @@ index caa7f429c6..5f5f70ac4d 100644
// shutdown
void stop();
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index aa6bbc81a4..a6e91a08ce 100644
index 4eccf9805..97643e792 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -2409,7 +2409,7 @@ void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) {
@ -102,5 +102,5 @@ index aa6bbc81a4..a6e91a08ce 100644
// This notify_all() will ensure that a thread that called
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From a0788fc8804ec901f1011a7a7a3264098a717223 Mon Sep 17 00:00:00 2001
Date: Tue, 16 Jul 2019 19:36:33 +0000
Subject: [PATCH] Backport of JDK-8131600
From e546db5e9c81fabace719417cc77154e08355005 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:37:38 +0800
Subject: Backport of JDK-8131600
Summary: JVM crashes when doing heapdump and handling a signal at a same time
LLT: none
@ -12,10 +12,10 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8131600
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
index 90c95f417d..84fc25071b 100644
index 224cd21ad..dc600d8ea 100644
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
@@ -2834,7 +2834,7 @@ inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
@@ -2829,7 +2829,7 @@ inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
if (klass->oop_is_instance()) {
InstanceKlass* ik = InstanceKlass::cast(klass);
@ -25,10 +25,10 @@ index 90c95f417d..84fc25071b 100644
return true;
}
diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp
index e5de80eaeb..9a1bb13ded 100644
index e9fd8946a..24c0830c5 100644
--- a/hotspot/src/share/vm/services/heapDumper.cpp
+++ b/hotspot/src/share/vm/services/heapDumper.cpp
@@ -950,6 +950,11 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
@@ -990,6 +990,11 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
return;
}
@ -41,5 +41,5 @@ index e5de80eaeb..9a1bb13ded 100644
// class ID
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From d58ebe4882c0dfcb2f185e948c5c838f2d867e6b Mon Sep 17 00:00:00 2001
Date: Wed, 12 Jun 2019 20:43:23 +0000
Subject: [PATCH] fix-fastdebug-jdk-crash-when-running-a-jtreg-case
From 3646a0ea5da00fe5b9316c2ed4d6ae20e94399fb Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:27:21 +0800
Subject: fix-fastdebug-jdk-crash-when-running-a-jtreg-case
Summary: The problem happens when c1s loop optimizations encounter a non natural loop for which one entry is an exception handler.Backport the patch from openjdk9
LLT:
@ -15,7 +15,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8134883
create mode 100644 hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
diff --git a/hotspot/src/share/vm/c1/c1_IR.cpp b/hotspot/src/share/vm/c1/c1_IR.cpp
index 0984098764..b500d5cf79 100644
index 098409876..b500d5cf7 100644
--- a/hotspot/src/share/vm/c1/c1_IR.cpp
+++ b/hotspot/src/share/vm/c1/c1_IR.cpp
@@ -578,11 +578,8 @@ void ComputeLinearScanOrder::count_edges(BlockBegin* cur, BlockBegin* parent) {
@ -43,7 +43,7 @@ index 0984098764..b500d5cf79 100644
diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
new file mode 100644
index 0000000000..2befe6db09
index 000000000..2befe6db0
--- /dev/null
+++ b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
@@ -0,0 +1,89 @@
@ -138,7 +138,7 @@ index 0000000000..2befe6db09
+} // end Class TestRangeCheckExceptionHandlerLoop
diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
new file mode 100644
index 0000000000..32df890bc0
index 000000000..3eac32315
--- /dev/null
+++ b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
@@ -0,0 +1,41 @@

View File

@ -1,6 +1,6 @@
From ffb7c326ceb85f9bab196a23d3c2adb4a27613ce Mon Sep 17 00:00:00 2001
Date: Wed, 17 Jul 2019 09:26:19 +0000
Subject: [PATCH] Backport of JDK-8138971
From 830b5806b508f180b44845b54d7d977706de5984 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:38:12 +0800
Subject: Backport of JDK-8138971
summary: G1CollectorPolicy::_rs_lengths_prediction is not initialized before use
LLT:
@ -10,7 +10,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8138971
1 file changed, 1 insertion(+)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index c4463f50fc..066aa40b25 100644
index 761b0e953..046f8a848 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -122,6 +122,7 @@ G1CollectorPolicy::G1CollectorPolicy() :
@ -22,5 +22,5 @@ index c4463f50fc..066aa40b25 100644
_initiate_conc_mark_if_possible(false),
_during_initial_mark_pause(false),
--
2.12.3
2.19.0

View File

@ -1,22 +1,22 @@
From f88d00280661d697440e40bf1300121bb704bb84 Mon Sep 17 00:00:00 2001
Date: Tue, 19 Nov 2019 11:38:36 +0800
Subject: [PATCH] 8139041: Redundant DMB instructions
From 32895acdd082ecb72e5c8adb56deb76242562d5a Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:15:42 +0800
Subject: 8139041: Redundant DMB instructions
Summary: <aarch64>: Redundant DMB instructions
LLT: jtreg
Bug url: https://bugs.openjdk.java.net/browse/JDK-8139041
---
hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp | 14 ++++++++++++++
hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp | 7 +++++++
hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp | 17 +++++++++++++++++
.../cpu/aarch64/vm/macroAssembler_aarch64.cpp | 14 ++++++++++++++
.../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 7 +++++++
.../src/cpu/aarch64/vm/nativeInst_aarch64.hpp | 17 +++++++++++++++++
hotspot/src/share/vm/asm/codeBuffer.hpp | 7 +++++++
4 files changed, 45 insertions(+)
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
index 178ec531b4..86abf44446 100644
index f4ce39661..714ab18bd 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
@@ -1761,6 +1761,20 @@ int MacroAssembler::corrected_idivq(Register result, Register ra, Register rb,
@@ -1766,6 +1766,20 @@ int MacroAssembler::corrected_idivq(Register result, Register ra, Register rb,
return idivq_offset;
}
@ -38,7 +38,7 @@ index 178ec531b4..86abf44446 100644
void MacroAssembler::push(Register src)
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
index 02216f1b10..388177589d 100644
index 02216f1b1..388177589 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
@@ -153,6 +153,13 @@ class MacroAssembler: public Assembler {
@ -56,7 +56,7 @@ index 02216f1b10..388177589d 100644
void build_frame(int framesize);
void remove_frame(int framesize);
diff --git a/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp
index 20deea54c7..0176e41184 100644
index 20deea54c..0176e4118 100644
--- a/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp
+++ b/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp
@@ -103,6 +103,12 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC {
@ -89,7 +89,7 @@ index 20deea54c7..0176e41184 100644
+
#endif // CPU_AARCH64_VM_NATIVEINST_AARCH64_HPP
diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp
index 02b619ad77..a89f2c18b3 100644
index 02b619ad7..a89f2c18b 100644
--- a/hotspot/src/share/vm/asm/codeBuffer.hpp
+++ b/hotspot/src/share/vm/asm/codeBuffer.hpp
@@ -368,6 +368,8 @@ class CodeBuffer: public StackObj {
@ -121,5 +121,5 @@ index 02b619ad77..a89f2c18b3 100644
if (!_code_strings.is_null()) {
_code_strings.free(); // sets _strings Null as a side-effect.
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From 81c4aa5c13e38b701a0ace0765ab153b750a1e7e Mon Sep 17 00:00:00 2001
Date: Tue, 25 Jun 2019 10:06:19 +0000
Subject: [PATCH] backport of JDK-8141356
From 055f8e3d684105857ad1a51e8f811d4149333dbc Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:34:34 +0800
Subject: backport of JDK-8141356
Summary: Explicitly stop CMS threads during VM termination
LLT:
@ -11,10 +11,10 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8141356
2 files changed, 11 insertions(+)
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
index f7c9591d90..eeb56f02a1 100644
index 1221da276..7f4fc0d61 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
@@ -1408,3 +1408,11 @@ jlong GenCollectedHeap::millis_since_last_gc() {
@@ -1406,3 +1406,11 @@ jlong GenCollectedHeap::millis_since_last_gc() {
}
return retVal;
}
@ -27,7 +27,7 @@ index f7c9591d90..eeb56f02a1 100644
+#endif
+}
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
index 58786eded2..c3eb0db064 100644
index 1a2fcaa06..416ae8741 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
@@ -538,6 +538,9 @@ private:
@ -41,5 +41,5 @@ index 58786eded2..c3eb0db064 100644
#endif // SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
--
2.19.0-rc1
2.19.0

View File

@ -1,6 +1,6 @@
From 58fcf0eb2ce3e74334ef124116a6e8f429ee9ae4 Mon Sep 17 00:00:00 2001
Date: Thu, 27 Jun 2019 11:04:38 +0000
Subject: [PATCH] Backport of JDK-8157570
From 1ae617207543d079b95384bc2a57996392d5df09 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:30:40 +0800
Subject: Backport of JDK-8157570
summary: sun.rmi.transport.GC retains a strong reference to the context class loader
LLT:
@ -10,7 +10,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8157570
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/jdk/src/share/classes/sun/misc/GC.java b/jdk/src/share/classes/sun/misc/GC.java
index c77bf1d055..eb92617c19 100644
index c77bf1d05..eb92617c1 100644
--- a/jdk/src/share/classes/sun/misc/GC.java
+++ b/jdk/src/share/classes/sun/misc/GC.java
@@ -29,6 +29,7 @@ import java.security.AccessController;

View File

@ -1,434 +0,0 @@
From 213dd3425bd0681a0ad4ed3c5f004898be645d86 Mon Sep 17 00:00:00 2001
Date: Thu, 15 Aug 2019 11:15:18 +0000
Subject: [PATCH] Backport of JDK-8158946 JDK-8165808 JDK-8166583 JDK-8166862
summary: Add release barriers when allocating objects with concurrent collection && CMS needs klass_or_null_acquire
LLT:
Bug url: https://bugs.openjdk.java.net/browse/JDK-8158946 https://bugs.openjdk.java.net/browse/JDK-8165808 https://bugs.openjdk.java.net/browse/JDK-8166583 https://bugs.openjdk.java.net/browse/JDK-8166862
---
.../src/share/vm/classfile/javaClasses.cpp | 5 +-
.../compactibleFreeListSpace.cpp | 23 ++------
.../concurrentMarkSweepGeneration.cpp | 16 +++---
.../share/vm/gc_interface/collectedHeap.cpp | 16 ++++++
.../share/vm/gc_interface/collectedHeap.hpp | 6 +--
.../vm/gc_interface/collectedHeap.inline.hpp | 54 ++++++++++---------
.../src/share/vm/oops/instanceMirrorKlass.cpp | 7 ++-
hotspot/src/share/vm/oops/oop.hpp | 2 +
hotspot/src/share/vm/oops/oop.inline.hpp | 38 ++++++++++---
9 files changed, 103 insertions(+), 64 deletions(-)
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index 1bad10334..719db22b7 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -651,10 +651,13 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
int java_lang_Class::oop_size(oop java_class) {
assert(_oop_size_offset != 0, "must be set");
- return java_class->int_field(_oop_size_offset);
+ int size = java_class->int_field(_oop_size_offset);
+ assert(size > 0, "Oop size must be greater than zero");
+ return size;
}
void java_lang_Class::set_oop_size(oop java_class, int size) {
assert(_oop_size_offset != 0, "must be set");
+ assert(size > 0, "Oop size must be greater than zero");
java_class->int_field_put(_oop_size_offset, size);
}
int java_lang_Class::static_oop_field_count(oop java_class) {
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
index e5a3a1106..2de68f7ae 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -984,18 +984,13 @@ size_t CompactibleFreeListSpace::block_size(const HeapWord* p) const {
return res;
}
} else {
- // must read from what 'p' points to in each loop.
- Klass* k = ((volatile oopDesc*)p)->klass_or_null();
+ // Ensure klass read before size.
+ Klass* k = oop(p)->klass_or_null_acquire();
if (k != NULL) {
assert(k->is_klass(), "Should really be klass oop.");
oop o = (oop)p;
assert(o->is_oop(true /* ignore mark word */), "Should be an oop.");
- // Bugfix for systems with weak memory model (PPC64/IA64).
- // The object o may be an array. Acquire to make sure that the array
- // size (third word) is consistent.
- OrderAccess::acquire();
-
size_t res = o->size_given_klass(k);
res = adjustObjectSize(res);
assert(res != 0, "Block size should not be 0");
@@ -1039,21 +1034,13 @@ const {
return res;
}
} else {
- // must read from what 'p' points to in each loop.
- Klass* k = ((volatile oopDesc*)p)->klass_or_null();
- // We trust the size of any object that has a non-NULL
- // klass and (for those in the perm gen) is parsable
- // -- irrespective of its conc_safe-ty.
+ // Ensure klass read before size.
+ Klass* k = oop(p)->klass_or_null_acquire();
if (k != NULL) {
assert(k->is_klass(), "Should really be klass oop.");
oop o = (oop)p;
assert(o->is_oop(), "Should be an oop");
- // Bugfix for systems with weak memory model (PPC64/IA64).
- // The object o may be an array. Acquire to make sure that the array
- // size (third word) is consistent.
- OrderAccess::acquire();
-
size_t res = o->size_given_klass(k);
res = adjustObjectSize(res);
assert(res != 0, "Block size should not be 0");
@@ -1101,7 +1088,7 @@ bool CompactibleFreeListSpace::block_is_obj(const HeapWord* p) const {
// assert(CollectedHeap::use_parallel_gc_threads() || _bt.block_start(p) == p,
// "Should be a block boundary");
if (FreeChunk::indicatesFreeChunk(p)) return false;
- Klass* k = oop(p)->klass_or_null();
+ Klass* k = oop(p)->klass_or_null_acquire();
if (k != NULL) {
// Ignore mark word because it may have been used to
// chain together promoted objects (the last one
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index 701231b4a..e3c0048da 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -6715,7 +6715,7 @@ size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const {
HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const {
size_t sz = 0;
oop p = (oop)addr;
- if (p->klass_or_null() != NULL) {
+ if (p->klass_or_null_acquire() != NULL) {
sz = CompactibleFreeListSpace::adjustObjectSize(p->size());
} else {
sz = block_size_using_printezis_bits(addr);
@@ -7173,7 +7173,7 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m(
}
if (_bitMap->isMarked(addr)) {
// it's marked; is it potentially uninitialized?
- if (p->klass_or_null() != NULL) {
+ if (p->klass_or_null_acquire() != NULL) {
// an initialized object; ignore mark word in verification below
// since we are running concurrent with mutators
assert(p->is_oop(true), "should be an oop");
@@ -7214,7 +7214,7 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m(
}
} else {
// Either a not yet marked object or an uninitialized object
- if (p->klass_or_null() == NULL) {
+ if (p->klass_or_null_acquire() == NULL) {
// An uninitialized object, skip to the next card, since
// we may not be able to read its P-bits yet.
assert(size == 0, "Initial value");
@@ -7425,7 +7425,7 @@ bool MarkFromRootsClosure::do_bit(size_t offset) {
assert(_skipBits == 0, "tautology");
_skipBits = 2; // skip next two marked bits ("Printezis-marks")
oop p = oop(addr);
- if (p->klass_or_null() == NULL) {
+ if (p->klass_or_null_acquire() == NULL) {
DEBUG_ONLY(if (!_verifying) {)
// We re-dirty the cards on which this object lies and increase
// the _threshold so that we'll come back to scan this object
@@ -7445,7 +7445,7 @@ bool MarkFromRootsClosure::do_bit(size_t offset) {
if (_threshold < end_card_addr) {
_threshold = end_card_addr;
}
- if (p->klass_or_null() != NULL) {
+ if (p->klass_or_null_acquire() != NULL) {
// Redirty the range of cards...
_mut->mark_range(redirty_range);
} // ...else the setting of klass will dirty the card anyway.
@@ -7596,7 +7596,7 @@ bool Par_MarkFromRootsClosure::do_bit(size_t offset) {
assert(_skip_bits == 0, "tautology");
_skip_bits = 2; // skip next two marked bits ("Printezis-marks")
oop p = oop(addr);
- if (p->klass_or_null() == NULL) {
+ if (p->klass_or_null_acquire() == NULL) {
// in the case of Clean-on-Enter optimization, redirty card
// and avoid clearing card by increasing the threshold.
return true;
@@ -8583,7 +8583,7 @@ size_t SweepClosure::do_live_chunk(FreeChunk* fc) {
"alignment problem");
#ifdef ASSERT
- if (oop(addr)->klass_or_null() != NULL) {
+ if (oop(addr)->klass_or_null_acquire() != NULL) {
// Ignore mark word because we are running concurrent with mutators
assert(oop(addr)->is_oop(true), "live block should be an oop");
assert(size ==
@@ -8594,7 +8594,7 @@ size_t SweepClosure::do_live_chunk(FreeChunk* fc) {
} else {
// This should be an initialized object that's alive.
- assert(oop(addr)->klass_or_null() != NULL,
+ assert(oop(addr)->klass_or_null_acquire() != NULL,
"Should be an initialized object");
// Ignore mark word because we are running concurrent with mutators
assert(oop(addr)->is_oop(true), "live block should be an oop");
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp
index 3ae8d61d0..e79251e13 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp
@@ -305,6 +305,22 @@ HeapWord* CollectedHeap::allocate_from_tlab_slow(KlassHandle klass, Thread* thre
return obj;
}
+void CollectedHeap::post_allocation_setup_class(KlassHandle klass,
+ HeapWord* obj_ptr,
+ int size) {
+ // Set oop_size field before setting the _klass field because a
+ // non-NULL _klass field indicates that the object is parsable by
+ // concurrent GC.
+ oop new_cls = (oop)obj_ptr;
+ assert(size > 0, "oop_size must be positive.");
+ java_lang_Class::set_oop_size(new_cls, size);
+ post_allocation_setup_common(klass, obj_ptr);
+ assert(Universe::is_bootstrapping() ||
+ !new_cls->is_array(), "must not be an array");
+ // notify jvmti and dtrace
+ post_allocation_notify(klass, new_cls, size);
+}
+
void CollectedHeap::flush_deferred_store_barrier(JavaThread* thread) {
MemRegion deferred = thread->deferred_card_mark();
if (!deferred.is_empty()) {
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
index 898a660f2..c13d29780 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
@@ -157,6 +157,8 @@ class CollectedHeap : public CHeapObj<mtInternal> {
inline static void post_allocation_setup_array(KlassHandle klass,
HeapWord* obj, int length);
+ static void post_allocation_setup_class(KlassHandle klass, HeapWord* obj, int size);
+
// Clears an allocated object.
inline static void init_obj(HeapWord* obj, size_t size);
@@ -321,9 +323,7 @@ class CollectedHeap : public CHeapObj<mtInternal> {
inline static oop obj_allocate(KlassHandle klass, int size, TRAPS);
inline static oop array_allocate(KlassHandle klass, int size, int length, TRAPS);
inline static oop array_allocate_nozero(KlassHandle klass, int size, int length, TRAPS);
-
- inline static void post_allocation_install_obj_klass(KlassHandle klass,
- oop obj);
+ inline static oop class_allocate(KlassHandle klass, int size, TRAPS);
// Raw memory allocation facilities
// The obj and array allocate methods are covers for these methods.
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
index 302d0c7cb..bdc97575f 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
@@ -39,14 +39,22 @@
// Inline allocation implementations.
void CollectedHeap::post_allocation_setup_common(KlassHandle klass,
- HeapWord* obj) {
- post_allocation_setup_no_klass_install(klass, obj);
- post_allocation_install_obj_klass(klass, oop(obj));
+ HeapWord* obj_ptr) {
+ post_allocation_setup_no_klass_install(klass, obj_ptr);
+ oop obj = (oop)obj_ptr;
+#if ! INCLUDE_ALL_GCS
+ obj->set_klass(klass());
+#else
+ // Need a release store to ensure array/class length, mark word, and
+ // object zeroing are visible before setting the klass non-NULL, for
+ // concurrent collectors.
+ obj->release_set_klass(klass());
+#endif
}
void CollectedHeap::post_allocation_setup_no_klass_install(KlassHandle klass,
- HeapWord* objPtr) {
- oop obj = (oop)objPtr;
+ HeapWord* obj_ptr) {
+ oop obj = (oop)obj_ptr;
assert(obj != NULL, "NULL object pointer");
if (UseBiasedLocking && (klass() != NULL)) {
@@ -57,18 +65,6 @@ void CollectedHeap::post_allocation_setup_no_klass_install(KlassHandle klass,
}
}
-void CollectedHeap::post_allocation_install_obj_klass(KlassHandle klass,
- oop obj) {
- // These asserts are kind of complicated because of klassKlass
- // and the beginning of the world.
- assert(klass() != NULL || !Universe::is_fully_initialized(), "NULL klass");
- assert(klass() == NULL || klass()->is_klass(), "not a klass");
- assert(obj != NULL, "NULL object pointer");
- obj->set_klass(klass());
- assert(!Universe::is_fully_initialized() || obj->klass() != NULL,
- "missing klass");
-}
-
// Support for jvmti and dtrace
inline void post_allocation_notify(KlassHandle klass, oop obj, int size) {
// support low memory notifications (no-op if not enabled)
@@ -96,15 +92,15 @@ void CollectedHeap::post_allocation_setup_obj(KlassHandle klass,
}
void CollectedHeap::post_allocation_setup_array(KlassHandle klass,
- HeapWord* obj,
+ HeapWord* obj_ptr,
int length) {
- // Set array length before setting the _klass field
- // in post_allocation_setup_common() because the klass field
- // indicates that the object is parsable by concurrent GC.
+ // Set array length before setting the _klass field because a
+ // non-NULL klass field indicates that the object is parsable by
+ // concurrent GC.
assert(length >= 0, "length should be non-negative");
- ((arrayOop)obj)->set_length(length);
- post_allocation_setup_common(klass, obj);
- oop new_obj = (oop)obj;
+ ((arrayOop)obj_ptr)->set_length(length);
+ post_allocation_setup_common(klass, obj_ptr);
+ oop new_obj = (oop)obj_ptr;
assert(new_obj->is_array(), "must be an array");
// notify jvmti and dtrace (must be after length is set for dtrace)
post_allocation_notify(klass, new_obj, new_obj->size());
@@ -206,6 +202,16 @@ oop CollectedHeap::obj_allocate(KlassHandle klass, int size, TRAPS) {
return (oop)obj;
}
+oop CollectedHeap::class_allocate(KlassHandle klass, int size, TRAPS) {
+ debug_only(check_for_valid_allocation_state());
+ assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
+ assert(size >= 0, "int won't convert to size_t");
+ HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL);
+ post_allocation_setup_class(klass, obj, size); // set oop_size
+ NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size));
+ return (oop)obj;
+}
+
oop CollectedHeap::array_allocate(KlassHandle klass,
int size,
int length,
diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
index 5b4c7d0fd..73da78e5a 100644
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
@@ -363,13 +363,12 @@ instanceOop InstanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
// Query before forming handle.
int size = instance_size(k);
KlassHandle h_k(THREAD, this);
- instanceOop i = (instanceOop)CollectedHeap::obj_allocate(h_k, size, CHECK_NULL);
+
+ assert(size > 0, "total object size must be positive");
// Since mirrors can be variable sized because of the static fields, store
// the size in the mirror itself.
- java_lang_Class::set_oop_size(i, size);
-
- return i;
+ return (instanceOop)CollectedHeap::class_allocate(h_k, size, CHECK_NULL);
}
int InstanceMirrorKlass::oop_size(oop obj) const {
diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp
index 4b707abce..c1e9fd550 100644
--- a/hotspot/src/share/vm/oops/oop.hpp
+++ b/hotspot/src/share/vm/oops/oop.hpp
@@ -83,10 +83,12 @@ class oopDesc {
Klass* klass() const;
Klass* klass_or_null() const volatile;
+ inline Klass* klass_or_null_acquire() const volatile;
Klass** klass_addr();
narrowKlass* compressed_klass_addr();
void set_klass(Klass* k);
+ inline void release_set_klass(Klass* k);
// For klass field compression
int klass_gap() const;
diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp
index 4632457bf..491f148b9 100644
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -85,7 +85,6 @@ inline Klass* oopDesc::klass() const {
}
inline Klass* oopDesc::klass_or_null() const volatile {
- // can be NULL in CMS
if (UseCompressedClassPointers) {
return Klass::decode_klass(_metadata._compressed_klass);
} else {
@@ -98,6 +97,17 @@ inline int oopDesc::klass_gap_offset_in_bytes() {
return oopDesc::klass_offset_in_bytes() + sizeof(narrowKlass);
}
+Klass* oopDesc::klass_or_null_acquire() const volatile {
+ if (UseCompressedClassPointers) {
+ // Workaround for non-const load_acquire parameter.
+ const volatile narrowKlass* addr = &_metadata._compressed_klass;
+ volatile narrowKlass* xaddr = const_cast<volatile narrowKlass*>(addr);
+ return Klass::decode_klass(OrderAccess::load_acquire(xaddr));
+ } else {
+ return (Klass*)OrderAccess::load_ptr_acquire(&_metadata._klass);
+ }
+}
+
inline Klass** oopDesc::klass_addr() {
// Only used internally and with CMS and will not work with
// UseCompressedOops
@@ -110,10 +120,14 @@ inline narrowKlass* oopDesc::compressed_klass_addr() {
return &_metadata._compressed_klass;
}
+#define CHECK_SET_KLASS(k) \
+ do { \
+ assert(Universe::is_bootstrapping() || k != NULL, "NULL Klass"); \
+ assert(Universe::is_bootstrapping() || k->is_klass(), "not a Klass"); \
+ } while (0)
+
inline void oopDesc::set_klass(Klass* k) {
- // since klasses are promoted no store check is needed
- assert(Universe::is_bootstrapping() || k != NULL, "must be a real Klass*");
- assert(Universe::is_bootstrapping() || k->is_klass(), "not a Klass*");
+ CHECK_SET_KLASS(k);
if (UseCompressedClassPointers) {
*compressed_klass_addr() = Klass::encode_klass_not_null(k);
} else {
@@ -121,6 +135,18 @@ inline void oopDesc::set_klass(Klass* k) {
}
}
+void oopDesc::release_set_klass(Klass* k) {
+ CHECK_SET_KLASS(k);
+ if (UseCompressedClassPointers) {
+ OrderAccess::release_store(compressed_klass_addr(),
+ Klass::encode_klass_not_null(k));
+ } else {
+ OrderAccess::release_store_ptr(klass_addr(), k);
+ }
+}
+
+#undef CHECK_SET_KLASS
+
inline int oopDesc::klass_gap() const {
return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes());
}
@@ -511,8 +537,8 @@ inline int oopDesc::size_given_klass(Klass* klass) {
}
}
- assert(s % MinObjAlignment == 0, "alignment check");
- assert(s > 0, "Bad size calculated");
+ assert(s % MinObjAlignment == 0, "Oop size is not properly aligned");
+ assert(s > 0, "Oop size must be greater than zero");
return s;
}
--
2.19.0

148
8158946.patch Normal file
View File

@ -0,0 +1,148 @@
From 27abb109817fb98fe6a52d83424bd3882c5cee4e Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 14:43:19 +0800
Subject: 8158946: btree009 fails with assert(s > 0) failed: Bad
size calculated Summary: Set oop_size before setting _klass Reviewed-by:
coleenp, dholmes, kbarrett, tschatzl
---
hotspot/src/share/vm/classfile/javaClasses.cpp | 7 ++++++-
.../src/share/vm/gc_interface/collectedHeap.cpp | 16 ++++++++++++++++
.../src/share/vm/gc_interface/collectedHeap.hpp | 3 +++
.../vm/gc_interface/collectedHeap.inline.hpp | 12 ++++++++++++
.../src/share/vm/oops/instanceMirrorKlass.cpp | 7 +++----
hotspot/src/share/vm/oops/oop.inline.hpp | 4 ++--
6 files changed, 42 insertions(+), 7 deletions(-)
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index 97a10ac02..3e37f9bd9 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -651,12 +651,17 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
int java_lang_Class::oop_size(oop java_class) {
assert(_oop_size_offset != 0, "must be set");
- return java_class->int_field(_oop_size_offset);
+ int size = java_class->int_field(_oop_size_offset);
+ assert(size > 0, "size not set or was stomped");
+ return size;
}
+
void java_lang_Class::set_oop_size(oop java_class, int size) {
assert(_oop_size_offset != 0, "must be set");
+ assert(size > 0, "size must be positive");
java_class->int_field_put(_oop_size_offset, size);
}
+
int java_lang_Class::static_oop_field_count(oop java_class) {
assert(_static_oop_field_count_offset != 0, "must be set");
return java_class->int_field(_static_oop_field_count_offset);
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp
index c248cba63..7646438bf 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp
@@ -303,6 +303,22 @@ HeapWord* CollectedHeap::allocate_from_tlab_slow(KlassHandle klass, Thread* thre
return obj;
}
+void CollectedHeap::post_allocation_setup_class(KlassHandle klass,
+ HeapWord* obj_ptr,
+ int size) {
+ // Set oop_size field before setting the _klass field because a
+ // non-NULL _klass field indicates that the object is parsable by
+ // concurrent GC.
+ oop new_cls = (oop)obj_ptr;
+ assert(size > 0, "oop_size must be positive.");
+ java_lang_Class::set_oop_size(new_cls, size);
+ post_allocation_setup_common(klass, obj_ptr);
+ assert(Universe::is_bootstrapping() ||
+ !new_cls->is_array(), "must not be an array");
+ // notify jvmti and dtrace
+ post_allocation_notify(klass, new_cls, size);
+}
+
void CollectedHeap::flush_deferred_store_barrier(JavaThread* thread) {
MemRegion deferred = thread->deferred_card_mark();
if (!deferred.is_empty()) {
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
index caf2d531f..c13d29780 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
@@ -157,6 +157,8 @@ class CollectedHeap : public CHeapObj<mtInternal> {
inline static void post_allocation_setup_array(KlassHandle klass,
HeapWord* obj, int length);
+ static void post_allocation_setup_class(KlassHandle klass, HeapWord* obj, int size);
+
// Clears an allocated object.
inline static void init_obj(HeapWord* obj, size_t size);
@@ -321,6 +323,7 @@ class CollectedHeap : public CHeapObj<mtInternal> {
inline static oop obj_allocate(KlassHandle klass, int size, TRAPS);
inline static oop array_allocate(KlassHandle klass, int size, int length, TRAPS);
inline static oop array_allocate_nozero(KlassHandle klass, int size, int length, TRAPS);
+ inline static oop class_allocate(KlassHandle klass, int size, TRAPS);
// Raw memory allocation facilities
// The obj and array allocate methods are covers for these methods.
diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
index 172bce44a..8ed2df96a 100644
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
@@ -215,6 +215,18 @@ oop CollectedHeap::obj_allocate(KlassHandle klass, int size, TRAPS) {
return (oop)obj;
}
+// Instances of j.l.Class have an oop_size field that must be set before the
+// the header is set in order to parse the instances's size correctly.
+oop CollectedHeap::class_allocate(KlassHandle klass, int size, TRAPS) {
+ debug_only(check_for_valid_allocation_state());
+ assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
+ assert(size >= 0, "int won't convert to size_t");
+ HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL);
+ post_allocation_setup_class(klass, obj, size); // set oop_size
+ NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size));
+ return (oop)obj;
+}
+
oop CollectedHeap::array_allocate(KlassHandle klass,
int size,
int length,
diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
index 5b4c7d0fd..73da78e5a 100644
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
@@ -363,13 +363,12 @@ instanceOop InstanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
// Query before forming handle.
int size = instance_size(k);
KlassHandle h_k(THREAD, this);
- instanceOop i = (instanceOop)CollectedHeap::obj_allocate(h_k, size, CHECK_NULL);
+
+ assert(size > 0, "total object size must be positive");
// Since mirrors can be variable sized because of the static fields, store
// the size in the mirror itself.
- java_lang_Class::set_oop_size(i, size);
-
- return i;
+ return (instanceOop)CollectedHeap::class_allocate(h_k, size, CHECK_NULL);
}
int InstanceMirrorKlass::oop_size(oop obj) const {
diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp
index e05167975..ddb9dca2d 100644
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -537,8 +537,8 @@ inline int oopDesc::size_given_klass(Klass* klass) {
}
}
- assert(s % MinObjAlignment == 0, "alignment check");
- assert(s > 0, "Bad size calculated");
+ assert(s % MinObjAlignment == 0, "Oop size is not properly aligned");
+ assert(s > 0, "Oop size must be greater than zero");
return s;
}
--
2.19.0

View File

@ -1,326 +0,0 @@
From 51f5988d94ab3488080c4b9350b9d37b2ea19140 Mon Sep 17 00:00:00 2001
Date: Fri, 19 Apr 2019 16:13:29 +0000
Subject: [PATCH] 8160300: aarch32: JNI layer to initialize native nio constants
Bug url: https://bugs.openjdk.java.net/browse/JDK-8160300
---
jdk/make/gensrc/GensrcMisc.gmk | 4 +
jdk/make/lib/NioLibraries.gmk | 3 +-
jdk/make/mapfiles/libnio/mapfile-linux | 1 +
.../genconstants/fs/genCrossUnixConstants.c | 139 ++++++++++++++++++
.../solaris/native/sun/nio/fs/UnixConstants.c | 114 ++++++++++++++
5 files changed, 260 insertions(+), 1 deletion(-)
create mode 100644 jdk/make/src/native/genconstants/fs/genCrossUnixConstants.c
create mode 100644 jdk/src/solaris/native/sun/nio/fs/UnixConstants.c
diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk
index 84a3c27e7d..02ca9ab7e0 100644
--- a/jdk/make/gensrc/GensrcMisc.gmk
+++ b/jdk/make/gensrc/GensrcMisc.gmk
@@ -102,7 +102,11 @@ ifneq ($(OPENJDK_TARGET_OS), windows)
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java
GENSRC_UC_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/fs
+ifneq ($(OPENJDK_TARGET_OS), linux)
GENSRC_UC_SRC_FILE := genUnixConstants.c
+else
+ GENSRC_UC_SRC_FILE := genCrossUnixConstants.c
+endif
GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/btnative/genUnixConstants
UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
diff --git a/jdk/make/lib/NioLibraries.gmk b/jdk/make/lib/NioLibraries.gmk
index 6c9c46a3f3..3d6c9ffa30 100644
--- a/jdk/make/lib/NioLibraries.gmk
+++ b/jdk/make/lib/NioLibraries.gmk
@@ -74,7 +74,8 @@ ifeq ($(OPENJDK_TARGET_OS), linux)
LinuxNativeDispatcher.c \
LinuxWatchService.c \
UnixCopyFile.c \
- UnixNativeDispatcher.c
+ UnixNativeDispatcher.c \
+ UnixConstants.c
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
diff --git a/jdk/make/mapfiles/libnio/mapfile-linux b/jdk/make/mapfiles/libnio/mapfile-linux
index 30f795f6f5..3373a45a82 100644
--- a/jdk/make/mapfiles/libnio/mapfile-linux
+++ b/jdk/make/mapfiles/libnio/mapfile-linux
@@ -201,6 +201,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0;
Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
Java_sun_nio_fs_UnixCopyFile_transfer;
+ Java_sun_nio_fs_UnixConstants_init;
handleSocketError;
local:
diff --git a/jdk/make/src/native/genconstants/fs/genCrossUnixConstants.c b/jdk/make/src/native/genconstants/fs/genCrossUnixConstants.c
new file mode 100644
index 0000000000..64e14592b4
--- /dev/null
+++ b/jdk/make/src/native/genconstants/fs/genCrossUnixConstants.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. 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.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/**
+ * Generates sun.nio.fs.UnixConstants class
+ */
+static const char* cnames[]={
+ // open flags
+ "O_RDONLY",
+ "O_WRONLY",
+ "O_RDWR",
+ "O_APPEND",
+ "O_CREAT",
+ "O_EXCL",
+ "O_TRUNC",
+ "O_SYNC",
+ "O_DSYNC",
+ "O_NOFOLLOW",
+ // mode masks
+ "S_IRUSR",
+ "S_IWUSR",
+ "S_IXUSR",
+ "S_IRGRP",
+ "S_IWGRP",
+ "S_IXGRP",
+ "S_IROTH",
+ "S_IWOTH",
+ "S_IXOTH",
+ "S_IFMT",
+ "S_IFREG",
+ "S_IFDIR",
+ "S_IFLNK",
+ "S_IFCHR",
+ "S_IFBLK",
+ "S_IFIFO",
+ "S_IAMB",
+ // access modes
+ "R_OK",
+ "W_OK",
+ "X_OK",
+ "F_OK",
+
+ // errors
+ "ENOENT",
+ "EACCES",
+ "EEXIST",
+ "ENOTDIR",
+ "EINVAL",
+ "EXDEV",
+ "EISDIR",
+ "ENOTEMPTY",
+ "ENOSPC",
+ "EAGAIN",
+ "ENOSYS",
+ "ELOOP",
+ "EROFS",
+ "ENODATA",
+ "ERANGE",
+ "EMFILE",
+
+ // flags used with openat/unlinkat/etc.
+ "AT_SYMLINK_NOFOLLOW",
+ "AT_REMOVEDIR"
+};
+static void out(const char* s) {
+ printf("%s\n", s);
+}
+
+static void declTemp(const char* name) {
+ printf(" private static int p%s=0;\n",name);
+}
+
+static void declConst(const char* name) {
+ printf(" static final int %s = p%s;\n", name, name);
+}
+
+static void init() {
+ out(" private static native void init();");
+ out(" static {");
+ out(" AccessController.doPrivileged(new PrivilegedAction<Void>() {");
+ out(" public Void run() {");
+ out(" System.loadLibrary(\"nio\");");
+ out(" return null;");
+ out(" }});");
+ out(" init();");
+ out(" }");
+}
+
+int main(int argc, const char* argv[]) {
+ int i;
+ out("// AUTOMATICALLY GENERATED FILE - DO NOT EDIT ");
+ out("package sun.nio.fs; ");
+ out("import java.security.AccessController; ");
+ out("import java.security.PrivilegedAction; ");
+ out("class UnixConstants { ");
+ out(" private UnixConstants() { } ");
+
+ // define private intermediate constants
+ for(i=0; i<(int)sizeof(cnames)/sizeof(cnames[0]);i++)
+ declTemp(cnames[i]);
+
+ init();
+
+ // define real unix constants
+ for(i=0; i<(int)sizeof(cnames)/sizeof(cnames[0]);i++)
+ declConst(cnames[i]);
+
+ out("} ");
+
+ return 0;
+}
diff --git a/jdk/src/solaris/native/sun/nio/fs/UnixConstants.c b/jdk/src/solaris/native/sun/nio/fs/UnixConstants.c
new file mode 100644
index 0000000000..95545405ce
--- /dev/null
+++ b/jdk/src/solaris/native/sun/nio/fs/UnixConstants.c
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. 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.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include "jni.h"
+
+#include "sun_nio_fs_UnixConstants.h"
+
+#define INIT_CONST(ENV, CLS, VAL) INIT_CONST_NAME(ENV, CLS, VAL, p ## VAL)
+
+#define INIT_CONST_NAME(ENV, CLS, VAL, NAME) \
+{ \
+ jfieldID fID = (*(ENV))->GetStaticFieldID((ENV), (CLS), #NAME, "I"); \
+ if (fID != 0) { \
+ (*(ENV))->SetStaticIntField((ENV), (CLS), fID, (VAL)); \
+ } \
+} \
+
+/**
+ * Initialization of the UnixConstants fields:
+ * file open flags, modes and error codes
+ */
+JNIEXPORT void JNICALL
+Java_sun_nio_fs_UnixConstants_init(JNIEnv* env, jclass cls) {
+ // open flags
+ INIT_CONST(env, cls, O_RDONLY);
+ INIT_CONST(env, cls, O_WRONLY);
+ INIT_CONST(env, cls, O_RDWR);
+ INIT_CONST(env, cls, O_APPEND);
+ INIT_CONST(env, cls, O_CREAT);
+ INIT_CONST(env, cls, O_EXCL);
+ INIT_CONST(env, cls, O_TRUNC);
+ INIT_CONST(env, cls, O_SYNC);
+ INIT_CONST(env, cls, O_DSYNC);
+ INIT_CONST(env, cls, O_NOFOLLOW);
+
+ // mode masks
+ INIT_CONST(env, cls, S_IRUSR);
+ INIT_CONST(env, cls, S_IWUSR);
+ INIT_CONST(env, cls, S_IXUSR);
+ INIT_CONST(env, cls, S_IRGRP);
+ INIT_CONST(env, cls, S_IWGRP);
+ INIT_CONST(env, cls, S_IXGRP);
+ INIT_CONST(env, cls, S_IROTH);
+ INIT_CONST(env, cls, S_IWOTH);
+ INIT_CONST(env, cls, S_IXOTH);
+ INIT_CONST(env, cls, S_IFMT);
+ INIT_CONST(env, cls, S_IFREG);
+ INIT_CONST(env, cls, S_IFDIR);
+ INIT_CONST(env, cls, S_IFLNK);
+ INIT_CONST(env, cls, S_IFCHR);
+ INIT_CONST(env, cls, S_IFBLK);
+ INIT_CONST(env, cls, S_IFIFO);
+ INIT_CONST_NAME(env, cls, (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH), pS_IAMB);
+
+ // access modes
+ INIT_CONST(env, cls, R_OK);
+ INIT_CONST(env, cls, W_OK);
+ INIT_CONST(env, cls, X_OK);
+ INIT_CONST(env, cls, F_OK);
+
+ // errors
+ INIT_CONST(env, cls, ENOENT);
+ INIT_CONST(env, cls, EACCES);
+ INIT_CONST(env, cls, EEXIST);
+ INIT_CONST(env, cls, ENOTDIR);
+ INIT_CONST(env, cls, EINVAL);
+ INIT_CONST(env, cls, EXDEV);
+ INIT_CONST(env, cls, EISDIR);
+ INIT_CONST(env, cls, ENOTEMPTY);
+ INIT_CONST(env, cls, ENOSPC);
+ INIT_CONST(env, cls, EAGAIN);
+ INIT_CONST(env, cls, ENOSYS);
+ INIT_CONST(env, cls, ELOOP);
+ INIT_CONST(env, cls, EROFS);
+ INIT_CONST(env, cls, ERANGE);
+ INIT_CONST(env, cls, EMFILE);
+
+#if defined(ENODATA)
+ INIT_CONST(env, cls, ENODATA);
+#endif
+
+#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_REMOVEDIR)
+ INIT_CONST(env, cls, AT_SYMLINK_NOFOLLOW);
+ INIT_CONST(env, cls, AT_REMOVEDIR);
+#endif
+
+}
--
2.19.0

View File

@ -1,22 +1,22 @@
From 822f93a00af8300b0516707c2fded59c7487b3ea Mon Sep 17 00:00:00 2001
Date: Mon, 14 Oct 2019 16:34:52 +0000
Subject: [PATCH] Backport of JDK-8160369
From be5a699028cd0b8fd49eb2df0c4b3d1653eca4f3 Mon Sep 17 00:00:00 2001
Date: Mon, 25 Jan 2021 17:22:52 +0800
Subject: Backport of JDK-8160369
Summary:<GC>:[Backport of JDK-8160369 and it's subtasks] Memory fences needed around setting and reading object lengths
LLT:
bug url: https://bugs.openjdk.java.net/browse/JDK-8160369
---
.../vm/gc_implementation/g1/g1BlockOffsetTable.cpp | 2 +-
.../g1/g1BlockOffsetTable.cpp | 2 +-
.../g1/g1BlockOffsetTable.inline.hpp | 4 +-
.../src/share/vm/gc_implementation/g1/g1RemSet.cpp | 137 ++++++++++-------
.../share/vm/gc_implementation/g1/heapRegion.cpp | 166 ++++++++++-----------
.../share/vm/gc_implementation/g1/heapRegion.hpp | 26 ++--
.../vm/gc_implementation/g1/heapRegionType.hpp | 3 +
.../gc_implementation/parNew/parNewGeneration.cpp | 21 ++-
7 files changed, 203 insertions(+), 156 deletions(-)
.../vm/gc_implementation/g1/g1RemSet.cpp | 101 +++++++++----
.../vm/gc_implementation/g1/heapRegion.cpp | 140 ++++++++++--------
.../vm/gc_implementation/g1/heapRegion.hpp | 2 +
.../gc_implementation/g1/heapRegionType.hpp | 3 +
.../parNew/parNewGeneration.cpp | 21 ++-
7 files changed, 173 insertions(+), 100 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
index ead98e24a0..1977fc83da 100644
index ead98e24a..1977fc83d 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
@@ -264,7 +264,7 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q,
@ -29,7 +29,7 @@ index ead98e24a0..1977fc83da 100644
}
assert(q <= next_boundary && n > next_boundary, "Consequence of loop");
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
index bcfd52a4a2..ffc56a0ba0 100644
index bcfd52a4a..ffc56a0ba 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
@@ -166,7 +166,7 @@ forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n,
@ -51,7 +51,7 @@ index bcfd52a4a2..ffc56a0ba0 100644
// In the normal case, where the query "addr" is a card boundary, and the
// offset table chunks are the same size as cards, the block starting at
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp
index da4d632487..da417fb725 100644
index 4cad9234c..b062947c8 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp
@@ -460,18 +460,26 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
@ -175,56 +175,20 @@ index da4d632487..da417fb725 100644
#if CARD_REPEAT_HISTO
init_ct_freq_table(_g1->max_capacity());
@@ -555,33 +606,17 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
(OopClosure*)&mux :
(OopClosure*)&update_rs_oop_cl));
@@ -570,7 +621,7 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
// allocation in this region and making it safe to check the young type.
- // The region for the current card may be a young region. The
- // current card may have been a card that was evicted from the
- // card cache. When the card was inserted into the cache, we had
- // determined that its region was non-young. While in the cache,
- // the region may have been freed during a cleanup pause, reallocated
- // and tagged as young.
- //
- // We wish to filter out cards for such a region but the current
- // thread, if we're running concurrently, may "see" the young type
- // change at any time (so an earlier "is_young" check may pass or
- // fail arbitrarily). We tell the iteration code to perform this
- // filtering when it has been determined that there has been an actual
- // allocation in this region and making it safe to check the young type.
- bool filter_young = true;
-
- HeapWord* stop_point =
bool card_processed =
- r->oops_on_card_seq_iterate_careful(dirtyRegion,
- &filter_then_update_rs_oop_cl,
- filter_young,
- card_ptr);
-
- // If stop_point is non-null, then we encountered an unallocated region
- // (perhaps the unfilled portion of a TLAB.) For now, we'll dirty the
- // card and re-enqueue: if we put off the card until a GC pause, then the
- // unallocated portion will be filled in. Alternatively, we might try
- // the full complexity of the technique used in "regular" precleaning.
- if (stop_point != NULL) {
+ bool card_processed =
+ r->oops_on_card_seq_iterate_careful(dirty_region,
+ &filter_then_update_rs_oop_cl);
+
+ // If unable to process the card then we encountered an unparsable
+ // part of the heap (e.g. a partially allocated object) while
+ // processing a stale card. Despite the card being stale, redirty
+ // and re-enqueue, because we've already cleaned the card. Without
+ // this we could incorrectly discard a non-stale card.
+ if (!card_processed) {
+ assert(!_g1->is_gc_active(), "Unparsable heap during GC");
// The card might have gotten re-dirtied and re-enqueued while we
// worked. (In fact, it's pretty likely.)
if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
&filter_then_update_rs_oop_cl,
card_ptr);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
index eefa1c9499..5d1578a248 100644
index 794911ef6..7c48501f3 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -339,6 +339,50 @@ void HeapRegion::note_self_forwarding_removal_end(bool during_initial_mark,
@@ -375,6 +375,50 @@ void HeapRegion::note_self_forwarding_removal_end(bool during_initial_mark,
_prev_marked_bytes = marked_bytes;
}
@ -275,7 +239,7 @@ index eefa1c9499..5d1578a248 100644
HeapWord*
HeapRegion::object_iterate_mem_careful(MemRegion mr,
ObjectClosure* cl) {
@@ -363,106 +407,62 @@ HeapRegion::object_iterate_mem_careful(MemRegion mr,
@@ -399,9 +443,6 @@ HeapRegion::object_iterate_mem_careful(MemRegion mr,
} else if (!g1h->is_obj_dead(obj)) {
cl->do_object(obj);
}
@ -285,23 +249,10 @@ index eefa1c9499..5d1578a248 100644
cur += block_size(cur);
}
return NULL;
}
-HeapWord*
-HeapRegion::
-oops_on_card_seq_iterate_careful(MemRegion mr,
- FilterOutOfRegionClosure* cl,
- bool filter_young,
- jbyte* card_ptr) {
- // Currently, we should only have to clean the card if filter_young
- // is true and vice versa.
- if (filter_young) {
- assert(card_ptr != NULL, "pre-condition");
- } else {
- assert(card_ptr == NULL, "pre-condition");
- }
+bool HeapRegion::oops_on_card_seq_iterate_careful(MemRegion mr,
+ FilterOutOfRegionClosure* cl) {
@@ -411,30 +452,14 @@ bool HeapRegion::oops_on_card_seq_iterate_careful(MemRegion mr,
FilterOutOfRegionClosure* cl,
jbyte* card_ptr) {
assert(card_ptr != NULL, "pre-condition");
+ assert(MemRegion(bottom(), end()).contains(mr), "Card region not in heap region");
G1CollectedHeap* g1h = G1CollectedHeap::heap();
@ -313,7 +264,9 @@ index eefa1c9499..5d1578a248 100644
- } else {
- mr = mr.intersection(used_region());
- }
- if (mr.is_empty()) return NULL;
- if (mr.is_empty()) {
- return true;
- }
- // Otherwise, find the obj that extends onto mr.start().
-
- // The intersection of the incoming mr (for the card) and the
@ -322,35 +275,21 @@ index eefa1c9499..5d1578a248 100644
- // G1CollectedHeap.cpp that allocates a new region sets the
- // is_young tag on the region before allocating. Thus we
- // safely know if this region is young.
- if (is_young() && filter_young) {
- return NULL;
- if (is_young()) {
- return true;
+ // Special handling for humongous regions.
+ if (isHumongous()) {
+ return do_oops_on_card_in_humongous(mr, cl, this, g1h);
}
+ assert(is_old(), "precondition");
- assert(!is_young(), "check value of filter_young");
-
- // We can only clean the card here, after we make the decision that
- // the card is not young. And we only clean the card if we have been
- // asked to (i.e., card_ptr != NULL).
- if (card_ptr != NULL) {
- *card_ptr = CardTableModRefBS::clean_card_val();
- // We must complete this write before we do any of the reads below.
- OrderAccess::storeload();
- }
+ // Because mr has been trimmed to what's been allocated in this
+ // region, the parts of the heap that are examined here are always
+ // parsable; there's no need to use klass_or_null to detect
+ // in-progress allocation.
// Cache the boundaries of the memory region in some const locals
// We can only clean the card here, after we make the decision that
// the card is not young.
@@ -446,50 +471,37 @@ bool HeapRegion::oops_on_card_seq_iterate_careful(MemRegion mr,
HeapWord* const start = mr.start();
HeapWord* const end = mr.end();
- // We used to use "block_start_careful" here. But we're actually happy
- // to update the BOT while we do this...
- // Update BOT as needed while finding start of (potential) object.
+ // Find the obj that extends onto mr.start().
+ // Update BOT as needed while finding start of (possibly dead)
+ // object containing the start of the region.
@ -365,12 +304,14 @@ index eefa1c9499..5d1578a248 100644
- obj = oop(cur);
- if (obj->klass_or_null() == NULL) {
- // Ran into an unparseable point.
- return cur;
- assert(!g1h->is_gc_active(),
- err_msg("Unparsable heap during GC at " PTR_FORMAT, p2i(cur)));
- return false;
- }
- // Otherwise...
- next = cur + block_size(cur);
- } while (next <= start);
-
- // If we finish the above loop...We have a parseable object that
- // begins on or before the start of the memory region, and ends
- // inside or spans the entire region.
@ -379,10 +320,10 @@ index eefa1c9499..5d1578a248 100644
+#ifdef ASSERT
+ {
+ assert(cur <= start,
+ "cur: " PTR_FORMAT ", start: " PTR_FORMAT);
+ err_msg("cur: " PTR_FORMAT ", start: " PTR_FORMAT, p2i(cur), p2i(start)));
+ HeapWord* next = cur + block_size(cur);
+ assert(start < next,
+ "start: " PTR_FORMAT ", next: " PTR_FORMAT);
+ err_msg("start: " PTR_FORMAT ", next: " PTR_FORMAT, p2i(start), p2i(next)));
+ }
+#endif
@ -391,21 +332,17 @@ index eefa1c9499..5d1578a248 100644
- assert((cur + block_size(cur)) > (HeapWord*)obj, "Loop invariant");
- if (obj->klass_or_null() == NULL) {
- // Ran into an unparseable point.
- return cur;
- assert(!g1h->is_gc_active(),
- err_msg("Unparsable heap during GC at " PTR_FORMAT, p2i(cur)));
- return false;
- }
-
- // Advance the current pointer. "obj" still points to the object to iterate.
- cur = cur + block_size(cur);
-
- if (!g1h->is_obj_dead(obj)) {
- // Non-objArrays are sometimes marked imprecise at the object start. We
- // always need to iterate over them in full.
- // We only iterate over object arrays in full if they are completely contained
- // in the memory region.
+ oop obj = oop(cur);
+ assert(obj->is_oop(true), "Not an oop at " PTR_FORMAT);
+ assert(obj->is_oop(true), err_msg("Not an oop at " PTR_FORMAT, p2i(obj)));
+ assert(obj->klass_or_null() != NULL,
+ "Unparsable heap at " PTR_FORMAT);
+ err_msg("Unparsable heap at " PTR_FORMAT, p2i(obj)));
+
+ if (g1h->is_obj_dead(obj, this)) {
+ // Carefully step over dead object.
@ -417,23 +354,20 @@ index eefa1c9499..5d1578a248 100644
+ // start, in which case we need to iterate over them in full.
+ // objArrays are precisely marked, but can still be iterated
+ // over in full if completely covered.
- if (!g1h->is_obj_dead(obj)) {
- // Non-objArrays are sometimes marked imprecise at the object start. We
- // always need to iterate over them in full.
- // We only iterate over object arrays in full if they are completely contained
- // in the memory region.
if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) {
obj->oop_iterate(cl);
} else {
@@ -471,7 +471,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
}
} while (cur < end);
- return NULL;
+ return true;
}
// Code roots support
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
index 76627e7ba4..a3f5e506a5 100644
index 52ef1d0d2..8a45b3915 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
@@ -418,6 +418,8 @@ class HeapRegion: public G1OffsetTableContigSpace {
@@ -422,6 +422,8 @@ class HeapRegion: public G1OffsetTableContigSpace {
bool is_old() const { return _type.is_old(); }
@ -442,49 +376,11 @@ index 76627e7ba4..a3f5e506a5 100644
// For a humongous region, region in which it starts.
HeapRegion* humongous_start_region() const {
return _humongous_start_region;
@@ -702,7 +704,7 @@ class HeapRegion: public G1OffsetTableContigSpace {
_next_marked_bytes = 0;
}
}
-
+
// Requires that "mr" be entirely within the region.
// Apply "cl->do_object" to all objects that intersect with "mr".
// If the iteration encounters an unparseable portion of the region,
@@ -714,16 +716,18 @@ class HeapRegion: public G1OffsetTableContigSpace {
HeapWord*
object_iterate_mem_careful(MemRegion mr, ObjectClosure* cl);
- // filter_young: if true and the region is a young region then we
- // skip the iteration.
- // card_ptr: if not NULL, and we decide that the card is not young
- // and we iterate over it, we'll clean the card before we start the
- // iteration.
- HeapWord*
- oops_on_card_seq_iterate_careful(MemRegion mr,
- FilterOutOfRegionClosure* cl,
- bool filter_young,
- jbyte* card_ptr);
+ // Iterate over the objects overlapping part of a card, applying cl
+ // to all references in the region. This is a helper for
+ // G1RemSet::refine_card, and is tightly coupled with it.
+ // mr: the memory region covered by the card, trimmed to the
+ // allocated space for this region. Must not be empty.
+ // This region must be old or humongous.
+ // Returns true if the designated objects were successfully
+ // processed, false if an unparsable part of the heap was
+ // encountered; that only happens when invoked concurrently with the
+ // mutator.
+ bool oops_on_card_seq_iterate_careful(MemRegion mr,
+ FilterOutOfRegionClosure* cl);
size_t recorded_rs_length() const { return _recorded_rs_length; }
double predicted_elapsed_time_ms() const { return _predicted_elapsed_time_ms; }
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionType.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionType.hpp
index b00590a6b7..3b9904c39b 100644
index a9a4fbc25..007dabf19 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionType.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionType.hpp
@@ -110,6 +110,9 @@ public:
@@ -111,6 +111,9 @@ public:
bool is_old() const { return get() == OldTag; }
@ -495,7 +391,7 @@ index b00590a6b7..3b9904c39b 100644
void set_free() { set(FreeTag); }
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index 67b0421ebf..2b9fb53293 100644
index f05b4f177..9481dba10 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -1551,22 +1551,25 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan
@ -544,5 +440,5 @@ index 67b0421ebf..2b9fb53293 100644
// Atomically prepend suffix to current overflow list
observed_overflow_list = _overflow_list;
--
2.12.3
2.19.0

View File

@ -1,18 +1,18 @@
From c10681e2567e34426759a73a7af8fe6809a8db09 Mon Sep 17 00:00:00 2001
Date: Fri, 28 Aug 2020 09:51:37 +0800
Subject: [PATCH] 8160425: Vectorization with signalling NaN returns wrong
result
From d33a3a2e991ef69db9711df53ba74a0a7ff918a6 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:30:59 +0800
Subject: 8160425: Vectorization with signalling NaN returns
wrong result
Summary: <hotspot>: Should not use doubles/floats for vector constants in the C code
LLT:
Bug url: https://bugs.openjdk.java.net/browse/JDK-8160425
LLT: huawei/test/gc/zgc/DTS2020032004776.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8160425 https://gitlab.huawei.com/huaweijdk/jdk8u-dev/issues/2213
---
hotspot/src/cpu/sparc/vm/sparc.ad | 10 ++-
hotspot/src/cpu/x86/vm/x86.ad | 10 ++-
hotspot/src/share/vm/asm/assembler.hpp | 9 +++
hotspot/src/cpu/sparc/vm/sparc.ad | 10 +--
hotspot/src/cpu/x86/vm/x86.ad | 10 +--
hotspot/src/share/vm/asm/assembler.hpp | 9 ++
hotspot/src/share/vm/opto/compile.cpp | 3 +
hotspot/src/share/vm/opto/compile.hpp | 9 +++
.../test/compiler/vectorization/TestNaNVector.java | 84 ++++++++++++++++++++++
hotspot/src/share/vm/opto/compile.hpp | 9 ++
.../compiler/vectorization/TestNaNVector.java | 84 +++++++++++++++++++
6 files changed, 113 insertions(+), 12 deletions(-)
create mode 100644 hotspot/test/compiler/vectorization/TestNaNVector.java
@ -108,10 +108,10 @@ index 889dd361d..ec72bc3a1 100644
CodeSection* c1 = _code_section;
address ptr = start_a_const(sizeof(c), sizeof(c));
diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp
index 8e14f1d5a..34e97286e 100644
index b1faf5dc4..540cae5d6 100644
--- a/hotspot/src/share/vm/opto/compile.cpp
+++ b/hotspot/src/share/vm/opto/compile.cpp
@@ -3739,6 +3739,7 @@ bool Compile::Constant::operator==(const Constant& other) {
@@ -3765,6 +3765,7 @@ bool Compile::Constant::operator==(const Constant& other) {
if (can_be_reused() != other.can_be_reused()) return false;
// For floating point values we compare the bit pattern.
switch (type()) {
@ -119,7 +119,7 @@ index 8e14f1d5a..34e97286e 100644
case T_FLOAT: return (_v._value.i == other._v._value.i);
case T_LONG:
case T_DOUBLE: return (_v._value.j == other._v._value.j);
@@ -3753,6 +3754,7 @@ bool Compile::Constant::operator==(const Constant& other) {
@@ -3779,6 +3780,7 @@ bool Compile::Constant::operator==(const Constant& other) {
static int type_to_size_in_bytes(BasicType t) {
switch (t) {
@ -127,7 +127,7 @@ index 8e14f1d5a..34e97286e 100644
case T_LONG: return sizeof(jlong );
case T_FLOAT: return sizeof(jfloat );
case T_DOUBLE: return sizeof(jdouble);
@@ -3821,6 +3823,7 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) {
@@ -3847,6 +3849,7 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) {
Constant con = _constants.at(i);
address constant_addr = NULL;
switch (con.type()) {
@ -136,7 +136,7 @@ index 8e14f1d5a..34e97286e 100644
case T_FLOAT: constant_addr = _masm.float_constant( con.get_jfloat() ); break;
case T_DOUBLE: constant_addr = _masm.double_constant(con.get_jdouble()); break;
diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp
index e4985acc7..60da8587b 100644
index cea7ad867..fd750b10e 100644
--- a/hotspot/src/share/vm/opto/compile.hpp
+++ b/hotspot/src/share/vm/opto/compile.hpp
@@ -203,6 +203,7 @@ class Compile : public Phase {
@ -253,5 +253,5 @@ index 000000000..302657951
+}
+
--
2.12.3
2.19.0

View File

@ -1,6 +1,7 @@
From d0c532d9b3e657fea7ce93602553c9d74aab85a6 Mon Sep 17 00:00:00 2001
Date: Fri, 21 Jun 2019 14:21:55 +0000
Subject: [PATCH] 8164948: Initializing stores of HeapRegions are not ordered with regards to their use in G1ConcurrentMark
From 82736f1e847b8de654f1d2c4c2a7de942a9ba132 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:24:25 +0800
Subject: 8164948: Initializing stores of HeapRegions are not
ordered with regards to their use in G1ConcurrentMark
Summary: Initializing stores of HeapRegions are not ordered with regards to their use in G1ConcurrentMark
LLT:
@ -11,7 +12,7 @@ bug link: https://bugs.openjdk.java.net/browse/JDK-8164948
2 files changed, 3 insertions(+)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index ea0e564b73..0c12478f2f 100644
index 14b5749f9..2f17dce61 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -3006,6 +3006,8 @@ ConcurrentMark::claim_region(uint worker_id) {
@ -24,7 +25,7 @@ index ea0e564b73..0c12478f2f 100644
// until the end of the heap. In this case, just jump to the next region.
HeapWord* end = curr_region != NULL ? curr_region->end() : finger + HeapRegion::GrainWords;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
index 14673df747..49c231d89b 100644
index 14673df74..49c231d89 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
@@ -124,6 +124,7 @@ void HeapRegionManager::make_regions_available(uint start, uint num_regions) {
@ -36,5 +37,5 @@ index 14673df747..49c231d89b 100644
_allocated_heapregions_length = MAX2(_allocated_heapregions_length, i + 1);
}
--
2.12.3
2.19.0

View File

@ -1,162 +0,0 @@
# HG changeset patch
# User kbarrett
# Date 1473955843 14400
# Thu Sep 15 12:10:43 2016 -0400
# Node ID f008248d98dd625b62b5f3f5ca9b24956d33c18d
# Parent 7767224562139a10efca0575c28a62be7895d5b3
8165808: Add release barriers when allocating objects with concurrent collection
Summary: Add release_set_klass, use in slow-path allocators.
Reviewed-by: jmasa, dholmes
diff --git a/src/share/vm/gc_interface/collectedHeap.hpp b/src/share/vm/gc_interface/collectedHeap.hpp
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp
@@ -320,9 +320,6 @@
inline static oop array_allocate(KlassHandle klass, int size, int length, TRAPS);
inline static oop array_allocate_nozero(KlassHandle klass, int size, int length, TRAPS);
- inline static void post_allocation_install_obj_klass(KlassHandle klass,
- oop obj);
-
// Raw memory allocation facilities
// The obj and array allocate methods are covers for these methods.
// mem_allocate() should never be
diff --git a/src/share/vm/gc_interface/collectedHeap.inline.hpp b/src/share/vm/gc_interface/collectedHeap.inline.hpp
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
@@ -39,14 +39,22 @@
// Inline allocation implementations.
void CollectedHeap::post_allocation_setup_common(KlassHandle klass,
- HeapWord* obj) {
- post_allocation_setup_no_klass_install(klass, obj);
- post_allocation_install_obj_klass(klass, oop(obj));
+ HeapWord* obj_ptr) {
+ post_allocation_setup_no_klass_install(klass, obj_ptr);
+ oop obj = (oop)obj_ptr;
+#if ! INCLUDE_ALL_GCS
+ obj->set_klass(klass());
+#else
+ // Need a release store to ensure array/class length, mark word, and
+ // object zeroing are visible before setting the klass non-NULL, for
+ // concurrent collectors.
+ obj->release_set_klass(klass());
+#endif
}
void CollectedHeap::post_allocation_setup_no_klass_install(KlassHandle klass,
- HeapWord* objPtr) {
- oop obj = (oop)objPtr;
+ HeapWord* obj_ptr) {
+ oop obj = (oop)obj_ptr;
assert(obj != NULL, "NULL object pointer");
if (UseBiasedLocking && (klass() != NULL)) {
@@ -57,18 +65,6 @@
}
}
-void CollectedHeap::post_allocation_install_obj_klass(KlassHandle klass,
- oop obj) {
- // These asserts are kind of complicated because of klassKlass
- // and the beginning of the world.
- assert(klass() != NULL || !Universe::is_fully_initialized(), "NULL klass");
- assert(klass() == NULL || klass()->is_klass(), "not a klass");
- assert(obj != NULL, "NULL object pointer");
- obj->set_klass(klass());
- assert(!Universe::is_fully_initialized() || obj->klass() != NULL,
- "missing klass");
-}
-
// Support for jvmti and dtrace
inline void post_allocation_notify(KlassHandle klass, oop obj, int size) {
// support low memory notifications (no-op if not enabled)
@@ -86,25 +82,26 @@
}
void CollectedHeap::post_allocation_setup_obj(KlassHandle klass,
- HeapWord* obj,
+ HeapWord* obj_ptr,
int size) {
- post_allocation_setup_common(klass, obj);
+ post_allocation_setup_common(klass, obj_ptr);
+ oop obj = (oop)obj_ptr;
assert(Universe::is_bootstrapping() ||
- !((oop)obj)->is_array(), "must not be an array");
+ !obj->is_array(), "must not be an array");
// notify jvmti and dtrace
- post_allocation_notify(klass, (oop)obj, size);
+ post_allocation_notify(klass, obj, size);
}
void CollectedHeap::post_allocation_setup_array(KlassHandle klass,
- HeapWord* obj,
+ HeapWord* obj_ptr,
int length) {
- // Set array length before setting the _klass field
- // in post_allocation_setup_common() because the klass field
- // indicates that the object is parsable by concurrent GC.
+ // Set array length before setting the _klass field because a
+ // non-NULL klass field indicates that the object is parsable by
+ // concurrent GC.
assert(length >= 0, "length should be non-negative");
- ((arrayOop)obj)->set_length(length);
- post_allocation_setup_common(klass, obj);
- oop new_obj = (oop)obj;
+ ((arrayOop)obj_ptr)->set_length(length);
+ post_allocation_setup_common(klass, obj_ptr);
+ oop new_obj = (oop)obj_ptr;
assert(new_obj->is_array(), "must be an array");
// notify jvmti and dtrace (must be after length is set for dtrace)
post_allocation_notify(klass, new_obj, new_obj->size());
diff --git a/src/share/vm/oops/oop.hpp b/src/share/vm/oops/oop.hpp
--- a/hotspot/src/share/vm/oops/oop.hpp
+++ b/hotspot/src/share/vm/oops/oop.hpp
@@ -87,6 +87,7 @@
narrowKlass* compressed_klass_addr();
void set_klass(Klass* k);
+ void release_set_klass(Klass* k);
// For klass field compression
int klass_gap() const;
diff --git a/src/share/vm/oops/oop.inline.hpp b/src/share/vm/oops/oop.inline.hpp
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -103,10 +103,14 @@
return &_metadata._compressed_klass;
}
+#define CHECK_SET_KLASS(k) \
+ do { \
+ assert(Universe::is_bootstrapping() || k != NULL, "NULL Klass"); \
+ assert(Universe::is_bootstrapping() || k->is_klass(), "not a Klass"); \
+ } while (0)
+
inline void oopDesc::set_klass(Klass* k) {
- // since klasses are promoted no store check is needed
- assert(Universe::is_bootstrapping() || k != NULL, "must be a real Klass*");
- assert(Universe::is_bootstrapping() || k->is_klass(), "not a Klass*");
+ CHECK_SET_KLASS(k);
if (UseCompressedClassPointers) {
*compressed_klass_addr() = Klass::encode_klass_not_null(k);
} else {
@@ -114,6 +118,18 @@
}
}
+inline void oopDesc::release_set_klass(Klass* k) {
+ CHECK_SET_KLASS(k);
+ if (UseCompressedClassPointers) {
+ OrderAccess::release_store(compressed_klass_addr(),
+ Klass::encode_klass_not_null(k));
+ } else {
+ OrderAccess::release_store_ptr(klass_addr(), k);
+ }
+}
+
+#undef CHECK_SET_KLASS
+
inline int oopDesc::klass_gap() const {
return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes());
}

View File

@ -1,17 +1,18 @@
From 19da764152e382f53c5c0f7069f52d993c649818 Mon Sep 17 00:00:00 2001
Date: Mon, 11 Nov 2019 16:59:01 +0000
Subject: [PATCH] 8165857: CMS _overflow_list is missing volatile specifiers.
From 0ed610485661235817121f82772b92742ac3743d Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:20:00 +0800
Subject: 8165857: CMS _overflow_list is missing volatile
specifiers.
Summary: <gc>: [backport of JDK-8165857][Change _overflow_list from "oop" to "oopDesc* volatile", both CMS and ParNew.]
LLT: NA
Bug url: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/f1ad14991f86
---
.../concurrentMarkSweep/concurrentMarkSweepGeneration.hpp | 2 +-
hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp | 2 +-
.../src/share/vm/gc_implementation/parNew/parNewGeneration.hpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
index a6d06a5dc5..183a97185b 100644
index a023b9fb9..c28f8d6c1 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
@@ -556,7 +556,7 @@ class CMSCollector: public CHeapObj<mtGC> {
@ -24,7 +25,7 @@ index a6d06a5dc5..183a97185b 100644
// displaced for accomodating overflow list above.
// This code will likely be revisited under RFE#4922830.
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
index 7685353ed1..5c6b6181fa 100644
index 7685353ed..5c6b6181f 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
@@ -326,7 +326,7 @@ class ParNewGeneration: public DefNewGeneration {
@ -37,5 +38,5 @@ index 7685353ed1..5c6b6181fa 100644
// If true, older generation does not support promotion undo, so avoid.
--
2.12.3
2.19.0

View File

@ -1,7 +1,7 @@
From 92585164635278b4b127f426bf50014d0a03b572 Mon Sep 17 00:00:00 2001
Date: Thu, 14 Nov 2019 15:23:46 +0000
Subject: [PATCH] 8165860: WorkGroup classes are missing volatile specifiers
for lock-free code
From e7c88ca74c8e8abc77b0a3d4786273067ec79b68 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:23:03 +0800
Subject: 8165860: WorkGroup classes are missing volatile
specifiers for lock-free code
Summary: <gc>: WorkGroup classes are missing volatile specifiers for lock-free code
LLT: NA
@ -12,10 +12,10 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8165860
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/hotspot/src/share/vm/utilities/workgroup.cpp b/hotspot/src/share/vm/utilities/workgroup.cpp
index 3d1f1eef7a..7123574186 100644
index 08b97aa77..29c7a7bf5 100644
--- a/hotspot/src/share/vm/utilities/workgroup.cpp
+++ b/hotspot/src/share/vm/utilities/workgroup.cpp
@@ -503,23 +503,21 @@ bool SequentialSubTasksDone::valid() {
@@ -502,23 +502,21 @@ bool SequentialSubTasksDone::valid() {
}
bool SequentialSubTasksDone::is_task_claimed(uint& t) {
@ -45,7 +45,7 @@ index 3d1f1eef7a..7123574186 100644
break;
}
diff --git a/hotspot/src/share/vm/utilities/workgroup.hpp b/hotspot/src/share/vm/utilities/workgroup.hpp
index 30337f1ef5..ef2dff4932 100644
index 30337f1ef..ef2dff493 100644
--- a/hotspot/src/share/vm/utilities/workgroup.hpp
+++ b/hotspot/src/share/vm/utilities/workgroup.hpp
@@ -400,7 +400,7 @@ public:
@ -81,5 +81,5 @@ index 30337f1ef5..ef2dff4932 100644
void clear();
--
2.12.3
2.19.0

View File

@ -1,17 +1,16 @@
From ece7241c82e94a5ec19e7a83754db10a646ddb11 Mon Sep 17 00:00:00 2001
Date: Mon, 12 Aug 2019 20:20:50 +0800
Subject: [PATCH] Backport of JDK-8166197.
From 20a2cb586843089c328041057057187f37ffe56f Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 14:31:49 +0800
Subject: Backport of JDK-8166197.
Summary: assert(RelaxAssert || w != Thread::current()->_MutexEvent) failed: invariant
LLT: hotspot/test/stress/gc/TestStressRSetCoarsening.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8166197
---
hotspot/src/share/vm/runtime/mutex.cpp | 31 ++++++++++++++++++-------------
hotspot/src/share/vm/runtime/mutex.cpp | 31 +++++++++++++++-----------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/hotspot/src/share/vm/runtime/mutex.cpp b/hotspot/src/share/vm/runtime/mutex.cpp
index 5973e4f199..9c0dcefe72 100644
index 84207eae0..646f7f152 100644
--- a/hotspot/src/share/vm/runtime/mutex.cpp
+++ b/hotspot/src/share/vm/runtime/mutex.cpp
@@ -465,7 +465,7 @@ void Monitor::ILock (Thread * Self) {
@ -114,5 +113,5 @@ index 5973e4f199..9c0dcefe72 100644
}
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From 0350ff861595f4d3b8d903533def704ac319dd45 Mon Sep 17 00:00:00 2001
Date: Sat, 29 Jun 2019 12:05:00 +0000
Subject: [PATCH] Backport of JDK-8166253
From d472c4bc5ff1cb72d6ecb0d691f239b9088378dc Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:35:09 +0800
Subject: Backport of JDK-8166253
summary: (ch) FileLock object can get GC'd and result in unexpected release of file lock
LLT: jdk/test/java/nio/channels/FileLock/FileLockGC.java
@ -13,7 +13,7 @@ bug link: https://bugs.openjdk.java.net/browse/JDK-8166253
create mode 100644 jdk/test/java/nio/channels/FileLock/FileLockGC.java
diff --git a/jdk/src/share/classes/sun/nio/ch/FileLockTable.java b/jdk/src/share/classes/sun/nio/ch/FileLockTable.java
index e77e1c4cec..b0351e5668 100644
index e77e1c4ce..b0351e566 100644
--- a/jdk/src/share/classes/sun/nio/ch/FileLockTable.java
+++ b/jdk/src/share/classes/sun/nio/ch/FileLockTable.java
@@ -1,5 +1,5 @@
@ -81,7 +81,7 @@ index e77e1c4cec..b0351e5668 100644
}
diff --git a/jdk/test/java/nio/channels/FileLock/FileLockGC.java b/jdk/test/java/nio/channels/FileLock/FileLockGC.java
new file mode 100644
index 0000000000..fb66186884
index 000000000..fb6618688
--- /dev/null
+++ b/jdk/test/java/nio/channels/FileLock/FileLockGC.java
@@ -0,0 +1,143 @@
@ -229,5 +229,5 @@ index 0000000000..fb66186884
+ }
+}
--
2.19.0-rc1
2.19.0

View File

@ -1,50 +0,0 @@
# HG changeset patch
# User kbarrett
# Date 1474669392 14400
# Fri Sep 23 18:23:12 2016 -0400
# Node ID 3296281c85d3d7aa95a2aa95aa4801bf1a343426
# Parent 7f7c1e1fbc8a70f9730339872ddf56fee812304c
8166583: Add oopDesc::klass_or_null_acquire()
Summary: Added new function.
Reviewed-by: dholmes, tschatzl
diff --git a/src/share/vm/oops/oop.hpp b/src/share/vm/oops/oop.hpp
--- a/hotspot/src/share/vm/oops/oop.hpp
+++ b/hotspot/src/share/vm/oops/oop.hpp
@@ -83,6 +83,7 @@
Klass* klass() const;
Klass* klass_or_null() const volatile;
+ Klass* klass_or_null_acquire() const volatile;
Klass** klass_addr();
narrowKlass* compressed_klass_addr();
diff --git a/src/share/vm/oops/oop.inline.hpp b/src/share/vm/oops/oop.inline.hpp
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -78,7 +78,6 @@
}
inline Klass* oopDesc::klass_or_null() const volatile {
- // can be NULL in CMS
if (UseCompressedClassPointers) {
return Klass::decode_klass(_metadata._compressed_klass);
} else {
@@ -86,6 +85,17 @@
}
}
+inline Klass* oopDesc::klass_or_null_acquire() const volatile {
+ if (UseCompressedClassPointers) {
+ // Workaround for non-const load_acquire parameter.
+ const volatile narrowKlass* addr = &_metadata._compressed_klass;
+ volatile narrowKlass* xaddr = const_cast<volatile narrowKlass*>(addr);
+ return Klass::decode_klass(OrderAccess::load_acquire(xaddr));
+ } else {
+ return (Klass*)OrderAccess::load_ptr_acquire(&_metadata._klass);
+ }
+}
+
inline int oopDesc::klass_gap_offset_in_bytes() {
assert(UseCompressedClassPointers, "only applicable to compressed klass pointers");
return oopDesc::klass_offset_in_bytes() + sizeof(narrowKlass);

View File

@ -1,142 +0,0 @@
# HG changeset patch
# User kbarrett
# Date 1477103211 14400
# Fri Oct 21 22:26:51 2016 -0400
# Node ID 053ad011aea25994e337f1c5dc9bd4dcc63f38cb
# Parent 7f7c1e1fbc8a70f9730339872ddf56fee812304c
8166862: CMS needs klass_or_null_acquire
Summary: Change CMS non-assert uses of klass_or_null to klass_or_null_acquire.
Reviewed-by: tschatzl, mgerdin
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -998,18 +998,13 @@
// and the klass read.
OrderAccess::loadload();
- // must read from what 'p' points to in each loop.
- Klass* k = ((volatile oopDesc*)p)->klass_or_null();
+ // Ensure klass read before size.
+ Klass* k = oop(p)->klass_or_null_acquire();
if (k != NULL) {
assert(k->is_klass(), "Should really be klass oop.");
oop o = (oop)p;
assert(o->is_oop(true /* ignore mark word */), "Should be an oop.");
- // Bugfix for systems with weak memory model (PPC64/IA64).
- // The object o may be an array. Acquire to make sure that the array
- // size (third word) is consistent.
- OrderAccess::acquire();
-
size_t res = o->size_given_klass(k);
res = adjustObjectSize(res);
assert(res != 0, "Block size should not be 0");
@@ -1057,21 +1052,13 @@
// and the klass read.
OrderAccess::loadload();
- // must read from what 'p' points to in each loop.
- Klass* k = ((volatile oopDesc*)p)->klass_or_null();
- // We trust the size of any object that has a non-NULL
- // klass and (for those in the perm gen) is parsable
- // -- irrespective of its conc_safe-ty.
+ // Ensure klass read before size.
+ Klass* k = oop(p)->klass_or_null_acquire();
if (k != NULL) {
assert(k->is_klass(), "Should really be klass oop.");
oop o = (oop)p;
assert(o->is_oop(), "Should be an oop");
- // Bugfix for systems with weak memory model (PPC64/IA64).
- // The object o may be an array. Acquire to make sure that the array
- // size (third word) is consistent.
- OrderAccess::acquire();
-
size_t res = o->size_given_klass(k);
res = adjustObjectSize(res);
assert(res != 0, "Block size should not be 0");
@@ -1124,7 +1111,7 @@
// and the klass read.
OrderAccess::loadload();
- Klass* k = oop(p)->klass_or_null();
+ Klass* k = oop(p)->klass_or_null_acquire();
if (k != NULL) {
// Ignore mark word because it may have been used to
// chain together promoted objects (the last one
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -6728,7 +6728,7 @@
HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const {
size_t sz = 0;
oop p = (oop)addr;
- if (p->klass_or_null() != NULL) {
+ if (p->klass_or_null_acquire() != NULL) {
sz = CompactibleFreeListSpace::adjustObjectSize(p->size());
} else {
sz = block_size_using_printezis_bits(addr);
@@ -7186,7 +7186,7 @@
}
if (_bitMap->isMarked(addr)) {
// it's marked; is it potentially uninitialized?
- if (p->klass_or_null() != NULL) {
+ if (p->klass_or_null_acquire() != NULL) {
// an initialized object; ignore mark word in verification below
// since we are running concurrent with mutators
assert(p->is_oop(true), "should be an oop");
@@ -7227,7 +7227,7 @@
}
} else {
// Either a not yet marked object or an uninitialized object
- if (p->klass_or_null() == NULL) {
+ if (p->klass_or_null_acquire() == NULL) {
// An uninitialized object, skip to the next card, since
// we may not be able to read its P-bits yet.
assert(size == 0, "Initial value");
@@ -7438,7 +7438,7 @@
assert(_skipBits == 0, "tautology");
_skipBits = 2; // skip next two marked bits ("Printezis-marks")
oop p = oop(addr);
- if (p->klass_or_null() == NULL) {
+ if (p->klass_or_null_acquire() == NULL) {
DEBUG_ONLY(if (!_verifying) {)
// We re-dirty the cards on which this object lies and increase
// the _threshold so that we'll come back to scan this object
@@ -7458,7 +7458,7 @@
if (_threshold < end_card_addr) {
_threshold = end_card_addr;
}
- if (p->klass_or_null() != NULL) {
+ if (p->klass_or_null_acquire() != NULL) {
// Redirty the range of cards...
_mut->mark_range(redirty_range);
} // ...else the setting of klass will dirty the card anyway.
@@ -7609,7 +7609,7 @@
assert(_skip_bits == 0, "tautology");
_skip_bits = 2; // skip next two marked bits ("Printezis-marks")
oop p = oop(addr);
- if (p->klass_or_null() == NULL) {
+ if (p->klass_or_null_acquire() == NULL) {
// in the case of Clean-on-Enter optimization, redirty card
// and avoid clearing card by increasing the threshold.
return true;
@@ -8596,7 +8596,7 @@
"alignment problem");
#ifdef ASSERT
- if (oop(addr)->klass_or_null() != NULL) {
+ if (oop(addr)->klass_or_null_acquire() != NULL) {
// Ignore mark word because we are running concurrent with mutators
assert(oop(addr)->is_oop(true), "live block should be an oop");
assert(size ==
@@ -8607,7 +8607,7 @@
} else {
// This should be an initialized object that's alive.
- assert(oop(addr)->klass_or_null() != NULL,
+ assert(oop(addr)->klass_or_null_acquire() != NULL,
"Should be an initialized object");
// Ignore mark word because we are running concurrent with mutators
assert(oop(addr)->is_oop(true), "live block should be an oop");

85
8168926.patch Normal file
View File

@ -0,0 +1,85 @@
From 72853c670c97aae4eab64a5e9edb3c7176beaf6a Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:36:41 +0800
Subject: 8168926: C2: Bytecode escape analyzer crashes due to
stack overflow
Summary: <C2>:8168926: C2: Bytecode escape analyzer crashes due to stack overflow
LLT: N/A
Bug url: https://bugs.openjdk.java.net/browse/JDK-8168926
---
hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp | 30 ++++++++++++++++++--
hotspot/src/share/vm/ci/ciMethod.hpp | 12 +++++---
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
index 2b9e0e514..34bdbe94d 100644
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
@@ -894,9 +894,33 @@ void BCEscapeAnalyzer::iterate_one_block(ciBlock *blk, StateInfo &state, Growabl
ciMethod* target = s.get_method(ignored_will_link, &declared_signature);
ciKlass* holder = s.get_declared_method_holder();
assert(declared_signature != NULL, "cannot be null");
- // Push appendix argument, if one.
- if (s.has_appendix()) {
- state.apush(unknown_obj);
+ // If the current bytecode has an attached appendix argument,
+ // push an unknown object to represent that argument. (Analysis
+ // of dynamic call sites, especially invokehandle calls, needs
+ // the appendix argument on the stack, in addition to "regular" arguments
+ // pushed onto the stack by bytecode instructions preceding the call.)
+ //
+ // The escape analyzer does _not_ use the ciBytecodeStream::has_appendix(s)
+ // method to determine whether the current bytecode has an appendix argument.
+ // The has_appendix() method obtains the appendix from the
+ // ConstantPoolCacheEntry::_f1 field, which can happen concurrently with
+ // resolution of dynamic call sites. Callees in the
+ // ciBytecodeStream::get_method() call above also access the _f1 field;
+ // interleaving the get_method() and has_appendix() calls in the current
+ // method with call site resolution can lead to an inconsistent view of
+ // the current method's argument count. In particular, some interleaving(s)
+ // can cause the method's argument count to not include the appendix, which
+ // then leads to stack over-/underflow in the escape analyzer.
+ //
+ // Instead of pushing the argument if has_appendix() is true, the escape analyzer
+ // pushes an appendix for all call sites targeted by invokedynamic and invokehandle
+ // instructions, except if the call site is the _invokeBasic intrinsic
+ // (that intrinsic is always targeted by an invokehandle instruction but does
+ // not have an appendix argument).
+ if (target->is_loaded() &&
+ Bytecodes::has_optional_appendix(s.cur_bc_raw()) &&
+ target->intrinsic_id() != vmIntrinsics::_invokeBasic) {
+ state.apush(unknown_obj);
}
// Pass in raw bytecode because we need to see invokehandle instructions.
invoke(state, s.cur_bc_raw(), target, holder);
diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp
index 307452422..99d8dbe67 100644
--- a/hotspot/src/share/vm/ci/ciMethod.hpp
+++ b/hotspot/src/share/vm/ci/ciMethod.hpp
@@ -133,15 +133,19 @@ class ciMethod : public ciMetadata {
check_is_loaded();
return _signature->size() + (_flags.is_static() ? 0 : 1);
}
- // Report the number of elements on stack when invoking this method.
- // This is different than the regular arg_size because invokedynamic
- // has an implicit receiver.
+ // Report the number of elements on stack when invoking the current method.
+ // If the method is loaded, arg_size() gives precise information about the
+ // number of stack elements (using the method's signature and its flags).
+ // However, if the method is not loaded, the number of stack elements must
+ // be determined differently, as the method's flags are not yet available.
+ // The invoke_arg_size() method assumes in that case that all bytecodes except
+ // invokestatic and invokedynamic have a receiver that is also pushed onto the
+ // stack by the caller of the current method.
int invoke_arg_size(Bytecodes::Code code) const {
if (is_loaded()) {
return arg_size();
} else {
int arg_size = _signature->size();
- // Add a receiver argument, maybe:
if (code != Bytecodes::_invokestatic &&
code != Bytecodes::_invokedynamic) {
arg_size++;
--
2.19.0

View File

@ -1,7 +1,6 @@
From 18161c97014b072d7c0628fada35f1ed050c7c78 Mon Sep 17 00:00:00 2001
Date: Thu, 16 Jan 2020 20:30:28 +0800
Subject: [PATCH] 8171410: aarch64: long multiplyExact shifts by 31 instead of
63
From 3665377e22f4896b5c7480ebc8c2138e9fc2fe16 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:31:06 +0800
Subject: aarch64: long multiplyExact shifts by 31 instead of 63
Summary: <c2>: long multiplyExact shifts by 31 instead of 63
LLT: NA
@ -11,10 +10,10 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8171410
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
index a82629edda..b010a690c4 100644
index 48d3628e9..38de0098b 100644
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
@@ -12438,7 +12438,7 @@ instruct overflowMulL_reg(rFlagsReg cr, iRegL op1, iRegL op2)
@@ -12582,7 +12582,7 @@ instruct overflowMulL_reg(rFlagsReg cr, iRegL op1, iRegL op2)
format %{ "mul rscratch1, $op1, $op2\t#overflow check long\n\t"
"smulh rscratch2, $op1, $op2\n\t"
@ -23,7 +22,7 @@ index a82629edda..b010a690c4 100644
"movw rscratch1, #0x80000000\n\t"
"cselw rscratch1, rscratch1, zr, NE\n\t"
"cmpw rscratch1, #1" %}
@@ -12446,7 +12446,7 @@ instruct overflowMulL_reg(rFlagsReg cr, iRegL op1, iRegL op2)
@@ -12590,7 +12590,7 @@ instruct overflowMulL_reg(rFlagsReg cr, iRegL op1, iRegL op2)
ins_encode %{
__ mul(rscratch1, $op1$$Register, $op2$$Register); // Result bits 0..63
__ smulh(rscratch2, $op1$$Register, $op2$$Register); // Result bits 64..127
@ -32,7 +31,7 @@ index a82629edda..b010a690c4 100644
__ movw(rscratch1, 0x80000000); // Develop 0 (EQ),
__ cselw(rscratch1, rscratch1, zr, Assembler::NE); // or 0x80000000 (NE)
__ cmpw(rscratch1, 1); // 0x80000000 - 1 => VS
@@ -12464,7 +12464,7 @@ instruct overflowMulL_reg_branch(cmpOp cmp, iRegL op1, iRegL op2, label labl, rF
@@ -12608,7 +12608,7 @@ instruct overflowMulL_reg_branch(cmpOp cmp, iRegL op1, iRegL op2, label labl, rF
format %{ "mul rscratch1, $op1, $op2\t#overflow check long\n\t"
"smulh rscratch2, $op1, $op2\n\t"
@ -41,7 +40,7 @@ index a82629edda..b010a690c4 100644
"b$cmp $labl" %}
ins_cost(4 * INSN_COST); // Branch is rare so treat as INSN_COST
ins_encode %{
@@ -12472,7 +12472,7 @@ instruct overflowMulL_reg_branch(cmpOp cmp, iRegL op1, iRegL op2, label labl, rF
@@ -12616,7 +12616,7 @@ instruct overflowMulL_reg_branch(cmpOp cmp, iRegL op1, iRegL op2, label labl, rF
Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode;
__ mul(rscratch1, $op1$$Register, $op2$$Register); // Result bits 0..63
__ smulh(rscratch2, $op1$$Register, $op2$$Register); // Result bits 64..127
@ -51,5 +50,5 @@ index a82629edda..b010a690c4 100644
%}
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From c36e8cdc5f1175a3f2a771194434d76324d8cdbb Mon Sep 17 00:00:00 2001
Date: Fri, 17 Apr 2020 17:42:09 +0000
Subject: [PATCH] 8181503: Can't compile hotspot with c++11
From 0145bea2eda2837cb9542c93be01dd3df53ef0b9 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:16:25 +0800
Subject: 8181503: Can't compile hotspot with c++11
Summary: <compile>: fix c++11 compiler issues
LLT: N/A
@ -12,7 +12,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8181503
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
index 018feea1..935a16b5 100644
index 018feea1e..935a16b50 100644
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
@@ -281,11 +281,11 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
@ -39,7 +39,7 @@ index 018feea1..935a16b5 100644
register intptr_t **ebp __asm__ (SPELL_REG_FP);
#endif
diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp
index 63821c06..06794215 100644
index 63821c061..067942150 100644
--- a/hotspot/src/share/vm/code/compiledIC.cpp
+++ b/hotspot/src/share/vm/code/compiledIC.cpp
@@ -222,7 +222,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
@ -52,7 +52,7 @@ index 63821c06..06794215 100644
}
#ifdef ASSERT
diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp
index e5aad6ff..23d495d9 100644
index e5aad6ff2..23d495d93 100644
--- a/hotspot/src/share/vm/utilities/vmError.cpp
+++ b/hotspot/src/share/vm/utilities/vmError.cpp
@@ -399,7 +399,7 @@ void VMError::report(outputStream* st) {

View File

@ -1,6 +1,6 @@
From 27de742e21eda38d2aff89d07364ec8f961f8e34 Mon Sep 17 00:00:00 2001
Date: Tue, 25 Jun 2019 21:09:31 +0000
Subject: [PATCH] Backport of JDK-8182036
From bc0b4ef15436f98b4e7fc87342320b5b4f10ef3c Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 14:30:40 +0800
Subject: Backport of JDK-8182036
summary: Load from initializing arraycopy uses wrong memory state
LLT:
@ -10,10 +10,10 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8182036
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp
index 4379f8359c..ea11a13e70 100644
index cd1b1e5c0..89ebabe6f 100644
--- a/hotspot/src/share/vm/opto/library_call.cpp
+++ b/hotspot/src/share/vm/opto/library_call.cpp
@@ -5723,7 +5723,8 @@ LibraryCallKit::generate_block_arraycopy(const TypePtr* adr_type,
@@ -5703,7 +5703,8 @@ LibraryCallKit::generate_block_arraycopy(const TypePtr* adr_type,
((src_off ^ dest_off) & (BytesPerLong-1)) == 0) {
Node* sptr = basic_plus_adr(src, src_off);
Node* dptr = basic_plus_adr(dest, dest_off);
@ -24,5 +24,5 @@ index 4379f8359c..ea11a13e70 100644
src_off += BytesPerInt;
dest_off += BytesPerInt;
--
2.12.3
2.19.0

View File

@ -1,21 +1,21 @@
From bd619b88d5e074d960b34ece8f60b4e5147c4a47 Mon Sep 17 00:00:00 2001
Date: Fri, 8 Nov 2019 17:42:55 +0000
Subject: [PATCH] 8182397: race in field updates
From 134e5e7eae46d77ec57b0a5b67715f08438f0721 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:22:17 +0800
Subject: 8182397: race in field updates
Summary: <ArrayKlasses>: race in field updates when creating ArrayKlasses can lead to crash
LLT: hotspot/test/runtime/CreateMirror/ArraysNewInstanceBug.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8182397
---
hotspot/src/share/vm/classfile/javaClasses.cpp | 31 ++++----
hotspot/src/share/vm/classfile/javaClasses.hpp | 2 +-
.../src/share/vm/classfile/javaClasses.cpp | 31 +++----
.../src/share/vm/classfile/javaClasses.hpp | 2 +-
hotspot/src/share/vm/oops/oop.hpp | 2 +
hotspot/src/share/vm/oops/oop.inline.hpp | 4 ++
.../runtime/CreateMirror/ArraysNewInstanceBug.java | 83 ++++++++++++++++++++++
hotspot/src/share/vm/oops/oop.inline.hpp | 4 +
.../CreateMirror/ArraysNewInstanceBug.java | 83 +++++++++++++++++++
5 files changed, 107 insertions(+), 15 deletions(-)
create mode 100644 hotspot/test/runtime/CreateMirror/ArraysNewInstanceBug.java
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index 86cb361c..4db165d4 100644
index 3e37f9bd9..ac984d961 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -575,6 +575,7 @@ void java_lang_Class::initialize_mirror_fields(KlassHandle k,
@ -84,7 +84,7 @@ index 86cb361c..4db165d4 100644
}
} else {
if (fixup_mirror_list() == NULL) {
@@ -716,7 +719,7 @@ oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, Basic
@@ -718,7 +721,7 @@ oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, Basic
if (type != T_VOID) {
Klass* aklass = Universe::typeArrayKlassObj(type);
assert(aklass != NULL, "correct bootstrap");
@ -93,7 +93,7 @@ index 86cb361c..4db165d4 100644
}
#ifdef ASSERT
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(SystemDictionary::Class_klass());
@@ -813,9 +816,9 @@ Klass* java_lang_Class::array_klass(oop java_class) {
@@ -815,9 +818,9 @@ Klass* java_lang_Class::array_klass(oop java_class) {
}
@ -106,7 +106,7 @@ index 86cb361c..4db165d4 100644
diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp
index 51879658..d9e65f90 100644
index c330c99e5..a5903d9b9 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp
@@ -281,7 +281,7 @@ class java_lang_Class : AllStatic {
@ -119,10 +119,10 @@ index 51879658..d9e65f90 100644
static int klass_offset_in_bytes() { return _klass_offset; }
static int array_klass_offset_in_bytes() { return _array_klass_offset; }
diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp
index 5e598b4b..a703a54e 100644
index ddaf177d0..97d44c046 100644
--- a/hotspot/src/share/vm/oops/oop.hpp
+++ b/hotspot/src/share/vm/oops/oop.hpp
@@ -203,6 +203,8 @@ class oopDesc {
@@ -202,6 +202,8 @@ class oopDesc {
Metadata* metadata_field(int offset) const;
void metadata_field_put(int offset, Metadata* value);
@ -132,7 +132,7 @@ index 5e598b4b..a703a54e 100644
void byte_field_put(int offset, jbyte contents);
diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp
index a76b8506..d4c4d75c 100644
index ddb9dca2d..2ba94158f 100644
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -373,6 +373,10 @@ inline void oopDesc::metadata_field_put(int offset, Metadata* value) {
@ -148,7 +148,7 @@ index a76b8506..d4c4d75c 100644
encode_store_heap_oop(obj_field_addr<narrowOop>(offset), value) :
diff --git a/hotspot/test/runtime/CreateMirror/ArraysNewInstanceBug.java b/hotspot/test/runtime/CreateMirror/ArraysNewInstanceBug.java
new file mode 100644
index 00000000..870e8ea9
index 000000000..870e8ea94
--- /dev/null
+++ b/hotspot/test/runtime/CreateMirror/ArraysNewInstanceBug.java
@@ -0,0 +1,83 @@
@ -236,5 +236,5 @@ index 00000000..870e8ea9
+ }
+}
--
2.12.3
2.19.0

View File

@ -1,21 +1,21 @@
From c673dc6b67a6f44bafb279b02c0f8616704636ea Mon Sep 17 00:00:00 2001
Date: Sun, 7 Jul 2019 19:16:39 +0000
Subject: [PATCH] Backport of JDK-8186042 for OopmapCache implementation
From 7fa0e2cc00d64ee0399740ff20971f5c11517172 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:36:20 +0800
Subject: Backport of JDK-8186042 for OopmapCache implementation
Summary: Backport of JDK-8186042 for OopmapCache implementation
LLT:
Bug url: https://bugs.openjdk.java.net/browse/JDK-8186042
---
.../shared/vmGCOperations.cpp | 6 +-
.../src/share/vm/interpreter/oopMapCache.cpp | 154 +++++++++++-------
.../src/share/vm/interpreter/oopMapCache.cpp | 150 +++++++++++-------
.../src/share/vm/interpreter/oopMapCache.hpp | 11 +-
hotspot/src/share/vm/oops/method.cpp | 26 +--
hotspot/src/share/vm/runtime/memprofiler.cpp | 2 +-
hotspot/src/share/vm/runtime/vframe.cpp | 8 +-
6 files changed, 113 insertions(+), 94 deletions(-)
6 files changed, 111 insertions(+), 92 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
index 972099b9cb..e50d9cf023 100644
index d60f751af..85059b82f 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
@@ -40,6 +40,7 @@
@ -39,7 +39,7 @@ index 972099b9cb..e50d9cf023 100644
if (sh != NULL) sh->_thread_holds_heap_lock_for_gc = false;
Heap_lock->unlock();
diff --git a/hotspot/src/share/vm/interpreter/oopMapCache.cpp b/hotspot/src/share/vm/interpreter/oopMapCache.cpp
index f696bcb259..160522912f 100644
index f696bcb25..528906267 100644
--- a/hotspot/src/share/vm/interpreter/oopMapCache.cpp
+++ b/hotspot/src/share/vm/interpreter/oopMapCache.cpp
@@ -30,6 +30,7 @@
@ -151,11 +151,10 @@ index f696bcb259..160522912f 100644
RC_TRACE(0x08000000, ("flush: %s(%s): cached entry @%d",
- _array[i].method()->name()->as_C_string(),
- _array[i].method()->signature()->as_C_string(), i));
-
- _array[i].flush();
+ entry->method()->name()->as_C_string(),
+ entry->method()->signature()->as_C_string(), i));
+
- _array[i].flush();
+ _array[i] = NULL;
+ entry->flush();
+ FREE_C_HEAP_OBJ(entry, mtClass);
@ -236,8 +235,6 @@ index f696bcb259..160522912f 100644
- // OopMapCacheEntry *from = entry_at(probe + i - 1);
- // to->copy(from);
- // }
-
- assert(method->is_method(), "gaga");
+ // where the first entry in the collision array is replaced with the new one.
+ OopMapCacheEntry* old = entry_at(probe + 0);
+ if (put_at(probe + 0, tmp, old)) {
@ -245,7 +242,8 @@ index f696bcb259..160522912f 100644
+ } else {
+ enqueue_for_cleanup(tmp);
+ }
+
- assert(method->is_method(), "gaga");
+ assert(!entry_for->is_empty(), "A non-empty oop map should be returned");
- entry = entry_at(probe + 0);
@ -295,7 +293,7 @@ index f696bcb259..160522912f 100644
void OopMapCache::compute_one_oop_map(methodHandle method, int bci, InterpreterOopMap* entry) {
diff --git a/hotspot/src/share/vm/interpreter/oopMapCache.hpp b/hotspot/src/share/vm/interpreter/oopMapCache.hpp
index 99fbe81681..ecbe4340aa 100644
index 99fbe8168..ecbe4340a 100644
--- a/hotspot/src/share/vm/interpreter/oopMapCache.hpp
+++ b/hotspot/src/share/vm/interpreter/oopMapCache.hpp
@@ -147,17 +147,19 @@ class InterpreterOopMap: ResourceObj {
@ -337,7 +335,7 @@ index 99fbe81681..ecbe4340aa 100644
#endif // SHARE_VM_INTERPRETER_OOPMAPCACHE_HPP
diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp
index ec36a59e07..8cfe06e9af 100644
index 9e58c0126..24fae4d30 100644
--- a/hotspot/src/share/vm/oops/method.cpp
+++ b/hotspot/src/share/vm/oops/method.cpp
@@ -216,26 +216,14 @@ int Method::fast_exception_handler_bci_for(methodHandle mh, KlassHandle ex_klass
@ -375,7 +373,7 @@ index ec36a59e07..8cfe06e9af 100644
}
diff --git a/hotspot/src/share/vm/runtime/memprofiler.cpp b/hotspot/src/share/vm/runtime/memprofiler.cpp
index c1cfb60bd6..ddb22601fa 100644
index c1cfb60bd..ddb22601f 100644
--- a/hotspot/src/share/vm/runtime/memprofiler.cpp
+++ b/hotspot/src/share/vm/runtime/memprofiler.cpp
@@ -129,7 +129,7 @@ void MemProfiler::do_trace() {
@ -388,7 +386,7 @@ index c1cfb60bd6..ddb22601fa 100644
}
diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp
index d98eb145ca..dfa02c55a5 100644
index 0d5524118..b3a6d0770 100644
--- a/hotspot/src/share/vm/runtime/vframe.cpp
+++ b/hotspot/src/share/vm/runtime/vframe.cpp
@@ -365,13 +365,7 @@ StackValueCollection* interpretedVFrame::expressions() const {
@ -407,5 +405,5 @@ index d98eb145ca..dfa02c55a5 100644
const int mask_len = oop_mask.number_of_entries();
--
2.19.0-rc1
2.19.0

View File

@ -1,19 +1,19 @@
From 31cb3f58bf65518cf3b9e35cd09405af693a38bd Mon Sep 17 00:00:00 2001
Date: Thu, 21 Nov 2019 11:49:57 +0000
Subject: [PATCH] 8190332: PngReader throws NegativeArraySizeException/OOM
error when IHDR width is very large
From 90676612ff2c10688f555604908267a4528f8c9f Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:29:22 +0800
Subject: 8190332: PngReader throws
NegativeArraySizeException/OOM error when IHDR width is very large
Summary: <imageio>: PngReader throws NegativeArraySizeException/OOM error when IHDR width is very large
LLT:
Bug url: https://bugs.openjdk.java.net/browse/JDK-8190332
---
.../sun/imageio/plugins/png/PNGImageReader.java | 27 +++++--
.../plugins/png/PngLargeIHDRDimensionTest.java | 86 ++++++++++++++++++++++
.../imageio/plugins/png/PNGImageReader.java | 27 ++++--
.../png/PngLargeIHDRDimensionTest.java | 86 +++++++++++++++++++
2 files changed, 106 insertions(+), 7 deletions(-)
create mode 100644 test/jdk/javax/imageio/plugins/png/PngLargeIHDRDimensionTest.java
diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
index 7da36e14b1..02a11d45f4 100644
index 7da36e14b..02a11d45f 100644
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
@@ -1,5 +1,5 @@
@ -67,7 +67,7 @@ index 7da36e14b1..02a11d45f4 100644
diff --git a/test/jdk/javax/imageio/plugins/png/PngLargeIHDRDimensionTest.java b/test/jdk/javax/imageio/plugins/png/PngLargeIHDRDimensionTest.java
new file mode 100644
index 0000000000..118a41f04f
index 000000000..118a41f04
--- /dev/null
+++ b/test/jdk/javax/imageio/plugins/png/PngLargeIHDRDimensionTest.java
@@ -0,0 +1,86 @@
@ -158,5 +158,5 @@ index 0000000000..118a41f04f
+}
+
--
2.12.3
2.19.0

View File

@ -1,22 +1,22 @@
From aee65626b97f366705d47c2d02df34aca5c64251 Mon Sep 17 00:00:00 2001
Date: Fri, 12 Jul 2019 12:45:54 +0000
Subject: [PATCH] Backport of JDK-8191129
From 8591ace51cb262bc6f35b4213f2ebac8a4b9111f Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 14:29:52 +0800
Subject: Backport of JDK-8191129
summary: AARCH64: Invalid value passed to critical JNI function
LLT:
Bug url: https://bugs.openjdk.java.net/browse/JDK-8191129
---
.../src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 2 +-
hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp | 3 +++
hotspot/src/share/vm/runtime/arguments.cpp | 22 ----------------------
hotspot/src/share/vm/runtime/arguments.hpp | 22 ++++++++++++++++++++++
.../cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 2 +-
.../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 3 +++
hotspot/src/share/vm/runtime/arguments.cpp | 22 -------------------
hotspot/src/share/vm/runtime/arguments.hpp | 22 +++++++++++++++++++
4 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
index 3eec8a3273..c48f2235ee 100644
index 55c2b5d6d..7143db519 100644
--- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
@@ -1660,7 +1660,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
@@ -1545,7 +1545,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// critical natives they are offset down.
GrowableArray<int> arg_order(2 * total_in_args);
VMRegPair tmp_vmreg;
@ -26,10 +26,10 @@ index 3eec8a3273..c48f2235ee 100644
if (!is_critical_native) {
for (int i = total_in_args - 1, c_arg = total_c_args - 1; i >= 0; i--, c_arg--) {
diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
index fe0f49a209..df81bacbd7 100644
index 211baa9dc..ae7265dfc 100644
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
@@ -31,6 +31,7 @@
@@ -30,6 +30,7 @@
#include "runtime/java.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "vm_version_aarch64.hpp"
@ -37,7 +37,7 @@ index fe0f49a209..df81bacbd7 100644
#ifdef TARGET_OS_FAMILY_linux
# include "os_linux.inline.hpp"
#endif
@@ -343,4 +344,6 @@ void VM_Version::initialize() {
@@ -339,4 +340,6 @@ void VM_Version::initialize() {
g.generate_getPsrInfo());
get_processor_features();
@ -45,10 +45,10 @@ index fe0f49a209..df81bacbd7 100644
+ UNSUPPORTED_OPTION(CriticalJNINatives, "CriticalJNINatives");
}
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index 6995c30405..83f5d3cfee 100644
index bd789f637..a9eb3fb10 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -76,28 +76,6 @@
@@ -79,28 +79,6 @@
#endif
#define DEFAULT_JAVA_LAUNCHER "generic"
@ -78,7 +78,7 @@ index 6995c30405..83f5d3cfee 100644
int Arguments::_num_jvm_flags = 0;
char** Arguments::_jvm_args_array = NULL;
diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp
index 86c415e6a2..a5cd59ea60 100644
index 86c415e6a..a5cd59ea6 100644
--- a/hotspot/src/share/vm/runtime/arguments.hpp
+++ b/hotspot/src/share/vm/runtime/arguments.hpp
@@ -39,6 +39,28 @@ extern "C" {
@ -111,5 +111,5 @@ index 86c415e6a2..a5cd59ea60 100644
class SysClassPath;
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From 8ae431d4207547ccd5a1d74c3a074c6b79097adb Mon Sep 17 00:00:00 2001
Date: Fri, 28 Jun 2019 14:34:24 +0000
Subject: [PATCH] Backport of JDK-8191483
From 20109e1a7f9941662abd5069d30ad693c181f415 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:33:53 +0800
Subject: Backport of JDK-8191483
summary: AbstractQueuedSynchronizer cancel/cancel race
LLT:
@ -11,7 +11,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8191483
2 files changed, 40 insertions(+), 28 deletions(-)
diff --git a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
index 47fdbfb944..8699fc9b8f 100644
index 47fdbfb94..8699fc9b8 100644
--- a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
+++ b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
@@ -531,7 +531,9 @@ public abstract class AbstractQueuedLongSynchronizer
@ -75,7 +75,7 @@ index 47fdbfb944..8699fc9b8f 100644
/**
diff --git a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
index dce35765df..9088e5894b 100644
index dce35765d..9088e5894 100644
--- a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
+++ b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
@@ -753,7 +753,9 @@ public abstract class AbstractQueuedSynchronizer
@ -139,5 +139,5 @@ index dce35765df..9088e5894b 100644
/**
--
2.19.0-rc1
2.19.0

View File

@ -1,20 +1,20 @@
From eeb0317f3582ae74dd7d42d149fdc457cd01d835 Mon Sep 17 00:00:00 2001
Date: Thu, 26 Dec 2019 20:04:58 +0000
Subject: [PATCH] 8191915: java.lang.Math.multiplyExact not throw an exception
for certain values
From a1125b79426556114c36a807ccd95bd916b07dab Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:26:12 +0800
Subject: 8191915: java.lang.Math.multiplyExact not throw an
exception for certain values
Summary: C2: java.lang.Math.multiplyExact not throw an exception for certain values
LLT: hotspot/test/compiler/intrinsics/mathexact/LongMulOverflowTest.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8191915
---
hotspot/src/share/vm/opto/mathexactnode.cpp | 42 +++++++++------
hotspot/src/share/vm/opto/mathexactnode.cpp | 42 ++++++++-----
hotspot/src/share/vm/opto/mathexactnode.hpp | 4 +-
.../intrinsics/mathexact/LongMulOverflowTest.java | 61 ++++++++++++++++++++++
.../mathexact/LongMulOverflowTest.java | 61 +++++++++++++++++++
3 files changed, 90 insertions(+), 17 deletions(-)
create mode 100644 hotspot/test/compiler/intrinsics/mathexact/LongMulOverflowTest.java
diff --git a/hotspot/src/share/vm/opto/mathexactnode.cpp b/hotspot/src/share/vm/opto/mathexactnode.cpp
index 00466ad3d5..661cc745bf 100644
index 00466ad3d..661cc745b 100644
--- a/hotspot/src/share/vm/opto/mathexactnode.cpp
+++ b/hotspot/src/share/vm/opto/mathexactnode.cpp
@@ -1,5 +1,5 @@
@ -74,7 +74,7 @@ index 00466ad3d5..661cc745bf 100644
bool OverflowAddINode::can_overflow(const Type* t1, const Type* t2) const {
diff --git a/hotspot/src/share/vm/opto/mathexactnode.hpp b/hotspot/src/share/vm/opto/mathexactnode.hpp
index 3e037cf568..0a59ebd96e 100644
index 3e037cf56..0a59ebd96 100644
--- a/hotspot/src/share/vm/opto/mathexactnode.hpp
+++ b/hotspot/src/share/vm/opto/mathexactnode.hpp
@@ -129,8 +129,10 @@ public:
@ -91,7 +91,7 @@ index 3e037cf568..0a59ebd96e 100644
#endif
diff --git a/hotspot/test/compiler/intrinsics/mathexact/LongMulOverflowTest.java b/hotspot/test/compiler/intrinsics/mathexact/LongMulOverflowTest.java
new file mode 100644
index 0000000000..69bd8f1579
index 000000000..69bd8f157
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/mathexact/LongMulOverflowTest.java
@@ -0,0 +1,61 @@
@ -157,5 +157,5 @@ index 0000000000..69bd8f1579
+ }
+}
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From 70641d56fb22355a85ad142700ae721a6a293908 Mon Sep 17 00:00:00 2001
Date: Tue, 25 Jun 2019 10:40:42 +0000
Subject: [PATCH] Backport of JDK-8191955
From 0457c6b44fd7856706acf57aea3de448e01040a5 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:35:45 +0800
Subject: Backport of JDK-8191955
summary: incorrect prefetch distance causes an internal error
LLT:
@ -10,10 +10,10 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8191955
1 file changed, 11 insertions(+)
diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
index f64e356558..ebdfeadf57 100644
index 78e6f1144..211baa9dc 100644
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
@@ -144,6 +144,17 @@ void VM_Version::get_processor_features() {
@@ -138,6 +138,17 @@ void VM_Version::get_processor_features() {
if (PrefetchCopyIntervalInBytes >= 32768)
PrefetchCopyIntervalInBytes = 32760;
}
@ -32,5 +32,5 @@ index f64e356558..ebdfeadf57 100644
unsigned long auxv = getauxval(AT_HWCAP);
--
2.19.0-rc1
2.19.0

View File

@ -1,19 +1,19 @@
From 8ca41b47ee0af3868fcfe745ddedd89cd342a25a Mon Sep 17 00:00:00 2001
Date: Tue, 12 Nov 2019 15:31:59 +0000
Subject: [PATCH] 8194154: System property user.dir should not be changed
From 5547d1f77577ad8514136255eed16921e4d02845 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:23:47 +0800
Subject: 8194154: System property user.dir should not be changed
Summary: <io>: System property user.dir should not be changed
LLT: jdk/test/java/io/File/UserDirChangedTest.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8194154
---
.../solaris/classes/java/io/UnixFileSystem.java | 11 ++++-
.../windows/classes/java/io/WinNTFileSystem.java | 11 ++++-
jdk/test/java/io/File/UserDirChangedTest.java | 51 ++++++++++++++++++++++
.../classes/java/io/UnixFileSystem.java | 11 +++-
.../classes/java/io/WinNTFileSystem.java | 11 +++-
jdk/test/java/io/File/UserDirChangedTest.java | 51 +++++++++++++++++++
3 files changed, 69 insertions(+), 4 deletions(-)
create mode 100644 jdk/test/java/io/File/UserDirChangedTest.java
diff --git a/jdk/src/solaris/classes/java/io/UnixFileSystem.java b/jdk/src/solaris/classes/java/io/UnixFileSystem.java
index fb0fef6364..a6ef2d3a62 100644
index fb0fef636..a6ef2d3a6 100644
--- a/jdk/src/solaris/classes/java/io/UnixFileSystem.java
+++ b/jdk/src/solaris/classes/java/io/UnixFileSystem.java
@@ -1,5 +1,5 @@
@ -54,7 +54,7 @@ index fb0fef6364..a6ef2d3a62 100644
// Caches for canonicalization results to improve startup performance.
diff --git a/jdk/src/windows/classes/java/io/WinNTFileSystem.java b/jdk/src/windows/classes/java/io/WinNTFileSystem.java
index caa47f80c0..1844a662a2 100644
index caa47f80c..1844a662a 100644
--- a/jdk/src/windows/classes/java/io/WinNTFileSystem.java
+++ b/jdk/src/windows/classes/java/io/WinNTFileSystem.java
@@ -1,5 +1,5 @@
@ -96,7 +96,7 @@ index caa47f80c0..1844a662a2 100644
private String getDrive(String path) {
diff --git a/jdk/test/java/io/File/UserDirChangedTest.java b/jdk/test/java/io/File/UserDirChangedTest.java
new file mode 100644
index 0000000000..9eccb768e6
index 000000000..9eccb768e
--- /dev/null
+++ b/jdk/test/java/io/File/UserDirChangedTest.java
@@ -0,0 +1,51 @@
@ -152,5 +152,5 @@ index 0000000000..9eccb768e6
+ }
+}
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From 86d65f4258c2c47751ae42281e84b6ba36712a08 Mon Sep 17 00:00:00 2001
Date: Tue, 9 Jul 2019 10:41:26 +0000
Subject: [PATCH] Backport of JDK-8194246
From 9aafe43836f718794f223e1484d20961a2858fc8 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:31:40 +0800
Subject: Backport of JDK-8194246
summary: JVM crashes when calling getStackTrace if stack contains a method that is a member of a very large class
LLT:
@ -10,10 +10,10 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8194246
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index ff65cb97e2..a9b40d235e 100644
index a6a452ff3..97a10ac02 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -1434,9 +1434,9 @@ class BacktraceBuilder: public StackObj {
@@ -1454,9 +1454,9 @@ class BacktraceBuilder: public StackObj {
method = mhandle();
}
@ -25,7 +25,7 @@ index ff65cb97e2..a9b40d235e 100644
// We need to save the mirrors in the backtrace to keep the class
// from being unloaded while we still have this stack trace.
@@ -1553,10 +1553,10 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
@@ -1573,10 +1573,10 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
Handle mirror(THREAD, mirrors->obj_at(index));
// NULL mirror means end of stack trace
if (mirror.is_null()) goto handle_cause;
@ -38,7 +38,7 @@ index ff65cb97e2..a9b40d235e 100644
print_stack_element(st, mirror, method, version, bci, cpref);
}
result = objArrayHandle(THREAD, objArrayOop(result->obj_at(trace_next_offset)));
@@ -1849,10 +1849,10 @@ oop java_lang_Throwable::get_stack_trace_element(oop throwable, int index, TRAPS
@@ -1869,10 +1869,10 @@ oop java_lang_Throwable::get_stack_trace_element(oop throwable, int index, TRAPS
assert(methods != NULL && bcis != NULL && mirrors != NULL, "sanity check");
@ -52,5 +52,5 @@ index ff65cb97e2..a9b40d235e 100644
// Chunk can be partial full
--
2.19.0-rc1
2.19.0

278
8196485.patch Normal file
View File

@ -0,0 +1,278 @@
From 8194e6260c4006165da6a4344aadceba25d5129d Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:28:23 +0800
Subject: 8196485: FromCardCache default card index can cause crashes
Summary: FromCardCache default card index can cause crashes
LLT: hotspot/test/gc/g1/TestFromCardCacheIndex.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8196485
---
.../gc_implementation/g1/heapRegionRemSet.cpp | 36 +++---
.../gc_implementation/g1/heapRegionRemSet.hpp | 17 +--
.../test/gc/g1/TestFromCardCacheIndex.java | 119 ++++++++++++++++++
3 files changed, 145 insertions(+), 27 deletions(-)
create mode 100644 hotspot/test/gc/g1/TestFromCardCacheIndex.java
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
index 437636281..ad8a3562e 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
@@ -102,17 +102,8 @@ protected:
// If the test below fails, then this table was reused concurrently
// with this operation. This is OK, since the old table was coarsened,
// and adding a bit to the new table is never incorrect.
- // If the table used to belong to a continues humongous region and is
- // now reused for the corresponding start humongous region, we need to
- // make sure that we detect this. Thus, we call is_in_reserved_raw()
- // instead of just is_in_reserved() here.
if (loc_hr->is_in_reserved_raw(from)) {
- size_t hw_offset = pointer_delta((HeapWord*)from, loc_hr->bottom());
- CardIdx_t from_card = (CardIdx_t)
- hw_offset >> (CardTableModRefBS::card_shift - LogHeapWordSize);
-
- assert(0 <= from_card && (size_t)from_card < HeapRegion::CardsPerRegion,
- "Must be in range.");
+ CardIdx_t from_card = OtherRegionsTable::card_within_region(from, loc_hr);
add_card_work(from_card, par);
}
}
@@ -331,6 +322,12 @@ void OtherRegionsTable::link_to_all(PerRegionTable* prt) {
"just checking");
}
+CardIdx_t OtherRegionsTable::card_within_region(OopOrNarrowOopStar within_region, HeapRegion* hr) {
+ assert(hr->is_in_reserved(within_region),"should be");
+ CardIdx_t result = (CardIdx_t)(pointer_delta((HeapWord*)within_region, hr->bottom()) >> (CardTableModRefBS::card_shift - LogHeapWordSize));
+ return result;
+}
+
void OtherRegionsTable::unlink_from_all(PerRegionTable* prt) {
if (prt->prev() != NULL) {
assert(_first_all_fine_prts != prt, "just checking");
@@ -364,18 +361,17 @@ void OtherRegionsTable::unlink_from_all(PerRegionTable* prt) {
"just checking");
}
-int** FromCardCache::_cache = NULL;
-uint FromCardCache::_max_regions = 0;
-size_t FromCardCache::_static_mem_size = 0;
+uintptr_t** FromCardCache::_cache = NULL;
+uint FromCardCache::_max_regions = 0;
+size_t FromCardCache::_static_mem_size = 0;
void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) {
guarantee(_cache == NULL, "Should not call this multiple times");
_max_regions = max_num_regions;
- _cache = Padded2DArray<int, mtGC>::create_unfreeable(n_par_rs,
- _max_regions,
- &_static_mem_size);
-
+ _cache = Padded2DArray<uintptr_t, mtGC>::create_unfreeable(n_par_rs,
+ _max_regions,
+ &_static_mem_size);
invalidate(0, _max_regions);
}
@@ -396,7 +392,8 @@ void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {
void FromCardCache::print(outputStream* out) {
for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) {
for (uint j = 0; j < _max_regions; j++) {
- out->print_cr("_from_card_cache[" UINT32_FORMAT "][" UINT32_FORMAT "] = " INT32_FORMAT ".",
+ out->print_cr("_from_card_cache[%u][%u] = " SIZE_FORMAT ".",
+
i, j, at(i, j));
}
}
@@ -433,7 +430,8 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, int tid) {
: (void *)oopDesc::load_decode_heap_oop((oop*)from));
}
- int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift);
+ uintptr_t from_card = uintptr_t(from) >> CardTableModRefBS::card_shift;
+
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print_cr("Table for [" PTR_FORMAT "...): card %d (cache = " INT32_FORMAT ")",
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp
index 1646e8cb9..77751b4a9 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp
@@ -51,21 +51,19 @@ class FromCardCache : public AllStatic {
private:
// Array of card indices. Indexed by thread X and heap region to minimize
// thread contention.
- static int** _cache;
+ static uintptr_t** _cache;
static uint _max_regions;
static size_t _static_mem_size;
public:
- enum {
- InvalidCard = -1 // Card value of an invalid card, i.e. a card index not otherwise used.
- };
+ static const uintptr_t InvalidCard = UINTPTR_MAX;
static void clear(uint region_idx);
// Returns true if the given card is in the cache at the given location, or
// replaces the card at that location and returns false.
- static bool contains_or_replace(uint worker_id, uint region_idx, int card) {
- int card_in_cache = at(worker_id, region_idx);
+ static bool contains_or_replace(uint worker_id, uint region_idx, uintptr_t card) {
+ uintptr_t card_in_cache = at(worker_id, region_idx);
if (card_in_cache == card) {
return true;
} else {
@@ -74,11 +72,11 @@ class FromCardCache : public AllStatic {
}
}
- static int at(uint worker_id, uint region_idx) {
+ static uintptr_t at(uint worker_id, uint region_idx) {
return _cache[worker_id][region_idx];
}
- static void set(uint worker_id, uint region_idx, int val) {
+ static void set(uint worker_id, uint region_idx, uintptr_t val) {
_cache[worker_id][region_idx] = val;
}
@@ -177,6 +175,9 @@ public:
HeapRegion* hr() const { return _hr; }
+ // Returns the card index of the given within_region pointer relative to the bottom ————————————————————heapRegionRemSet.hpp:312 OtherRegionsTable
+ // of the given heap region.
+ static CardIdx_t card_within_region(OopOrNarrowOopStar within_region, HeapRegion* hr);
// For now. Could "expand" some tables in the future, so that this made
// sense.
void add_reference(OopOrNarrowOopStar from, int tid);
diff --git a/hotspot/test/gc/g1/TestFromCardCacheIndex.java b/hotspot/test/gc/g1/TestFromCardCacheIndex.java
new file mode 100644
index 000000000..92950cf68
--- /dev/null
+++ b/hotspot/test/gc/g1/TestFromCardCacheIndex.java
@@ -0,0 +1,119 @@
+/*
+ * @test TestFromCardCacheIndex.java
+ * @bug 8196485
+ * @summary Ensure that G1 does not miss a remembered set entry due to from card cache default value indices.
+ * @key gc
+ * @requires vm.gc.G1
+ * @requires vm.debug
+ * @requires vm.bits != "32"
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ * java.management
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xms20M -Xmx20M -XX:+UseCompressedOops -XX:G1HeapRegionSize=1M -XX:HeapBaseMinAddress=2199011721216 -XX:+UseG1GC -verbose:gc TestFromCardCacheIndex
+ */
+
+import sun.hotspot.WhiteBox;
+
+/**
+ * Repeatedly tries to generate references from objects that contained a card with the same index
+ * of the from card cache default value.
+ */
+public class TestFromCardCacheIndex {
+ private static WhiteBox WB;
+
+ // Shift value to calculate card indices from addresses.
+ private static final int CardSizeShift = 9;
+
+ /**
+ * Returns the last address on the heap within the object.
+ *
+ * @param The Object array to get the last address from.
+ */
+ private static long getObjectLastAddress(Object[] o) {
+ return WB.getObjectAddress(o) + WB.getObjectSize(o) - 1;
+ }
+
+ /**
+ * Returns the (truncated) 32 bit card index for the given address.
+ *
+ * @param The address to get the 32 bit card index from.
+ */
+ private static int getCardIndex32bit(long address) {
+ return (int)(address >> CardSizeShift);
+ }
+
+ // The source arrays that are placed on the heap in old gen.
+ private static int numArrays = 7000;
+ private static int arraySize = 508;
+ // Size of a humongous byte array, a bit less than a 1M region. This makes sure
+ // that we always create a cross-region reference when referencing it.
+ private static int byteArraySize = 1024*1023;
+
+ public static void main(String[] args) {
+ WB = sun.hotspot.WhiteBox.getWhiteBox();
+ for (int i = 0; i < 5; i++) {
+ runTest();
+ WB.fullGC();
+ }
+ }
+
+ public static void runTest() {
+ System.out.println("Starting test");
+
+ // Spray the heap with random object arrays in the hope that we get one
+ // at the proper place.
+ Object[][] arrays = new Object[numArrays][];
+ for (int i = 0; i < numArrays; i++) {
+ arrays[i] = new Object[arraySize];
+ }
+
+ // Make sure that everything is in old gen.
+ WB.fullGC();
+
+ // Find if we got an allocation at the right spot.
+ Object[] arrayWithCardMinus1 = findArray(arrays);
+
+ if (arrayWithCardMinus1 == null) {
+ System.out.println("Array with card -1 not found. Trying again.");
+ return;
+ } else {
+ System.out.println("Array with card -1 found.");
+ }
+
+ System.out.println("Modifying the last card in the array with a new object in a different region...");
+ // Create a target object that is guaranteed to be in a different region.
+ byte[] target = new byte[byteArraySize];
+
+ // Modify the last entry of the object we found.
+ arrayWithCardMinus1[arraySize - 1] = target;
+
+ target = null;
+ // Make sure that the dirty cards are flushed by doing a GC.
+ System.out.println("Doing a GC.");
+ WB.youngGC();
+
+ System.out.println("The crash didn't reproduce. Trying again.");
+ }
+
+ /**
+ * Finds an returns an array that contains a (32 bit truncated) card with value -1.
+ */
+ private static Object[] findArray(Object[][] arrays) {
+ for (int i = 0; i < arrays.length; i++) {
+ Object[] target = arrays[i];
+ if (target == null) {
+ continue;
+ }
+ final long startAddress = WB.getObjectAddress(target);
+ final long lastAddress = getObjectLastAddress(target);
+ final int card = getCardIndex32bit(lastAddress);
+ if (card == -1) {
+ Object[] foundArray = target;
+ return foundArray;
+ }
+ }
+ return null;
+ }
+}
--
2.19.0

View File

@ -1,18 +1,18 @@
From 11a00ac42593c9338b9ec8779dd8c142d1492907 Mon Sep 17 00:00:00 2001
Date: Mon, 27 May 2019 21:41:37 +0000
Subject: [PATCH] 8202952:C2:Unexpected dead nodes after matching
From 5fafa8bd0a85d93ff0480bc2d163c4070742d8f5 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:26:11 +0800
Subject: 8202952:C2:Unexpected dead nodes after
matching
Bug url: https://bugs.openjdk.java.net/browse/JDK-8202952
---
hotspot/src/share/vm/opto/matcher.cpp | 1 +
1 files changed, 1 insertion(+), 1 deletions(-)
1 file changed, 1 insertion(+)
diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp
index ddd34e7503..6cc9e04e6c 100644
index 70e8af221..f5d30c3af 100644
--- a/hotspot/src/share/vm/opto/matcher.cpp
+++ b/hotspot/src/share/vm/opto/matcher.cpp
@@ -2236,6 +2236,7 @@ void Matcher::find_shared( Node *n ) {
@@ -2230,6 +2230,7 @@ void Matcher::find_shared( Node *n ) {
// AtomicAdd is not an addressing expression.
// Cheap to find it by looking for screwy base.
!adr->in(AddPNode::Base)->is_top() &&

View File

@ -1,20 +1,20 @@
From 0e8b56655778da1200e06bb7138f86f8d395aec5 Mon Sep 17 00:00:00 2001
Date: Sat, 28 Dec 2019 12:41:30 +0000
Subject: [PATCH] 8203196: C1 emits incorrect code due to integer overflow in
_tableswitch keys
From 3607951c82cbfb387b071bdbbcf24e0a48344f36 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:28:34 +0800
Subject: 8203196: C1 emits incorrect code due to integer
overflow in _tableswitch keys
Summary: <c1>: C1 emits incorrect code due to integer overflow in _tableswitch keys
LLT: NA
Bug url: https://bugs.openjdk.java.net/browse/JDK-8203196
---
hotspot/src/share/vm/c1/c1_Instruction.hpp | 4 +--
hotspot/src/share/vm/c1/c1_Instruction.hpp | 4 +-
hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 2 +-
hotspot/test/compiler/c1/SwitchTest.java | 46 +++++++++++++++++++++++++++++
hotspot/test/compiler/c1/SwitchTest.java | 46 +++++++++++++++++++++
3 files changed, 49 insertions(+), 3 deletions(-)
create mode 100644 hotspot/test/compiler/c1/SwitchTest.java
diff --git a/hotspot/src/share/vm/c1/c1_Instruction.hpp b/hotspot/src/share/vm/c1/c1_Instruction.hpp
index 789dba62b2..ee4adbc483 100644
index 789dba62b..ee4adbc48 100644
--- a/hotspot/src/share/vm/c1/c1_Instruction.hpp
+++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp
@@ -2124,11 +2124,11 @@ LEAF(TableSwitch, Switch)
@ -32,10 +32,10 @@ index 789dba62b2..ee4adbc483 100644
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index 1cf9f0e8c4..3a48de9eb0 100644
index 8cfda1b3f..5d47231ca 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -2602,8 +2602,8 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) {
@@ -2574,8 +2574,8 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) {
move_to_phi(x->state());
int lo_key = x->lo_key();
@ -47,7 +47,7 @@ index 1cf9f0e8c4..3a48de9eb0 100644
do_SwitchRanges(create_lookup_ranges(x), value, x->default_sux());
diff --git a/hotspot/test/compiler/c1/SwitchTest.java b/hotspot/test/compiler/c1/SwitchTest.java
new file mode 100644
index 0000000000..d18eccc0fb
index 000000000..d18eccc0f
--- /dev/null
+++ b/hotspot/test/compiler/c1/SwitchTest.java
@@ -0,0 +1,46 @@
@ -99,5 +99,5 @@ index 0000000000..d18eccc0fb
+}
\ No newline at end of file
--
2.12.3
2.19.0

205
8203699.patch Normal file
View File

@ -0,0 +1,205 @@
From eb601b613dbc909471b2a66c368ae0cace4da8d2 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:39:59 +0800
Subject: Backport of JDK-8203699:
java/lang/invoke/SpecialInterfaceCall fails with SIGILL on aarch64
summary: Get super_klass value into r0 to make check in VerifyMethodHandles success
LLT: jdk/test/java/lang/invoke/lookup/TestDefenderMethodLookup.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8203699
---
.../cpu/aarch64/vm/macroAssembler_aarch64.cpp | 5 +
.../lookup/TestDefenderMethodLookup.java | 166 ++++++++++++++++++
2 files changed, 171 insertions(+)
create mode 100644 jdk/test/java/lang/invoke/lookup/TestDefenderMethodLookup.java
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
index f771c5f07..70ab1bcb8 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
@@ -1209,6 +1209,11 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
mov(r0, super_klass);
}
+ // Get super_klass value into r0 (even if it was in r5 or r2)
+ if (super_klass != r0) {
+ mov(r0, super_klass);
+ }
+
#ifndef PRODUCT
mov(rscratch2, (address)&SharedRuntime::_partial_subtype_ctr);
Address pst_counter_addr(rscratch2);
diff --git a/jdk/test/java/lang/invoke/lookup/TestDefenderMethodLookup.java b/jdk/test/java/lang/invoke/lookup/TestDefenderMethodLookup.java
new file mode 100644
index 000000000..8ab268b57
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lookup/TestDefenderMethodLookup.java
@@ -0,0 +1,166 @@
+/*
+ * @test
+ * @author zhangli
+ * @bug 8203699
+ * @summary see https://code.huawei.com/HuaweiJDK/JVM-team/JVM/issues/1368
+ * @run testng/othervm test.java.lang.invoke.lookup.TestDefenderMethodLookup
+ */
+
+package test.java.lang.invoke.lookup;
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import java.lang.invoke.*;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+
+//@Test(groups = { "level.sanity" })
+public class TestDefenderMethodLookup {
+ /**
+ * Get a <b>SPECIAL</b> MethodHandle for the method "test()V" in the <b>DIRECT</b> super interface DefenderInterface. The method
+ * has a default implementation in DefenderInterface and does <b>NOT</b> have an implementation in the class.
+ * Invoke the MethodHandle, and assert that the DefenderInterface.test was invoked (should return "default").
+ *
+ * @throws Throwable No exceptions is expected. Any exception should be treated as an error.
+ */
+ @Test
+ public void testDirectSuperInterface() throws Throwable {
+ DefenderInterface impl = new DefenderInterface() {
+ public MethodHandle run() throws Throwable {
+ Lookup l = DefenderInterface.lookup();
+ Class<? extends DefenderInterface> defc = this.getClass();
+ Class<DefenderInterface> target = DefenderInterface.class;
+ MethodType mt = MethodType.methodType(String.class);
+ return l.findSpecial(defc, "test", mt, target);
+ }
+ };
+ MethodHandle mh = impl.run();
+ String result = (String)mh.invoke(impl);
+ Assert.assertEquals("default", result);
+ }
+
+ /**
+ * Same as <b>testDirectSuperInterface</b>, but with the findSpecial arguments <b>target</b> and <b>defc</b> switched.
+ *
+ * @throws Throwable No exceptions is expected. Any exception should be treated as an error.
+ */
+ @Test
+ public void testDirectSuperInterfaceSwitchedTargetDefc() throws Throwable {
+ DefenderInterface impl = new DefenderInterface() {
+ public MethodHandle run() throws Throwable {
+ Lookup l = MethodHandles.lookup();
+ Class<? extends DefenderInterface> defc = this.getClass();
+ Class<DefenderInterface> target = DefenderInterface.class;
+ MethodType mt = MethodType.methodType(String.class);
+ // Switched target and defc
+ return l.findSpecial(target, "test", mt, defc);
+ }
+ };
+ MethodHandle mh = impl.run();
+ String result = (String)mh.invoke(impl);
+ Assert.assertEquals("default", result);
+ }
+
+ /**
+ * Get a <b>SPECIAL</b> MethodHandle for the method "test()V" in the <b>DIRECT</b> super interface DefenderInterface. The method
+ * has a default implementation in DefenderInterface and does <b>ALSO</b> have an implementation in the class.
+ * Invoke the MethodHandle, and assert that the DefenderInterface.test was invoked (should return "default").
+ *
+ * @throws Throwable No exceptions is expected. Any exception should be treated as an error.
+ */
+ @Test
+ public void testDirectSuperInterfaceWithOverride() throws Throwable {
+ DefenderInterface impl = new DefenderInterface() {
+ @Test
+ @Override
+ public String test() {
+ return "impl";
+ }
+
+ public MethodHandle run() throws Throwable {
+ Lookup l = DefenderInterface.lookup();
+ Class<? extends DefenderInterface> defc = DefenderInterface.class;
+ Class<DefenderInterface> target = DefenderInterface.class;
+ MethodType mt = MethodType.methodType(String.class);
+ return l.findSpecial(defc, "test", mt, target);
+ }
+ };
+ MethodHandle mh = impl.run();
+ String result = (String)mh.invoke(impl);
+ Assert.assertEquals("default", result);
+ }
+
+ /**
+ * Same as <b>testDirectSuperInterfaceWithOverride</b>, but with the findSpecial arguments <b>target</b> and <b>defc</b> switched.
+ *
+ * @throws Throwable No exceptions is expected. Any exception should be treated as an error.
+ */
+ @Test
+ public void testDirectSuperInterfaceWithOverrideSwitchedTargetDefc() throws Throwable {
+ DefenderInterface impl = new DefenderInterface() {
+ @Override
+ public String test() {
+ return "impl";
+ }
+
+ public MethodHandle run() throws Throwable {
+ Lookup l = MethodHandles.lookup();
+ Class<? extends DefenderInterface> defc = this.getClass();
+ Class<DefenderInterface> target = DefenderInterface.class;
+ MethodType mt = MethodType.methodType(String.class);
+ // Switched target and defc
+ return l.findSpecial(target, "test", mt, defc);
+ }
+ };
+ MethodHandle mh = impl.run();
+ String result = (String)mh.invoke(impl);
+ Assert.assertEquals("default", result);
+ }
+
+ /**
+ * <b>NEGATIVE</b><br />
+ * Try to get a <b>SPECIAL</b> MethodHandle for the method "test()V" in the <b>INDIRECT</b> super interface DefenderInterface
+ * (through the interface <b>DefenderSubInterface</b>).
+ *
+ * @throws Throwable Expected exceptions are caught. Any other exception should be treated as an error.
+ */
+ @Test
+ public void testIndirectSuperInterface() throws Throwable {
+ DefenderSubInterface impl = new DefenderSubInterface() {
+ public MethodHandle run() throws Throwable {
+ Lookup l = DefenderSubInterface.lookup();
+ Class<? extends DefenderInterface> defc = this.getClass();
+ Class<DefenderInterface> target = DefenderInterface.class;
+ MethodType mt = MethodType.methodType(String.class);
+ return l.findSpecial(defc, "test", mt, target);
+ }
+ };
+ try {
+ impl.run();
+ Assert.fail("Successfully created supersend MethodHandle to INDIRECT super interface. Should fail with IllegalAccessException.");
+ } catch (IllegalAccessException e) {}
+ }
+}
+
+interface DefenderInterface {
+ public default String test() {
+ return "default";
+ }
+
+ public static Lookup lookup() {
+ return MethodHandles.lookup();
+ }
+
+ public MethodHandle run() throws Throwable;
+}
+
+interface DefenderSubInterface extends DefenderInterface {
+ public default String test() {
+ return "subDefault";
+ }
+
+ public static Lookup lookup() {
+ return MethodHandles.lookup();
+ }
+}
--
2.19.0

View File

@ -1,33 +1,33 @@
From be9a6e1c3f15e798de03ef08c3bca91ef9589c80 Mon Sep 17 00:00:00 2001
Date: Thu, 12 Mar 2020 09:41:07 +0800
Subject: [PATCH] 8204947: Port ShenandoahTaskTerminator to mainline and make
it default
From c0b8967cbdfae95cf2352ff5d0b702e9c66cdd85 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:33:00 +0800
Subject: 8204947: Port ShenandoahTaskTerminator to mainline and
make it default
Summary: <gc>: Improve gc performance, port ShenandoahTaskTerminator to mainline and make it default
LLT: jtreg
Bug url: https://bugs.openjdk.java.net/browse/JDK-8204947
---
.../concurrentMarkSweepGeneration.cpp | 72 ++++++++-
.../vm/gc_implementation/g1/concurrentMark.cpp | 4 +-
.../vm/gc_implementation/g1/concurrentMark.hpp | 12 +-
.../vm/gc_implementation/g1/g1CollectedHeap.cpp | 10 +-
.../gc_implementation/parNew/parNewGeneration.cpp | 16 +-
.../gc_implementation/parNew/parNewGeneration.hpp | 2 +-
.../gc_implementation/parallelScavenge/pcTasks.cpp | 4 +-
.../concurrentMarkSweepGeneration.cpp | 72 +++++++-
.../gc_implementation/g1/concurrentMark.cpp | 4 +-
.../gc_implementation/g1/concurrentMark.hpp | 12 +-
.../gc_implementation/g1/g1CollectedHeap.cpp | 10 +-
.../parNew/parNewGeneration.cpp | 16 +-
.../parNew/parNewGeneration.hpp | 2 +-
.../parallelScavenge/pcTasks.cpp | 4 +-
.../parallelScavenge/psParallelCompact.cpp | 8 +-
.../parallelScavenge/psScavenge.cpp | 11 +-
.../shared/owstTaskTerminator.cpp | 173 +++++++++++++++++++++
.../shared/owstTaskTerminator.hpp | 80 ++++++++++
.../shared/owstTaskTerminator.cpp | 173 ++++++++++++++++++
.../shared/owstTaskTerminator.hpp | 80 ++++++++
hotspot/src/share/vm/runtime/globals.hpp | 4 +
hotspot/src/share/vm/utilities/taskqueue.cpp | 23 +++
hotspot/src/share/vm/utilities/taskqueue.hpp | 47 +++++-
hotspot/src/share/vm/utilities/taskqueue.hpp | 47 ++++-
hotspot/src/share/vm/utilities/workgroup.hpp | 4 +-
15 files changed, 424 insertions(+), 46 deletions(-)
create mode 100644 hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp
create mode 100644 hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index 9d457fd1d6..e42c8b5f39 100644
index 56fb1c451..02a29c2b0 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -41,6 +41,7 @@
@ -38,7 +38,7 @@ index 9d457fd1d6..e42c8b5f39 100644
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/allocation.hpp"
#include "memory/cardTableRS.hpp"
@@ -3887,7 +3888,7 @@ bool CMSCollector::markFromRootsWork(bool asynch) {
@@ -3884,7 +3885,7 @@ bool CMSCollector::markFromRootsWork(bool asynch) {
// Forward decl
class CMSConcMarkingTask;
@ -47,7 +47,7 @@ index 9d457fd1d6..e42c8b5f39 100644
CMSCollector* _collector;
CMSConcMarkingTask* _task;
public:
@@ -3897,7 +3898,7 @@ class CMSConcMarkingTerminator: public ParallelTaskTerminator {
@@ -3894,7 +3895,7 @@ class CMSConcMarkingTerminator: public ParallelTaskTerminator {
// "queue_set" is a set of work queues of other threads.
// "collector" is the CMS collector associated with this task terminator.
// "yield" indicates whether we need the gang as a whole to yield.
@ -56,7 +56,7 @@ index 9d457fd1d6..e42c8b5f39 100644
ParallelTaskTerminator(n_threads, queue_set),
_collector(collector) { }
@@ -3906,6 +3907,45 @@ class CMSConcMarkingTerminator: public ParallelTaskTerminator {
@@ -3903,6 +3904,45 @@ class CMSConcMarkingTerminator: public ParallelTaskTerminator {
}
};
@ -102,7 +102,7 @@ index 9d457fd1d6..e42c8b5f39 100644
class CMSConcMarkingTerminatorTerminator: public TerminatorTerminator {
CMSConcMarkingTask* _task;
public:
@@ -3934,7 +3974,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
@@ -3931,7 +3971,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
OopTaskQueueSet* _task_queues;
// Termination (and yielding) support
@ -111,7 +111,7 @@ index 9d457fd1d6..e42c8b5f39 100644
CMSConcMarkingTerminatorTerminator _term_term;
public:
@@ -3964,7 +4004,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
@@ -3961,7 +4001,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
HeapWord*volatile* global_finger_addr() { return &_global_finger; }
@ -120,7 +120,7 @@ index 9d457fd1d6..e42c8b5f39 100644
virtual void set_for_termination(int active_workers) {
terminator()->reset_for_reuse(active_workers);
@@ -3983,7 +4023,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
@@ -3980,7 +4020,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
void reset(HeapWord* ra) {
assert(_global_finger >= _cms_space->end(), "Postcondition of ::work(i)");
_restart_addr = _global_finger = ra;
@ -129,7 +129,7 @@ index 9d457fd1d6..e42c8b5f39 100644
}
static bool get_work_from_overflow_stack(CMSMarkStack* ovflw_stk,
@@ -4004,7 +4044,7 @@ bool CMSConcMarkingTerminatorTerminator::should_exit_termination() {
@@ -4001,7 +4041,7 @@ bool CMSConcMarkingTerminatorTerminator::should_exit_termination() {
// thread has yielded.
}
@ -138,7 +138,7 @@ index 9d457fd1d6..e42c8b5f39 100644
if (_task->should_yield()) {
_task->yield();
} else {
@@ -4012,6 +4052,22 @@ void CMSConcMarkingTerminator::yield() {
@@ -4009,6 +4049,22 @@ void CMSConcMarkingTerminator::yield() {
}
}
@ -161,7 +161,7 @@ index 9d457fd1d6..e42c8b5f39 100644
////////////////////////////////////////////////////////////////
// Concurrent Marking Algorithm Sketch
////////////////////////////////////////////////////////////////
@@ -5290,7 +5346,7 @@ class CMSParRemarkTask: public CMSParMarkTask {
@@ -5287,7 +5343,7 @@ class CMSParRemarkTask: public CMSParMarkTask {
// The per-thread work queues, available here for stealing.
OopTaskQueueSet* _task_queues;
@ -170,7 +170,7 @@ index 9d457fd1d6..e42c8b5f39 100644
public:
// A value of 0 passed to n_workers will cause the number of
@@ -5309,7 +5365,7 @@ class CMSParRemarkTask: public CMSParMarkTask {
@@ -5306,7 +5362,7 @@ class CMSParRemarkTask: public CMSParMarkTask {
OopTaskQueue* work_queue(int i) { return task_queues()->queue(i); }
@ -180,7 +180,7 @@ index 9d457fd1d6..e42c8b5f39 100644
void work(uint worker_id);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index 0c12478f2f..28dd5aadaa 100644
index 2f17dce61..f7b64a61b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -549,7 +549,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev
@ -202,10 +202,10 @@ index 0c12478f2f..28dd5aadaa 100644
_second_overflow_barrier_sync.set_n_workers((int) active_tasks);
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
index 4c6262415e..02a0cb1843 100644
index 3d01f1cee..c22c9b601 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
@@ -427,8 +427,8 @@ protected:
@@ -428,8 +428,8 @@ protected:
uint _max_worker_id;// maximum worker id
uint _active_tasks; // task num currently active
CMTask** _tasks; // task queue array (max_worker_id len)
@ -216,7 +216,7 @@ index 4c6262415e..02a0cb1843 100644
// Two sync barriers that are used to synchronise tasks when an
// overflow occurs. The algorithm is the following. All tasks enter
@@ -528,10 +528,10 @@ protected:
@@ -529,10 +529,10 @@ protected:
return _parallel_workers != NULL;
}
@ -232,10 +232,10 @@ index 4c6262415e..02a0cb1843 100644
// It claims the next available region to be scanned by a marking
// task/thread. It might return NULL if the next region is empty or
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index 2380cf791e..6e575e07e4 100644
index 97643e792..91ad2e98e 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -4650,7 +4650,7 @@ protected:
@@ -4672,7 +4672,7 @@ protected:
G1CollectedHeap* _g1h;
RefToScanQueueSet *_queues;
G1RootProcessor* _root_processor;
@ -244,7 +244,7 @@ index 2380cf791e..6e575e07e4 100644
uint _n_workers;
Mutex _stats_lock;
@@ -4672,7 +4672,7 @@ public:
@@ -4694,7 +4694,7 @@ public:
return queues()->queue(i);
}
@ -253,7 +253,7 @@ index 2380cf791e..6e575e07e4 100644
virtual void set_for_termination(int active_workers) {
_root_processor->set_num_workers(active_workers);
@@ -4787,7 +4787,7 @@ public:
@@ -4809,7 +4809,7 @@ public:
{
double start = os::elapsedTime();
@ -262,7 +262,7 @@ index 2380cf791e..6e575e07e4 100644
evac.do_void();
double elapsed_sec = os::elapsedTime() - start;
double term_sec = pss.term_time();
@@ -5484,8 +5484,8 @@ public:
@@ -5506,8 +5506,8 @@ public:
void G1STWRefProcTaskExecutor::execute(ProcessTask& proc_task) {
assert(_workers != NULL, "Need parallel worker threads.");
@ -274,7 +274,7 @@ index 2380cf791e..6e575e07e4 100644
_g1h->set_par_threads(_active_workers);
_workers->run_task(&proc_task_proxy);
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index 2b9fb53293..67867d4edb 100644
index 9481dba10..84cd4ed73 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -68,7 +68,7 @@ ParScanThreadState::ParScanThreadState(Space* to_space_,
@ -347,7 +347,7 @@ index 2b9fb53293..67867d4edb 100644
*to(), *this, *_next_gen, *task_queues(),
_overflow_stacks, desired_plab_sz(), _term);
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
index 5c6b6181fa..fa4265a2dc 100644
index 5c6b6181f..fa4265a2d 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
@@ -132,7 +132,7 @@ class ParScanThreadState {
@ -360,7 +360,7 @@ index 5c6b6181fa..fa4265a2dc 100644
public:
ageTable* age_table() {return &_ageTable;}
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
index 7d85c34947..35ea2992b7 100644
index 7d85c3494..35ea2992b 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
@@ -172,7 +172,7 @@ void RefProcTaskExecutor::execute(ProcessTask& task)
@ -382,10 +382,10 @@ index 7d85c34947..35ea2992b7 100644
}
}
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
index bdf254d61d..001b365d88 100644
index 0fa980ef8..3f103ee00 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
@@ -2356,7 +2356,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
@@ -2359,7 +2359,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
uint parallel_gc_threads = heap->gc_task_manager()->workers();
uint active_gc_threads = heap->gc_task_manager()->active_workers();
TaskQueueSetSuper* qset = ParCompactionManager::stack_array();
@ -394,7 +394,7 @@ index bdf254d61d..001b365d88 100644
PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
PSParallelCompact::FollowStackClosure follow_stack_closure(cm);
@@ -2385,7 +2385,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
@@ -2388,7 +2388,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
if (active_gc_threads > 1) {
for (uint j = 0; j < active_gc_threads; j++) {
@ -403,7 +403,7 @@ index bdf254d61d..001b365d88 100644
}
}
@@ -2692,12 +2692,12 @@ void PSParallelCompact::compact() {
@@ -2696,12 +2696,12 @@ void PSParallelCompact::compact() {
uint parallel_gc_threads = heap->gc_task_manager()->workers();
uint active_gc_threads = heap->gc_task_manager()->active_workers();
TaskQueueSetSuper* qset = ParCompactionManager::region_array();
@ -419,7 +419,7 @@ index bdf254d61d..001b365d88 100644
{
GCTraceTime tm_pc("par compact", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
index 5d7e99bd2c..12e282eeb1 100644
index 5d7e99bd2..12e282eeb 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
@@ -189,11 +189,11 @@ void PSRefProcTaskExecutor::execute(ProcessTask& task)
@ -454,7 +454,7 @@ index 5d7e99bd2c..12e282eeb1 100644
diff --git a/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp
new file mode 100644
index 0000000000..9438f6a9ea
index 000000000..9438f6a9e
--- /dev/null
+++ b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp
@@ -0,0 +1,173 @@
@ -481,10 +481,10 @@ index 0000000000..9438f6a9ea
+ *
+ */
+
+#include "precompiled.hpp"
+
+#include "owstTaskTerminator.hpp"
+
+#include "precompiled/precompiled.hpp"
+
+bool OWSTTaskTerminator::exit_termination(size_t tasks, TerminatorTerminator* terminator) {
+ return tasks > 0 || (terminator != NULL && terminator->should_exit_termination());
+}
@ -633,7 +633,7 @@ index 0000000000..9438f6a9ea
+
diff --git a/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp
new file mode 100644
index 0000000000..ad50889d43
index 000000000..ad50889d4
--- /dev/null
+++ b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp
@@ -0,0 +1,80 @@
@ -718,10 +718,10 @@ index 0000000000..ad50889d43
+#endif // SHARE_VM_GC_SHARED_OWSTTASKTERMINATOR_HPP
+
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index 0cf5ac1a8c..28e1bfd8e1 100644
index 254f57651..e25a72cad 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -2020,6 +2020,10 @@ class CommandLineFlags {
@@ -2024,6 +2024,10 @@ class CommandLineFlags {
develop(uintx, PromotionFailureALotInterval, 5, \
"Total collections between promotion failures alot") \
\
@ -733,7 +733,7 @@ index 0cf5ac1a8c..28e1bfd8e1 100644
"Sleep time when sleep is used for yields") \
\
diff --git a/hotspot/src/share/vm/utilities/taskqueue.cpp b/hotspot/src/share/vm/utilities/taskqueue.cpp
index da2e928b8a..0f4dcc90ba 100644
index da2e928b8..0f4dcc90b 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.cpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.cpp
@@ -29,6 +29,7 @@
@ -771,10 +771,10 @@ index da2e928b8a..0f4dcc90ba 100644
+}
+
diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp
index 34ad795e62..dec76c51cc 100644
index c8223b2eb..0f1376b49 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp
@@ -500,6 +500,8 @@ protected:
@@ -503,6 +503,8 @@ protected:
public:
// Returns "true" if some TaskQueue in the set contains a task.
virtual bool peek() = 0;
@ -783,7 +783,7 @@ index 34ad795e62..dec76c51cc 100644
virtual size_t tasks() = 0;
};
@@ -537,6 +539,7 @@ public:
@@ -540,6 +542,7 @@ public:
bool steal(uint queue_num, int* seed, E& t);
bool peek();
@ -791,7 +791,7 @@ index 34ad795e62..dec76c51cc 100644
size_t tasks();
uint size() const { return _n; }
@@ -606,6 +609,15 @@ size_t GenericTaskQueueSet<T, F>::tasks() {
@@ -609,6 +612,15 @@ size_t GenericTaskQueueSet<T, F>::tasks() {
return n;
}
@ -807,7 +807,7 @@ index 34ad795e62..dec76c51cc 100644
// When to terminate from the termination protocol.
class TerminatorTerminator: public CHeapObj<mtInternal> {
public:
@@ -617,7 +629,7 @@ public:
@@ -620,7 +632,7 @@ public:
#undef TRACESPINNING
@ -816,7 +816,7 @@ index 34ad795e62..dec76c51cc 100644
protected:
int _n_threads;
TaskQueueSetSuper* _queue_set;
@@ -653,7 +665,7 @@ public:
@@ -656,7 +668,7 @@ public:
// As above, but it also terminates if the should_exit_termination()
// method of the terminator parameter returns true. If terminator is
// NULL, then it is ignored.
@ -825,7 +825,7 @@ index 34ad795e62..dec76c51cc 100644
// Reset the terminator, so that it may be reused again.
// The caller is responsible for ensuring that this is done
@@ -672,6 +684,37 @@ public:
@@ -675,6 +687,37 @@ public:
#endif
};
@ -864,7 +864,7 @@ index 34ad795e62..dec76c51cc 100644
GenericTaskQueue<E, F, N>::push(E t) {
uint localBot = _bottom;
diff --git a/hotspot/src/share/vm/utilities/workgroup.hpp b/hotspot/src/share/vm/utilities/workgroup.hpp
index ef2dff4932..dd95651572 100644
index ef2dff493..dd9565157 100644
--- a/hotspot/src/share/vm/utilities/workgroup.hpp
+++ b/hotspot/src/share/vm/utilities/workgroup.hpp
@@ -97,11 +97,11 @@ public:
@ -882,5 +882,5 @@ index ef2dff4932..dd95651572 100644
terminator()->reset_for_reuse(active_workers);
}
--
2.12.3
2.19.0

View File

@ -1,8 +1,11 @@
From 0939432f28371aa91ec3fdbb7b38838aa282ecfa Mon Sep 17 00:00:00 2001
From:
Date: Tue, 21 Jul 2020 04:04:12 +0800
Subject: [PATCH] 73
From 99b38421c0da651ded6d5bd4d39ce1a7f6675188 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:14:06 +0800
Subject: 8205921: Optimizing best-of-2 work stealing queue
selection
Summary: <gc>: Improve gc performance, optimizing best-of-2 work stealing queue selection
LLT: jtreg
Bug url: https://bugs.openjdk.java.net/browse/JDK-8205921
---
.../concurrentMarkSweepGeneration.cpp | 29 ++---
.../concurrentMarkSweepGeneration.hpp | 3 -
@ -18,13 +21,12 @@ Subject: [PATCH] 73
.../parallelScavenge/psPromotionManager.hpp | 4 +-
.../parallelScavenge/psTasks.cpp | 3 +-
.../shenandoah/shenandoahConcurrentMark.cpp | 3 +-
hotspot/src/share/vm/memory/padded.hpp | 6 +
hotspot/src/share/vm/utilities/taskqueue.cpp | 18 ---
hotspot/src/share/vm/utilities/taskqueue.hpp | 106 ++++++++++++++----
17 files changed, 120 insertions(+), 92 deletions(-)
hotspot/src/share/vm/utilities/taskqueue.hpp | 105 ++++++++++++++----
16 files changed, 113 insertions(+), 92 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index 02a29c2b..53b75a4c 100644
index 02a29c2b0..53b75a4ca 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -680,11 +680,6 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
@ -141,7 +143,7 @@ index 02a29c2b..53b75a4c 100644
assert(obj_to_scan->is_oop(), "Oops, not an oop!");
assert(_mark_bit_map->isMarked((HeapWord*)obj_to_scan), "Stole an unmarked oop?");
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
index 8b65d342..ca3fee21 100644
index 8b65d3426..ca3fee21b 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
@@ -563,8 +563,6 @@ class CMSCollector: public CHeapObj<mtGC> {
@ -162,10 +164,10 @@ index 8b65d342..ca3fee21 100644
// Support for parallelizing Eden rescan in CMS remark phase
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index 28dd5aad..271b33a5 100644
index f7b64a61b..d782c892d 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -4421,7 +4421,7 @@ void CMTask::do_marking_step(double time_target_ms,
@@ -4431,7 +4431,7 @@ void CMTask::do_marking_step(double time_target_ms,
oop obj;
statsOnly( ++_steal_attempts );
@ -174,7 +176,7 @@ index 28dd5aad..271b33a5 100644
if (_cm->verbose_medium()) {
gclog_or_tty->print_cr("[%u] stolen " PTR_FORMAT " successfully",
_worker_id, p2i((void*) obj));
@@ -4612,7 +4614,7 @@ CMTask::CMTask(uint worker_id,
@@ -4614,7 +4614,7 @@ CMTask::CMTask(uint worker_id,
_worker_id(worker_id), _cm(cm),
_objArray_processor(this),
_claimed(false),
@ -184,10 +186,10 @@ index 28dd5aad..271b33a5 100644
_task_queues(task_queues),
_cm_oop_closure(NULL),
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
index 02a0cb18..1d785c19 100644
index c22c9b601..3404be2a3 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
@@ -679,8 +679,8 @@ public:
@@ -680,8 +680,8 @@ public:
}
// Attempts to steal an object from the task queues of other tasks
@ -198,7 +200,7 @@ index 02a0cb18..1d785c19 100644
}
ConcurrentMark(G1CollectedHeap* g1h,
@@ -1004,8 +1004,6 @@ private:
@@ -1007,8 +1007,6 @@ private:
// it was decreased).
size_t _real_refs_reached_limit;
@ -208,7 +210,7 @@ index 02a0cb18..1d785c19 100644
bool _has_aborted;
// set when the task aborts because it has met its time quota
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
index e765620b..394f20e8 100644
index e765620bc..394f20e82 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
@@ -36,7 +36,7 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num,
@ -221,7 +223,7 @@ index e765620b..394f20e8 100644
_tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
_age_table(false), _scanner(g1h, rp),
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp
index d9403aa4..990b71d3 100644
index d9403aa43..990b71d31 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp
@@ -59,7 +59,6 @@ class G1ParScanThreadState : public StackObj {
@ -241,7 +243,7 @@ index d9403aa4..990b71d3 100644
size_t term_attempts() const { return _term_attempts; }
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp
index 1b03f8ca..7dedb151 100644
index 1b03f8caa..7dedb1517 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp
@@ -131,7 +131,7 @@ inline void G1ParScanThreadState::dispatch_reference(StarTask ref) {
@ -254,7 +256,7 @@ index 1b03f8ca..7dedb151 100644
dispatch_reference(stolen_task);
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index 84cd4ed7..c07e9b81 100644
index 84cd4ed73..c07e9b812 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -92,7 +92,6 @@ ParScanThreadState::ParScanThreadState(Space* to_space_,
@ -274,7 +276,7 @@ index 84cd4ed7..c07e9b81 100644
bool res = work_q->push(obj_to_scan);
assert(res, "Empty queue should have room for a push.");
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
index fa4265a2..ea527fdb 100644
index fa4265a2d..ea527fdb5 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
@@ -95,7 +95,6 @@ class ParScanThreadState {
@ -294,7 +296,7 @@ index fa4265a2..ea527fdb 100644
// Allocate a to-space block of size "sz", or else return NULL.
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
index 35ea2992..37610f3d 100644
index 35ea2992b..37610f3d1 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
@@ -217,14 +217,13 @@ void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
@ -330,7 +332,7 @@ index 35ea2992..37610f3d 100644
cm->drain_region_stacks();
} else {
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp
index 7d7a9f49..a16a1676 100644
index 7d7a9f495..a16a16762 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp
@@ -177,16 +177,16 @@ private:
@ -357,7 +359,7 @@ index 7d7a9f49..a16a1676 100644
// Process tasks remaining on any marking stack
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
index 6eef954b..542d8694 100644
index 6eef954b7..542d86943 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
@@ -164,8 +164,8 @@ class PSPromotionManager VALUE_OBJ_CLASS_SPEC {
@ -372,7 +374,7 @@ index 6eef954b..542d8694 100644
PSPromotionManager();
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
index f829e934..4fe869fd 100644
index f829e9344..4fe869fd6 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
@@ -151,10 +151,9 @@ void StealTask::do_it(GCTaskManager* manager, uint which) {
@ -388,7 +390,7 @@ index f829e934..4fe869fd 100644
pm->process_popped_location_depth(p);
pm->drain_stacks_depth(true);
diff --git a/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.cpp
index 85bbea6c..afcb0dd4 100644
index 85bbea6cd..afcb0dd4a 100644
--- a/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.cpp
@@ -939,7 +939,6 @@ void ShenandoahConcurrentMark::mark_loop_prework(uint w, ShenandoahTaskTerminato
@ -408,25 +410,8 @@ index 85bbea6c..afcb0dd4 100644
do_task<T>(q, cl, live_data, &t);
work++;
} else {
diff --git a/hotspot/src/share/vm/memory/padded.hpp b/hotspot/src/share/vm/memory/padded.hpp
index 9ddd14f8..34eccd66 100644
--- a/hotspot/src/share/vm/memory/padded.hpp
+++ b/hotspot/src/share/vm/memory/padded.hpp
@@ -80,6 +80,12 @@ class PaddedEnd : public PaddedEndImpl<T, PADDED_END_SIZE(T, alignment)> {
// super class that is specialized for the pad_size == 0 case.
};
+// Similar to PaddedEnd, this macro defines a _pad_buf#id field
+// that is (alignment - size) bytes in size. This macro is used
+// to add padding in between non-class fields in a class or struct.
+#define DEFINE_PAD_MINUS_SIZE(id, alignment, size) \
+ char _pad_buf##id[(alignment) - (size)]
+
// Helper class to create an array of PaddedEnd<T> objects. All elements will
// start at a multiple of alignment and the size will be aligned to alignment.
template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
diff --git a/hotspot/src/share/vm/utilities/taskqueue.cpp b/hotspot/src/share/vm/utilities/taskqueue.cpp
index 0f4dcc90..37f4066a 100644
index 0f4dcc90b..37f4066ab 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.cpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.cpp
@@ -112,24 +112,6 @@ void TaskQueueStats::verify() const
@ -455,18 +440,10 @@ index 0f4dcc90..37f4066a 100644
ParallelTaskTerminator(int n_threads, TaskQueueSetSuper* queue_set) :
_n_threads(n_threads),
diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp
index dec76c51..5b03ccfa 100644
index 0f1376b49..77556a7d4 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp
@@ -27,6 +27,7 @@
#include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp"
+#include "memory/padded.hpp"
#include "runtime/mutex.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "utilities/globalDefinitions.hpp"
@@ -307,12 +308,30 @@ public:
@@ -309,12 +309,30 @@ public:
void oops_do(OopClosure* f);
private:
@ -498,7 +475,7 @@ index dec76c51..5b03ccfa 100644
assert(sizeof(Age) == sizeof(size_t), "Depends on this.");
}
@@ -426,6 +445,30 @@ bool GenericTaskQueue<E, F, N>::pop_global(volatile E& t) {
@@ -429,6 +447,30 @@ bool GenericTaskQueue<E, F, N>::pop_global(volatile E& t) {
return resAge == oldAge;
}
@ -529,7 +506,7 @@ index dec76c51..5b03ccfa 100644
template<class E, MEMFLAGS F, unsigned int N>
GenericTaskQueue<E, F, N>::~GenericTaskQueue() {
FREE_C_HEAP_ARRAY(E, _elems, F);
@@ -495,8 +538,6 @@ bool OverflowTaskQueue<E, F, N>::try_push_to_taskqueue(E t) {
@@ -498,8 +540,6 @@ bool OverflowTaskQueue<E, F, N>::try_push_to_taskqueue(E t) {
return taskqueue_t::push(t);
}
class TaskQueueSetSuper {
@ -538,7 +515,7 @@ index dec76c51..5b03ccfa 100644
public:
// Returns "true" if some TaskQueue in the set contains a task.
virtual bool peek() = 0;
@@ -517,27 +558,23 @@ private:
@@ -520,27 +560,23 @@ private:
public:
typedef typename T::element_type E;
@ -572,7 +549,7 @@ index dec76c51..5b03ccfa 100644
bool peek();
uint tasks() const;
size_t tasks();
@@ -557,9 +594,9 @@ GenericTaskQueueSet<T, F>::queue(uint i) {
@@ -560,9 +596,9 @@ GenericTaskQueueSet<T, F>::queue(uint i) {
}
template<class T, MEMFLAGS F> bool
@ -584,7 +561,7 @@ index dec76c51..5b03ccfa 100644
TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal(true));
return true;
}
@@ -569,17 +606,46 @@ GenericTaskQueueSet<T, F>::steal(uint queue_num, int* seed, E& t) {
@@ -572,17 +608,46 @@ GenericTaskQueueSet<T, F>::steal(uint queue_num, int* seed, E& t) {
}
template<class T, MEMFLAGS F> bool
@ -639,4 +616,3 @@ index dec76c51..5b03ccfa 100644
--
2.19.0

View File

@ -1,5 +1,23 @@
From b4d0d09b54fa6a9666aa9d01045d37b3886bce01 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:56:40 +0800
Subject: 8207160: ClassReader::adjustMethodParams can
potentially return null if the args list is empty
Summary: <javac>: adjustMethodParams can potentially return null if the args list is empty
LLT: langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8207160
---
.../com/sun/tools/javac/jvm/ClassReader.java | 3 ++
.../AvoidNPEAtClassReaderTest.java | 43 +++++++++++++++++
.../pkg/Outer$Inner.jasm | 42 ++++++++++++++++
.../AvoidNPEAtClassReader/pkg/Outer.jasm | 48 +++++++++++++++++++
4 files changed, 136 insertions(+)
create mode 100644 langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java
create mode 100644 langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer$Inner.jasm
create mode 100644 langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer.jasm
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
index 40248923..637d83b2 100644
index 402489234..637d83b2f 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
@@ -2051,6 +2051,9 @@ public class ClassReader {
@ -14,7 +32,7 @@ index 40248923..637d83b2 100644
Type varargsElem = args.last();
diff --git a/langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java b/langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java
new file mode 100644
index 00000000..3b47d694
index 000000000..3b47d6944
--- /dev/null
+++ b/langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java
@@ -0,0 +1,43 @@
@ -63,7 +81,7 @@ index 00000000..3b47d694
+}
diff --git a/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer$Inner.jasm b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer$Inner.jasm
new file mode 100644
index 00000000..d3ee1331
index 000000000..d3ee1331c
--- /dev/null
+++ b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer$Inner.jasm
@@ -0,0 +1,42 @@
@ -111,7 +129,7 @@ index 00000000..d3ee1331
+} // end Class Outer$Inner
diff --git a/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer.jasm b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer.jasm
new file mode 100644
index 00000000..29239b13
index 000000000..29239b139
--- /dev/null
+++ b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer.jasm
@@ -0,0 +1,48 @@
@ -163,3 +181,6 @@ index 00000000..29239b13
+public final InnerClass Inner=class Outer$Inner of class Outer;
+
+} // end Class Outer
--
2.19.0

View File

@ -1,6 +1,6 @@
From a3a0d29610bef14392cf20a8d5807ab288320056 Mon Sep 17 00:00:00 2001
Date: Mon, 1 Jul 2019 11:47:36 +0000
Subject: [PATCH] Backpot of JDK-8214345
From 3083c0197855a49e3a59ac3e677e69db0e5db4bc Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:33:03 +0800
Subject: Backpot of JDK-8214345
Summary: infinite recursion while checking super class
LLT: langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.java
@ -14,7 +14,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8214345
create mode 100644 langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.out
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
index d5e9c47a41..68af438218 100644
index d5e9c47a4..68af43821 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
@@ -2617,6 +2617,10 @@ public class Check {
@ -40,7 +40,7 @@ index d5e9c47a41..68af438218 100644
diff --git a/langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.java b/langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.java
new file mode 100644
index 0000000000..1aeb7d71ab
index 000000000..1aeb7d71a
--- /dev/null
+++ b/langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.java
@@ -0,0 +1,12 @@
@ -58,7 +58,7 @@ index 0000000000..1aeb7d71ab
+}
diff --git a/langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.out b/langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.out
new file mode 100644
index 0000000000..bed6acfd7f
index 000000000..bed6acfd7
--- /dev/null
+++ b/langtools/test/tools/javac/generics/ClassBoundCheckingOverflow.out
@@ -0,0 +1,3 @@
@ -66,5 +66,5 @@ index 0000000000..bed6acfd7f
+ClassBoundCheckingOverflow.java:11:73: compiler.err.type.found.req: (compiler.misc.type.parameter: E), (compiler.misc.type.req.class)
+2 errors
--
2.19.0-rc1
2.19.0

View File

@ -1,28 +0,0 @@
From cad64c28ba497ba1165a5ce4530ce53c4ac6263c Mon Sep 17 00:00:00 2001
Date: Sat, 31 Oct 2020 22:05:05 +0800
Subject: [PATCH] 8214440:ldap over a TLS connection negotiate fail
Summary: <java.naming>: ldap over a TLS connection negotiate failed with "javax.net.ssl.SSLPeerUnverifiedException: hostname of the server '' does not match the hostname in the server's certificate"
LLT: NA
Bug url: https://bugs.openjdk.java.net/browse/JDK-8214440
---
.../classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java b/jdk/src/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java
index d9c22b075..2e090fecb 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java
@@ -288,7 +288,8 @@ final public class StartTlsResponseImpl extends StartTlsResponse {
*/
public void setConnection(Connection ldapConnection, String hostname) {
this.ldapConnection = ldapConnection;
- this.hostname = (hostname != null) ? hostname : ldapConnection.host;
+ this.hostname = (hostname == null || hostname.isEmpty())
+ ? ldapConnection.host : hostname;
originalInputStream = ldapConnection.inStream;
originalOutputStream = ldapConnection.outStream;
}
--
2.19.0

390
8215047.patch Normal file
View File

@ -0,0 +1,390 @@
From 751cd3d4fa1b6f207c4022a117c360b99a276156 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:57:28 +0800
Subject: 8215047: backport of OWSTTaskTerminator caused memory
leak in during GC
Summary: <GC>: backport JDK-8215047 JDK-8215299 JDK-8217794 to slove memory leak
LLT: NA
Bug url: https://bugs.openjdk.java.net/browse/JDK-8207160
---
.../gc_implementation/g1/concurrentMark.cpp | 43 ++++++++++---------
.../gc_implementation/g1/concurrentMark.hpp | 5 ++-
.../g1/concurrentMark.inline.hpp | 6 +++
.../shared/owstTaskTerminator.cpp | 39 ++++++++++++-----
.../shared/owstTaskTerminator.hpp | 1 +
hotspot/src/share/vm/utilities/taskqueue.cpp | 27 ++++++++++--
hotspot/src/share/vm/utilities/taskqueue.hpp | 10 ++++-
7 files changed, 94 insertions(+), 37 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index d782c892d..bc4168619 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -3704,7 +3704,9 @@ void CMTask::reset(CMBitMap* nextMarkBitMap) {
}
bool CMTask::should_exit_termination() {
- regular_clock_call();
+ if (!regular_clock_call()) {
+ return true;
+ }
// This is called when we are in the termination protocol. We should
// quit if, for some reason, this task wants to abort or the global
// stack is not empty (this means that we can get work from it).
@@ -3715,11 +3717,13 @@ void CMTask::reached_limit() {
assert(_words_scanned >= _words_scanned_limit ||
_refs_reached >= _refs_reached_limit ,
"shouldn't have been called otherwise");
- regular_clock_call();
+ abort_marking_if_regular_check_fail();
}
-void CMTask::regular_clock_call() {
- if (has_aborted()) return;
+bool CMTask::regular_clock_call() {
+ if (has_aborted()) {
+ return false;
+ };
// First, we need to recalculate the words scanned and refs reached
// limits for the next clock call.
@@ -3729,20 +3733,20 @@ void CMTask::regular_clock_call() {
// (1) If an overflow has been flagged, then we abort.
if (_cm->has_overflown()) {
- set_has_aborted();
- return;
+ return false;
}
// If we are not concurrent (i.e. we're doing remark) we don't need
// to check anything else. The other steps are only needed during
// the concurrent marking phase.
- if (!concurrent()) return;
+ if (!concurrent()) {
+ return true;
+}
// (2) If marking has been aborted for Full GC, then we also abort.
if (_cm->has_aborted()) {
- set_has_aborted();
statsOnly( ++_aborted_cm_aborted );
- return;
+ return false;
}
double curr_time_ms = os::elapsedVTime() * 1000.0;
@@ -3775,19 +3779,17 @@ void CMTask::regular_clock_call() {
if (SuspendibleThreadSet::should_yield()) {
// We should yield. To do this we abort the task. The caller is
// responsible for yielding.
- set_has_aborted();
statsOnly( ++_aborted_yield );
- return;
+ return false;
}
// (5) We check whether we've reached our time quota. If we have,
// then we abort.
double elapsed_time_ms = curr_time_ms - _start_time_ms;
if (elapsed_time_ms > _time_target_ms) {
- set_has_aborted();
_has_timed_out = true;
statsOnly( ++_aborted_timed_out );
- return;
+ return false;
}
// (6) Finally, we check whether there are enough completed STAB
@@ -3800,10 +3802,10 @@ void CMTask::regular_clock_call() {
}
// we do need to process SATB buffers, we'll abort and restart
// the marking task to do so
- set_has_aborted();
statsOnly( ++_aborted_satb );
- return;
+ return false;
}
+ return true;
}
void CMTask::recalculate_limits() {
@@ -4017,7 +4019,7 @@ void CMTask::drain_satb_buffers() {
gclog_or_tty->print_cr("[%u] processed an SATB buffer", _worker_id);
}
statsOnly( ++_satb_buffers_processed );
- regular_clock_call();
+ abort_marking_if_regular_check_fail();
}
_draining_satb_buffers = false;
@@ -4303,7 +4305,7 @@ void CMTask::do_marking_step(double time_target_ms,
// If the iteration is successful, give up the region.
if (mr.is_empty()) {
giveup_current_region();
- regular_clock_call();
+ abort_marking_if_regular_check_fail();
} else if (_curr_region->isHumongous() && mr.start() == _curr_region->bottom()) {
if (_nextMarkBitMap->isMarked(mr.start())) {
// The object is marked - apply the closure
@@ -4313,10 +4315,10 @@ void CMTask::do_marking_step(double time_target_ms,
// Even if this task aborted while scanning the humongous object
// we can (and should) give up the current region.
giveup_current_region();
- regular_clock_call();
+ abort_marking_if_regular_check_fail();
} else if (_nextMarkBitMap->iterate(&bitmap_closure, mr)) {
giveup_current_region();
- regular_clock_call();
+ abort_marking_if_regular_check_fail();
} else {
assert(has_aborted(), "currently the only way to do so");
// The only way to abort the bitmap iteration is to return
@@ -4384,7 +4386,7 @@ void CMTask::do_marking_step(double time_target_ms,
// block of empty regions. So we need to call the regular clock
// method once round the loop to make sure it's called
// frequently enough.
- regular_clock_call();
+ abort_marking_if_regular_check_fail();
}
if (!has_aborted() && _curr_region == NULL) {
@@ -4507,6 +4509,7 @@ void CMTask::do_marking_step(double time_target_ms,
guarantee(_task_queue->size() == 0, "only way to reach here");
guarantee(!_cm->has_overflown(), "only way to reach here");
guarantee(!_cm->mark_stack_overflow(), "only way to reach here");
+ guarantee(!has_aborted(), "should never happen if termination has completed");
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] all tasks terminated", _worker_id);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
index 3404be2a3..f78b1cb3e 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
@@ -1101,9 +1101,10 @@ private:
// this is supposed to be called regularly during a marking step as
// it checks a bunch of conditions that might cause the marking step
// to abort
- void regular_clock_call();
+ bool regular_clock_call();
bool concurrent() { return _concurrent; }
-
+ // Set abort flag if regular_clock_call() check fails
+ inline void abort_marking_if_regular_check_fail();
// Test whether obj might have already been passed over by the
// mark bitmap scan, and so needs to be pushed onto the mark stack.
bool is_below_finger(oop obj, HeapWord* global_finger) const;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp
index 4a8d6a910..7dc2855ca 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp
@@ -290,6 +290,12 @@ inline bool CMTask::is_below_finger(oop obj, HeapWord* global_finger) const {
return objAddr < global_finger;
}
+inline void CMTask::abort_marking_if_regular_check_fail() {
+ if (!regular_clock_call()) {
+ set_has_aborted();
+ }
+}
+
inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) {
if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
diff --git a/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp
index 821cf4198..181628567 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.cpp
@@ -36,15 +36,17 @@ bool OWSTTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
// Single worker, done
if (_n_threads == 1) {
_offered_termination = 1;
+ assert(!peek_in_queue_set(), "Precondition");
return true;
}
_blocker->lock_without_safepoint_check();
- // All arrived, done
_offered_termination++;
+ // All arrived, done
if (_offered_termination == _n_threads) {
_blocker->notify_all();
_blocker->unlock();
+ assert(!peek_in_queue_set(), "Precondition");
return true;
}
@@ -57,21 +59,31 @@ bool OWSTTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
if (do_spin_master_work(terminator)) {
assert(_offered_termination == _n_threads, "termination condition");
+ assert(!peek_in_queue_set(), "Precondition");
return true;
} else {
_blocker->lock_without_safepoint_check();
+ // There is possibility that termination is reached between dropping the lock
+ // before returning from do_spin_master_work() and acquiring lock above.
+ if (_offered_termination == _n_threads) {
+ _blocker->unlock();
+ assert(!peek_in_queue_set(), "Precondition");
+ return true;
+ }
}
} else {
_blocker->wait(true, WorkStealingSleepMillis);
if (_offered_termination == _n_threads) {
_blocker->unlock();
+ assert(!peek_in_queue_set(), "Precondition");
return true;
}
}
size_t tasks = tasks_in_queue_set();
if (exit_termination(tasks, terminator)) {
+ assert_lock_strong(_blocker);
_offered_termination--;
_blocker->unlock();
return false;
@@ -153,19 +165,24 @@ bool OWSTTaskTerminator::do_spin_master_work(TerminatorTerminator* terminator) {
_total_peeks++;
#endif
size_t tasks = tasks_in_queue_set();
- if (exit_termination(tasks, terminator)) {
+ bool exit = exit_termination(tasks, terminator);
+ {
MonitorLockerEx locker(_blocker, Mutex::_no_safepoint_check_flag);
- if ((int) tasks >= _offered_termination - 1) {
- locker.notify_all();
- } else {
- for (; tasks > 1; tasks--) {
- locker.notify();
+ // Termination condition reached
+ if (_offered_termination == _n_threads) {
+ _spin_master = NULL;
+ return true;
+ } else if (exit) {
+ if ((int)tasks >= _offered_termination - 1) {
+ locker.notify_all();
+ } else {
+ for (; tasks > 1; tasks--) {
+ locker.notify();
+ }
}
+ _spin_master = NULL;
+ return false;
}
- _spin_master = NULL;
- return false;
- } else if (_offered_termination == _n_threads) {
- return true;
}
}
}
diff --git a/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp
index ad50889d4..0297b9cd6 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/owstTaskTerminator.hpp
@@ -55,6 +55,7 @@ public:
}
virtual ~OWSTTaskTerminator() {
+ assert(_spin_master == NULL, "Should have been reset");
assert(_blocker != NULL, "Can not be NULL");
delete _blocker;
}
diff --git a/hotspot/src/share/vm/utilities/taskqueue.cpp b/hotspot/src/share/vm/utilities/taskqueue.cpp
index 37f4066ab..120c65a60 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.cpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.cpp
@@ -118,6 +118,11 @@ ParallelTaskTerminator(int n_threads, TaskQueueSetSuper* queue_set) :
_queue_set(queue_set),
_offered_termination(0) {}
+ParallelTaskTerminator::~ParallelTaskTerminator() {
+ assert(_offered_termination == 0 || !peek_in_queue_set(), "Precondition");
+ assert(_offered_termination == 0 || _offered_termination == _n_threads, "Terminated or aborted" );
+}
+
bool ParallelTaskTerminator::peek_in_queue_set() {
return _queue_set->peek();
}
@@ -162,6 +167,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
assert(_offered_termination <= _n_threads, "Invariant");
// Are all threads offering termination?
if (_offered_termination == _n_threads) {
+ assert(!peek_in_queue_set(), "Precondition");
return true;
} else {
// Look for more work.
@@ -214,9 +220,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
#endif
if (peek_in_queue_set() ||
(terminator != NULL && terminator->should_exit_termination())) {
- Atomic::dec(&_offered_termination);
- assert(_offered_termination < _n_threads, "Invariant");
- return false;
+ return complete_or_exit_termination();
}
}
}
@@ -247,6 +251,23 @@ bool ObjArrayTask::is_valid() const {
}
#endif // ASSERT
+bool ParallelTaskTerminator::complete_or_exit_termination() {
+ // If termination is ever reached, terminator should stay in such state,
+ // so that all threads see the same state
+ uint current_offered = _offered_termination;
+ uint expected_value;
+ do {
+ if ((int)current_offered == _n_threads) {
+ assert(!peek_in_queue_set(), "Precondition");
+ return true;
+ }
+ expected_value = current_offered;
+ } while ((current_offered = Atomic::cmpxchg(current_offered - 1, &_offered_termination, current_offered)) != expected_value);
+
+ assert(_offered_termination < _n_threads, "Invariant");
+ return false;
+}
+
void ParallelTaskTerminator::reset_for_reuse(int n_threads) {
reset_for_reuse();
_n_threads = n_threads;
diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp
index 3df7744dc..144333055 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp
@@ -690,7 +690,7 @@ protected:
int _n_threads;
TaskQueueSetSuper* _queue_set;
char _pad_before[DEFAULT_CACHE_LINE_SIZE];
- int _offered_termination;
+ volatile int _offered_termination;
char _pad_after[DEFAULT_CACHE_LINE_SIZE];
#ifdef TRACESPINNING
@@ -704,11 +704,19 @@ protected:
virtual void yield();
void sleep(uint millis);
+ // Called when exiting termination is requested.
+ // When the request is made, terminator may have already terminated
+ // (e.g. all threads are arrived and offered termination). In this case,
+ // it should ignore the request and complete the termination.
+ // Return true if termination is completed. Otherwise, return false.
+ bool complete_or_exit_termination();
+
public:
// "n_threads" is the number of threads to be terminated. "queue_set" is a
// queue sets of work queues of other threads.
ParallelTaskTerminator(int n_threads, TaskQueueSetSuper* queue_set);
+ virtual ~ParallelTaskTerminator();
// The current thread has no work, and is ready to terminate if everyone
// else is. If returns "true", all threads are terminated. If returns
--
2.19.0

View File

@ -1,18 +1,17 @@
From a0559370c5b6ca2a080b673da7198ae366aa34bd Mon Sep 17 00:00:00 2001
Date: Fri, 19 Apr 2019 17:34:30 +0000
Subject: [PATCH] 8221658: aarch64: add necessary predicate for ubfx patterns
Bug url: https://bugs.openjdk.java.net/browse/JDK-8221658
From 56af1a5b3a8dc267f31a1e3ea7766b0ec2f6664b Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:15:05 +0800
Subject: 8221658: aarch64: add necessary predicate for ubfx
patterns
---
hotspot/src/cpu/aarch64/vm/aarch64.ad | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
index d779915db..a82629edd 100644
index fb80c0184..48d3628e9 100644
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
@@ -10777,7 +10777,7 @@ instruct ubfxwI(iRegINoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask)
@@ -10917,7 +10917,7 @@ instruct ubfxwI(iRegINoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask)
long mask = $mask$$constant;
int width = exact_log2(mask+1);
__ ubfxw(as_Register($dst$$reg),
@ -21,7 +20,7 @@ index d779915db..a82629edd 100644
%}
ins_pipe(ialu_reg_shift);
%}
@@ -10792,7 +10792,7 @@ instruct ubfxL(iRegLNoSp dst, iRegL src, immI rshift, immL_bitmask mask)
@@ -10954,7 +10954,7 @@ instruct ubfxIConvI2L(iRegLNoSp dst, iRegIorL2I src, immI rshift, immI_bitmask m
long mask = $mask$$constant;
int width = exact_log2(mask+1);
__ ubfx(as_Register($dst$$reg),

View File

@ -1,376 +0,0 @@
From 0e369d21e25a6de07a5fb54b78dab0012add60c0 Mon Sep 17 00:00:00 2001
Date: Thu, 5 Nov 2020 19:36:14 +0800
Subject: [PATCH] 8223940: Private key not supported by chosen signature
algorithm
Summary: TLS1.3: If a client prefers RSA-PSS, but the provider does not support it, it will fail as above rather than falling back on other providers.
LLT: N/A
Bug url: https://bugs.openjdk.java.net/browse/JDK-8223940
---
.../sun/security/ssl/CertificateVerify.java | 54 +++++++++---------
.../sun/security/ssl/DHServerKeyExchange.java | 30 +++++-----
.../sun/security/ssl/ECDHServerKeyExchange.java | 28 ++++------
.../classes/sun/security/ssl/SignatureScheme.java | 64 +++++++++++++++++-----
4 files changed, 102 insertions(+), 74 deletions(-)
diff --git a/jdk/src/share/classes/sun/security/ssl/CertificateVerify.java b/jdk/src/share/classes/sun/security/ssl/CertificateVerify.java
index 323a7d995..409119c09 100644
--- a/jdk/src/share/classes/sun/security/ssl/CertificateVerify.java
+++ b/jdk/src/share/classes/sun/security/ssl/CertificateVerify.java
@@ -31,6 +31,7 @@ import java.security.*;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Locale;
+import java.util.Map;
import sun.security.ssl.SSLHandshake.HandshakeMessage;
import sun.security.ssl.X509Authentication.X509Credentials;
import sun.security.ssl.X509Authentication.X509Possession;
@@ -585,30 +586,27 @@ final class CertificateVerify {
// This happens in client side only.
ClientHandshakeContext chc = (ClientHandshakeContext)context;
- this.signatureScheme = SignatureScheme.getPreferableAlgorithm(
+ Map.Entry<SignatureScheme, Signature> schemeAndSigner =
+ SignatureScheme.getSignerOfPreferableAlgorithm(
chc.peerRequestedSignatureSchemes,
x509Possession,
chc.negotiatedProtocol);
- if (signatureScheme == null) {
+ if (schemeAndSigner == null) {
// Unlikely, the credentials generator should have
// selected the preferable signature algorithm properly.
throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
- "No preferred signature algorithm for CertificateVerify");
+ "No supported CertificateVerify signature algorithm for " +
+ x509Possession.popPrivateKey.getAlgorithm() +
+ " key");
}
+ this.signatureScheme = schemeAndSigner.getKey();
byte[] temproary = null;
try {
- Signature signer =
- signatureScheme.getSignature(x509Possession.popPrivateKey);
+ Signature signer = schemeAndSigner.getValue();
signer.update(chc.handshakeHash.archived());
temproary = signer.sign();
- } catch (NoSuchAlgorithmException |
- InvalidAlgorithmParameterException nsae) {
- throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
- "Unsupported signature algorithm (" +
- signatureScheme.name +
- ") used in CertificateVerify handshake message", nsae);
- } catch (InvalidKeyException | SignatureException ikse) {
+ } catch (SignatureException ikse) {
throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
"Cannot produce CertificateVerify signature", ikse);
}
@@ -668,7 +666,7 @@ final class CertificateVerify {
this.signature = Record.getBytes16(m);
try {
Signature signer =
- signatureScheme.getSignature(x509Credentials.popPublicKey);
+ signatureScheme.getVerifier(x509Credentials.popPublicKey);
signer.update(shc.handshakeHash.archived());
if (!signer.verify(signature)) {
throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
@@ -897,17 +895,22 @@ final class CertificateVerify {
X509Possession x509Possession) throws IOException {
super(context);
- this.signatureScheme = SignatureScheme.getPreferableAlgorithm(
- context.peerRequestedSignatureSchemes,
- x509Possession,
- context.negotiatedProtocol);
- if (signatureScheme == null) {
+ Map.Entry<SignatureScheme, Signature> schemeAndSigner =
+ SignatureScheme.getSignerOfPreferableAlgorithm(
+ context.peerRequestedSignatureSchemes,
+ x509Possession,
+ context.negotiatedProtocol);
+ if (schemeAndSigner == null) {
// Unlikely, the credentials generator should have
// selected the preferable signature algorithm properly.
throw context.conContext.fatal(Alert.INTERNAL_ERROR,
- "No preferred signature algorithm for CertificateVerify");
+ "No supported CertificateVerify signature algorithm for " +
+ x509Possession.popPrivateKey.getAlgorithm() +
+ " key");
}
+ this.signatureScheme = schemeAndSigner.getKey();
+
byte[] hashValue = context.handshakeHash.digest();
byte[] contentCovered;
if (context.sslConfig.isClientMode) {
@@ -924,17 +927,10 @@ final class CertificateVerify {
byte[] temproary = null;
try {
- Signature signer =
- signatureScheme.getSignature(x509Possession.popPrivateKey);
+ Signature signer = schemeAndSigner.getValue();
signer.update(contentCovered);
temproary = signer.sign();
- } catch (NoSuchAlgorithmException |
- InvalidAlgorithmParameterException nsae) {
- throw context.conContext.fatal(Alert.INTERNAL_ERROR,
- "Unsupported signature algorithm (" +
- signatureScheme.name +
- ") used in CertificateVerify handshake message", nsae);
- } catch (InvalidKeyException | SignatureException ikse) {
+ } catch (SignatureException ikse) {
throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
"Cannot produce CertificateVerify signature", ikse);
}
@@ -1005,7 +1001,7 @@ final class CertificateVerify {
try {
Signature signer =
- signatureScheme.getSignature(x509Credentials.popPublicKey);
+ signatureScheme.getVerifier(x509Credentials.popPublicKey);
signer.update(contentCovered);
if (!signer.verify(signature)) {
throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
diff --git a/jdk/src/share/classes/sun/security/ssl/DHServerKeyExchange.java b/jdk/src/share/classes/sun/security/ssl/DHServerKeyExchange.java
index 48ca870ed..3245482d7 100644
--- a/jdk/src/share/classes/sun/security/ssl/DHServerKeyExchange.java
+++ b/jdk/src/share/classes/sun/security/ssl/DHServerKeyExchange.java
@@ -42,6 +42,7 @@ import java.security.SignatureException;
import java.text.MessageFormat;
import java.util.EnumSet;
import java.util.Locale;
+import java.util.Map;
import javax.crypto.interfaces.DHPublicKey;
import javax.crypto.spec.DHParameterSpec;
import javax.crypto.spec.DHPublicKeySpec;
@@ -125,24 +126,21 @@ final class DHServerKeyExchange {
shc.negotiatedProtocol.useTLS12PlusSpec();
Signature signer = null;
if (useExplicitSigAlgorithm) {
- signatureScheme = SignatureScheme.getPreferableAlgorithm(
- shc.peerRequestedSignatureSchemes,
- x509Possession,
- shc.negotiatedProtocol);
- if (signatureScheme == null) {
+ Map.Entry<SignatureScheme, Signature> schemeAndSigner =
+ SignatureScheme.getSignerOfPreferableAlgorithm(
+ shc.peerRequestedSignatureSchemes,
+ x509Possession,
+ shc.negotiatedProtocol);
+ if (schemeAndSigner == null) {
// Unlikely, the credentials generator should have
// selected the preferable signature algorithm properly.
throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
- "No preferred signature algorithm");
- }
- try {
- signer = signatureScheme.getSignature(
- x509Possession.popPrivateKey);
- } catch (NoSuchAlgorithmException | InvalidKeyException |
- InvalidAlgorithmParameterException nsae) {
- throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
- "Unsupported signature algorithm: " +
- signatureScheme.name, nsae);
+ "No supported signature algorithm for " +
+ x509Possession.popPrivateKey.getAlgorithm() +
+ " key");
+ } else {
+ signatureScheme = schemeAndSigner.getKey();
+ signer = schemeAndSigner.getValue();
}
} else {
signatureScheme = null;
@@ -241,7 +239,7 @@ final class DHServerKeyExchange {
Signature signer;
if (useExplicitSigAlgorithm) {
try {
- signer = signatureScheme.getSignature(
+ signer = signatureScheme.getVerifier(
x509Credentials.popPublicKey);
} catch (NoSuchAlgorithmException | InvalidKeyException |
InvalidAlgorithmParameterException nsae) {
diff --git a/jdk/src/share/classes/sun/security/ssl/ECDHServerKeyExchange.java b/jdk/src/share/classes/sun/security/ssl/ECDHServerKeyExchange.java
index 8c23e3546..2e1cc02c9 100644
--- a/jdk/src/share/classes/sun/security/ssl/ECDHServerKeyExchange.java
+++ b/jdk/src/share/classes/sun/security/ssl/ECDHServerKeyExchange.java
@@ -45,6 +45,7 @@ import java.security.spec.InvalidKeySpecException;
import java.text.MessageFormat;
import java.util.EnumSet;
import java.util.Locale;
+import java.util.Map;
import sun.security.ssl.ECDHKeyExchange.ECDHECredentials;
import sun.security.ssl.ECDHKeyExchange.ECDHEPossession;
import sun.security.ssl.SSLHandshake.HandshakeMessage;
@@ -139,26 +140,21 @@ final class ECDHServerKeyExchange {
shc.negotiatedProtocol.useTLS12PlusSpec();
Signature signer = null;
if (useExplicitSigAlgorithm) {
- signatureScheme = SignatureScheme.getPreferableAlgorithm(
- shc.peerRequestedSignatureSchemes,
- x509Possession,
- shc.negotiatedProtocol);
- if (signatureScheme == null) {
+ Map.Entry<SignatureScheme, Signature> schemeAndSigner =
+ SignatureScheme.getSignerOfPreferableAlgorithm(
+ shc.peerRequestedSignatureSchemes,
+ x509Possession,
+ shc.negotiatedProtocol);
+ if (schemeAndSigner == null) {
// Unlikely, the credentials generator should have
// selected the preferable signature algorithm properly.
throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
- "No preferred signature algorithm for " +
+ "No supported signature algorithm for " +
x509Possession.popPrivateKey.getAlgorithm() +
" key");
- }
- try {
- signer = signatureScheme.getSignature(
- x509Possession.popPrivateKey);
- } catch (NoSuchAlgorithmException | InvalidKeyException |
- InvalidAlgorithmParameterException nsae) {
- throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
- "Unsupported signature algorithm: " +
- signatureScheme.name, nsae);
+ } else {
+ signatureScheme = schemeAndSigner.getKey();
+ signer = schemeAndSigner.getValue();
}
} else {
signatureScheme = null;
@@ -295,7 +291,7 @@ final class ECDHServerKeyExchange {
Signature signer;
if (useExplicitSigAlgorithm) {
try {
- signer = signatureScheme.getSignature(
+ signer = signatureScheme.getVerifier(
x509Credentials.popPublicKey);
} catch (NoSuchAlgorithmException | InvalidKeyException |
InvalidAlgorithmParameterException nsae) {
diff --git a/jdk/src/share/classes/sun/security/ssl/SignatureScheme.java b/jdk/src/share/classes/sun/security/ssl/SignatureScheme.java
index 93f5473da..9fd9707ba 100644
--- a/jdk/src/share/classes/sun/security/ssl/SignatureScheme.java
+++ b/jdk/src/share/classes/sun/security/ssl/SignatureScheme.java
@@ -31,6 +31,7 @@ import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.ECParameterSpec;
import java.security.spec.MGF1ParameterSpec;
import java.security.spec.PSSParameterSpec;
+import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -38,6 +39,7 @@ import java.util.Collections;
import java.util.EnumSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import sun.security.ssl.SupportedGroupsExtension.NamedGroup;
import sun.security.ssl.SupportedGroupsExtension.NamedGroupType;
@@ -427,7 +429,7 @@ enum SignatureScheme {
return null;
}
- static SignatureScheme getPreferableAlgorithm(
+ static Map.Entry<SignatureScheme, Signature> getSignerOfPreferableAlgorithm(
List<SignatureScheme> schemes,
X509Possession x509Possession,
ProtocolVersion version) {
@@ -452,7 +454,10 @@ enum SignatureScheme {
x509Possession.getECParameterSpec();
if (params != null &&
ss.namedGroup == NamedGroup.valueOf(params)) {
- return ss;
+ Signature signer = ss.getSigner(signingKey);
+ if (signer != null) {
+ return new SimpleImmutableEntry<>(ss, signer);
+ }
}
if (SSLLogger.isOn &&
@@ -477,7 +482,10 @@ enum SignatureScheme {
NamedGroup keyGroup = NamedGroup.valueOf(params);
if (keyGroup != null &&
SupportedGroups.isSupported(keyGroup)) {
- return ss;
+ Signature signer = ss.getSigner(signingKey);
+ if (signer != null) {
+ return new SimpleImmutableEntry<>(ss, signer);
+ }
}
}
@@ -488,7 +496,10 @@ enum SignatureScheme {
"), unsupported EC parameter spec: " + params);
}
} else {
- return ss;
+ Signature signer = ss.getSigner(signingKey);
+ if (signer != null) {
+ return new SimpleImmutableEntry<>(ss, signer);
+ }
}
}
}
@@ -509,21 +520,48 @@ enum SignatureScheme {
return new String[0];
}
- Signature getSignature(Key key) throws NoSuchAlgorithmException,
+ // This method is used to get the signature instance of this signature
+ // scheme for the specific public key. Unlike getSigner(), the exception
+ // is bubbled up. If the public key does not support this signature
+ // scheme, it normally means the TLS handshaking cannot continue and
+ // the connection should be terminated.
+ Signature getVerifier(PublicKey publicKey) throws NoSuchAlgorithmException,
InvalidAlgorithmParameterException, InvalidKeyException {
if (!isAvailable) {
return null;
}
- Signature signer = JsseJce.getSignature(algorithm);
- if (key instanceof PublicKey) {
- SignatureUtil.initVerifyWithParam(signer, (PublicKey)key,
- signAlgParameter);
- } else {
- SignatureUtil.initSignWithParam(signer, (PrivateKey)key,
- signAlgParameter, null);
+ Signature verifier = Signature.getInstance(algorithm);
+ SignatureUtil.initVerifyWithParam(verifier, publicKey, signAlgParameter);
+
+ return verifier;
+ }
+
+ // This method is also used to choose preferable signature scheme for the
+ // specific private key. If the private key does not support the signature
+ // scheme, {@code null} is returned, and the caller may fail back to next
+ // available signature scheme.
+ private Signature getSigner(PrivateKey privateKey) {
+ if (!isAvailable) {
+ return null;
}
- return signer;
+ try {
+ Signature signer = Signature.getInstance(algorithm);
+ SignatureUtil.initSignWithParam(signer, privateKey,
+ signAlgParameter,
+ null);
+ return signer;
+ } catch (NoSuchAlgorithmException | InvalidKeyException |
+ InvalidAlgorithmParameterException nsae) {
+ if (SSLLogger.isOn &&
+ SSLLogger.isOn("ssl,handshake,verbose")) {
+ SSLLogger.finest(
+ "Ignore unsupported signature algorithm (" +
+ this.name + ")", nsae);
+ }
+ }
+
+ return null;
}
}
--
2.12.3

View File

@ -1,6 +1,6 @@
From 0a3958872fd70590976b185e086eec3f461b27c4 Mon Sep 17 00:00:00 2001
Date: Fri, 28 Aug 2020 09:28:23 +0800
Subject: [PATCH] 8231631: sun/net/ftp/FtpURLConnectionLeak.java fails
From 3c82728571afa83fefd594343170dc31c275a8b6 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:28:31 +0800
Subject: 8231631: sun/net/ftp/FtpURLConnectionLeak.java fails
intermittently with NPE
Summary: <sun.net>: sun/net/www/ftptest/FtpCommandHandler.java is modified to handle EOF properly
@ -26,5 +26,5 @@ index 151b3df8e..f6c87d5a4 100644
res = parseCmd(buf);
switch (res) {
--
2.12.3
2.19.0

View File

@ -1,489 +0,0 @@
From 67c2c66d6befca1236a92c68ed9a0ba55c3a3eb6 Mon Sep 17 00:00:00 2001
Date: Thu, 5 Nov 2020 22:28:14 +0800
Subject: [PATCH] 8236512: PKCS11 Connection closed after Cipher.doFinal and
NoPadding
Summary: security-libs : Removed killSession() calls in certain impl classes when cancelling operations
LLT: N/A
Bug url: https://bugs.openjdk.java.net/browse/JDK-8236512
---
.../classes/sun/security/pkcs11/P11AEADCipher.java | 38 +++++-----
.../classes/sun/security/pkcs11/P11Cipher.java | 31 ++++----
.../share/classes/sun/security/pkcs11/P11Mac.java | 20 +++---
.../sun/security/pkcs11/P11PSSSignature.java | 30 ++++----
.../classes/sun/security/pkcs11/P11RSACipher.java | 60 ++++++++--------
.../classes/sun/security/pkcs11/P11Signature.java | 82 ++++++++++------------
6 files changed, 127 insertions(+), 134 deletions(-)
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11AEADCipher.java b/jdk/src/share/classes/sun/security/pkcs11/P11AEADCipher.java
index bfd00046c..5af9c8aef 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11AEADCipher.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11AEADCipher.java
@@ -1,4 +1,5 @@
-/* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+/*
+ * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -331,25 +332,25 @@ final class P11AEADCipher extends CipherSpi {
}
private void cancelOperation() {
+ // cancel operation by finishing it; avoid killSession as some
+ // hardware vendors may require re-login
+ int bufLen = doFinalLength(0);
+ byte[] buffer = new byte[bufLen];
+ byte[] in = dataBuffer.toByteArray();
+ int inLen = in.length;
try {
- if (session.hasObjects() == false) {
- session = token.killSession(session);
- return;
+ if (encrypt) {
+ token.p11.C_Encrypt(session.id(), 0, in, 0, inLen,
+ 0, buffer, 0, bufLen);
} else {
- // cancel operation by finishing it
- int bufLen = doFinalLength(0);
- byte[] buffer = new byte[bufLen];
-
- if (encrypt) {
- token.p11.C_Encrypt(session.id(), 0, buffer, 0, bufLen,
- 0, buffer, 0, bufLen);
- } else {
- token.p11.C_Decrypt(session.id(), 0, buffer, 0, bufLen,
- 0, buffer, 0, bufLen);
- }
+ token.p11.C_Decrypt(session.id(), 0, in, 0, inLen,
+ 0, buffer, 0, bufLen);
}
} catch (PKCS11Exception e) {
- throw new ProviderException("Cancel failed", e);
+ if (encrypt) {
+ throw new ProviderException("Cancel failed", e);
+ }
+ // ignore failure for decryption
}
}
@@ -432,18 +433,21 @@ final class P11AEADCipher extends CipherSpi {
if (!initialized) {
return;
}
+ initialized = false;
+
try {
if (session == null) {
return;
}
+
if (doCancel && token.explicitCancel) {
cancelOperation();
}
} finally {
p11Key.releaseKeyID();
session = token.releaseSession(session);
+ dataBuffer.reset();
}
- initialized = false;
}
// see JCE spec
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java
index 9837f12a5..8f2620e13 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -409,10 +409,12 @@ final class P11Cipher extends CipherSpi {
return;
}
initialized = false;
+
try {
if (session == null) {
return;
}
+
if (doCancel && token.explicitCancel) {
cancelOperation();
}
@@ -426,22 +428,21 @@ final class P11Cipher extends CipherSpi {
private void cancelOperation() {
token.ensureValid();
- if (session.hasObjects() == false) {
- session = token.killSession(session);
- return;
- } else {
- try {
- // cancel operation by finishing it
- int bufLen = doFinalLength(0);
- byte[] buffer = new byte[bufLen];
- if (encrypt) {
- token.p11.C_EncryptFinal(session.id(), 0, buffer, 0, bufLen);
- } else {
- token.p11.C_DecryptFinal(session.id(), 0, buffer, 0, bufLen);
- }
- } catch (PKCS11Exception e) {
+ // cancel operation by finishing it; avoid killSession as some
+ // hardware vendors may require re-login
+ try {
+ int bufLen = doFinalLength(0);
+ byte[] buffer = new byte[bufLen];
+ if (encrypt) {
+ token.p11.C_EncryptFinal(session.id(), 0, buffer, 0, bufLen);
+ } else {
+ token.p11.C_DecryptFinal(session.id(), 0, buffer, 0, bufLen);
+ }
+ } catch (PKCS11Exception e) {
+ if (encrypt) {
throw new ProviderException("Cancel failed", e);
}
+ // ignore failure for decryption
}
}
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Mac.java b/jdk/src/share/classes/sun/security/pkcs11/P11Mac.java
index 56d0b1c70..7d80bcb90 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Mac.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Mac.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -122,10 +122,12 @@ final class P11Mac extends MacSpi {
return;
}
initialized = false;
+
try {
if (session == null) {
return;
}
+
if (doCancel && token.explicitCancel) {
cancelOperation();
}
@@ -137,15 +139,12 @@ final class P11Mac extends MacSpi {
private void cancelOperation() {
token.ensureValid();
- if (session.hasObjects() == false) {
- session = token.killSession(session);
- return;
- } else {
- try {
- token.p11.C_SignFinal(session.id(), 0);
- } catch (PKCS11Exception e) {
- throw new ProviderException("Cancel failed", e);
- }
+ // cancel operation by finishing it; avoid killSession as some
+ // hardware vendors may require re-login
+ try {
+ token.p11.C_SignFinal(session.id(), 0);
+ } catch (PKCS11Exception e) {
+ throw new ProviderException("Cancel failed", e);
}
}
@@ -207,7 +206,6 @@ final class P11Mac extends MacSpi {
ensureInitialized();
return token.p11.C_SignFinal(session.id(), 0);
} catch (PKCS11Exception e) {
- reset(true);
throw new ProviderException("doFinal() failed", e);
} finally {
reset(false);
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11PSSSignature.java b/jdk/src/share/classes/sun/security/pkcs11/P11PSSSignature.java
index c0f48715d..d172108fc 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11PSSSignature.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11PSSSignature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -223,10 +223,12 @@ final class P11PSSSignature extends SignatureSpi {
return;
}
initialized = false;
+
try {
if (session == null) {
return;
}
+
if (doCancel && token.explicitCancel) {
cancelOperation();
}
@@ -242,14 +244,10 @@ final class P11PSSSignature extends SignatureSpi {
token.ensureValid();
if (DEBUG) System.out.print("Cancelling operation");
- if (session.hasObjects() == false) {
- if (DEBUG) System.out.println(" by killing session");
- session = token.killSession(session);
- return;
- }
- // "cancel" operation by finishing it
- if (mode == M_SIGN) {
- try {
+ // cancel operation by finishing it; avoid killSession as some
+ // hardware vendors may require re-login
+ try {
+ if (mode == M_SIGN) {
if (type == T_UPDATE) {
if (DEBUG) System.out.println(" by C_SignFinal");
token.p11.C_SignFinal(session.id(), 0);
@@ -259,11 +257,7 @@ final class P11PSSSignature extends SignatureSpi {
if (DEBUG) System.out.println(" by C_Sign");
token.p11.C_Sign(session.id(), digest);
}
- } catch (PKCS11Exception e) {
- throw new ProviderException("cancel failed", e);
- }
- } else { // M_VERIFY
- try {
+ } else { // M_VERIFY
byte[] signature =
new byte[(p11Key.length() + 7) >> 3];
if (type == T_UPDATE) {
@@ -275,10 +269,12 @@ final class P11PSSSignature extends SignatureSpi {
if (DEBUG) System.out.println(" by C_Verify");
token.p11.C_Verify(session.id(), digest, signature);
}
- } catch (PKCS11Exception e) {
- // will fail since the signature is incorrect
- // XXX check error code
}
+ } catch (PKCS11Exception e) {
+ if (mode == M_SIGN) {
+ throw new ProviderException("cancel failed", e);
+ }
+ // ignore failure for verification
}
}
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java b/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java
index 421a16285..4bb629dbf 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -246,10 +246,12 @@ final class P11RSACipher extends CipherSpi {
return;
}
initialized = false;
+
try {
if (session == null) {
return;
}
+
if (doCancel && token.explicitCancel) {
cancelOperation();
}
@@ -263,36 +265,33 @@ final class P11RSACipher extends CipherSpi {
// state variables such as "initialized"
private void cancelOperation() {
token.ensureValid();
- if (session.hasObjects() == false) {
- session = token.killSession(session);
- return;
- } else {
- try {
- PKCS11 p11 = token.p11;
- int inLen = maxInputSize;
- int outLen = buffer.length;
- long sessId = session.id();
- switch (mode) {
- case MODE_ENCRYPT:
- p11.C_Encrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen);
- break;
- case MODE_DECRYPT:
- p11.C_Decrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen);
- break;
- case MODE_SIGN:
- byte[] tmpBuffer = new byte[maxInputSize];
- p11.C_Sign(sessId, tmpBuffer);
- break;
- case MODE_VERIFY:
- p11.C_VerifyRecover(sessId, buffer, 0, inLen, buffer,
- 0, outLen);
- break;
- default:
- throw new ProviderException("internal error");
- }
- } catch (PKCS11Exception e) {
- // XXX ensure this always works, ignore error
+ // cancel operation by finishing it; avoid killSession as some
+ // hardware vendors may require re-login
+ try {
+ PKCS11 p11 = token.p11;
+ int inLen = maxInputSize;
+ int outLen = buffer.length;
+ long sessId = session.id();
+ switch (mode) {
+ case MODE_ENCRYPT:
+ p11.C_Encrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen);
+ break;
+ case MODE_DECRYPT:
+ p11.C_Decrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen);
+ break;
+ case MODE_SIGN:
+ byte[] tmpBuffer = new byte[maxInputSize];
+ p11.C_Sign(sessId, tmpBuffer);
+ break;
+ case MODE_VERIFY:
+ p11.C_VerifyRecover(sessId, buffer, 0, inLen, buffer,
+ 0, outLen);
+ break;
+ default:
+ throw new ProviderException("internal error");
}
+ } catch (PKCS11Exception e) {
+ // XXX ensure this always works, ignore error
}
}
@@ -361,6 +360,7 @@ final class P11RSACipher extends CipherSpi {
private int implDoFinal(byte[] out, int outOfs, int outLen)
throws BadPaddingException, IllegalBlockSizeException {
if (bufOfs > maxInputSize) {
+ reset(true);
throw new IllegalBlockSizeException("Data must not be longer "
+ "than " + maxInputSize + " bytes");
}
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java
index 48a49f66b..844a23d1a 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java
@@ -245,10 +245,12 @@ final class P11Signature extends SignatureSpi {
return;
}
initialized = false;
+
try {
if (session == null) {
return;
}
+
if (doCancel && token.explicitCancel) {
cancelOperation();
}
@@ -259,59 +261,51 @@ final class P11Signature extends SignatureSpi {
}
private void cancelOperation() {
-
token.ensureValid();
- if (session.hasObjects() == false) {
- session = token.killSession(session);
- return;
- } else {
- // "cancel" operation by finishing it
- // XXX make sure all this always works correctly
+ // cancel operation by finishing it; avoid killSession as some
+ // hardware vendors may require re-login
+ try {
if (mode == M_SIGN) {
- try {
- if (type == T_UPDATE) {
- token.p11.C_SignFinal(session.id(), 0);
- } else {
- byte[] digest;
- if (type == T_DIGEST) {
- digest = md.digest();
- } else { // T_RAW
- digest = buffer;
- }
- token.p11.C_Sign(session.id(), digest);
+ if (type == T_UPDATE) {
+ token.p11.C_SignFinal(session.id(), 0);
+ } else {
+ byte[] digest;
+ if (type == T_DIGEST) {
+ digest = md.digest();
+ } else { // T_RAW
+ digest = buffer;
}
- } catch (PKCS11Exception e) {
- throw new ProviderException("cancel failed", e);
+ token.p11.C_Sign(session.id(), digest);
}
} else { // M_VERIFY
byte[] signature;
- try {
- if (keyAlgorithm.equals("DSA")) {
- signature = new byte[40];
- } else {
- signature = new byte[(p11Key.length() + 7) >> 3];
- }
- if (type == T_UPDATE) {
- token.p11.C_VerifyFinal(session.id(), signature);
- } else {
- byte[] digest;
- if (type == T_DIGEST) {
- digest = md.digest();
- } else { // T_RAW
- digest = buffer;
- }
- token.p11.C_Verify(session.id(), digest, signature);
- }
- } catch (PKCS11Exception e) {
- long errorCode = e.getErrorCode();
- if ((errorCode == CKR_SIGNATURE_INVALID) ||
- (errorCode == CKR_SIGNATURE_LEN_RANGE)) {
- // expected since signature is incorrect
- return;
+ if (keyAlgorithm.equals("DSA")) {
+ signature = new byte[40];
+ } else {
+ signature = new byte[(p11Key.length() + 7) >> 3];
+ }
+ if (type == T_UPDATE) {
+ token.p11.C_VerifyFinal(session.id(), signature);
+ } else {
+ byte[] digest;
+ if (type == T_DIGEST) {
+ digest = md.digest();
+ } else { // T_RAW
+ digest = buffer;
}
- throw new ProviderException("cancel failed", e);
+ token.p11.C_Verify(session.id(), digest, signature);
+ }
+ }
+ } catch (PKCS11Exception e) {
+ if (mode == M_VERIFY) {
+ long errorCode = e.getErrorCode();
+ if ((errorCode == CKR_SIGNATURE_INVALID) ||
+ (errorCode == CKR_SIGNATURE_LEN_RANGE)) {
+ // expected since signature is incorrect
+ return;
}
}
+ throw new ProviderException("cancel failed", e);
}
}
--
2.12.3

263
8237894.patch Normal file
View File

@ -0,0 +1,263 @@
From 1f8f5bac958a2655d9188744e6402b96a5f6d666 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:37:39 +0800
Subject: 8237894: C1 compilation fails with
assert(x->type()->tag() == f->type()->tag())
Summary: <c1>: C1 compilation fails with assert(x->type()->tag() == f->type()->tag()) failed: should have same type
LLT: hotspot/test/compiler/c1/TestValueNumberingNullObject.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8237894
---
hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 29 ++--
hotspot/src/share/vm/c1/c1_Instruction.hpp | 14 +-
.../c1/TestValueNumberingNullObject.java | 131 ++++++++++++++++++
3 files changed, 157 insertions(+), 17 deletions(-)
create mode 100644 hotspot/test/compiler/c1/TestValueNumberingNullObject.java
diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
index 99f1c510c..174e59436 100644
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -3891,6 +3891,23 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
INLINE_BAILOUT("mdo allocation failed");
}
+ const bool is_invokedynamic = (bc == Bytecodes::_invokedynamic);
+ const bool has_receiver = (bc != Bytecodes::_invokestatic && !is_invokedynamic);
+
+ const int args_base = state()->stack_size() - callee->arg_size();
+ assert(args_base >= 0, "stack underflow during inlining");
+
+ Value recv = NULL;
+ if (has_receiver) {
+ assert(!callee->is_static(), "callee must not be static");
+ assert(callee->arg_size() > 0, "must have at least a receiver");
+
+ recv = state()->stack_at(args_base);
+ if (recv->is_null_obj()) {
+ INLINE_BAILOUT("receiver is always null");
+ }
+ }
+
// now perform tests that are based on flag settings
if (callee->force_inline() || callee->should_inline()) {
if (inline_level() > MaxForceInlineLevel ) INLINE_BAILOUT("MaxForceInlineLevel");
@@ -3932,21 +3949,11 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
BlockBegin* orig_block = block();
- const bool is_invokedynamic = bc == Bytecodes::_invokedynamic;
- const bool has_receiver = (bc != Bytecodes::_invokestatic && !is_invokedynamic);
-
- const int args_base = state()->stack_size() - callee->arg_size();
- assert(args_base >= 0, "stack underflow during inlining");
-
// Insert null check if necessary
- Value recv = NULL;
if (has_receiver) {
// note: null check must happen even if first instruction of callee does
// an implicit null check since the callee is in a different scope
// and we must make sure exception handling does the right thing
- assert(!callee->is_static(), "callee must not be static");
- assert(callee->arg_size() > 0, "must have at least a receiver");
- recv = state()->stack_at(args_base);
null_check(recv);
}
diff --git a/hotspot/src/share/vm/c1/c1_Instruction.hpp b/hotspot/src/share/vm/c1/c1_Instruction.hpp
index ee4adbc48..6e61358e6 100644
--- a/hotspot/src/share/vm/c1/c1_Instruction.hpp
+++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -277,7 +277,7 @@ class InstructionVisitor: public StackObj {
#define HASHING3(class_name, enabled, f1, f2, f3) \
- virtual intx hash() const { \
+ virtual intx hash() const { \
return (enabled) ? HASH4(name(), f1, f2, f3) : 0; \
} \
virtual bool is_equal(Value v) const { \
@@ -462,6 +462,8 @@ class Instruction: public CompilationResourceObj {
bool is_linked() const { return check_flag(IsLinkedInBlockFlag); }
bool can_be_linked() { return as_Local() == NULL && as_Phi() == NULL; }
+ bool is_null_obj() { return as_Constant() != NULL && type()->as_ObjectType()->constant_value()->is_null_object(); }
+
bool has_uses() const { return use_count() > 0; }
ValueStack* state_before() const { return _state_before; }
ValueStack* exception_state() const { return _exception_state; }
@@ -839,8 +841,8 @@ LEAF(LoadField, AccessField)
ciType* declared_type() const;
- // generic
- HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset()) // cannot be eliminated if needs patching or if volatile
+ // generic; cannot be eliminated if needs patching or if volatile.
+ HASHING3(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset(), declared_type())
};
@@ -966,8 +968,8 @@ LEAF(LoadIndexed, AccessIndexed)
ciType* exact_type() const;
ciType* declared_type() const;
- // generic
- HASHING2(LoadIndexed, true, array()->subst(), index()->subst())
+ // generic;
+ HASHING3(LoadIndexed, true, type()->tag(), array()->subst(), index()->subst())
};
diff --git a/hotspot/test/compiler/c1/TestValueNumberingNullObject.java b/hotspot/test/compiler/c1/TestValueNumberingNullObject.java
new file mode 100644
index 000000000..66d5581f5
--- /dev/null
+++ b/hotspot/test/compiler/c1/TestValueNumberingNullObject.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8237894
+ * @summary CTW: C1 compilation fails with assert(x->type()->tag() == f->type()->tag()) failed: should have same type
+ *
+ * @run main/othervm
+ * -Xcomp -Xbatch -XX:CompileCommand=compileonly,compiler.c1.T*::*
+ * -XX:CompileCommand=exclude,compiler.c1.TestValueNumberingNullObject::main
+ * -XX:CompileCommand=inline,*.*
+ * -XX:TieredStopAtLevel=3
+ * compiler.c1.TestValueNumberingNullObject
+ */
+
+package compiler.c1;
+
+class T1 {
+
+ public T2 f1;
+
+ public int za() {
+ return 0;
+ }
+
+ public int zb() {
+ return 0;
+ }
+
+ public int zc() {
+ return 0;
+ }
+
+ public int zd() {
+ return 0;
+ }
+
+ public int ze() {
+ return 0;
+ }
+
+ public int zf() {
+ return 0;
+ }
+
+ public int zg() {
+ return 0;
+ }
+
+ public int zh() {
+ return 0;
+ }
+}
+
+class T2 {
+
+ public T1 f1;
+
+ public int zh() {
+ return 0;
+ }
+}
+
+public class TestValueNumberingNullObject {
+
+ public static void main(String args[]) {
+ new T1(); // Load
+ new T2(); // Load
+ try {
+ // case 1
+ // Null based field access.
+ // Value Numbering null based field access causes instructions to be eliminated across type/subtypes.
+ // declared type of these instructions are field type, so it being receiver causes problems to Type System.
+ // to mitigate this issue, we hash declared type in addition to existing hashing.
+ testFieldAccess();
+ } catch (Exception e) {
+ }
+ try {
+ // case 2
+ // Null based indexed access.
+ // Value Numbering null based indexed access causes instructions to be eliminated across type/subtypes.
+ // element basic type in encoded in the access instruction, this causes problems to Type system.
+ // declared type of these instructions are null, so it being receiver doesn't cause any problem to Type System.
+ // to mitigate this issue, we hash basic type in addition to existing hashing
+ basicTypeAccess();
+ } catch (Exception e) {
+ }
+ }
+
+ static long testFieldAccess() {
+ T1 t1 = null;
+ T2 t2 = null;
+ T1[] t3 = null;
+ T2[] t4 = null;
+
+ long value = t1.f1.zh() + t2.f1.zh();
+ // null array object based field access.
+ value += t3[2].f1.zh() + t4[2].f1.zh();
+ return value;
+ }
+
+ static long basicTypeAccess() {
+ long[] f1 = null;
+ int[] f2 = null;
+ T2[] t2 = null;
+ T1[] t1 = null;
+ return f1[5] + f2[5] + t2[5].zh() + t1[5].zh();
+ }
+}
+
--
2.19.0

View File

@ -1,16 +1,16 @@
From 3276b4d8d066703d3abc81e3a7815d1c03474af2 Mon Sep 17 00:00:00 2001
Date: Wed, 19 Aug 2020 17:43:46 +0000
Subject: [PATCH] 8243670:Unexpected test result caused by C2
From 00a03e7acf5509396c8a1ac90d3d661250750d9c Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:29:29 +0800
Subject: 8243670:Unexpected test result caused by C2
MergeMemNode::Ideal
Summary: <c2>: <Unexpected test result caused by C2 MergeMemNode>
LLT: hotspot/test/compiler/c2/TestReplaceEquivPhis.java
Bug url: https://bugs.openjdk.java.net/browse/JDK-8243670
---
hotspot/src/share/vm/opto/cfgnode.cpp | 24 +++++++
hotspot/src/share/vm/opto/memnode.cpp | 20 +-----
hotspot/src/share/vm/opto/cfgnode.cpp | 24 ++++++
hotspot/src/share/vm/opto/memnode.cpp | 20 +----
hotspot/src/share/vm/opto/type.hpp | 7 ++
hotspot/test/compiler/c2/TestReplaceEquivPhis.java | 77 ++++++++++++++++++++++
.../compiler/c2/TestReplaceEquivPhis.java | 77 +++++++++++++++++++
4 files changed, 109 insertions(+), 19 deletions(-)
create mode 100644 hotspot/test/compiler/c2/TestReplaceEquivPhis.java
@ -81,10 +81,10 @@ index 68a13dbd8..f2a2ee6a2 100644
Node* new_in = new_mem;
if (new_in == new_base) new_in = empty_mem;
diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp
index a9352345e..321d79914 100644
index ec06f8d69..8da4a766d 100644
--- a/hotspot/src/share/vm/opto/type.hpp
+++ b/hotspot/src/share/vm/opto/type.hpp
@@ -431,6 +431,8 @@ public:
@@ -432,6 +432,8 @@ public:
return exact_kls != NULL;
}
@ -93,7 +93,7 @@ index a9352345e..321d79914 100644
private:
// support arrays
static const Type* _zero_type[T_CONFLICT+1];
@@ -1332,6 +1334,11 @@ public:
@@ -1333,6 +1335,11 @@ public:
return _ptrtype;
}
@ -112,7 +112,7 @@ index 000000000..d4c93b390
+++ b/hotspot/test/compiler/c2/TestReplaceEquivPhis.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2020, Huawei Technologies Co., LTD. All rights reserved.
+ * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
@ -189,5 +189,5 @@ index 000000000..d4c93b390
+
+}
--
2.12.3
2.19.0

View File

@ -1,6 +1,7 @@
From 0b09070295851b808b0266205282af763bd74baf Mon Sep 17 00:00:00 2001
Date: Sun, 27 Sep 2020 14:52:45 +0800
Subject: [PATCH] 8248336: AArch64: C2: offset overflow in BoxLockNode::emit
From 0fc0d41f2af723a0abdb3c73100137f847b1d820 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:40:43 +0800
Subject: 8248336: AArch64: C2: offset overflow in
BoxLockNode::emit
Summary: <C2>: offset overflow in BoxLockNode::emit
LLT: jtreg
@ -10,7 +11,7 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-8248336
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
index f53c68737..1774c9e1d 100644
index 38de0098b..accce6720 100644
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
@@ -1828,16 +1828,20 @@ void BoxLockNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
@ -41,5 +42,5 @@ index f53c68737..1774c9e1d 100644
//=============================================================================
--
2.12.3
2.19.0

View File

@ -1,36 +0,0 @@
From 32271b8bfd2325ebb0d7fd338f3454be7dd1f998 Mon Sep 17 00:00:00 2001
Date: Fri, 30 Oct 2020 18:15:32 +0800
Subject: [PATCH] 8250861: Crash in MinINode::Ideal(PhaseGVN*, bool)
Summary: C2: Added missing NULL checks.
LLT: N/A
Bug url: https://bugs.openjdk.java.net/browse/JDK-8250861
---
hotspot/src/share/vm/opto/addnode.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp
index 7bfa6e404..61b376e9b 100644
--- a/hotspot/src/share/vm/opto/addnode.cpp
+++ b/hotspot/src/share/vm/opto/addnode.cpp
@@ -921,7 +921,7 @@ Node *MinINode::Ideal(PhaseGVN *phase, bool can_reshape) {
// Transform MIN2(x + c0, MIN2(x + c1, z)) into MIN2(x + MIN2(c0, c1), z)
// if x == y and the additions can't overflow.
- if (phase->eqv(x,y) &&
+ if (phase->eqv(x,y) && tx != NULL &&
!can_overflow(tx, x_off) &&
!can_overflow(tx, y_off)) {
return new (phase->C) MinINode(phase->transform(new (phase->C) AddINode(x, phase->intcon(MIN2(x_off, y_off)))), r->in(2));
@@ -929,7 +929,7 @@ Node *MinINode::Ideal(PhaseGVN *phase, bool can_reshape) {
} else {
// Transform MIN2(x + c0, y + c1) into x + MIN2(c0, c1)
// if x == y and the additions can't overflow.
- if (phase->eqv(x,y) &&
+ if (phase->eqv(x,y) && tx != NULL &&
!can_overflow(tx, x_off) &&
!can_overflow(tx, y_off)) {
return new (phase->C) AddINode(x,phase->intcon(MIN2(x_off,y_off)));
--
2.12.3

View File

@ -1,14 +1,13 @@
From 8e390a2cdfff1138f3ba6e694395cd8790aa1603 Mon Sep 17 00:00:00 2001
Date: Fri, 19 Apr 2019 17:33:26 +0000
Subject: [PATCH] AARCH64 fix itable stub code size limit
From bd26df9efb8b765bb40fcfeef3e8908e77bfb15f Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:14:02 +0800
Subject: AARCH64 fix itable stub code size limit
---
hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp | 12 +++++++++---
hotspot/src/share/vm/code/codeCache.cpp | 2 ++
2 files changed, 11 insertions(+), 3 deletions(-)
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp
index d8d1ec11ba..645b690dae 100644
index d8d1ec11b..645b690da 100644
--- a/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp
@@ -130,6 +130,10 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
@ -32,7 +31,7 @@ index d8d1ec11ba..645b690dae 100644
- else
- size += 176;
+ } else {
+ // itable code size limit
+ // itable code size limit, see issue#983
+ size += 192;
+ }
return size;

View File

@ -1,17 +1,17 @@
From b3b4fb064edf3a9537e5580dfaec69761b49f717 Mon Sep 17 00:00:00 2001
Date: Mon, 6 Jan 2020 15:49:40 +0000
Subject: [PATCH] Add ability to configure third port for remote JMX
From e389786d6785852bf8fedb9ff24294a1518d9bed Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:27:51 +0800
Subject: Add ability to configure third port for remote JMX
Summary: <jmx>:<Add ability to configure third port for remote JMX>
LLT: NA
Bug url: NA
---
.../sun/management/AgentConfigurationError.java | 2 ++
.../sun/management/jmxremote/ConnectorBootstrap.java | 19 ++++++++++++++++++-
.../management/AgentConfigurationError.java | 2 ++
.../jmxremote/ConnectorBootstrap.java | 19 ++++++++++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/jdk/src/share/classes/sun/management/AgentConfigurationError.java b/jdk/src/share/classes/sun/management/AgentConfigurationError.java
index 56c4301611..d3d67ff313 100644
index 56c430161..d3d67ff31 100644
--- a/jdk/src/share/classes/sun/management/AgentConfigurationError.java
+++ b/jdk/src/share/classes/sun/management/AgentConfigurationError.java
@@ -55,6 +55,8 @@ public class AgentConfigurationError extends Error {
@ -24,7 +24,7 @@ index 56c4301611..d3d67ff313 100644
"agent.err.password.file.notset";
public static final String PASSWORD_FILE_NOT_READABLE =
diff --git a/jdk/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java b/jdk/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java
index 56287edbd0..0a82c65d10 100644
index 56287edbd..0a82c65d1 100644
--- a/jdk/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java
+++ b/jdk/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java
@@ -117,6 +117,8 @@ public final class ConnectorBootstrap {
@ -63,5 +63,5 @@ index 56287edbd0..0a82c65d10 100644
Properties props = Agent.getManagementProperties();
if (props == null) {
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From a409bdd4982a6a463b65b529ed3aedb0c3e29144 Mon Sep 17 00:00:00 2001
Date: Mon, 17 Aug 2020 19:32:33 +0000
Subject: [PATCH] Fix LineBuffer::vappend when buffer too small
From 51bf279a63f1ae3f4a8fc255d12f3b339741dd2e Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:25:49 +0800
Subject: Fix LineBuffer::vappend when buffer too small
Summary: <runtime>: fix LineBuffer::vappend when buffer too small
LLT: NA
@ -23,5 +23,5 @@ index 75a9a5f95..185b7d67e 100644
_buffer[BUFFER_LEN -1] = 0;
_cur = BUFFER_LEN; // vsnprintf above should not add to _buffer if we are called again
--
2.12.3
2.19.0

0
G1-memory-uncommit.patch Executable file → Normal file
View File

View File

@ -1,19 +1,18 @@
From 8f0acd949be2c01c445e402ae81421d4554f7d2b Mon Sep 17 00:00:00 2001
Date: Fri, 13 Dec 2019 12:02:23 +0000
Subject: [PATCH] PS GC: adding acquire_size method for
PSParallelCompact::mark_obj.
From 124ad73c00d643445653ad9a0d424b50316df1c6 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:25:45 +0800
Subject: PS GC: adding acquire_size method for
Summary: GC: adding acquire_size method for PSParallelCompact::mark_obj.
LLT: NA
Bug url:
---
.../share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp | 2 +-
hotspot/src/share/vm/oops/oop.hpp | 1 +
.../gc_implementation/parallelScavenge/psParallelCompact.hpp | 2 +-
hotspot/src/share/vm/oops/oop.hpp | 2 +-
hotspot/src/share/vm/oops/oop.inline.hpp | 4 ++++
3 files changed, 6 insertions(+), 1 deletion(-)
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
index 881f380cea..f971383a09 100644
index 881f380ce..f971383a0 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
@@ -1326,7 +1326,7 @@ class PSParallelCompact : AllStatic {
@ -26,22 +25,23 @@ index 881f380cea..f971383a09 100644
_summary_data.add_obj(obj, obj_size);
return true;
diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp
index 142ab2769c..42ad9307f7 100644
index 97d44c046..a5ff97260 100644
--- a/hotspot/src/share/vm/oops/oop.hpp
+++ b/hotspot/src/share/vm/oops/oop.hpp
@@ -123,6 +123,7 @@ class oopDesc {
@@ -105,7 +105,7 @@ class oopDesc {
// Returns the actual oop size of the object
int size();
-
+ int acquire_size();
// Sometimes (for complicated concurrency-related reasons), it is useful
// to be able to figure out the size of an object knowing its klass.
int size_given_klass(Klass* klass);
diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp
index b519d86118..803080c9e7 100644
index 2ba94158f..7e03033b0 100644
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -839,6 +839,10 @@ inline int oopDesc::size() {
@@ -551,6 +551,10 @@ inline int oopDesc::size() {
return size_given_klass(klass());
}
@ -53,5 +53,5 @@ index b519d86118..803080c9e7 100644
assert(oopDesc::bs() != NULL, "Uninitialized bs in oop!");
oopDesc::bs()->write_ref_field(p, v, release);
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From 29e183488a96a4c169f89eab9410e0a91a903476 Mon Sep 17 00:00:00 2001
Date: Tue, 22 Oct 2019 19:18:39 +0000
Subject: [PATCH] Reduce the probability of the crash related to
From b0eb81f7e030ceaa908f9dc492e70562a4f40a7c Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 15:18:14 +0800
Subject: Reduce the probability of the crash related to
ciObjectFactory::create_new_metadata
Summary: <interpreter>: add load acquire barriers when profiling klass
@ -13,10 +13,10 @@ Bug url:
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
index d8926cd87d..58fc267f99 100644
index 70ab1bcb8..f4ce39661 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
@@ -3234,6 +3234,16 @@ void MacroAssembler::load_klass(Register dst, Register src) {
@@ -3177,6 +3177,16 @@ void MacroAssembler::load_klass(Register dst, Register src) {
}
}
@ -34,10 +34,10 @@ index d8926cd87d..58fc267f99 100644
if (UseCompressedClassPointers) {
ldrw(tmp, Address(oop, oopDesc::klass_offset_in_bytes()));
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
index 2cf827dcf0..168fe4d3b1 100644
index 0b083c834..02216f1b1 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
@@ -790,6 +790,7 @@ public:
@@ -788,6 +788,7 @@ public:
// oop manipulations
void load_klass(Register dst, Register src);
@ -46,10 +46,10 @@ index 2cf827dcf0..168fe4d3b1 100644
void cmp_klass(Register oop, Register trial_klass, Register tmp);
diff --git a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp
index 1e590780b7..7ee4e317d4 100644
index a0446cd4d..65e56661b 100644
--- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp
@@ -3243,7 +3243,7 @@ void TemplateTable::invokevirtual_helper(Register index,
@@ -3250,7 +3250,7 @@ void TemplateTable::invokevirtual_helper(Register index,
// get receiver klass
__ null_check(recv, oopDesc::klass_offset_in_bytes());
@ -59,5 +59,5 @@ index 1e590780b7..7ee4e317d4 100644
// profile this call
__ profile_virtual_call(r0, rlocals, r3);
--
2.12.3
2.19.0

View File

@ -0,0 +1,50 @@
From 1691b58a6eab64bc7df3f568b3d9f9e9d963cb73 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:38:12 +0800
Subject: Remove the parentheses around company-name
Summary: <java -version>: Remove the parentheses around company-name in the displayed result
LLT: N/A
Bug url:
---
jdk/make/gensrc/GensrcMisc.gmk | 2 +-
jdk/src/share/classes/sun/misc/Version.java.template | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk
index d20a29c00..46bd5b8c0 100644
--- a/jdk/make/gensrc/GensrcMisc.gmk
+++ b/jdk/make/gensrc/GensrcMisc.gmk
@@ -32,7 +32,7 @@ include ProfileNames.gmk
company_name =
ifneq ($(COMPANY_NAME),N/A)
- company_name=($(COMPANY_NAME))
+ company_name=$(COMPANY_NAME)
endif
$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
diff --git a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template
index ffdaf9fbc..b29cab718 100644
--- a/jdk/src/share/classes/sun/misc/Version.java.template
+++ b/jdk/src/share/classes/sun/misc/Version.java.template
@@ -106,7 +106,7 @@ public class Version {
/* Second line: runtime version (ie, libraries). */
- ps.print(java_runtime_name + " " + company_name + "(build " + java_runtime_version);
+ ps.print(java_runtime_name + " " + company_name + " " + "(build " + java_runtime_version);
if (java_profile_name.length() > 0) {
// profile name
@@ -123,7 +123,7 @@ public class Version {
String java_vm_name = System.getProperty("java.vm.name");
String java_vm_version = System.getProperty("java.vm.version");
String java_vm_info = System.getProperty("java.vm.info");
- ps.println(java_vm_name + " " + company_name + "(build " + java_vm_version + ", " +
+ ps.println(java_vm_name + " " + company_name + " " + "(build " + java_vm_version + ", " +
java_vm_info + ")");
}
--
2.19.0

View File

@ -1,6 +1,6 @@
From bd4fd0ac21f668f9f91e802e73cad0c120ba9df6 Mon Sep 17 00:00:00 2001
Date: Thu, 4 Jun 2020 15:45:47 +0800
Subject: [PATCH] Remove unused GenericTaskQueueSet<T, F>::tasks()
From 79a2de08f6a6aa5113e730bd9bc58229f7a2da14 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:21:34 +0800
Subject: Remove unused GenericTaskQueueSet<T, F>::tasks()
Summary: <gc>: remove unused GenericTaskQueueSet<T, F>::tasks()
LLT: NA
@ -10,10 +10,10 @@ Bug url: NA
1 file changed, 12 deletions(-)
diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp
index 5b03ccfa..9a2e2ee2 100644
index 77556a7d4..3df7744dc 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp
@@ -541,8 +541,6 @@ class TaskQueueSetSuper {
@@ -543,8 +543,6 @@ class TaskQueueSetSuper {
public:
// Returns "true" if some TaskQueue in the set contains a task.
virtual bool peek() = 0;
@ -22,7 +22,7 @@ index 5b03ccfa..9a2e2ee2 100644
virtual size_t tasks() = 0;
};
@@ -576,7 +574,6 @@ public:
@@ -578,7 +576,6 @@ public:
// Returns if stealing succeeds, and sets "t" to the stolen task.
bool steal(uint queue_num, E& t);
bool peek();
@ -30,7 +30,7 @@ index 5b03ccfa..9a2e2ee2 100644
size_t tasks();
uint size() const { return _n; }
@@ -675,15 +672,6 @@ size_t GenericTaskQueueSet<T, F>::tasks() {
@@ -677,15 +674,6 @@ size_t GenericTaskQueueSet<T, F>::tasks() {
return n;
}

View File

@ -1,16 +1,17 @@
From 0cf95d445b1f6854249987ec55591e26cc21c6a1 Mon Sep 17 00:00:00 2001
Date: Thu, 14 May 2020 09:59:34 +0800
Subject: [PATCH] Test8167409.sh fails to run with 32bit jdk on 64bit system
From ae2c3958cb7e238c1112de18e216f82b72771db0 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:23:19 +0800
Subject: Test8167409.sh fails to run with 32bit jdk on 64bit
system
Summary: <test case>: Test8167409.sh fails to run with 32bit jdk on 64bit system
LLT: jdk8u/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh
Bug url:
Bug url: https://gitlab.huawei.com/huaweijdk/jdk8u-dev/issues/2157
---
.../criticalnatives/argumentcorruption/Test8167409.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh
index 81695e75..1108aaf9 100644
index 81695e758..1108aaf93 100644
--- a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh
+++ b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh
@@ -61,13 +61,17 @@ case "$OS" in

0
add-appcds-file-lock.patch Executable file → Normal file
View File

0
add-appcds-test-case.patch Executable file → Normal file
View File

View File

@ -1,13 +1,13 @@
From b26a2445044d5ba0a3ed0d45ef66108231fcec0f Mon Sep 17 00:00:00 2001
Date: Fri, 19 Apr 2019 17:41:12 +0000
Subject: [PATCH] add debuginfo for libsaproc on aarch64
From 5e4c07bdb41eb63e9407aedbf00bb35bacadcdc1 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:15:52 +0800
Subject: add debuginfo for libsaproc on aarch64
---
hotspot/make/linux/makefiles/defs.make | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make
index 9aebd998d2..bb382bbd76 100644
index 9aebd998d..bb382bbd7 100644
--- a/hotspot/make/linux/makefiles/defs.make
+++ b/hotspot/make/linux/makefiles/defs.make
@@ -316,9 +316,11 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)

View File

@ -1,22 +1,22 @@
From 2f9cb1a32393b6bb2607133836d16c1da73ec497 Mon Sep 17 00:00:00 2001
Date: Tue, 3 Sep 2019 09:52:13 +0000
Subject: [PATCH] Add with-company-name option
From 8323788a287f8476e20c2360c149938a83fd53f6 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 14:45:06 +0800
Subject: Add with-company-name option
Summary: <openjdk_dev>: <Add with-company-name option to support customize the output of java -version>
LLT:
Bug url: AdoptOpenJDK
---
common/autoconf/generated-configure.sh | 22 ++++++++++++++--------
common/autoconf/jdk-options.m4 | 12 ++++++++++++
jdk/make/gensrc/GensrcMisc.gmk | 6 ++++++
.../share/classes/sun/misc/Version.java.template | 9 ++++++---
common/autoconf/generated-configure.sh | 22 ++++++++++++-------
common/autoconf/jdk-options.m4 | 12 ++++++++++
jdk/make/gensrc/GensrcMisc.gmk | 6 +++++
.../classes/sun/misc/Version.java.template | 9 +++++---
4 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 19efd8be38..32dc7779d5 100644
index 3b2b51f6f..1fb86fd02 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -1062,6 +1062,7 @@ with_milestone
@@ -1064,6 +1064,7 @@ with_milestone
with_update_version
with_user_release_suffix
with_build_number
@ -24,7 +24,7 @@ index 19efd8be38..32dc7779d5 100644
with_vendor_name
with_vendor_url
with_vendor_bug_url
@@ -1910,6 +1911,7 @@ Optional Packages:
@@ -1903,6 +1904,7 @@ Optional Packages:
Add a custom string to the version string if build
number isn't set.[username_builddateb00]
--with-build-number Set build number value for build [b00]
@ -32,7 +32,7 @@ index 19efd8be38..32dc7779d5 100644
--with-vendor-name Set vendor name. Among others, used to set the
'java.vendor' and 'java.vm.vendor' system
properties. [not specified]
@@ -19886,16 +19888,20 @@ fi
@@ -19916,16 +19918,20 @@ fi
# Now set the JDK version, milestone, build number etc.
@ -62,10 +62,10 @@ index 19efd8be38..32dc7779d5 100644
# The vendor name, if any
diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
index 9d75dc7bd4..e7657a14fe 100644
index b1917664a..e4eb2352a 100644
--- a/common/autoconf/jdk-options.m4
+++ b/common/autoconf/jdk-options.m4
@@ -509,6 +509,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
@@ -539,6 +539,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
@ -85,7 +85,7 @@ index 9d75dc7bd4..e7657a14fe 100644
AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name],
[Set vendor name. Among others, used to set the 'java.vendor'
diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk
index df886e88f4..c0c7b7bdb3 100644
index 0e3dee5ca..d20a29c00 100644
--- a/jdk/make/gensrc/GensrcMisc.gmk
+++ b/jdk/make/gensrc/GensrcMisc.gmk
@@ -30,6 +30,11 @@ include ProfileNames.gmk
@ -94,7 +94,7 @@ index df886e88f4..c0c7b7bdb3 100644
+company_name =
+ifneq ($(COMPANY_NAME),N/A)
+ company_name=$(COMPANY_NAME)
+ company_name=($(COMPANY_NAME))
+endif
+
$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
@ -109,7 +109,7 @@ index df886e88f4..c0c7b7bdb3 100644
$(MV) $@.tmp $@
diff --git a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template
index 32e2586e79..022c142810 100644
index 32e2586e7..022c14281 100644
--- a/jdk/src/share/classes/sun/misc/Version.java.template
+++ b/jdk/src/share/classes/sun/misc/Version.java.template
@@ -44,6 +44,9 @@ public class Version {
@ -127,7 +127,7 @@ index 32e2586e79..022c142810 100644
/* Second line: runtime version (ie, libraries). */
- ps.print(java_runtime_name + " (build " + java_runtime_version);
+ ps.print(java_runtime_name + " " + company_name + " " + "(build " + java_runtime_version);
+ ps.print(java_runtime_name + " " + company_name + "(build " + java_runtime_version);
if (java_profile_name.length() > 0) {
// profile name
@ -137,11 +137,11 @@ index 32e2586e79..022c142810 100644
String java_vm_info = System.getProperty("java.vm.info");
- ps.println(java_vm_name + " (build " + java_vm_version + ", " +
- java_vm_info + ")");
+ ps.println(java_vm_name + " " + company_name + " " + "(build " + java_vm_version + ", " +
+ ps.println(java_vm_name + " " + company_name + "(build " + java_vm_version + ", " +
+ java_vm_info + ")");
}
--
2.12.3
2.19.0

View File

@ -1,6 +1,28 @@
From 00a5f242451e72d32e29156bb132ceb4b78cf719 Mon Sep 17 00:00:00 2001
Date: Tue, 26 Jan 2021 16:46:28 +0800
Subject: delete untrustworthy cacert files
Summary: <JDK> : delete untrustworthy cacert files
LLT: jtreg -nr -va jdk/test/sun/security/lib/cacerts/VerifyCACerts.java
Bug url: NA
---
jdk/make/data/cacerts/addtrustexternalca | 32 ------------------
jdk/make/data/cacerts/addtrustqualifiedca | 32 ------------------
jdk/make/data/cacerts/thawtepremiumserverca | 27 ---------------
jdk/make/data/cacerts/utnuserfirstobjectca | 33 -------------------
jdk/make/data/cacerts/verisigntsaca | 24 --------------
.../security/lib/cacerts/VerifyCACerts.java | 25 +++-----------
6 files changed, 5 insertions(+), 168 deletions(-)
delete mode 100644 jdk/make/data/cacerts/addtrustexternalca
delete mode 100644 jdk/make/data/cacerts/addtrustqualifiedca
delete mode 100644 jdk/make/data/cacerts/thawtepremiumserverca
delete mode 100644 jdk/make/data/cacerts/utnuserfirstobjectca
delete mode 100644 jdk/make/data/cacerts/verisigntsaca
diff --git a/jdk/make/data/cacerts/addtrustexternalca b/jdk/make/data/cacerts/addtrustexternalca
deleted file mode 100644
index ad84cad9..00000000
index ad84cad96..000000000
--- a/jdk/make/data/cacerts/addtrustexternalca
+++ /dev/null
@@ -1,32 +0,0 @@
@ -38,7 +60,7 @@ index ad84cad9..00000000
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/addtrustqualifiedca b/jdk/make/data/cacerts/addtrustqualifiedca
deleted file mode 100644
index 0c62d44c..00000000
index 0c62d44c7..000000000
--- a/jdk/make/data/cacerts/addtrustqualifiedca
+++ /dev/null
@@ -1,32 +0,0 @@
@ -76,7 +98,7 @@ index 0c62d44c..00000000
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/thawtepremiumserverca b/jdk/make/data/cacerts/thawtepremiumserverca
deleted file mode 100644
index 2df456ab..00000000
index 2df456ab0..000000000
--- a/jdk/make/data/cacerts/thawtepremiumserverca
+++ /dev/null
@@ -1,27 +0,0 @@
@ -109,7 +131,7 @@ index 2df456ab..00000000
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/utnuserfirstobjectca b/jdk/make/data/cacerts/utnuserfirstobjectca
deleted file mode 100644
index 80a0b5c2..00000000
index 80a0b5c23..000000000
--- a/jdk/make/data/cacerts/utnuserfirstobjectca
+++ /dev/null
@@ -1,33 +0,0 @@
@ -148,7 +170,7 @@ index 80a0b5c2..00000000
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/verisigntsaca b/jdk/make/data/cacerts/verisigntsaca
deleted file mode 100644
index 9813ddae..00000000
index 9813ddaea..000000000
--- a/jdk/make/data/cacerts/verisigntsaca
+++ /dev/null
@@ -1,24 +0,0 @@
@ -177,10 +199,18 @@ index 9813ddae..00000000
-JvUXzMEZXkt8XOKDgJH6L/uatxY=
------END CERTIFICATE-----
diff --git a/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java b/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java
index af78073b..6b5f692e 100644
index 1f443381c..29d4f0f97 100644
--- a/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java
+++ b/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java
@@ -57,7 +57,7 @@ public class VerifyCACerts {
@@ -27,7 +27,6 @@
* @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779
* 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136
* 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320
- * 8225072 8258630
* @summary Check root CA entries in cacerts file
*/
import java.io.ByteArrayInputStream;
@@ -58,7 +57,7 @@ public class VerifyCACerts {
// SHA-256 of cacerts, can be generated with
// shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95
private static final String CHECKSUM
@ -189,7 +219,7 @@ index af78073b..6b5f692e 100644
// map of cert alias to SHA-256 fingerprint
@SuppressWarnings("serial")
@@ -92,12 +92,6 @@ public class VerifyCACerts {
@@ -93,12 +92,6 @@ public class VerifyCACerts {
"E7:93:C9:B0:2F:D8:AA:13:E2:1C:31:22:8A:CC:B0:81:19:64:3B:74:9C:89:89:64:B1:74:6D:46:C3:D4:CB:D2");
put("usertrusteccca [jdk]",
"4F:F4:60:D5:4B:9C:86:DA:BF:BC:FC:57:12:E0:40:0D:2B:ED:3F:BC:4D:4F:BD:AA:86:E0:6A:DC:D2:A9:AD:7A");
@ -202,7 +232,7 @@ index af78073b..6b5f692e 100644
put("baltimorecybertrustca [jdk]",
"16:AF:57:A9:F6:76:B0:AB:12:60:95:AA:5E:BA:DE:F2:2A:B3:11:19:D6:44:AC:95:CD:4B:93:DB:F3:F2:6A:EB");
put("digicertglobalrootca [jdk]",
@@ -262,12 +256,6 @@ public class VerifyCACerts {
@@ -253,19 +246,11 @@ public class VerifyCACerts {
@SuppressWarnings("serial")
private static final HashSet<String> EXPIRY_EXC_ENTRIES = new HashSet<String>() {
{
@ -212,6 +242,20 @@ index af78073b..6b5f692e 100644
- add("addtrustexternalca [jdk]");
- // Valid until: Sat May 30 10:44:50 GMT 2020
- add("addtrustqualifiedca [jdk]");
- // Valid until: Fri Jan 01 15:59:59 PST 2021
- add("verisigntsaca [jdk]");
- // Valid until: Fri Jan 01 15:59:59 PST 2021
- add("thawtepremiumserverca [jdk]");
- // Valid until: Wed Mar 17 02:51:37 PDT 2021
+ // Valid until: Wed Mar 17 17:51:37 HKT 2021
add("luxtrustglobalrootca [jdk]");
- // Valid until: Wed Mar 17 11:33:33 PDT 2021
+ // Valid until: Tue Apr 06 15:29:40 HKT 2021
+ add("soneraclass2ca [jdk]");
+ // Valid until: Thu Mar 18 02:33:33 HKT 2021
add("quovadisrootca [jdk]");
}
};
--
2.19.0

View File

@ -1,14 +1,14 @@
From 1161177ce24da0348b5f6c6358667dc4a93f544b Mon Sep 17 00:00:00 2001
Date: Thu, 17 Oct 2019 14:49:51 +0000
Subject: [PATCH] disable UseLSE on ARMv8.1 by default
From 9dbf60065bbc841d1eea360719c6c666f39d35d3 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:29:27 +0800
Subject: disable UseLSE on ARMv8.1 by default
Summary: <UseLSE>: disable UseLSE by default and set UseLSE to
experimental
LLT: java -XX:+UnlockExperimentalVMOptions -XX:+PrintFlagsFinal
Bug url: NA
---
.../hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp | 2 +-
.../hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp | 3 ++-
hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp | 2 +-
hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp
@ -25,10 +25,10 @@ index 8cdd5c498..e0749ff80 100644
product(bool, UseSIMDForMemoryOps, false, \
"Use SIMD instructions in generated memory move code") \
diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
index 65bdaa83a..35d1062c8 100644
index 0bd2e0a54..78e6f1144 100644
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
@@ -203,10 +203,11 @@ void VM_Version::get_processor_features() {
@@ -202,10 +202,11 @@ void VM_Version::get_processor_features() {
if (auxv & HWCAP_ATOMICS) {
if (FLAG_IS_DEFAULT(UseLSE))

View File

@ -0,0 +1,27 @@
From 9734b82288a429d3cb04d0c3e1f55b25447b5d51 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:34:29 +0800
Subject: dismiss company_name info of java -version
Summary: <version>: <dismiss company_name info of java -version>
LLT: NA
Bug url: NA
---
jdk/src/share/classes/sun/misc/Version.java.template | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template
index 022c14281..ffdaf9fbc 100644
--- a/jdk/src/share/classes/sun/misc/Version.java.template
+++ b/jdk/src/share/classes/sun/misc/Version.java.template
@@ -45,7 +45,7 @@ public class Version {
"@@java_runtime_version@@";
private static final String company_name =
- "@@company_name@@";
+ "";
static {
init();
--
2.19.0

View File

@ -1,13 +1,13 @@
From 82250c7c4978bf7591299e8635fb183f36d3546f Mon Sep 17 00:00:00 2001
Date: Fri, 19 Apr 2019 16:30:04 +0000
Subject: [PATCH] fix crash in JVMTI debug
From 2c8ad6489ccb8c160dc0ddcfd1811c27828221f2 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:11:56 +0800
Subject: fix crash in JVMTI debug
---
hotspot/src/share/vm/prims/jvmtiEnvBase.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp
index fe2a3811..5db41567 100644
index fe2a38116..5db415676 100644
--- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp
@@ -1092,7 +1092,7 @@ JvmtiEnvBase::get_object_monitor_usage(JavaThread* calling_thread, jobject objec

View File

@ -1,6 +1,7 @@
From f2833457ae8419c099bf167693c602911413257c Mon Sep 17 00:00:00 2001
Date: Sat, 25 May 2019 10:36:33 +0000
Subject: [PATCH] change vendor to openEuler Community
From 175bc1bb2cf5d850e3a5dd13ce5ccd6ef330e81b Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:23:08 +0800
Subject: modify vendor to Huawei Technologies
Co., LTD
---
hotspot/src/share/vm/runtime/vm_version.cpp | 7 +------
@ -8,7 +9,7 @@ Subject: [PATCH] change vendor to openEuler Community
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp
index c7d34aac64..fa721facea 100644
index ef25fb4b2..c30ebc288 100644
--- a/hotspot/src/share/vm/runtime/vm_version.cpp
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp
@@ -142,12 +142,7 @@ const char* Abstract_VM_Version::vm_name() {
@ -21,12 +22,12 @@ index c7d34aac64..fa721facea 100644
- return JDK_Version::is_gte_jdk17x_version() ?
- "Oracle Corporation" : "Sun Microsystems Inc.";
-#endif
+ return "openEuler Community";
+ return "Huawei Technologies Co., Ltd";
}
diff --git a/jdk/src/share/native/java/lang/System.c b/jdk/src/share/native/java/lang/System.c
index ff80b0abdd..758cfabb39 100644
index ff80b0abd..758cfabb3 100644
--- a/jdk/src/share/native/java/lang/System.c
+++ b/jdk/src/share/native/java/lang/System.c
@@ -110,13 +110,13 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
@ -34,15 +35,15 @@ index ff80b0abdd..758cfabb39 100644
/* Third party may overwrite these values. */
#ifndef VENDOR
-#define VENDOR "Oracle Corporation"
+#define VENDOR "openEuler Community"
+#define VENDOR "Huawei Technologies Co., Ltd"
#endif
#ifndef VENDOR_URL
-#define VENDOR_URL "http://java.oracle.com/"
+#define VENDOR_URL "https://gitee.com/src-openeuler/openjdk-1.8.0/"
+#define VENDOR_URL "http://jdk.rnd.huawei.com/"
#endif
#ifndef VENDOR_URL_BUG
-#define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/"
+#define VENDOR_URL_BUG "https://gitee.com/src-openeuler/openjdk-1.8.0/issues"
+#define VENDOR_URL_BUG "http://jdk.rnd.huawei.com/"
#endif
#define JAVA_MAX_SUPPORTED_VERSION 52

View File

@ -148,7 +148,7 @@
# Define old aarch64/jdk8u tree variables for compatibility
%global project aarch64-port
%global repo jdk8u-shenandoah
%global revision aarch64-shenandoah-jdk8u272-b10
%global revision aarch64-shenandoah-jdk8u282-b08
%global full_revision %{project}-%{repo}-%{revision}
# Define IcedTea version used for SystemTap tapsets and desktop files
%global icedteaver 3.15.0
@ -915,7 +915,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r
Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever}.%{buildver}
Release: 14
Release: 0
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@ -969,15 +969,14 @@ Source14: TestECDSA.java
Source20: repackReproduciblePolycies.sh
Patch1: 8160300.patch
Patch8: replace-vector-to-improve-performance-of-xml.validat.patch
Patch9: AARCH64-fix-itable-stub-code-size-limit.patch
Patch10: 8221658.patch
Patch12: add-debuginfo-for-libsaproc-on-aarch64.patch
Patch18: fix-vendor-info.patch
Patch21: 8202952-C2-Unexpected-dead-nodes-after-matching.patch
Patch21: 8202952.patch
Patch24: 8134883.patch
Patch25: FromCardCache-default-card-index-can-cause.patch
Patch25: 8196485.patch
Patch26: disable-UseLSE-on-ARMv8.1-by-default.patch
Patch27: 8157570.patch
Patch28: 8194246.patch
@ -986,62 +985,63 @@ Patch30: 8191483.patch
Patch31: 8141356.patch
Patch33: 8166253.patch
Patch34: 8191955.patch
Patch35: 8186042-OopmapCache-implementation.patch
Patch35: 8186042.patch
Patch36: 8060463.patch
Patch37: 8131600.patch
Patch38: 8138971.patch
Patch40: 8129626.patch
Patch41: 8203699.patch
Patch45: 8191129.patch
Patch46: 8182036.patch
Patch47: 8166197.patch
Patch50: 8158946.patch
Patch51: add-with-company-name-option.patch
Patch57: 8031085.patch
Patch58: Reduce-the-probability-of-the-crash-related-to-ciObj.patch
Patch62: 8165857-CMS-_overflow_list-is-missing-volatile-speci.patch
Patch63: 8033552-Fix-missing-missing-volatile-specifiers-in-C.patch
Patch67: 8165860-WorkGroup-classes-are-missing-volatile-speci.patch
Patch68: 8194154-System-property-user.dir-should-not-be-chang.patch
Patch62: 8165857.patch
Patch63: 8033552.patch
Patch67: 8165860.patch
Patch68: 8194154.patch
Patch70: 8164948.patch
Patch72: inline-optimize-for-aarch64.patch
# 8u242
Patch74: 8191915-java.lang.Math.multiplyExact-not-throw-an-ex.patch
Patch74: 8191915.patch
Patch75: Add-ability-to-configure-third-port-for-remote-JMX.patch
Patch76: 8203196-C1-emits-incorrect-code-due-to-integer-overf.patch
Patch77: 8190332-PngReader-throws-NegativeArraySizeException-.patch
Patch78: 8171410-aarch64-long-multiplyExact-shifts-by-31-inst.patch
Patch83: 8204947-Port-ShenandoahTaskTerminator-to-mainline-an.patch
Patch85: 8139041-Redundant-DMB-instructions.patch
Patch76: 8203196.patch
Patch77: 8190332.patch
Patch78: 8171410.patch
Patch83: 8204947.patch
Patch85: 8139041.patch
# 8u252
Patch86: 6858051-Create-GC-worker-threads-dynamically.patch
Patch87: 6858051-Add-a-switch-for-the-dynamic-thread-related-.patch
Patch87: 6858051-Add-a-switch-for-the-dynamic-thread-related-log.patch
Patch88: dismiss-warnings-in-GCC-8.X.patch
# 8u262
Patch89: 8144993-Elide-redundant-memory-barrier-after-AllocationNode.patch
Patch90: 8223504-improve-performance-of-forall-loops-by-better.patch
Patch89: 8144993.patch
Patch90: 8223504.patch
Patch91: add-vm-option-BoxTypeCachedMax-for-Integer-and-Long-cache.patch
Patch92: 8080289-8040213-8189067-move-the-store-out-of-the-loop.patch
Patch94: 8182397-race-in-field-updates.patch
Patch95: 8205921-Optimizing-best-of-2-work-stealing-queue-selection.patch
Patch94: 8182397.patch
Patch95: 8205921.patch
# 8u265
Patch96: fix-Long-cache-range-and-remove-VM-option-java.lang.IntegerCache.high-by-default.patch
Patch97: leaf-optimize-in-ParallelScanvageGC.patch
Patch102: fix-LongCache-s-range-when-BoxTypeCachedMax-number-is-bigger-than-Integer.MAX_VALUE.patch
Patch103: Ddot-intrinsic-implement.patch
Patch104: 8234003-Improve-IndexSet-iteration.patch
Patch105: 8220159-Optimize-various-RegMask-operations-by-introducing-watermarks.patch
Patch104: 8234003.patch
Patch105: 8220159.patch
Patch106: fast-serializer-jdk8.patch
Patch107: 6896810-Pin.java-fails-with-OOME-during-System.out.p.patch
Patch108: 8231631-sun-net-ftp-FtpURLConnectionLeak.java-fails-.patch
Patch107: 6896810.patch
Patch108: 8231631.patch
Patch109: Test8167409.sh-fails-to-run-with-32bit-jdk-on-64bit-.patch
Patch111: The-runok-method-retrying-another-port-does-not-take.patch
Patch112: 8048210-8056152-fix-assert-fail-for-an-InnocuousThre.patch
Patch113: 8160425-Vectorization-with-signalling-NaN-returns-wr.patch
Patch114: 8181503-Can-t-compile-hotspot-with-c-11.patch
Patch115: 8243670-Unexpected-test-result-caused-by-C2-MergeMem.patch
Patch112: 8048210-8056152.patch
Patch113: 8160425.patch
Patch114: 8181503.patch
Patch115: 8243670.patch
Patch116: fix-crash-in-JVMTI-debug.patch
Patch118: Fix-LineBuffer-vappend-when-buffer-too-small.patch
Patch121: Remove-unused-GenericTaskQueueSet-T-F-tasks.patch
@ -1053,24 +1053,24 @@ Patch126: zlib-optimization.patch
Patch127: add-DumpSharedSpace-guarantee-when-create-anonymous-classes.patch
# 8u272
Patch128: 8214440-ldap-over-a-TLS-connection-negotiate-fail.patch
Patch129: 8248336-AArch64-C2-offset-overflow-in-BoxLockNode-em.patch
Patch130: 8165808-Add-release-barriers-when-allocating-objects-with-concurrent-collection.patch
Patch131: 8166583-Add-oopDesc-klass_or_null_acquire.patch
Patch132: 8166862-CMS-needs-klass_or_null_acquire.patch
Patch129: 8248336.patch
Patch133: 8160369.patch
Patch134: PS-GC-adding-acquire_size-method-for-PSParallelCompa.patch
Patch135: 8223940-Private-key-not-supported-by-chosen-signature.patch
Patch136: 8236512-PKCS11-Connection-closed-after-Cipher.doFinal-and-NoPadding.patch
Patch137: 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
Patch138: add-appcds-file-lock.patch
Patch139: G1-memory-uncommit.patch
Patch140: 8015927-Class-reference-duplicates-in-constant-pool.patch
Patch141: 8040327-Eliminate-AnnotatedType-8040319-Clean-up-type-annotation-exception-index.patch
Patch142: 8207160-ClassReader-adjustMethodParams-can-potentially-return-null-if-the-args-list-is-empty.patch
Patch143: delete-untrustworthy-cacert.patch
Patch140: 8015927.patch
Patch141: 8040327.patch
Patch142: 8207160.patch
Patch143: delete-untrustworthy-cacert-files.patch
Patch144: add-appcds-test-case.patch
# 8u282
Patch145: 8080911.patch
Patch146: 8168926.patch
Patch147: 8215047.patch
Patch148: 8237894.patch
Patch149: Remove-the-parentheses-around-company-name.patch
#############################################
#
# Upstreamable patches
@ -1404,7 +1404,6 @@ ln -s %{top_level_dir_name} jdk8
pushd %{top_level_dir_name}
# OpenJDK patches
%patch1 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
@ -1426,9 +1425,11 @@ pushd %{top_level_dir_name}
%patch37 -p1
%patch38 -p1
%patch40 -p1
%patch41 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch50 -p1
%patch51 -p1
%patch57 -p1
%patch58 -p1
@ -1464,7 +1465,6 @@ pushd %{top_level_dir_name}
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
@ -1478,16 +1478,9 @@ pushd %{top_level_dir_name}
%patch125 -p1
%patch126 -p1
%patch127 -p1
%patch128 -p1
%patch129 -p1
%patch130 -p1
%patch131 -p1
%patch132 -p1
%patch133 -p1
%patch134 -p1
%patch135 -p1
%patch136 -p1
%patch137 -p1
%patch138 -p1
%patch139 -p1
%patch140 -p1
@ -1495,6 +1488,11 @@ pushd %{top_level_dir_name}
%patch142 -p1
%patch143 -p1
%patch144 -p1
%patch145 -p1
%patch146 -p1
%patch147 -p1
%patch148 -p1
%patch149 -p1
popd
@ -2111,6 +2109,23 @@ require "copy_jdk_configs.lua"
%endif
%changelog
* Tue Feb 2 2021 jdkboy <ge.guo@huawei.com> - 1:1.8.0.282-b08.0
- updated to aarch64-shenandoah-jdk8u282-b08 (from aarch64-port/jdk8u-shenandoah)
- delete 8160300.patch
- delete The-runok-method-retrying-another-port-does-not-take.patch
- delete 8214440-ldap-over-a-TLS-connection-negotiate-fail.patch
- delete 8165808-Add-release-barriers-when-allocating-objects-with-concurrent-collection.patch
- delete 8166583-Add-oopDesc-klass_or_null_acquire.patch
- delete 8166862-CMS-needs-klass_or_null_acquire.patch
- delete 8223940-Private-key-not-supported-by-chosen-signature.patch
- delete 8236512-PKCS11-Connection-closed-after-Cipher.doFinal-and-NoPadding.patch
- delete 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
- add 8080911.patch
- add 8168926.patch
- add 8215047.patch
- add 8237894.patch
- add Remove-the-parentheses-around-company-name.patch
* Thu Dec 24 2020 lee18767 <lijunhui15@huawei.com> - 1:1.8.0.272-b10.14
- add add-appcds-test-case.patch

View File

@ -1,3 +1,21 @@
From 7cb30e69748be16c082d016a94694990ef7f40bc Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:22:34 +0800
Subject: leaf optimize in ParallelScanvageGC
Summary: <leaf gc optimization>:1. add _is_gc_leaf field in klass, if none of klass field is reference,then this klass's oop is leaf, set this at classfile parser. 2. aarch64 use relax cas when gc cas_forward_to. 3. ParallelScanvage copy before push_depth if oop is leaf 4. leaf oop don't push_contents 5. Use gcc builtin __atomic_compare_exchange instead of hand-written asm.
LLT: N/A
Bug url: N/A
---
.../vm/atomic_linux_aarch64.inline.hpp | 8 +++++
.../share/vm/classfile/classFileParser.cpp | 5 ++++
.../psPromotionManager.inline.hpp | 24 ++++++++++++---
hotspot/src/share/vm/oops/klass.cpp | 2 ++
hotspot/src/share/vm/oops/klass.hpp | 5 ++++
hotspot/src/share/vm/oops/oop.hpp | 7 +++++
hotspot/src/share/vm/oops/oop.inline.hpp | 30 +++++++++++++++++++
hotspot/src/share/vm/runtime/atomic.hpp | 4 +++
8 files changed, 81 insertions(+), 4 deletions(-)
diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp b/hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp
index fba64e15f..1c92314f9 100644
--- a/hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp
@ -18,10 +36,10 @@ index fba64e15f..1c92314f9 100644
{
return (void *) cmpxchg_ptr((intptr_t) exchange_value,
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index 07d07e4f2..f001a94e7 100644
index 59bd021a1..f8bba7821 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -4393,6 +4393,11 @@ void ClassFileParser::fill_oop_maps(instanceKlassHandle k,
@@ -4490,6 +4490,11 @@ void ClassFileParser::fill_oop_maps(instanceKlassHandle k,
OopMapBlock* this_oop_map = k->start_of_nonstatic_oop_maps();
const InstanceKlass* const super = k->superklass();
const unsigned int super_count = super ? super->nonstatic_oop_map_count() : 0;
@ -34,7 +52,7 @@ index 07d07e4f2..f001a94e7 100644
// Copy maps from superklass
OopMapBlock* super_oop_map = super->start_of_nonstatic_oop_maps();
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
index b2de74d41..dde9ac426 100644
index a33132009..e517abcee 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
@@ -49,7 +49,12 @@ inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
@ -51,7 +69,7 @@ index b2de74d41..dde9ac426 100644
}
}
}
@@ -171,7 +176,15 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) {
@@ -202,7 +207,15 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) {
Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size);
// Now we have to CAS in the header.
@ -67,7 +85,7 @@ index b2de74d41..dde9ac426 100644
// We won any races, we "own" this object.
assert(new_obj == o->forwardee(), "Sanity");
@@ -195,10 +208,13 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) {
@@ -226,10 +239,13 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) {
push_depth(masked_o);
TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes);
} else {
@ -85,10 +103,10 @@ index b2de74d41..dde9ac426 100644
guarantee(o->is_forwarded(), "Object must be forwarded if the cas failed.");
diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp
index 7fda7ce62..6e8f9acde 100644
index 0d39dbb9f..ba20471d4 100644
--- a/hotspot/src/share/vm/oops/klass.cpp
+++ b/hotspot/src/share/vm/oops/klass.cpp
@@ -207,6 +207,8 @@ Klass::Klass() {
@@ -208,6 +208,8 @@ Klass::Klass() {
clear_modified_oops();
clear_accumulated_modified_oops();
_shared_class_path_index = -1;
@ -98,10 +116,10 @@ index 7fda7ce62..6e8f9acde 100644
jint Klass::array_layout_helper(BasicType etype) {
diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp
index 22ae48f5c..4aea54795 100644
index 5931abc1c..428df4242 100644
--- a/hotspot/src/share/vm/oops/klass.hpp
+++ b/hotspot/src/share/vm/oops/klass.hpp
@@ -177,6 +177,8 @@ class Klass : public Metadata {
@@ -179,6 +179,8 @@ class Klass : public Metadata {
jbyte _modified_oops; // Card Table Equivalent (YC/CMS support)
jbyte _accumulated_modified_oops; // Mod Union Equivalent (CMS support)
@ -110,7 +128,7 @@ index 22ae48f5c..4aea54795 100644
private:
// This is an index into FileMapHeader::_classpath_entry_table[], to
// associate this class with the JAR file where it's loaded from during
@@ -569,6 +571,9 @@ protected:
@@ -571,6 +573,9 @@ protected:
oop_is_typeArray_slow()); }
#undef assert_same_query
@ -121,7 +139,7 @@ index 22ae48f5c..4aea54795 100644
AccessFlags access_flags() const { return _access_flags; }
void set_access_flags(AccessFlags flags) { _access_flags = flags; }
diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp
index a703a54ef..41a7bce4d 100644
index a5ff97260..ce4881bf6 100644
--- a/hotspot/src/share/vm/oops/oop.hpp
+++ b/hotspot/src/share/vm/oops/oop.hpp
@@ -76,6 +76,9 @@ class oopDesc {
@ -134,7 +152,7 @@ index a703a54ef..41a7bce4d 100644
// Used only to re-initialize the mark word (e.g., of promoted
// objects during a GC) -- requires a valid klass pointer
@@ -317,6 +320,10 @@ class oopDesc {
@@ -316,6 +319,10 @@ class oopDesc {
void forward_to(oop p);
bool cas_forward_to(oop p, markOop compare);
@ -146,7 +164,7 @@ index a703a54ef..41a7bce4d 100644
// Like "forward_to", but inserts the forwarding pointer atomically.
// Exactly one thread succeeds in inserting the forwarding pointer, and
diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp
index d4c4d75c0..c3abdb128 100644
index 7e03033b0..6512ec576 100644
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -76,6 +76,12 @@ inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) {
@ -208,3 +226,6 @@ index 9ca5fce97..015178b61 100644
inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value);
};
--
2.19.0

View File

@ -1,6 +1,6 @@
From 12ec07c99ff937953c3adafc12818136d9fb1d2b Mon Sep 17 00:00:00 2001
Date: Thu, 9 Apr 2020 09:18:13 +0000
Subject: [PATCH] optimize jmap -F -dump:xxx
From 675360f4912dad7eeeac4b6a05b782dca234c008 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:16:57 +0800
Subject: optimize jmap -F -dump:xxx
Summary: optimize jmap -F -dump:xxx to speed up the dump process
LLT: N/A
@ -10,7 +10,7 @@ Bug url: N/A
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java
index 4fc2ed8c..2e56d270 100644
index 4fc2ed8c6..2e56d2708 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java
@@ -45,6 +45,7 @@ abstract public class Metadata extends VMObject {

89
patch_list Normal file
View File

@ -0,0 +1,89 @@
replace-vector-to-improve-performance-of-xml.validat.patch
AARCH64-fix-itable-stub-code-size-limit.patch
8221658.patch
add-debuginfo-for-libsaproc-on-aarch64.patch
fix-vendor-info.patch
8202952.patch
8134883.patch
8196485.patch
disable-UseLSE-on-ARMv8.1-by-default.patch
8157570.patch
8194246.patch
8214345.patch
8191483.patch
8141356.patch
8166253.patch
8191955.patch
8186042.patch
8060463.patch
8131600.patch
8138971.patch
8129626.patch
8203699.patch
8191129.patch
8182036.patch
8166197.patch
8158946.patch
add-with-company-name-option.patch
8031085.patch
Reduce-the-probability-of-the-crash-related-to-ciObj.patch
8165857.patch
8033552.patch
8165860.patch
8194154.patch
8164948.patch
inline-optimize-for-aarch64.patch
8191915.patch
Add-ability-to-configure-third-port-for-remote-JMX.patch
8203196.patch
8190332.patch
8171410.patch
8204947.patch
8139041.patch
6858051-Create-GC-worker-threads-dynamically.patch
6858051-Add-a-switch-for-the-dynamic-thread-related-log.patch
dismiss-warnings-in-GCC-8.X.patch
8144993-Elide-redundant-memory-barrier-after-AllocationNode.patch
8223504-improve-performance-of-forall-loops-by-better.patch
add-vm-option-BoxTypeCachedMax-for-Integer-and-Long-cache.patch
8080289-8040213-8189067-move-the-store-out-of-the-loop.patch
8182397.patch
8205921.patch
fix-Long-cache-range-and-remove-VM-option-java.lang.IntegerCache.high-by-default.patch
leaf-optimize-in-ParallelScanvageGC.patch
fix-LongCache-s-range-when-BoxTypeCachedMax-number-is-bigger-than-Integer.MAX_VALUE.patch
Ddot-intrinsic-implement.patch
8234003.patch
8220159.patch
fast-serializer-jdk8.patch
6896810.patch
8231631.patch
Test8167409.sh-fails-to-run-with-32bit-jdk-on-64bit-.patch
8048210-8056152.patch
8160425.patch
8181503.patch
8243670.patch
fix-crash-in-JVMTI-debug.patch
Fix-LineBuffer-vappend-when-buffer-too-small.patch
Remove-unused-GenericTaskQueueSet-T-F-tasks.patch
optimize-jmap-F-dump-xxx.patch
recreate-.java_pid-file-when-deleted-for-attach-mechanism.patch
Support-Git-commit-ID-in-the-SOURCE-field-of-the-release.patch
Extend-CDS-to-support-app-class-metadata-sharing.patch
zlib-optimization.patch
add-DumpSharedSpace-guarantee-when-create-anonymous-classes.patch
8248336.patch
8160369.patch
PS-GC-adding-acquire_size-method-for-PSParallelCompa.patch
add-appcds-file-lock.patch
G1-memory-uncommit.patch
8015927.patch
8040327.patch
8207160.patch
delete-untrustworthy-cacert-files.patch
add-appcds-test-case.patch
8080911.patch
8168926.patch
8215047.patch
8237894.patch
Remove-the-parentheses-around-company-name.patch

View File

@ -1,14 +1,15 @@
From 9f8ee6d44e254da38605d3ceb527d412a208c862 Mon Sep 17 00:00:00 2001
Date: Wed, 12 Aug 2020 12:09:15 +0000
Subject: [PATCH] recreate .java_pid file when deleted for attach mechanism
From 7e879bcae45b7a7e4b3fa8044564e3590344dbbd Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:23:51 +0800
Subject: recreate .java_pid file when deleted for attach
mechanism
Summary: <hotspot>: <enable attach mechanism when .java_pid is lost>
LLT:
Bug url:
---
hotspot/src/os/linux/vm/attachListener_linux.cpp | 20 ++++++++++++++++----
hotspot/src/share/vm/services/attachListener.cpp | 1 +
hotspot/src/share/vm/services/attachListener.hpp | 2 +-
.../src/os/linux/vm/attachListener_linux.cpp | 20 +++++++++++++++----
.../src/share/vm/services/attachListener.cpp | 1 +
.../src/share/vm/services/attachListener.hpp | 2 +-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp
@ -71,5 +72,5 @@ index 5204c4c62..11ec525c6 100644
// indicates if this VM supports attach-on-demand
static bool is_attach_supported() { return !DisableAttachMechanism; }
--
2.12.3
2.19.0

View File

@ -1,6 +1,6 @@
From 6ee202c81902416a9ec5ec5a32c536d3294bd5e6 Mon Sep 17 00:00:00 2001
Date: Fri, 19 Apr 2019 17:23:48 +0000
Subject: [PATCH] replace vector to improve performance of xml.validation
From 329323e9ca450efd1a87fd36753eb6c060203cca Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 11:13:19 +0800
Subject: replace vector to improve performance of xml.validation
---
.../internal/impl/dv/ValidatedInfo.java | 5 +
@ -10,7 +10,7 @@ Subject: [PATCH] replace vector to improve performance of xml.validation
4 files changed, 97 insertions(+), 72 deletions(-)
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
index e6b8f267a5..8d5d86772f 100644
index e6b8f267a..8d5d86772 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
@@ -95,4 +95,9 @@ public class ValidatedInfo {
@ -24,7 +24,7 @@ index e6b8f267a5..8d5d86772f 100644
+
}
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
index c9c913464e..98546f2d50 100644
index c9c913464..98546f2d5 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
@@ -20,11 +20,6 @@
@ -377,7 +377,7 @@ index c9c913464e..98546f2d50 100644
+ }
} // class XSSimpleTypeDecl
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
index 372242ff6e..ab6cdb8455 100644
index 372242ff6..ab6cdb845 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
@@ -20,7 +20,7 @@
@ -414,7 +414,7 @@ index 372242ff6e..ab6cdb8455 100644
}
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
index fa488d64ad..913740fe0d 100644
index fa488d64a..913740fe0 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
@@ -22,7 +22,7 @@ package com.sun.org.apache.xerces.internal.impl.xpath.regex;

View File

@ -0,0 +1,54 @@
From cdc9dd2e9c2454259394d4b7f46c9bb720db6643 Mon Sep 17 00:00:00 2001
Date: Fri, 22 Jan 2021 16:25:03 +0800
Subject: set vm.vendor by configure
Summary: <vendor>: <backout the vendor patch>
LLT: java -XshowSettings:properties
Bug url: NA
---
hotspot/src/share/vm/runtime/vm_version.cpp | 7 ++++++-
jdk/src/share/native/java/lang/System.c | 6 +++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp
index c6a559521..5ee3a7942 100644
--- a/hotspot/src/share/vm/runtime/vm_version.cpp
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp
@@ -142,7 +142,12 @@ const char* Abstract_VM_Version::vm_name() {
const char* Abstract_VM_Version::vm_vendor() {
- return "Huawei Technologies Co., Ltd";
+#ifdef VENDOR
+ return VENDOR;
+#else
+ return JDK_Version::is_gte_jdk17x_version() ?
+ "Oracle Corporation" : "Sun Microsystems Inc.";
+#endif
}
diff --git a/jdk/src/share/native/java/lang/System.c b/jdk/src/share/native/java/lang/System.c
index 758cfabb3..ff80b0abd 100644
--- a/jdk/src/share/native/java/lang/System.c
+++ b/jdk/src/share/native/java/lang/System.c
@@ -110,13 +110,13 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
/* Third party may overwrite these values. */
#ifndef VENDOR
-#define VENDOR "Huawei Technologies Co., Ltd"
+#define VENDOR "Oracle Corporation"
#endif
#ifndef VENDOR_URL
-#define VENDOR_URL "http://jdk.rnd.huawei.com/"
+#define VENDOR_URL "http://java.oracle.com/"
#endif
#ifndef VENDOR_URL_BUG
-#define VENDOR_URL_BUG "http://jdk.rnd.huawei.com/"
+#define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/"
#endif
#define JAVA_MAX_SUPPORTED_VERSION 52
--
2.19.0

View File

@ -31,7 +31,7 @@ if [ "x$REPO_NAME" = "x" ] ; then
REPO_NAME="jdk8u-shenandoah"
fi
if [ "x$VERSION" = "x" ] ; then
VERSION="aarch64-shenandoah-jdk8u272-b10"
VERSION="aarch64-shenandoah-jdk8u282-b08"
fi
if [ "x$COMPRESSION" = "x" ] ; then