!156 I4SV7X: upgrade to jdk11.0.14-ga
Merge pull request !156 from kuen/I4SV7X
This commit is contained in:
commit
5d5dd46361
@ -1,858 +0,0 @@
|
||||
From 65e9f0b4c719146b0958cb3c01fd31e11e49ec37 Mon Sep 17 00:00:00 2001
|
||||
Date: Tue, 16 Mar 2021 07:09:57 +0000
|
||||
Subject: [PATCH 4/4] backport JDK-8214535 to support Jmap parallel
|
||||
|
||||
---
|
||||
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 25 ++++
|
||||
src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 4 +
|
||||
.../gc/parallel/parallelScavengeHeap.cpp | 64 +++++++++++
|
||||
.../gc/parallel/parallelScavengeHeap.hpp | 22 +++-
|
||||
src/hotspot/share/gc/parallel/psOldGen.cpp | 32 ++++++
|
||||
src/hotspot/share/gc/parallel/psOldGen.hpp | 11 ++
|
||||
src/hotspot/share/gc/shared/collectedHeap.hpp | 11 ++
|
||||
.../share/gc/shared/vmGCOperations.cpp | 2 +-
|
||||
.../share/gc/shared/vmGCOperations.hpp | 5 +-
|
||||
src/hotspot/share/gc/shared/workgroup.hpp | 21 ++++
|
||||
src/hotspot/share/memory/heapInspection.cpp | 108 ++++++++++++++++--
|
||||
src/hotspot/share/memory/heapInspection.hpp | 44 ++++++-
|
||||
src/hotspot/share/runtime/arguments.hpp | 12 +-
|
||||
src/hotspot/share/services/attachListener.cpp | 15 ++-
|
||||
.../share/classes/sun/tools/jmap/JMap.java | 41 +++++--
|
||||
test/jdk/sun/tools/jmap/BasicJMapTest.java | 55 +++++++++
|
||||
16 files changed, 442 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
index 7e9c6254c..fd2da14a3 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
|
||||
@@ -77,6 +77,7 @@
|
||||
#include "gc/shared/weakProcessor.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
+#include "memory/heapInspection.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "memory/metaspaceShared.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
@@ -2208,6 +2209,30 @@ void G1CollectedHeap::object_iterate(ObjectClosure* cl) {
|
||||
heap_region_iterate(&blk);
|
||||
}
|
||||
|
||||
+class G1ParallelObjectIterator : public ParallelObjectIterator {
|
||||
+private:
|
||||
+ G1CollectedHeap* _heap;
|
||||
+ HeapRegionClaimer _claimer;
|
||||
+
|
||||
+public:
|
||||
+ G1ParallelObjectIterator(uint thread_num) :
|
||||
+ _heap(G1CollectedHeap::heap()),
|
||||
+ _claimer(thread_num == 0 ? G1CollectedHeap::heap()->workers()->active_workers() : thread_num) {}
|
||||
+
|
||||
+ virtual void object_iterate(ObjectClosure* cl, uint worker_id) {
|
||||
+ _heap->object_iterate_parallel(cl, worker_id, &_claimer);
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+ParallelObjectIterator* G1CollectedHeap::parallel_object_iterator(uint thread_num) {
|
||||
+ return new G1ParallelObjectIterator(thread_num);
|
||||
+}
|
||||
+
|
||||
+void G1CollectedHeap::object_iterate_parallel(ObjectClosure* cl, uint worker_id, HeapRegionClaimer* claimer) {
|
||||
+ IterateObjectClosureRegionClosure blk(cl);
|
||||
+ heap_region_par_iterate_from_worker_offset(&blk, claimer, worker_id);
|
||||
+}
|
||||
+
|
||||
void G1CollectedHeap::keep_alive(oop obj) {
|
||||
G1BarrierSet::enqueue(obj);
|
||||
}
|
||||
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
|
||||
index bb46cae83..82f59d69b 100644
|
||||
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
|
||||
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
|
||||
@@ -1125,9 +1125,13 @@ public:
|
||||
|
||||
// Iteration functions.
|
||||
|
||||
+ void object_iterate_parallel(ObjectClosure* cl, uint worker_id, HeapRegionClaimer* claimer);
|
||||
+
|
||||
// Iterate over all objects, calling "cl.do_object" on each.
|
||||
virtual void object_iterate(ObjectClosure* cl);
|
||||
|
||||
+ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num);
|
||||
+
|
||||
virtual void safe_object_iterate(ObjectClosure* cl) {
|
||||
object_iterate(cl);
|
||||
}
|
||||
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
index 29f967fb3..66e1b32a6 100644
|
||||
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
@@ -523,6 +523,70 @@ void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
|
||||
old_gen()->object_iterate(cl);
|
||||
}
|
||||
|
||||
+// The HeapBlockClaimer is used during parallel iteration over the heap,
|
||||
+// allowing workers to claim heap areas ("blocks"), gaining exclusive rights to these.
|
||||
+// The eden and survivor spaces are treated as single blocks as it is hard to divide
|
||||
+// these spaces.
|
||||
+// The old space is divided into fixed-size blocks.
|
||||
+class HeapBlockClaimer : public StackObj {
|
||||
+ size_t _claimed_index;
|
||||
+
|
||||
+public:
|
||||
+ static const size_t InvalidIndex = SIZE_MAX;
|
||||
+ static const size_t EdenIndex = 0;
|
||||
+ static const size_t SurvivorIndex = 1;
|
||||
+ static const size_t NumNonOldGenClaims = 2;
|
||||
+
|
||||
+ HeapBlockClaimer() : _claimed_index(EdenIndex) { }
|
||||
+ // Claim the block and get the block index.
|
||||
+ size_t claim_and_get_block() {
|
||||
+ size_t block_index;
|
||||
+ block_index = Atomic::add(1u, &_claimed_index) - 1; // TODO: original impl is: Atomic::fetch_and_add(&_claimed_index, 1u);
|
||||
+
|
||||
+ PSOldGen* old_gen = ParallelScavengeHeap::heap()->old_gen();
|
||||
+ size_t num_claims = old_gen->num_iterable_blocks() + NumNonOldGenClaims;
|
||||
+
|
||||
+ return block_index < num_claims ? block_index : InvalidIndex;
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+void ParallelScavengeHeap::object_iterate_parallel(ObjectClosure* cl,
|
||||
+ HeapBlockClaimer* claimer) {
|
||||
+ size_t block_index = claimer->claim_and_get_block();
|
||||
+ // Iterate until all blocks are claimed
|
||||
+ if (block_index == HeapBlockClaimer::EdenIndex) {
|
||||
+ young_gen()->eden_space()->object_iterate(cl);
|
||||
+ block_index = claimer->claim_and_get_block();
|
||||
+ }
|
||||
+ if (block_index == HeapBlockClaimer::SurvivorIndex) {
|
||||
+ young_gen()->from_space()->object_iterate(cl);
|
||||
+ young_gen()->to_space()->object_iterate(cl);
|
||||
+ block_index = claimer->claim_and_get_block();
|
||||
+ }
|
||||
+ while (block_index != HeapBlockClaimer::InvalidIndex) {
|
||||
+ old_gen()->object_iterate_block(cl, block_index - HeapBlockClaimer::NumNonOldGenClaims);
|
||||
+ block_index = claimer->claim_and_get_block();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+class PSScavengeParallelObjectIterator : public ParallelObjectIterator {
|
||||
+private:
|
||||
+ ParallelScavengeHeap* _heap;
|
||||
+ HeapBlockClaimer _claimer;
|
||||
+
|
||||
+public:
|
||||
+ PSScavengeParallelObjectIterator() :
|
||||
+ _heap(ParallelScavengeHeap::heap()),
|
||||
+ _claimer() {}
|
||||
+
|
||||
+ virtual void object_iterate(ObjectClosure* cl, uint worker_id) {
|
||||
+ _heap->object_iterate_parallel(cl, &_claimer);
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+ParallelObjectIterator* ParallelScavengeHeap::parallel_object_iterator(uint thread_num) {
|
||||
+ return new PSScavengeParallelObjectIterator();
|
||||
+}
|
||||
|
||||
HeapWord* ParallelScavengeHeap::block_start(const void* addr) const {
|
||||
if (young_gen()->is_in_reserved(addr)) {
|
||||
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
index 5d18efb92..0a9b7bd3f 100644
|
||||
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
@@ -44,6 +44,7 @@
|
||||
class AdjoiningGenerations;
|
||||
class GCHeapSummary;
|
||||
class GCTaskManager;
|
||||
+class HeapBlockClaimer;
|
||||
class MemoryManager;
|
||||
class MemoryPool;
|
||||
class PSAdaptiveSizePolicy;
|
||||
@@ -79,6 +80,8 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
MemoryPool* _survivor_pool;
|
||||
MemoryPool* _old_pool;
|
||||
|
||||
+ WorkGang _workers;
|
||||
+
|
||||
virtual void initialize_serviceability();
|
||||
|
||||
void trace_heap(GCWhen::Type when, const GCTracer* tracer);
|
||||
@@ -93,7 +96,20 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
|
||||
public:
|
||||
ParallelScavengeHeap(GenerationSizer* policy) :
|
||||
- CollectedHeap(), _collector_policy(policy), _death_march_count(0) { }
|
||||
+ CollectedHeap(),
|
||||
+ _collector_policy(policy),
|
||||
+ _death_march_count(0),
|
||||
+ _young_manager(NULL),
|
||||
+ _old_manager(NULL),
|
||||
+ _eden_pool(NULL),
|
||||
+ _survivor_pool(NULL),
|
||||
+ _old_pool(NULL),
|
||||
+ _workers("GC Thread",
|
||||
+ ParallelGCThreads,
|
||||
+ true /* are_GC_task_threads */,
|
||||
+ false /* are_ConcurrentGC_threads */) {
|
||||
+ _workers.initialize_workers();
|
||||
+ }
|
||||
|
||||
// For use by VM operations
|
||||
enum CollectionType {
|
||||
@@ -217,6 +233,8 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
|
||||
void object_iterate(ObjectClosure* cl);
|
||||
void safe_object_iterate(ObjectClosure* cl) { object_iterate(cl); }
|
||||
+ void object_iterate_parallel(ObjectClosure* cl, HeapBlockClaimer* claimer);
|
||||
+ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num);
|
||||
|
||||
HeapWord* block_start(const void* addr) const;
|
||||
size_t block_size(const HeapWord* addr) const;
|
||||
@@ -232,6 +250,8 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
virtual void gc_threads_do(ThreadClosure* tc) const;
|
||||
virtual void print_tracing_info() const;
|
||||
|
||||
+ virtual WorkGang* get_safepoint_workers() { return &_workers; }
|
||||
+
|
||||
void verify(VerifyOption option /* ignored */);
|
||||
|
||||
// Resize the young generation. The reserved space for the
|
||||
diff --git a/src/hotspot/share/gc/parallel/psOldGen.cpp b/src/hotspot/share/gc/parallel/psOldGen.cpp
|
||||
index 35844b14b..dbb5148fd 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psOldGen.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psOldGen.cpp
|
||||
@@ -213,6 +213,38 @@ HeapWord* PSOldGen::allocate(size_t word_size) {
|
||||
return res;
|
||||
}
|
||||
|
||||
+size_t PSOldGen::num_iterable_blocks() const {
|
||||
+ return (object_space()->used_in_bytes() + IterateBlockSize - 1) / IterateBlockSize;
|
||||
+}
|
||||
+
|
||||
+void PSOldGen::object_iterate_block(ObjectClosure* cl, size_t block_index) {
|
||||
+ size_t block_word_size = IterateBlockSize / HeapWordSize;
|
||||
+ assert((block_word_size % (ObjectStartArray::block_size)) == 0,
|
||||
+ "Block size not a multiple of start_array block");
|
||||
+
|
||||
+ MutableSpace *space = object_space();
|
||||
+
|
||||
+ HeapWord* begin = space->bottom() + block_index * block_word_size;
|
||||
+ HeapWord* end = MIN2(space->top(), begin + block_word_size);
|
||||
+
|
||||
+ if (!start_array()->object_starts_in_range(begin, end)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Get object starting at or reaching into this block.
|
||||
+ HeapWord* start = start_array()->object_start(begin);
|
||||
+ if (start < begin) {
|
||||
+ start += oop(start)->size();
|
||||
+ }
|
||||
+ assert(start >= begin,
|
||||
+ "Object address" PTR_FORMAT " must be larger or equal to block address at " PTR_FORMAT,
|
||||
+ p2i(start), p2i(begin));
|
||||
+ // Iterate all objects until the end.
|
||||
+ for (HeapWord* p = start; p < end; p += oop(p)->size()) {
|
||||
+ cl->do_object(oop(p));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
|
||||
expand(word_size*HeapWordSize);
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
diff --git a/src/hotspot/share/gc/parallel/psOldGen.hpp b/src/hotspot/share/gc/parallel/psOldGen.hpp
|
||||
index fa27f5a04..fa6e4849b 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psOldGen.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psOldGen.hpp
|
||||
@@ -59,6 +59,9 @@ class PSOldGen : public CHeapObj<mtGC> {
|
||||
const size_t _min_gen_size;
|
||||
const size_t _max_gen_size;
|
||||
|
||||
+ // Block size for parallel iteration
|
||||
+ static const size_t IterateBlockSize = 1024 * 1024;
|
||||
+
|
||||
// Used when initializing the _name field.
|
||||
static inline const char* select_name();
|
||||
|
||||
@@ -195,6 +198,14 @@ class PSOldGen : public CHeapObj<mtGC> {
|
||||
void oop_iterate(OopIterateClosure* cl) { object_space()->oop_iterate(cl); }
|
||||
void object_iterate(ObjectClosure* cl) { object_space()->object_iterate(cl); }
|
||||
|
||||
+ // Number of blocks to be iterated over in the used part of old gen.
|
||||
+ size_t num_iterable_blocks() const;
|
||||
+ // Iterate the objects starting in block block_index within [bottom, top) of the
|
||||
+ // old gen. The object just reaching into this block is not iterated over.
|
||||
+ // A block is an evenly sized non-overlapping part of the old gen of
|
||||
+ // IterateBlockSize bytes.
|
||||
+ void object_iterate_block(ObjectClosure* cl, size_t block_index);
|
||||
+
|
||||
// Debugging - do not use for time critical operations
|
||||
virtual void print() const;
|
||||
virtual void print_on(outputStream* st) const;
|
||||
diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp
|
||||
index 47acf22cb..bcd4da29a 100644
|
||||
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp
|
||||
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "gc/shared/gcCause.hpp"
|
||||
#include "gc/shared/gcWhen.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
+#include "memory/heapInspection.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
#include "runtime/perfData.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
@@ -42,6 +43,7 @@
|
||||
// class defines the functions that a heap must implement, and contains
|
||||
// infrastructure common to all heaps.
|
||||
|
||||
+class AbstractGangTask;
|
||||
class AdaptiveSizePolicy;
|
||||
class BarrierSet;
|
||||
class CollectorPolicy;
|
||||
@@ -83,6 +85,11 @@ class GCHeapLog : public EventLogBase<GCMessage> {
|
||||
}
|
||||
};
|
||||
|
||||
+class ParallelObjectIterator : public CHeapObj<mtGC> {
|
||||
+public:
|
||||
+ virtual void object_iterate(ObjectClosure* cl, uint worker_id) = 0;
|
||||
+};
|
||||
+
|
||||
//
|
||||
// CollectedHeap
|
||||
// GenCollectedHeap
|
||||
@@ -434,6 +441,10 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
||||
// Iterate over all objects, calling "cl.do_object" on each.
|
||||
virtual void object_iterate(ObjectClosure* cl) = 0;
|
||||
|
||||
+ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
// Similar to object_iterate() except iterates only
|
||||
// over live objects.
|
||||
virtual void safe_object_iterate(ObjectClosure* cl) = 0;
|
||||
diff --git a/src/hotspot/share/gc/shared/vmGCOperations.cpp b/src/hotspot/share/gc/shared/vmGCOperations.cpp
|
||||
index b02305a6e..728290a7b 100644
|
||||
--- a/src/hotspot/share/gc/shared/vmGCOperations.cpp
|
||||
+++ b/src/hotspot/share/gc/shared/vmGCOperations.cpp
|
||||
@@ -154,7 +154,7 @@ void VM_GC_HeapInspection::doit() {
|
||||
}
|
||||
HeapInspection inspect(_csv_format, _print_help, _print_class_stats,
|
||||
_columns);
|
||||
- inspect.heap_inspection(_out);
|
||||
+ inspect.heap_inspection(_out, _parallel_thread_num);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/hotspot/share/gc/shared/vmGCOperations.hpp b/src/hotspot/share/gc/shared/vmGCOperations.hpp
|
||||
index 65876e559..ef73b45de 100644
|
||||
--- a/src/hotspot/share/gc/shared/vmGCOperations.hpp
|
||||
+++ b/src/hotspot/share/gc/shared/vmGCOperations.hpp
|
||||
@@ -125,18 +125,21 @@ class VM_GC_HeapInspection: public VM_GC_Operation {
|
||||
private:
|
||||
outputStream* _out;
|
||||
bool _full_gc;
|
||||
+ uint _parallel_thread_num;
|
||||
bool _csv_format; // "comma separated values" format for spreadsheet.
|
||||
bool _print_help;
|
||||
bool _print_class_stats;
|
||||
const char* _columns;
|
||||
public:
|
||||
- VM_GC_HeapInspection(outputStream* out, bool request_full_gc) :
|
||||
+ VM_GC_HeapInspection(outputStream* out, bool request_full_gc,
|
||||
+ uint parallel_thread_num = 1) :
|
||||
VM_GC_Operation(0 /* total collections, dummy, ignored */,
|
||||
GCCause::_heap_inspection /* GC Cause */,
|
||||
0 /* total full collections, dummy, ignored */,
|
||||
request_full_gc) {
|
||||
_out = out;
|
||||
_full_gc = request_full_gc;
|
||||
+ _parallel_thread_num = parallel_thread_num;
|
||||
_csv_format = false;
|
||||
_print_help = false;
|
||||
_print_class_stats = false;
|
||||
diff --git a/src/hotspot/share/gc/shared/workgroup.hpp b/src/hotspot/share/gc/shared/workgroup.hpp
|
||||
index 8b46d3bc4..109649df0 100644
|
||||
--- a/src/hotspot/share/gc/shared/workgroup.hpp
|
||||
+++ b/src/hotspot/share/gc/shared/workgroup.hpp
|
||||
@@ -228,6 +228,27 @@ protected:
|
||||
virtual AbstractGangWorker* allocate_worker(uint which);
|
||||
};
|
||||
|
||||
+// Temporarily try to set the number of active workers.
|
||||
+// It's not guaranteed that it succeeds, and users need to
|
||||
+// query the number of active workers.
|
||||
+class WithUpdatedActiveWorkers : public StackObj {
|
||||
+private:
|
||||
+ AbstractWorkGang* const _gang;
|
||||
+ const uint _old_active_workers;
|
||||
+
|
||||
+public:
|
||||
+ WithUpdatedActiveWorkers(AbstractWorkGang* gang, uint requested_num_workers) :
|
||||
+ _gang(gang),
|
||||
+ _old_active_workers(gang->active_workers()) {
|
||||
+ uint capped_num_workers = MIN2(requested_num_workers, gang->total_workers());
|
||||
+ gang->update_active_workers(capped_num_workers);
|
||||
+ }
|
||||
+
|
||||
+ ~WithUpdatedActiveWorkers() {
|
||||
+ _gang->update_active_workers(_old_active_workers);
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
// Several instances of this class run in parallel as workers for a gang.
|
||||
class AbstractGangWorker: public WorkerThread {
|
||||
public:
|
||||
diff --git a/src/hotspot/share/memory/heapInspection.cpp b/src/hotspot/share/memory/heapInspection.cpp
|
||||
index 9c2cdc117..dbc0eb274 100644
|
||||
--- a/src/hotspot/share/memory/heapInspection.cpp
|
||||
+++ b/src/hotspot/share/memory/heapInspection.cpp
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/reflectionAccessorImplKlassHelper.hpp"
|
||||
+#include "runtime/atomic.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
@@ -236,6 +237,41 @@ size_t KlassInfoTable::size_of_instances_in_words() const {
|
||||
return _size_of_instances_in_words;
|
||||
}
|
||||
|
||||
+// Return false if the entry could not be recorded on account
|
||||
+// of running out of space required to create a new entry.
|
||||
+bool KlassInfoTable::merge_entry(const KlassInfoEntry* cie) {
|
||||
+ Klass* k = cie->klass();
|
||||
+ KlassInfoEntry* elt = lookup(k);
|
||||
+ // elt may be NULL if it's a new klass for which we
|
||||
+ // could not allocate space for a new entry in the hashtable.
|
||||
+ if (elt != NULL) {
|
||||
+ elt->set_count(elt->count() + cie->count());
|
||||
+ elt->set_words(elt->words() + cie->words());
|
||||
+ _size_of_instances_in_words += cie->words();
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+class KlassInfoTableMergeClosure : public KlassInfoClosure {
|
||||
+ private:
|
||||
+ KlassInfoTable* _dest;
|
||||
+ bool _success;
|
||||
+ public:
|
||||
+ KlassInfoTableMergeClosure(KlassInfoTable* table) : _dest(table), _success(true) {}
|
||||
+ void do_cinfo(KlassInfoEntry* cie) {
|
||||
+ _success &= _dest->merge_entry(cie);
|
||||
+ }
|
||||
+ bool success() { return _success; }
|
||||
+};
|
||||
+
|
||||
+// merge from table
|
||||
+bool KlassInfoTable::merge(KlassInfoTable* table) {
|
||||
+ KlassInfoTableMergeClosure closure(this);
|
||||
+ table->iterate(&closure);
|
||||
+ return closure.success();
|
||||
+}
|
||||
+
|
||||
int KlassInfoHisto::sort_helper(KlassInfoEntry** e1, KlassInfoEntry** e2) {
|
||||
return (*e1)->compare(*e1,*e2);
|
||||
}
|
||||
@@ -687,7 +723,7 @@ class HistoClosure : public KlassInfoClosure {
|
||||
class RecordInstanceClosure : public ObjectClosure {
|
||||
private:
|
||||
KlassInfoTable* _cit;
|
||||
- size_t _missed_count;
|
||||
+ uintx _missed_count;
|
||||
BoolObjectClosure* _filter;
|
||||
public:
|
||||
RecordInstanceClosure(KlassInfoTable* cit, BoolObjectClosure* filter) :
|
||||
@@ -701,7 +737,7 @@ class RecordInstanceClosure : public ObjectClosure {
|
||||
}
|
||||
}
|
||||
|
||||
- size_t missed_count() { return _missed_count; }
|
||||
+ uintx missed_count() { return _missed_count; }
|
||||
|
||||
private:
|
||||
bool should_visit(oop obj) {
|
||||
@@ -709,15 +745,73 @@ class RecordInstanceClosure : public ObjectClosure {
|
||||
}
|
||||
};
|
||||
|
||||
-size_t HeapInspection::populate_table(KlassInfoTable* cit, BoolObjectClosure *filter) {
|
||||
- ResourceMark rm;
|
||||
+// Heap inspection for every worker.
|
||||
+// When native OOM hanppens for KlassInfoTable, set _success to false.
|
||||
+void ParHeapInspectTask::work(uint worker_id) {
|
||||
+ uintx missed_count = 0;
|
||||
+ bool merge_success = true;
|
||||
+ if (!Atomic::load(&_success)) {
|
||||
+ // other worker has failed on parallel iteration.
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
+ KlassInfoTable cit(false);
|
||||
+ if (cit.allocation_failed()) {
|
||||
+ // fail to allocate memory, stop parallel mode
|
||||
+ Atomic::store(false, &_success);
|
||||
+ return;
|
||||
+ }
|
||||
+ RecordInstanceClosure ric(&cit, _filter);
|
||||
+ _poi->object_iterate(&ric, worker_id);
|
||||
+ missed_count = ric.missed_count();
|
||||
+ {
|
||||
+ MutexLocker x(&_mutex);
|
||||
+ merge_success = _shared_cit->merge(&cit);
|
||||
+ }
|
||||
+ if (merge_success) {
|
||||
+ Atomic::add(missed_count, &_missed_count);
|
||||
+ } else {
|
||||
+ Atomic::store(false, &_success);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+size_t HeapInspection::populate_table(KlassInfoTable* cit, BoolObjectClosure *filter, uint parallel_thread_num) {
|
||||
+ // Try parallel first.
|
||||
+ if (parallel_thread_num > 1) {
|
||||
+ ResourceMark rm;
|
||||
+
|
||||
+ WorkGang* gang = Universe::heap()->get_safepoint_workers();
|
||||
+ if (gang != NULL) {
|
||||
+ // The GC provided a WorkGang to be used during a safepoint.
|
||||
+
|
||||
+ // Can't run with more threads than provided by the WorkGang.
|
||||
+ WithUpdatedActiveWorkers update_and_restore(gang, parallel_thread_num);
|
||||
+
|
||||
+ ParallelObjectIterator* poi = Universe::heap()->parallel_object_iterator(gang->active_workers());
|
||||
+ if (poi != NULL) {
|
||||
+ // The GC supports parallel object iteration.
|
||||
+
|
||||
+ ParHeapInspectTask task(poi, cit, filter);
|
||||
+ // Run task with the active workers.
|
||||
+
|
||||
+ gang->run_task(&task);
|
||||
+
|
||||
+ delete poi;
|
||||
+ if (task.success()) {
|
||||
+ return task.missed_count();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ResourceMark rm;
|
||||
+ // If no parallel iteration available, run serially.
|
||||
RecordInstanceClosure ric(cit, filter);
|
||||
Universe::heap()->safe_object_iterate(&ric);
|
||||
return ric.missed_count();
|
||||
}
|
||||
|
||||
-void HeapInspection::heap_inspection(outputStream* st) {
|
||||
+void HeapInspection::heap_inspection(outputStream* st, uint parallel_thread_num) {
|
||||
ResourceMark rm;
|
||||
|
||||
if (_print_help) {
|
||||
@@ -741,9 +835,9 @@ void HeapInspection::heap_inspection(outputStream* st) {
|
||||
KlassInfoTable cit(_print_class_stats);
|
||||
if (!cit.allocation_failed()) {
|
||||
// populate table with object allocation info
|
||||
- size_t missed_count = populate_table(&cit);
|
||||
+ uintx missed_count = populate_table(&cit, NULL, parallel_thread_num);
|
||||
if (missed_count != 0) {
|
||||
- st->print_cr("WARNING: Ran out of C-heap; undercounted " SIZE_FORMAT
|
||||
+ st->print_cr("WARNING: Ran out of C-heap; undercounted " UINTX_FORMAT
|
||||
" total instances in data below",
|
||||
missed_count);
|
||||
}
|
||||
diff --git a/src/hotspot/share/memory/heapInspection.hpp b/src/hotspot/share/memory/heapInspection.hpp
|
||||
index d8935dc68..026293bf7 100644
|
||||
--- a/src/hotspot/share/memory/heapInspection.hpp
|
||||
+++ b/src/hotspot/share/memory/heapInspection.hpp
|
||||
@@ -25,12 +25,15 @@
|
||||
#ifndef SHARE_VM_MEMORY_HEAPINSPECTION_HPP
|
||||
#define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
|
||||
|
||||
+#include "gc/shared/workgroup.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "oops/objArrayOop.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
#include "oops/annotations.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
+class ParallelObjectIterator;
|
||||
+
|
||||
#if INCLUDE_SERVICES
|
||||
|
||||
|
||||
@@ -261,6 +264,8 @@ class KlassInfoTable: public StackObj {
|
||||
void iterate(KlassInfoClosure* cic);
|
||||
bool allocation_failed() { return _buckets == NULL; }
|
||||
size_t size_of_instances_in_words() const;
|
||||
+ bool merge(KlassInfoTable* table);
|
||||
+ bool merge_entry(const KlassInfoEntry* cie);
|
||||
|
||||
friend class KlassInfoHisto;
|
||||
friend class KlassHierarchy;
|
||||
@@ -364,11 +369,46 @@ class HeapInspection : public StackObj {
|
||||
bool print_class_stats, const char *columns) :
|
||||
_csv_format(csv_format), _print_help(print_help),
|
||||
_print_class_stats(print_class_stats), _columns(columns) {}
|
||||
- void heap_inspection(outputStream* st) NOT_SERVICES_RETURN;
|
||||
- size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0);
|
||||
+ void heap_inspection(outputStream* st, uint parallel_thread_num = 1) NOT_SERVICES_RETURN;
|
||||
+ size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL, uint parallel_thread_num = 1) NOT_SERVICES_RETURN_(0);
|
||||
static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
|
||||
private:
|
||||
void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL);
|
||||
};
|
||||
|
||||
+// Parallel heap inspection task. Parallel inspection can fail due to
|
||||
+// a native OOM when allocating memory for TL-KlassInfoTable.
|
||||
+// _success will be set false on an OOM, and serial inspection tried.
|
||||
+class ParHeapInspectTask : public AbstractGangTask {
|
||||
+private:
|
||||
+ ParallelObjectIterator *_poi;
|
||||
+ KlassInfoTable *_shared_cit;
|
||||
+ BoolObjectClosure *_filter;
|
||||
+ uintx _missed_count;
|
||||
+ bool _success;
|
||||
+ Mutex _mutex;
|
||||
+
|
||||
+public:
|
||||
+ ParHeapInspectTask(ParallelObjectIterator *poi,
|
||||
+ KlassInfoTable *shared_cit,
|
||||
+ BoolObjectClosure *filter) :
|
||||
+ AbstractGangTask("Iterating heap"),
|
||||
+ _poi(poi),
|
||||
+ _shared_cit(shared_cit),
|
||||
+ _filter(filter),
|
||||
+ _missed_count(0),
|
||||
+ _success(true),
|
||||
+ _mutex(Mutex::leaf, "Parallel heap iteration data merge lock") {}
|
||||
+
|
||||
+ uintx missed_count() const {
|
||||
+ return _missed_count;
|
||||
+ }
|
||||
+
|
||||
+ bool success() {
|
||||
+ return _success;
|
||||
+ }
|
||||
+
|
||||
+ virtual void work(uint worker_id);
|
||||
+};
|
||||
+
|
||||
#endif // SHARE_VM_MEMORY_HEAPINSPECTION_HPP
|
||||
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
|
||||
index bd439aab0..9827a4c66 100644
|
||||
--- a/src/hotspot/share/runtime/arguments.hpp
|
||||
+++ b/src/hotspot/share/runtime/arguments.hpp
|
||||
@@ -450,12 +450,6 @@ class Arguments : AllStatic {
|
||||
static ArgsRange check_memory_size(julong size, julong min_size, julong max_size);
|
||||
static ArgsRange parse_memory_size(const char* s, julong* long_arg,
|
||||
julong min_size, julong max_size = max_uintx);
|
||||
- // Parse a string for a unsigned integer. Returns true if value
|
||||
- // is an unsigned integer greater than or equal to the minimum
|
||||
- // parameter passed and returns the value in uintx_arg. Returns
|
||||
- // false otherwise, with uintx_arg undefined.
|
||||
- static bool parse_uintx(const char* value, uintx* uintx_arg,
|
||||
- uintx min_size);
|
||||
|
||||
// methods to build strings from individual args
|
||||
static void build_jvm_args(const char* arg);
|
||||
@@ -493,6 +487,12 @@ class Arguments : AllStatic {
|
||||
public:
|
||||
// Parses the arguments, first phase
|
||||
static jint parse(const JavaVMInitArgs* args);
|
||||
+ // Parse a string for a unsigned integer. Returns true if value
|
||||
+ // is an unsigned integer greater than or equal to the minimum
|
||||
+ // parameter passed and returns the value in uintx_arg. Returns
|
||||
+ // false otherwise, with uintx_arg undefined.
|
||||
+ static bool parse_uintx(const char* value, uintx* uintx_arg,
|
||||
+ uintx min_size);
|
||||
// Apply ergonomics
|
||||
static jint apply_ergo();
|
||||
// Adjusts the arguments after the OS have adjusted the arguments
|
||||
diff --git a/src/hotspot/share/services/attachListener.cpp b/src/hotspot/share/services/attachListener.cpp
|
||||
index fc77970a0..b0f3b2e87 100644
|
||||
--- a/src/hotspot/share/services/attachListener.cpp
|
||||
+++ b/src/hotspot/share/services/attachListener.cpp
|
||||
@@ -258,9 +258,11 @@ jint dump_heap(AttachOperation* op, outputStream* out) {
|
||||
//
|
||||
// Input arguments :-
|
||||
// arg0: "-live" or "-all"
|
||||
+// arg1: parallel thread number
|
||||
static jint heap_inspection(AttachOperation* op, outputStream* out) {
|
||||
bool live_objects_only = true; // default is true to retain the behavior before this change is made
|
||||
const char* arg0 = op->arg(0);
|
||||
+ uint parallel_thread_num = MAX2<uint>(1, (uint)os::initial_active_processor_count() * 3 / 8);
|
||||
if (arg0 != NULL && (strlen(arg0) > 0)) {
|
||||
if (strcmp(arg0, "-all") != 0 && strcmp(arg0, "-live") != 0) {
|
||||
out->print_cr("Invalid argument to inspectheap operation: %s", arg0);
|
||||
@@ -268,7 +270,18 @@ static jint heap_inspection(AttachOperation* op, outputStream* out) {
|
||||
}
|
||||
live_objects_only = strcmp(arg0, "-live") == 0;
|
||||
}
|
||||
- VM_GC_HeapInspection heapop(out, live_objects_only /* request full gc */);
|
||||
+
|
||||
+ const char* num_str = op->arg(1);
|
||||
+ if (num_str != NULL && num_str[0] != '\0') {
|
||||
+ uintx num;
|
||||
+ if (!Arguments::parse_uintx(num_str, &num, 0)) {
|
||||
+ out->print_cr("Invalid parallel thread number: [%s]", num_str);
|
||||
+ return JNI_ERR;
|
||||
+ }
|
||||
+ parallel_thread_num = num == 0 ? parallel_thread_num : (uint)num;
|
||||
+ }
|
||||
+
|
||||
+ VM_GC_HeapInspection heapop(out, live_objects_only /* request full gc */, parallel_thread_num);
|
||||
VMThread::execute(&heapop);
|
||||
return JNI_OK;
|
||||
}
|
||||
diff --git a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
|
||||
index f2db61ab7..9af74f362 100644
|
||||
--- a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
|
||||
+++ b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
|
||||
@@ -149,18 +149,28 @@ public class JMap {
|
||||
throws AttachNotSupportedException, IOException,
|
||||
UnsupportedEncodingException {
|
||||
String liveopt = "-all";
|
||||
- if (options.equals("") || options.equals("all")) {
|
||||
- // pass
|
||||
- }
|
||||
- else if (options.equals("live")) {
|
||||
- liveopt = "-live";
|
||||
- }
|
||||
- else {
|
||||
- usage(1);
|
||||
+ String parallel = null;
|
||||
+ String subopts[] = options.split(",");
|
||||
+
|
||||
+ for (int i = 0; i < subopts.length; i++) {
|
||||
+ String subopt = subopts[i];
|
||||
+ if (subopt.equals("") || subopt.equals("all")) {
|
||||
+ // pass
|
||||
+ } else if (subopt.equals("live")) {
|
||||
+ liveopt = "-live";
|
||||
+ } else if (subopt.startsWith("parallel=")) {
|
||||
+ parallel = subopt.substring("parallel=".length());
|
||||
+ if (parallel == null) {
|
||||
+ System.err.println("Fail: no number provided in option: '" + subopt + "'");
|
||||
+ System.exit(1);
|
||||
+ }
|
||||
+ } else {
|
||||
+ usage(1);
|
||||
+ }
|
||||
}
|
||||
|
||||
// inspectHeap is not the same as jcmd GC.class_histogram
|
||||
- executeCommandForPid(pid, "inspectheap", liveopt);
|
||||
+ executeCommandForPid(pid, "inspectheap", liveopt, parallel);
|
||||
}
|
||||
|
||||
private static void dump(String pid, String options)
|
||||
@@ -246,9 +256,8 @@ public class JMap {
|
||||
System.err.println(" to connect to running process and print class loader statistics");
|
||||
System.err.println(" jmap -finalizerinfo <pid>");
|
||||
System.err.println(" to connect to running process and print information on objects awaiting finalization");
|
||||
- System.err.println(" jmap -histo[:live] <pid>");
|
||||
+ System.err.println(" jmap -histo:<histo-options> <pid>");
|
||||
System.err.println(" to connect to running process and print histogram of java object heap");
|
||||
- System.err.println(" if the \"live\" suboption is specified, only count live objects");
|
||||
System.err.println(" jmap -dump:<dump-options> <pid>");
|
||||
System.err.println(" to connect to running process and dump java heap");
|
||||
System.err.println(" jmap -? -h --help");
|
||||
@@ -261,6 +270,16 @@ public class JMap {
|
||||
System.err.println(" file=<file> dump heap to <file>");
|
||||
System.err.println("");
|
||||
System.err.println(" Example: jmap -dump:live,format=b,file=heap.bin <pid>");
|
||||
+ System.err.println("");
|
||||
+ System.err.println(" histo-options:");
|
||||
+ System.err.println(" live count only live objects");
|
||||
+ System.err.println(" all count all objects in the heap (default if one of \"live\" or \"all\" is not specified)");
|
||||
+ System.err.println(" parallel=<number> parallel threads number for heap iteration:");
|
||||
+ System.err.println(" parallel=0 default behavior, use predefined number of threads");
|
||||
+ System.err.println(" parallel=1 disable parallel heap iteration");
|
||||
+ System.err.println(" parallel=<N> use N threads for parallel heap iteration");
|
||||
+ System.err.println("");
|
||||
+ System.err.println(" Example: jmap -histo:live,parallel=2 <pid>");
|
||||
System.exit(exit);
|
||||
}
|
||||
}
|
||||
diff --git a/test/jdk/sun/tools/jmap/BasicJMapTest.java b/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
index c0432dede..960705e24 100644
|
||||
--- a/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
+++ b/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
@@ -45,6 +45,35 @@ import jdk.testlibrary.ProcessTools;
|
||||
* @build jdk.test.lib.hprof.util.*
|
||||
* @run main/timeout=240 BasicJMapTest
|
||||
*/
|
||||
+
|
||||
+/*
|
||||
+ * @test id=Parallel
|
||||
+ * @summary Unit test for jmap utility (Parallel GC)
|
||||
+ * @key intermittent
|
||||
+ * @library /lib/testlibrary
|
||||
+ * @library /test/lib
|
||||
+ * @build jdk.testlibrary.*
|
||||
+ * @build jdk.test.lib.hprof.*
|
||||
+ * @build jdk.test.lib.hprof.model.*
|
||||
+ * @build jdk.test.lib.hprof.parser.*
|
||||
+ * @build jdk.test.lib.hprof.util.*
|
||||
+ * @run main/othervm/timeout=240 -XX:+UseParallelGC BasicJMapTest
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * @test id=G1
|
||||
+ * @summary Unit test for jmap utility (G1 GC)
|
||||
+ * @key intermittent
|
||||
+ * @library /lib/testlibrary
|
||||
+ * @library /test/lib
|
||||
+ * @build jdk.testlibrary.*
|
||||
+ * @build jdk.test.lib.hprof.*
|
||||
+ * @build jdk.test.lib.hprof.model.*
|
||||
+ * @build jdk.test.lib.hprof.parser.*
|
||||
+ * @build jdk.test.lib.hprof.util.*
|
||||
+ * @run main/othervm/timeout=240 -XX:+UseG1GC BasicJMapTest
|
||||
+ */
|
||||
+
|
||||
public class BasicJMapTest {
|
||||
|
||||
private static ProcessBuilder processBuilder = new ProcessBuilder();
|
||||
@@ -68,6 +97,32 @@ public class BasicJMapTest {
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
+ private static void testHistoParallelZero() throws Exception {
|
||||
+ OutputAnalyzer output = jmap("-histo:parallel=0");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ }
|
||||
+
|
||||
+ private static void testHistoParallel() throws Exception {
|
||||
+ OutputAnalyzer output = jmap("-histo:parallel=2");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ }
|
||||
+
|
||||
+ private static void testHistoNonParallel() throws Exception {
|
||||
+ OutputAnalyzer output = jmap("-histo:parallel=1");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ }
|
||||
+
|
||||
+ private static void testHistoMultipleParameters() throws Exception {
|
||||
+ OutputAnalyzer output = jmap("-histo:parallel=2,live");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ output = jmap("-histo:live,parallel=2");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ output = jmap("-histo:parallel=2,all");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ output = jmap("-histo:all,parallel=2");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ }
|
||||
+
|
||||
private static void testFinalizerInfo() throws Exception {
|
||||
OutputAnalyzer output = jmap("-finalizerinfo");
|
||||
output.shouldHaveExitValue(0);
|
||||
--
|
||||
2.19.0
|
||||
|
||||
@ -2818,39 +2818,10 @@ index 50c0c2d..05ec9fa 100644
|
||||
case Op_LoadS:
|
||||
case Op_LoadKlass:
|
||||
diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp
|
||||
index 641c829..6aff3d5 100644
|
||||
index 5454d1350..d7eb3996b 100644
|
||||
--- a/src/hotspot/share/opto/loopnode.cpp
|
||||
+++ b/src/hotspot/share/opto/loopnode.cpp
|
||||
@@ -990,7 +990,7 @@ void LoopNode::verify_strip_mined(int expect_skeleton) const {
|
||||
wq.push(u);
|
||||
bool found_sfpt = false;
|
||||
for (uint next = 0; next < wq.size() && !found_sfpt; next++) {
|
||||
- Node *n = wq.at(next);
|
||||
+ Node* n = wq.at(next);
|
||||
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax && !found_sfpt; i++) {
|
||||
Node* u = n->fast_out(i);
|
||||
if (u == sfpt) {
|
||||
@@ -1004,6 +1004,19 @@ void LoopNode::verify_strip_mined(int expect_skeleton) const {
|
||||
assert(found_sfpt, "no node in loop that's not input to safepoint");
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (UseZGC && !inner_out->in(0)->is_CountedLoopEnd()) {
|
||||
+ // In some very special cases there can be a load that has no other uses than the
|
||||
+ // counted loop safepoint. Then its loadbarrier will be placed between the inner
|
||||
+ // loop exit and the safepoint. This is very rare
|
||||
+
|
||||
+ Node* ifnode = inner_out->in(1)->in(0);
|
||||
+ // Region->IfTrue->If == Region->Iffalse->If
|
||||
+ if (ifnode == inner_out->in(2)->in(0)) {
|
||||
+ inner_out = ifnode->in(0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
CountedLoopEndNode* cle = inner_out->in(0)->as_CountedLoopEnd();
|
||||
assert(cle == inner->loopexit_or_null(), "mismatch");
|
||||
bool has_skeleton = outer_le->in(1)->bottom_type()->singleton() && outer_le->in(1)->bottom_type()->is_int()->get_con() == 0;
|
||||
@@ -2729,7 +2742,7 @@ bool PhaseIdealLoop::process_expensive_nodes() {
|
||||
@@ -2762,7 +2762,7 @@ bool PhaseIdealLoop::only_has_infinite_loops() {
|
||||
//----------------------------build_and_optimize-------------------------------
|
||||
// Create a PhaseLoop. Build the ideal Loop tree. Map each Ideal Node to
|
||||
// its corresponding LoopNode. If 'optimize' is true, do some loop cleanups.
|
||||
@ -2859,7 +2830,7 @@ index 641c829..6aff3d5 100644
|
||||
bool do_split_ifs = (mode == LoopOptsDefault || mode == LoopOptsLastRound);
|
||||
bool skip_loop_opts = (mode == LoopOptsNone);
|
||||
#if INCLUDE_SHENANDOAHGC
|
||||
@@ -2800,7 +2813,8 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
@@ -2840,7 +2840,8 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
}
|
||||
|
||||
// Nothing to do, so get out
|
||||
@ -2869,7 +2840,7 @@ index 641c829..6aff3d5 100644
|
||||
bool do_expensive_nodes = C->should_optimize_expensive_nodes(_igvn);
|
||||
if (stop_early && !do_expensive_nodes) {
|
||||
_igvn.optimize(); // Cleanup NeverBranches
|
||||
@@ -2892,9 +2906,7 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
@@ -2932,9 +2933,7 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
build_loop_late( visited, worklist, nstack );
|
||||
|
||||
if (_verify_only) {
|
||||
@ -2880,19 +2851,19 @@ index 641c829..6aff3d5 100644
|
||||
assert(C->unique() == unique, "verification mode made Nodes? ? ?");
|
||||
assert(_igvn._worklist.size() == orig_worklist_size, "shouldn't push anything");
|
||||
return;
|
||||
@@ -2938,10 +2950,7 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
@@ -2977,10 +2976,7 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
#endif
|
||||
|
||||
if (skip_loop_opts) {
|
||||
// restore major progress flag
|
||||
- // restore major progress flag
|
||||
- for (int i = 0; i < old_progress; i++) {
|
||||
- C->set_major_progress();
|
||||
- }
|
||||
-
|
||||
+ C->restore_major_progress(old_progress);
|
||||
|
||||
// Cleanup any modified bits
|
||||
_igvn.optimize();
|
||||
|
||||
@@ -2961,6 +2970,16 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
@@ -3001,6 +2997,16 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2909,7 +2880,7 @@ index 641c829..6aff3d5 100644
|
||||
if (ReassociateInvariants) {
|
||||
// Reassociate invariants and prep for split_thru_phi
|
||||
for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) {
|
||||
@@ -3127,8 +3146,7 @@ void PhaseIdealLoop::verify() const {
|
||||
@@ -3167,8 +3173,7 @@ void PhaseIdealLoop::verify() const {
|
||||
_ltree_root->verify_tree(loop_verify._ltree_root, NULL);
|
||||
// Reset major-progress. It was cleared by creating a verify version of
|
||||
// PhaseIdealLoop.
|
||||
@ -2919,7 +2890,7 @@ index 641c829..6aff3d5 100644
|
||||
}
|
||||
|
||||
//------------------------------verify_compare---------------------------------
|
||||
@@ -4256,7 +4274,6 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) {
|
||||
@@ -4296,7 +4301,6 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) {
|
||||
case Op_LoadS:
|
||||
case Op_LoadP:
|
||||
case Op_LoadBarrierSlowReg:
|
||||
|
||||
523
8231441-1-AArch64-Initial-SVE-backend-support.patch
Executable file
523
8231441-1-AArch64-Initial-SVE-backend-support.patch
Executable file
@ -0,0 +1,523 @@
|
||||
diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
|
||||
index 0824ca393..228b82660 100644
|
||||
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
|
||||
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
|
||||
@@ -2670,15 +2670,28 @@ public:
|
||||
#undef INSN
|
||||
|
||||
void ext(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm, int index)
|
||||
- {
|
||||
- starti;
|
||||
- assert(T == T8B || T == T16B, "invalid arrangement");
|
||||
- assert((T == T8B && index <= 0b0111) || (T == T16B && index <= 0b1111), "Invalid index value");
|
||||
- f(0, 31), f((int)T & 1, 30), f(0b101110000, 29, 21);
|
||||
- rf(Vm, 16), f(0, 15), f(index, 14, 11);
|
||||
- f(0, 10), rf(Vn, 5), rf(Vd, 0);
|
||||
+{
|
||||
+ starti;
|
||||
+ assert(T == T8B || T == T16B, "invalid arrangement");
|
||||
+ assert((T == T8B && index <= 0b0111) || (T == T16B && index <= 0b1111), "Invalid index value");
|
||||
+ f(0, 31), f((int)T & 1, 30), f(0b101110000, 29, 21);
|
||||
+ rf(Vm, 16), f(0, 15), f(index, 14, 11);
|
||||
+ f(0, 10), rf(Vn, 5), rf(Vd, 0);
|
||||
+}
|
||||
+
|
||||
+// SVE inc/dec register by element count
|
||||
+#define INSN(NAME, op) \
|
||||
+ void NAME(Register Xdn, SIMD_RegVariant T, unsigned imm4 = 1, int pattern = 0b11111) { \
|
||||
+ starti; \
|
||||
+ assert(T != Q, "invalid size"); \
|
||||
+ f(0b00000100,31, 24), f(T, 23, 22), f(0b11, 21, 20); \
|
||||
+ f(imm4 - 1, 19, 16), f(0b11100, 15, 11), f(op, 10), f(pattern, 9, 5), rf(Xdn, 0); \
|
||||
}
|
||||
|
||||
+ INSN(sve_inc, 0);
|
||||
+ INSN(sve_dec, 1);
|
||||
+#undef INSN
|
||||
+
|
||||
Assembler(CodeBuffer* code) : AbstractAssembler(code) {
|
||||
}
|
||||
|
||||
diff --git a/src/hotspot/cpu/aarch64/globals_aarch64.hpp b/src/hotspot/cpu/aarch64/globals_aarch64.hpp
|
||||
index 071845e5b..f26ea2a8b 100644
|
||||
--- a/src/hotspot/cpu/aarch64/globals_aarch64.hpp
|
||||
+++ b/src/hotspot/cpu/aarch64/globals_aarch64.hpp
|
||||
@@ -112,6 +112,9 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
||||
"Avoid generating unaligned memory accesses") \
|
||||
product(bool, UseLSE, false, \
|
||||
"Use LSE instructions") \
|
||||
+ product(uint, UseSVE, 0, \
|
||||
+ "Highest supported SVE instruction set version") \
|
||||
+ range(0, 2) \
|
||||
product(bool, UseBlockZeroing, true, \
|
||||
"Use DC ZVA for block zeroing") \
|
||||
product(intx, BlockZeroingLowLimit, 256, \
|
||||
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
|
||||
index aecab30c1..5d10c08a6 100644
|
||||
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
|
||||
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
|
||||
@@ -5879,3 +5879,14 @@ void MacroAssembler::get_thread(Register dst) {
|
||||
|
||||
pop(saved_regs, sp);
|
||||
}
|
||||
+
|
||||
+void MacroAssembler::verify_sve_vector_length() {
|
||||
+ Label verify_ok;
|
||||
+ assert(UseSVE > 0, "should only be used for SVE");
|
||||
+ movw(rscratch1, zr);
|
||||
+ sve_inc(rscratch1, B);
|
||||
+ subsw(zr, rscratch1, VM_Version::get_initial_sve_vector_length());
|
||||
+ br(EQ, verify_ok);
|
||||
+ stop("Error: SVE vector length has changed since jvm startup");
|
||||
+ bind(verify_ok);
|
||||
+}
|
||||
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
|
||||
index 85fdc0c88..1e7a7401f 100644
|
||||
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
|
||||
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
|
||||
@@ -938,6 +938,7 @@ public:
|
||||
|
||||
Address argument_address(RegisterOrConstant arg_slot, int extra_slot_offset = 0);
|
||||
|
||||
+ void verify_sve_vector_length();
|
||||
|
||||
// Debugging
|
||||
|
||||
diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
|
||||
index 3d3cc3a1e..dbad48582 100644
|
||||
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
|
||||
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
|
||||
@@ -1829,6 +1829,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
__ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
|
||||
}
|
||||
|
||||
+ if (UseSVE > 0) {
|
||||
+ // Make sure that jni code does not change SVE vector length.
|
||||
+ __ verify_sve_vector_length();
|
||||
+ }
|
||||
+
|
||||
// check for safepoint operation in progress and/or pending suspend requests
|
||||
Label safepoint_in_progress, safepoint_in_progress_done;
|
||||
{
|
||||
diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
|
||||
index 03d7a6e2d..42f301531 100644
|
||||
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
|
||||
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
|
||||
@@ -1377,6 +1377,11 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ push(dtos);
|
||||
__ push(ltos);
|
||||
|
||||
+ if (UseSVE > 0) {
|
||||
+ // Make sure that jni code does not change SVE vector length.
|
||||
+ __ verify_sve_vector_length();
|
||||
+ }
|
||||
+
|
||||
// change thread state
|
||||
__ mov(rscratch1, _thread_in_native_trans);
|
||||
__ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
|
||||
diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
|
||||
index 0136f24f4..f9696fd08 100644
|
||||
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
|
||||
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
|
||||
@@ -40,6 +40,7 @@ int VM_Version::_model2;
|
||||
int VM_Version::_variant;
|
||||
int VM_Version::_revision;
|
||||
int VM_Version::_stepping;
|
||||
+int VM_Version::_initial_sve_vector_length;
|
||||
|
||||
int VM_Version::_zva_length;
|
||||
int VM_Version::_dcache_line_size;
|
||||
@@ -177,6 +178,8 @@ void VM_Version::initialize() {
|
||||
if (_features & CPU_SHA1) strcat(buf, ", sha1");
|
||||
if (_features & CPU_SHA2) strcat(buf, ", sha256");
|
||||
if (_features & CPU_LSE) strcat(buf, ", lse");
|
||||
+ if (_features & CPU_SVE) strcat(buf, ", sve");
|
||||
+ if (_features & CPU_SVE2) strcat(buf, ", sve2");
|
||||
|
||||
_features_string = os::strdup(buf);
|
||||
|
||||
@@ -312,6 +315,18 @@ void VM_Version::initialize() {
|
||||
FLAG_SET_DEFAULT(UseBlockZeroing, false);
|
||||
}
|
||||
|
||||
+ if (_features & CPU_SVE) {
|
||||
+ if (FLAG_IS_DEFAULT(UseSVE)) {
|
||||
+ FLAG_SET_DEFAULT(UseSVE, (_features & CPU_SVE2) ? 2 : 1);
|
||||
+ }
|
||||
+ if (UseSVE > 0) {
|
||||
+ _initial_sve_vector_length = get_current_sve_vector_length();
|
||||
+ }
|
||||
+ } else if (UseSVE > 0) {
|
||||
+ warning("UseSVE specified, but not supported on current CPU. Disabling SVE.");
|
||||
+ FLAG_SET_DEFAULT(UseSVE, 0);
|
||||
+ }
|
||||
+
|
||||
// This machine allows unaligned memory accesses
|
||||
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
|
||||
FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
|
||||
@@ -345,6 +360,50 @@ void VM_Version::initialize() {
|
||||
UseMontgomerySquareIntrinsic = true;
|
||||
}
|
||||
|
||||
+ if (UseSVE > 0) {
|
||||
+ if (FLAG_IS_DEFAULT(MaxVectorSize)) {
|
||||
+ MaxVectorSize = _initial_sve_vector_length;
|
||||
+ } else if (MaxVectorSize < 16) {
|
||||
+ warning("SVE does not support vector length less than 16 bytes. Disabling SVE.");
|
||||
+ UseSVE = 0;
|
||||
+ } else if ((MaxVectorSize % 16) == 0 && is_power_of_2(MaxVectorSize)) {
|
||||
+ int new_vl = set_and_get_current_sve_vector_length(MaxVectorSize);
|
||||
+ _initial_sve_vector_length = new_vl;
|
||||
+ // If MaxVectorSize is larger than system largest supported SVE vector length, above prctl()
|
||||
+ // call will set task vector length to the system largest supported value. So, we also update
|
||||
+ // MaxVectorSize to that largest supported value.
|
||||
+ if (new_vl < 0) {
|
||||
+ vm_exit_during_initialization(
|
||||
+ err_msg("Current system does not support SVE vector length for MaxVectorSize: %d",
|
||||
+ (int)MaxVectorSize));
|
||||
+ } else if (new_vl != MaxVectorSize) {
|
||||
+ warning("Current system only supports max SVE vector length %d. Set MaxVectorSize to %d",
|
||||
+ new_vl, new_vl);
|
||||
+ }
|
||||
+ MaxVectorSize = new_vl;
|
||||
+ } else {
|
||||
+ vm_exit_during_initialization(err_msg("Unsupported MaxVectorSize: %d", (int)MaxVectorSize));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (UseSVE == 0) { // NEON
|
||||
+ int min_vector_size = 8;
|
||||
+ int max_vector_size = 16;
|
||||
+ if (!FLAG_IS_DEFAULT(MaxVectorSize)) {
|
||||
+ if (!is_power_of_2(MaxVectorSize)) {
|
||||
+ vm_exit_during_initialization(err_msg("Unsupported MaxVectorSize: %d", (int)MaxVectorSize));
|
||||
+ } else if (MaxVectorSize < min_vector_size) {
|
||||
+ warning("MaxVectorSize must be at least %i on this platform", min_vector_size);
|
||||
+ FLAG_SET_DEFAULT(MaxVectorSize, min_vector_size);
|
||||
+ } else if (MaxVectorSize > max_vector_size) {
|
||||
+ warning("MaxVectorSize must be at most %i on this platform", max_vector_size);
|
||||
+ FLAG_SET_DEFAULT(MaxVectorSize, max_vector_size);
|
||||
+ }
|
||||
+ } else {
|
||||
+ FLAG_SET_DEFAULT(MaxVectorSize, 16);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (FLAG_IS_DEFAULT(OptoScheduling)) {
|
||||
OptoScheduling = true;
|
||||
}
|
||||
diff --git a/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
|
||||
index 5d943ff38..2763c1c6a 100644
|
||||
--- a/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
|
||||
+++ b/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
|
||||
@@ -55,9 +55,35 @@
|
||||
#define HWCAP_ATOMICS (1<<8)
|
||||
#endif
|
||||
|
||||
+#ifndef HWCAP_SVE
|
||||
+#define HWCAP_SVE (1 << 22)
|
||||
+#endif
|
||||
+
|
||||
+#ifndef HWCAP2_SVE2
|
||||
+#define HWCAP2_SVE2 (1 << 1)
|
||||
+#endif
|
||||
+
|
||||
+#ifndef PR_SVE_GET_VL
|
||||
+// For old toolchains which do not have SVE related macros defined.
|
||||
+#define PR_SVE_SET_VL 50
|
||||
+#define PR_SVE_GET_VL 51
|
||||
+#endif
|
||||
+
|
||||
+int VM_Version::get_current_sve_vector_length() {
|
||||
+ assert(_features & CPU_SVE, "should not call this");
|
||||
+ return prctl(PR_SVE_GET_VL);
|
||||
+}
|
||||
+
|
||||
+int VM_Version::set_and_get_current_sve_vector_length(int length) {
|
||||
+ assert(_features & CPU_SVE, "should not call this");
|
||||
+ int new_length = prctl(PR_SVE_SET_VL, length);
|
||||
+ return new_length;
|
||||
+}
|
||||
+
|
||||
void VM_Version::get_os_cpu_info() {
|
||||
|
||||
uint64_t auxv = getauxval(AT_HWCAP);
|
||||
+ unsigned long auxv2 = getauxval(AT_HWCAP2);
|
||||
|
||||
STATIC_ASSERT(CPU_FP == HWCAP_FP);
|
||||
STATIC_ASSERT(CPU_ASIMD == HWCAP_ASIMD);
|
||||
@@ -68,6 +94,8 @@ void VM_Version::get_os_cpu_info() {
|
||||
STATIC_ASSERT(CPU_SHA2 == HWCAP_SHA2);
|
||||
STATIC_ASSERT(CPU_CRC32 == HWCAP_CRC32);
|
||||
STATIC_ASSERT(CPU_LSE == HWCAP_ATOMICS);
|
||||
+ STATIC_ASSERT(CPU_SVE == HWCAP_SVE);
|
||||
+
|
||||
_features = auxv & (
|
||||
HWCAP_FP |
|
||||
HWCAP_ASIMD |
|
||||
@@ -77,7 +105,10 @@ void VM_Version::get_os_cpu_info() {
|
||||
HWCAP_SHA1 |
|
||||
HWCAP_SHA2 |
|
||||
HWCAP_CRC32 |
|
||||
- HWCAP_ATOMICS);
|
||||
+ HWCAP_ATOMICS |
|
||||
+ HWCAP_SVE);
|
||||
+
|
||||
+ if (auxv2 & HWCAP2_SVE2) _features |= CPU_SVE2;
|
||||
|
||||
uint64_t ctr_el0;
|
||||
uint64_t dczid_el0;
|
||||
diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
|
||||
index 643e3d564..82e615241 100644
|
||||
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
|
||||
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
|
||||
@@ -40,6 +40,7 @@ protected:
|
||||
static int _variant;
|
||||
static int _revision;
|
||||
static int _stepping;
|
||||
+ static int _initial_sve_vector_length;
|
||||
|
||||
static int _zva_length;
|
||||
static int _dcache_line_size;
|
||||
@@ -48,6 +49,13 @@ protected:
|
||||
// Read additional info using OS-specific interfaces
|
||||
static void get_os_cpu_info();
|
||||
|
||||
+
|
||||
+ // Sets the SVE length and returns a new actual value or negative on error.
|
||||
+ // If the len is larger than the system largest supported SVE vector length,
|
||||
+ // the function sets the largest supported value.
|
||||
+ static int set_and_get_current_sve_vector_length(int len);
|
||||
+ static int get_current_sve_vector_length();
|
||||
+
|
||||
public:
|
||||
// Initialization
|
||||
static void initialize();
|
||||
@@ -91,6 +99,8 @@ public:
|
||||
CPU_SHA2 = (1<<6),
|
||||
CPU_CRC32 = (1<<7),
|
||||
CPU_LSE = (1<<8),
|
||||
+ CPU_SVE = (1<<22),
|
||||
+ CPU_SVE2 = (1<<28),
|
||||
// flags above must follow Linux HWCAP
|
||||
CPU_STXR_PREFETCH= (1 << 29),
|
||||
CPU_A53MAC = (1 << 30),
|
||||
@@ -102,6 +112,7 @@ public:
|
||||
static int cpu_model2() { return _model2; }
|
||||
static int cpu_variant() { return _variant; }
|
||||
static int cpu_revision() { return _revision; }
|
||||
+ static int get_initial_sve_vector_length() { return _initial_sve_vector_length; };
|
||||
|
||||
static bool is_zva_enabled() { return 0 <= _zva_length; }
|
||||
static int zva_length() {
|
||||
diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java
|
||||
new file mode 100644
|
||||
index 000000000..dc15ca800
|
||||
--- /dev/null
|
||||
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestSVEWithJNI.java
|
||||
@@ -0,0 +1,128 @@
|
||||
+/*
|
||||
+* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
+* Copyright (c) 2020, Arm Limited. All rights reserved.
|
||||
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
+*
|
||||
+* This code is free software; you can redistribute it and/or modify it
|
||||
+* under the terms of the GNU General Public License version 2 only, as
|
||||
+* published by the Free Software Foundation.
|
||||
+*
|
||||
+* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
+* version 2 for more details (a copy is included in the LICENSE file that
|
||||
+* accompanied this code).
|
||||
+*
|
||||
+* You should have received a copy of the GNU General Public License version
|
||||
+* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
+* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+*
|
||||
+* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
+* or visit www.oracle.com if you need additional information or have any
|
||||
+* questions.
|
||||
+*
|
||||
+*/
|
||||
+
|
||||
+/**
|
||||
+ * @test
|
||||
+ *
|
||||
+ * @requires os.arch == "aarch64" & vm.compiler2.enabled
|
||||
+ * @summary Verify VM SVE checking behavior
|
||||
+ * @library /test/lib
|
||||
+ * @run main/othervm/native compiler.c2.aarch64.TestSVEWithJNI
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+package compiler.c2.aarch64;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import jdk.test.lib.process.ProcessTools;
|
||||
+import jdk.test.lib.process.OutputAnalyzer;
|
||||
+
|
||||
+public class TestSVEWithJNI {
|
||||
+ static {
|
||||
+ System.loadLibrary("TestSVEWithJNI");
|
||||
+ }
|
||||
+
|
||||
+ static final int EXIT_CODE = 99;
|
||||
+ // Returns a nonnegative on success, or a negative value on error.
|
||||
+ public static native int setVectorLength(int arg);
|
||||
+ // Returns a nonnegative value on success, or a negative value on error.
|
||||
+ public static native int getVectorLength();
|
||||
+
|
||||
+ public static final String MSG = "Current Vector Size: ";
|
||||
+ public static void testNormal() {
|
||||
+ int vlen = getVectorLength();
|
||||
+ System.out.println(MSG + vlen);
|
||||
+ // Should be fine if no vector length changed.
|
||||
+ if (setVectorLength(vlen) < 0) {
|
||||
+ throw new Error("Error in setting vector length.");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void testAbort() {
|
||||
+ int vlen = getVectorLength();
|
||||
+ if (vlen <= 16) {
|
||||
+ throw new Error("Error: unsupported vector length.");
|
||||
+ }
|
||||
+ if (setVectorLength(16) < 0) {
|
||||
+ throw new Error("Error: setting vector length failed.");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static ProcessBuilder createProcessBuilder(String [] args, String mode) {
|
||||
+ List<String> vmopts = new ArrayList<>();
|
||||
+ String testjdkPath = System.getProperty("test.jdk");
|
||||
+ Collections.addAll(vmopts, "-Dtest.jdk=" + testjdkPath);
|
||||
+ Collections.addAll(vmopts, args);
|
||||
+ Collections.addAll(vmopts, TestSVEWithJNI.class.getName(), mode);
|
||||
+ return ProcessTools.createJavaProcessBuilder(vmopts.toArray(new String[vmopts.size()]));
|
||||
+ }
|
||||
+
|
||||
+ public static void main(String [] args) throws Exception {
|
||||
+ if (args.length == 0) {
|
||||
+ int vlen = getVectorLength();
|
||||
+ if (vlen < 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ String [][] testOpts = {
|
||||
+ {"-Xint", "-XX:UseSVE=1"},
|
||||
+ {"-Xcomp", "-XX:UseSVE=1"},
|
||||
+ };
|
||||
+ ProcessBuilder pb;
|
||||
+ OutputAnalyzer output;
|
||||
+ for (String [] opts : testOpts) {
|
||||
+ pb = createProcessBuilder(opts, "normal");
|
||||
+ output = new OutputAnalyzer(pb.start());
|
||||
+ output.shouldHaveExitValue(EXIT_CODE);
|
||||
+
|
||||
+ pb = createProcessBuilder(opts, "abort");
|
||||
+ output = new OutputAnalyzer(pb.start());
|
||||
+ output.shouldNotHaveExitValue(EXIT_CODE);
|
||||
+ output.shouldMatch("(error|Error|ERROR)");
|
||||
+ }
|
||||
+
|
||||
+ // Verify MaxVectorSize
|
||||
+
|
||||
+ // Any SVE architecture should support 128-bit vector size.
|
||||
+ pb = createProcessBuilder(new String []{"-XX:UseSVE=1", "-XX:MaxVectorSize=16"}, "normal");
|
||||
+ output = new OutputAnalyzer(pb.start());
|
||||
+ output.shouldHaveExitValue(EXIT_CODE);
|
||||
+ output.shouldContain(MSG + 16);
|
||||
+
|
||||
+ // An unsupported large vector size value.
|
||||
+ pb = createProcessBuilder(new String []{"-XX:UseSVE=1", "-XX:MaxVectorSize=512"}, "normal");
|
||||
+ output = new OutputAnalyzer(pb.start());
|
||||
+ output.shouldHaveExitValue(EXIT_CODE);
|
||||
+ output.shouldContain("warning");
|
||||
+ } else if (args[0].equals("normal")) {
|
||||
+ testNormal();
|
||||
+ System.exit(EXIT_CODE);
|
||||
+ } else if (args[0].equals("abort")) {
|
||||
+ testAbort();
|
||||
+ System.exit(EXIT_CODE);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/libTestSVEWithJNI.c b/test/hotspot/jtreg/compiler/c2/aarch64/libTestSVEWithJNI.c
|
||||
new file mode 100644
|
||||
index 000000000..0cb3ab0b5
|
||||
--- /dev/null
|
||||
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/libTestSVEWithJNI.c
|
||||
@@ -0,0 +1,68 @@
|
||||
+/*
|
||||
+* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
+* Copyright (c) 2020, Arm Limited. All rights reserved.
|
||||
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
+*
|
||||
+* This code is free software; you can redistribute it and/or modify it
|
||||
+* under the terms of the GNU General Public License version 2 only, as
|
||||
+* published by the Free Software Foundation.
|
||||
+*
|
||||
+* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
+* version 2 for more details (a copy is included in the LICENSE file that
|
||||
+* accompanied this code).
|
||||
+*
|
||||
+* You should have received a copy of the GNU General Public License version
|
||||
+* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
+* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+*
|
||||
+* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
+* or visit www.oracle.com if you need additional information or have any
|
||||
+* questions.
|
||||
+*
|
||||
+*/
|
||||
+
|
||||
+#ifdef __aarch64__
|
||||
+
|
||||
+#include <jni.h>
|
||||
+#include <pthread.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <sys/prctl.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#ifndef PR_SVE_GET_VL
|
||||
+// For old toolchains which do not have SVE related macros defined.
|
||||
+#define PR_SVE_SET_VL 50
|
||||
+#define PR_SVE_GET_VL 51
|
||||
+#endif
|
||||
+
|
||||
+int get_current_thread_vl() {
|
||||
+ return prctl(PR_SVE_GET_VL);
|
||||
+}
|
||||
+
|
||||
+int set_current_thread_vl(unsigned long arg) {
|
||||
+ return prctl(PR_SVE_SET_VL, arg);
|
||||
+}
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+extern "C" {
|
||||
+#endif
|
||||
+
|
||||
+JNIEXPORT jint JNICALL Java_compiler_c2_aarch64_TestSVEWithJNI_setVectorLength
|
||||
+(JNIEnv * env, jclass clz, jint length) {
|
||||
+ return set_current_thread_vl(length);
|
||||
+}
|
||||
+
|
||||
+JNIEXPORT jint JNICALL Java_compiler_c2_aarch64_TestSVEWithJNI_getVectorLength
|
||||
+(JNIEnv *env, jclass clz) {
|
||||
+ return get_current_thread_vl();
|
||||
+}
|
||||
+
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
2.19.0
|
||||
|
||||
2201
8231441-2-AArch64-Initial-SVE-backend-support.patch
Executable file
2201
8231441-2-AArch64-Initial-SVE-backend-support.patch
Executable file
File diff suppressed because it is too large
Load Diff
6217
8231441-3-AArch64-Initial-SVE-backend-support.patch
Executable file
6217
8231441-3-AArch64-Initial-SVE-backend-support.patch
Executable file
File diff suppressed because it is too large
Load Diff
266
8252103-support-Jmap-parallel-heap-inspection.patch
Executable file
266
8252103-support-Jmap-parallel-heap-inspection.patch
Executable file
@ -0,0 +1,266 @@
|
||||
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
index 820b4bef9..db5c41cd3 100644
|
||||
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
@@ -525,6 +525,72 @@ void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
|
||||
}
|
||||
|
||||
|
||||
+// The HeapBlockClaimer is used during parallel iteration over the heap,
|
||||
+// allowing workers to claim heap areas ("blocks"), gaining exclusive rights to these.
|
||||
+// The eden and survivor spaces are treated as single blocks as it is hard to divide
|
||||
+// these spaces.
|
||||
+// The old space is divided into fixed-size blocks.
|
||||
+class HeapBlockClaimer : public StackObj {
|
||||
+ size_t _claimed_index;
|
||||
+
|
||||
+public:
|
||||
+ static const size_t InvalidIndex = SIZE_MAX;
|
||||
+ static const size_t EdenIndex = 0;
|
||||
+ static const size_t SurvivorIndex = 1;
|
||||
+ static const size_t NumNonOldGenClaims = 2;
|
||||
+
|
||||
+ HeapBlockClaimer() : _claimed_index(EdenIndex) { }
|
||||
+ // Claim the block and get the block index.
|
||||
+ size_t claim_and_get_block() {
|
||||
+ size_t block_index;
|
||||
+ block_index = Atomic::add(1u, &_claimed_index) - 1;
|
||||
+
|
||||
+ PSOldGen* old_gen = ParallelScavengeHeap::heap()->old_gen();
|
||||
+ size_t num_claims = old_gen->num_iterable_blocks() + NumNonOldGenClaims;
|
||||
+
|
||||
+ return block_index < num_claims ? block_index : InvalidIndex;
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+void ParallelScavengeHeap::object_iterate_parallel(ObjectClosure* cl,
|
||||
+ HeapBlockClaimer* claimer) {
|
||||
+ size_t block_index = claimer->claim_and_get_block();
|
||||
+ // Iterate until all blocks are claimed
|
||||
+ if (block_index == HeapBlockClaimer::EdenIndex) {
|
||||
+ young_gen()->eden_space()->object_iterate(cl);
|
||||
+ block_index = claimer->claim_and_get_block();
|
||||
+ }
|
||||
+ if (block_index == HeapBlockClaimer::SurvivorIndex) {
|
||||
+ young_gen()->from_space()->object_iterate(cl);
|
||||
+ young_gen()->to_space()->object_iterate(cl);
|
||||
+ block_index = claimer->claim_and_get_block();
|
||||
+ }
|
||||
+ while (block_index != HeapBlockClaimer::InvalidIndex) {
|
||||
+ old_gen()->object_iterate_block(cl, block_index - HeapBlockClaimer::NumNonOldGenClaims);
|
||||
+ block_index = claimer->claim_and_get_block();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+class PSScavengeParallelObjectIterator : public ParallelObjectIterator {
|
||||
+private:
|
||||
+ ParallelScavengeHeap* _heap;
|
||||
+ HeapBlockClaimer _claimer;
|
||||
+
|
||||
+public:
|
||||
+ PSScavengeParallelObjectIterator() :
|
||||
+ _heap(ParallelScavengeHeap::heap()),
|
||||
+ _claimer() {}
|
||||
+
|
||||
+ virtual void object_iterate(ObjectClosure* cl, uint worker_id) {
|
||||
+ _heap->object_iterate_parallel(cl, &_claimer);
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+ParallelObjectIterator* ParallelScavengeHeap::parallel_object_iterator(uint thread_num) {
|
||||
+ return new PSScavengeParallelObjectIterator();
|
||||
+}
|
||||
+
|
||||
+
|
||||
HeapWord* ParallelScavengeHeap::block_start(const void* addr) const {
|
||||
if (young_gen()->is_in_reserved(addr)) {
|
||||
assert(young_gen()->is_in(addr),
|
||||
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
index 82aeba67a..b7c481949 100644
|
||||
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
|
||||
@@ -44,6 +44,7 @@
|
||||
class AdjoiningGenerations;
|
||||
class GCHeapSummary;
|
||||
class GCTaskManager;
|
||||
+class HeapBlockClaimer;
|
||||
class MemoryManager;
|
||||
class MemoryPool;
|
||||
class PSAdaptiveSizePolicy;
|
||||
@@ -80,6 +81,8 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
MemoryPool* _survivor_pool;
|
||||
MemoryPool* _old_pool;
|
||||
|
||||
+ WorkGang _workers;
|
||||
+
|
||||
virtual void initialize_serviceability();
|
||||
|
||||
void trace_heap(GCWhen::Type when, const GCTracer* tracer);
|
||||
@@ -94,7 +97,20 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
|
||||
public:
|
||||
ParallelScavengeHeap(GenerationSizer* policy) :
|
||||
- CollectedHeap(), _collector_policy(policy), _death_march_count(0) { }
|
||||
+ CollectedHeap(),
|
||||
+ _collector_policy(policy),
|
||||
+ _death_march_count(0),
|
||||
+ _young_manager(NULL),
|
||||
+ _old_manager(NULL),
|
||||
+ _eden_pool(NULL),
|
||||
+ _survivor_pool(NULL),
|
||||
+ _old_pool(NULL),
|
||||
+ _workers("GC Thread",
|
||||
+ ParallelGCThreads,
|
||||
+ true /* are_GC_task_threads */,
|
||||
+ false /* are_ConcurrentGC_threads */) {
|
||||
+ _workers.initialize_workers();
|
||||
+ }
|
||||
|
||||
// For use by VM operations
|
||||
enum CollectionType {
|
||||
@@ -218,6 +234,8 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
|
||||
void object_iterate(ObjectClosure* cl);
|
||||
void safe_object_iterate(ObjectClosure* cl) { object_iterate(cl); }
|
||||
+ void object_iterate_parallel(ObjectClosure* cl, HeapBlockClaimer* claimer);
|
||||
+ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num);
|
||||
|
||||
HeapWord* block_start(const void* addr) const;
|
||||
size_t block_size(const HeapWord* addr) const;
|
||||
@@ -232,6 +250,7 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
virtual void print_gc_threads_on(outputStream* st) const;
|
||||
virtual void gc_threads_do(ThreadClosure* tc) const;
|
||||
virtual void print_tracing_info() const;
|
||||
+ virtual WorkGang* get_safepoint_workers() { return &_workers; }
|
||||
|
||||
void verify(VerifyOption option /* ignored */);
|
||||
|
||||
diff --git a/src/hotspot/share/gc/parallel/psOldGen.cpp b/src/hotspot/share/gc/parallel/psOldGen.cpp
|
||||
index 486bb7c87..830b1b758 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psOldGen.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psOldGen.cpp
|
||||
@@ -213,6 +213,38 @@ HeapWord* PSOldGen::allocate(size_t word_size) {
|
||||
return res;
|
||||
}
|
||||
|
||||
+size_t PSOldGen::num_iterable_blocks() const {
|
||||
+ return (object_space()->used_in_bytes() + IterateBlockSize - 1) / IterateBlockSize;
|
||||
+}
|
||||
+
|
||||
+void PSOldGen::object_iterate_block(ObjectClosure* cl, size_t block_index) {
|
||||
+ size_t block_word_size = IterateBlockSize / HeapWordSize;
|
||||
+ assert((block_word_size % (ObjectStartArray::block_size)) == 0,
|
||||
+ "Block size not a multiple of start_array block");
|
||||
+
|
||||
+ MutableSpace *space = object_space();
|
||||
+
|
||||
+ HeapWord* begin = space->bottom() + block_index * block_word_size;
|
||||
+ HeapWord* end = MIN2(space->top(), begin + block_word_size);
|
||||
+
|
||||
+ if (!start_array()->object_starts_in_range(begin, end)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Get object starting at or reaching into this block.
|
||||
+ HeapWord* start = start_array()->object_start(begin);
|
||||
+ if (start < begin) {
|
||||
+ start += oop(start)->size();
|
||||
+ }
|
||||
+ assert(start >= begin,
|
||||
+ "Object address" PTR_FORMAT " must be larger or equal to block address at " PTR_FORMAT,
|
||||
+ p2i(start), p2i(begin));
|
||||
+ // Iterate all objects until the end.
|
||||
+ for (HeapWord* p = start; p < end; p += oop(p)->size()) {
|
||||
+ cl->do_object(oop(p));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
|
||||
expand(word_size*HeapWordSize);
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
diff --git a/src/hotspot/share/gc/parallel/psOldGen.hpp b/src/hotspot/share/gc/parallel/psOldGen.hpp
|
||||
index fa27f5a04..fa6e4849b 100644
|
||||
--- a/src/hotspot/share/gc/parallel/psOldGen.hpp
|
||||
+++ b/src/hotspot/share/gc/parallel/psOldGen.hpp
|
||||
@@ -59,6 +59,9 @@ class PSOldGen : public CHeapObj<mtGC> {
|
||||
const size_t _min_gen_size;
|
||||
const size_t _max_gen_size;
|
||||
|
||||
+ // Block size for parallel iteration
|
||||
+ static const size_t IterateBlockSize = 1024 * 1024;
|
||||
+
|
||||
// Used when initializing the _name field.
|
||||
static inline const char* select_name();
|
||||
|
||||
@@ -195,6 +198,14 @@ class PSOldGen : public CHeapObj<mtGC> {
|
||||
void oop_iterate(OopIterateClosure* cl) { object_space()->oop_iterate(cl); }
|
||||
void object_iterate(ObjectClosure* cl) { object_space()->object_iterate(cl); }
|
||||
|
||||
+ // Number of blocks to be iterated over in the used part of old gen.
|
||||
+ size_t num_iterable_blocks() const;
|
||||
+ // Iterate the objects starting in block block_index within [bottom, top) of the
|
||||
+ // old gen. The object just reaching into this block is not iterated over.
|
||||
+ // A block is an evenly sized non-overlapping part of the old gen of
|
||||
+ // IterateBlockSize bytes.
|
||||
+ void object_iterate_block(ObjectClosure* cl, size_t block_index);
|
||||
+
|
||||
// Debugging - do not use for time critical operations
|
||||
virtual void print() const;
|
||||
virtual void print_on(outputStream* st) const;
|
||||
diff --git a/test/jdk/sun/tools/jmap/BasicJMapTest.java b/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
index ad890f880..8658e6e5a 100644
|
||||
--- a/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
+++ b/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
@@ -46,6 +46,34 @@ import jdk.testlibrary.ProcessTools;
|
||||
* @run main/timeout=240 BasicJMapTest
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * @test id=Parallel
|
||||
+ * @summary Unit test for jmap utility (Parallel GC)
|
||||
+ * @key intermittent
|
||||
+ * @library /lib/testlibrary
|
||||
+ * @library /test/lib
|
||||
+ * @build jdk.testlibrary.*
|
||||
+ * @build jdk.test.lib.hprof.*
|
||||
+ * @build jdk.test.lib.hprof.model.*
|
||||
+ * @build jdk.test.lib.hprof.parser.*
|
||||
+ * @build jdk.test.lib.hprof.util.*
|
||||
+ * @run main/othervm/timeout=240 -XX:+UseParallelGC BasicJMapTest
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * @test id=G1
|
||||
+ * @summary Unit test for jmap utility (G1 GC)
|
||||
+ * @key intermittent
|
||||
+ * @library /lib/testlibrary
|
||||
+ * @library /test/lib
|
||||
+ * @build jdk.testlibrary.*
|
||||
+ * @build jdk.test.lib.hprof.*
|
||||
+ * @build jdk.test.lib.hprof.model.*
|
||||
+ * @build jdk.test.lib.hprof.parser.*
|
||||
+ * @build jdk.test.lib.hprof.util.*
|
||||
+ * @run main/othervm/timeout=240 -XX:+UseG1GC BasicJMapTest
|
||||
+ */
|
||||
+
|
||||
/*
|
||||
* @test id=CMS
|
||||
* @summary Unit test for jmap utility (CMS GC)
|
||||
@@ -98,6 +126,17 @@ public class BasicJMapTest {
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
+ private static void testHistoMultipleParameters() throws Exception {
|
||||
+ OutputAnalyzer output = jmap("-histo:parallel=2,live");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ output = jmap("-histo:live,parallel=2");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ output = jmap("-histo:parallel=2,all");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ output = jmap("-histo:all,parallel=2");
|
||||
+ output.shouldHaveExitValue(0);
|
||||
+ }
|
||||
+
|
||||
private static void testFinalizerInfo() throws Exception {
|
||||
OutputAnalyzer output = jmap("-finalizerinfo");
|
||||
output.shouldHaveExitValue(0);
|
||||
@ -1,189 +0,0 @@
|
||||
From 417887ac236f58b1ecba79826229295794a3e0be Mon Sep 17 00:00:00 2001
|
||||
From: zhangyipeng <zhangyipeng7@huawei.com>
|
||||
Date: Wed, 15 Dec 2021 18:33:09 +0800
|
||||
Subject: [PATCH 2/2] Delete expired certificate
|
||||
|
||||
DTS/AR: DTS2021112910463
|
||||
Summary: < JDK> : Delete expired certificate
|
||||
LLT: NA
|
||||
Patch Type: huawei
|
||||
Bug url: NA
|
||||
---
|
||||
make/data/cacerts/globalsignr2ca | 29 -------------
|
||||
make/data/cacerts/luxtrustglobalrootca | 28 -------------
|
||||
make/data/cacerts/quovadisrootca | 41 -------------------
|
||||
.../security/lib/cacerts/VerifyCACerts.java | 14 +------
|
||||
4 files changed, 2 insertions(+), 110 deletions(-)
|
||||
delete mode 100644 make/data/cacerts/globalsignr2ca
|
||||
delete mode 100644 make/data/cacerts/luxtrustglobalrootca
|
||||
delete mode 100644 make/data/cacerts/quovadisrootca
|
||||
|
||||
diff --git a/make/data/cacerts/globalsignr2ca b/make/data/cacerts/globalsignr2ca
|
||||
deleted file mode 100644
|
||||
index 746d1fab9..000000000
|
||||
--- a/make/data/cacerts/globalsignr2ca
|
||||
+++ /dev/null
|
||||
@@ -1,29 +0,0 @@
|
||||
-Owner: CN=GlobalSign, O=GlobalSign, OU=GlobalSign Root CA - R2
|
||||
-Issuer: CN=GlobalSign, O=GlobalSign, OU=GlobalSign Root CA - R2
|
||||
-Serial number: 400000000010f8626e60d
|
||||
-Valid from: Fri Dec 15 08:00:00 GMT 2006 until: Wed Dec 15 08:00:00 GMT 2021
|
||||
-Signature algorithm name: SHA1withRSA
|
||||
-Subject Public Key Algorithm: 2048-bit RSA key
|
||||
-Version: 3
|
||||
------BEGIN CERTIFICATE-----
|
||||
-MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G
|
||||
-A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp
|
||||
-Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1
|
||||
-MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG
|
||||
-A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
|
||||
-hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL
|
||||
-v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8
|
||||
-eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq
|
||||
-tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd
|
||||
-C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa
|
||||
-zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB
|
||||
-mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH
|
||||
-V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n
|
||||
-bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG
|
||||
-3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs
|
||||
-J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO
|
||||
-291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS
|
||||
-ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd
|
||||
-AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
|
||||
-TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
|
||||
------END CERTIFICATE-----
|
||||
diff --git a/make/data/cacerts/luxtrustglobalrootca b/make/data/cacerts/luxtrustglobalrootca
|
||||
deleted file mode 100644
|
||||
index 7fb3d818f..000000000
|
||||
--- a/make/data/cacerts/luxtrustglobalrootca
|
||||
+++ /dev/null
|
||||
@@ -1,28 +0,0 @@
|
||||
-Owner: CN=LuxTrust Global Root, O=LuxTrust s.a., C=LU
|
||||
-Issuer: CN=LuxTrust Global Root, O=LuxTrust s.a., C=LU
|
||||
-Serial number: bb8
|
||||
-Valid from: Thu Mar 17 09:51:37 GMT 2011 until: Wed Mar 17 09:51:37 GMT 2021
|
||||
-Signature algorithm name: SHA256withRSA
|
||||
-Subject Public Key Algorithm: 2048-bit RSA key
|
||||
-Version: 3
|
||||
------BEGIN CERTIFICATE-----
|
||||
-MIIDZDCCAkygAwIBAgICC7gwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCTFUx
|
||||
-FjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0IEdsb2Jh
|
||||
-bCBSb290MB4XDTExMDMxNzA5NTEzN1oXDTIxMDMxNzA5NTEzN1owRDELMAkGA1UE
|
||||
-BhMCTFUxFjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0
|
||||
-IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsn+n
|
||||
-QPAiygz267Hxyw6VV0B1r6A/Ps7sqjJX5hmxZ0OYWmt8s7j6eJyqpoSyYBuAQc5j
|
||||
-zR8XCJmk9e8+EsdMsFeaXHhAePxFjdqRZ9w6Ubltc+a3OY52OrQfBfVpVfmTz3iI
|
||||
-Sr6qm9d7R1tGBEyCFqY19vx039a0r9jitScRdFmiwmYsaArhmIiIPIoFdRTjuK7z
|
||||
-CISbasE/MRivJ6VLm6T9eTHemD0OYcqHmMH4ijCc+j4z1aXEAwfh95Z0GAAnOCfR
|
||||
-K6qq4UFFi2/xJcLcopeVx0IUM115hCNq52XAV6DYXaljAeew5Ivo+MVjuOVsdJA9
|
||||
-x3f8K7p56aTGEnin/wIDAQABo2AwXjAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQE
|
||||
-AwIBBjAfBgNVHSMEGDAWgBQXFYWJCS8kh28/HRvk8pZ5g0gTzjAdBgNVHQ4EFgQU
|
||||
-FxWFiQkvJIdvPx0b5PKWeYNIE84wDQYJKoZIhvcNAQELBQADggEBAFrwHNDUUM9B
|
||||
-fua4nX3DcNBeNv9ujnov3kgR1TQuPLdFwlQlp+HBHjeDtpSutkVIA+qVvuucarQ3
|
||||
-XB8u02uCgUNbCj8RVWOs+nwIAjegPDkEM/6XMshS5dklTbDG7mgfcKpzzlcD3H0K
|
||||
-DTPy0lrfCmw7zBFRlxqkIaKFNQLXgCLShLL4wKpov9XrqsMLq6F8K/f1O4fhVFfs
|
||||
-BSTveUJO84ton+Ruy4KZycwq3FPCH3CDqyEPVrRI/98HIrOM+R2mBN8tAza53W/+
|
||||
-MYhm/2xtRDSvCHc+JtJy9LtHVpM8mGPhM7uZI5K1g3noHZ9nrWLWidb2/CfeMifL
|
||||
-hNp3hSGhEiE=
|
||||
------END CERTIFICATE-----
|
||||
diff --git a/make/data/cacerts/quovadisrootca b/make/data/cacerts/quovadisrootca
|
||||
deleted file mode 100644
|
||||
index 0c195ff51..000000000
|
||||
--- a/make/data/cacerts/quovadisrootca
|
||||
+++ /dev/null
|
||||
@@ -1,41 +0,0 @@
|
||||
-Owner: CN=QuoVadis Root Certification Authority, OU=Root Certification Authority, O=QuoVadis Limited, C=BM
|
||||
-Issuer: CN=QuoVadis Root Certification Authority, OU=Root Certification Authority, O=QuoVadis Limited, C=BM
|
||||
-Serial number: 3ab6508b
|
||||
-Valid from: Mon Mar 19 18:33:33 GMT 2001 until: Wed Mar 17 18:33:33 GMT 2021
|
||||
-Signature algorithm name: SHA1withRSA
|
||||
-Subject Public Key Algorithm: 2048-bit RSA key
|
||||
-Version: 3
|
||||
------BEGIN CERTIFICATE-----
|
||||
-MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC
|
||||
-TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0
|
||||
-aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0
|
||||
-aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz
|
||||
-MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw
|
||||
-IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR
|
||||
-dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG
|
||||
-9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp
|
||||
-li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D
|
||||
-rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ
|
||||
-WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug
|
||||
-F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU
|
||||
-xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC
|
||||
-Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv
|
||||
-dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw
|
||||
-ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl
|
||||
-IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh
|
||||
-c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy
|
||||
-ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
|
||||
-Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI
|
||||
-KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T
|
||||
-KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq
|
||||
-y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p
|
||||
-dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD
|
||||
-VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL
|
||||
-MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk
|
||||
-fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8
|
||||
-7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R
|
||||
-cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y
|
||||
-mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW
|
||||
-xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK
|
||||
-SnQ2+Q==
|
||||
------END CERTIFICATE-----
|
||||
diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
|
||||
index 8b8739d33..1b258059f 100644
|
||||
--- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
|
||||
+++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
|
||||
@@ -53,12 +53,12 @@ public class VerifyCACerts {
|
||||
+ File.separator + "security" + File.separator + "cacerts";
|
||||
|
||||
// The numbers of certs now.
|
||||
- private static final int COUNT = 87;
|
||||
+ private static final int COUNT = 84;
|
||||
|
||||
// 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
|
||||
- = "EA:29:DE:36:FD:06:0A:A1:D9:46:0B:DF:E0:B8:E7:16:40:1B:52:3B:5F:0F:58:EE:E0:2A:A9:2A:D7:8D:34:68";
|
||||
+ = "D3:05:21:64:FA:D7:CD:29:E8:CB:57:E7:47:ED:79:9B:47:D8:0E:75:2D:CA:83:BB:86:AF:D9:43:FD:3E:17:85";
|
||||
|
||||
// map of cert alias to SHA-256 fingerprint
|
||||
@SuppressWarnings("serial")
|
||||
@@ -144,10 +144,6 @@ public class VerifyCACerts {
|
||||
"5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE");
|
||||
put("letsencryptisrgx1 [jdk]",
|
||||
"96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6");
|
||||
- put("luxtrustglobalrootca [jdk]",
|
||||
- "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50");
|
||||
- put("quovadisrootca [jdk]",
|
||||
- "A4:5E:DE:3B:BB:F0:9C:8A:E1:5C:72:EF:C0:72:68:D6:93:A2:1C:99:6F:D5:1E:67:CA:07:94:60:FD:6D:88:73");
|
||||
put("quovadisrootca1g3 [jdk]",
|
||||
"8A:86:6F:D1:B2:76:B5:7E:57:8E:92:1C:65:82:8A:2B:ED:58:E9:F2:F2:88:05:41:34:B7:F1:F4:BF:C9:CC:74");
|
||||
put("quovadisrootca2 [jdk]",
|
||||
@@ -210,8 +206,6 @@ public class VerifyCACerts {
|
||||
"17:9F:BC:14:8A:3D:D0:0F:D2:4E:A1:34:58:CC:43:BF:A7:F5:9C:81:82:D7:83:A5:13:F6:EB:EC:10:0C:89:24");
|
||||
put("globalsigneccrootcar4 [jdk]",
|
||||
"BE:C9:49:11:C2:95:56:76:DB:6C:0A:55:09:86:D7:6E:3B:A0:05:66:7C:44:2C:97:62:B4:FB:B7:73:DE:22:8C");
|
||||
- put("globalsignr2ca [jdk]",
|
||||
- "CA:42:DD:41:74:5F:D0:B8:1E:B9:02:36:2C:F9:D8:BF:71:9D:A1:BD:1B:1E:FC:94:6F:5B:4C:99:F4:2C:1B:9E");
|
||||
put("teliasonerarootcav1 [jdk]",
|
||||
"DD:69:36:FE:21:F8:F0:77:C1:23:A1:A5:21:C1:22:24:F7:22:55:B7:3E:03:A7:26:06:93:E8:A2:4B:0F:A3:89");
|
||||
put("globalsignrootcar6 [jdk]",
|
||||
@@ -252,10 +246,6 @@ public class VerifyCACerts {
|
||||
add("addtrustexternalca [jdk]");
|
||||
// Valid until: Sat May 30 10:44:50 GMT 2020
|
||||
add("addtrustqualifiedca [jdk]");
|
||||
- // Valid until: Wed Mar 17 02:51:37 PDT 2021
|
||||
- add("luxtrustglobalrootca [jdk]");
|
||||
- // Valid until: Wed Mar 17 11:33:33 PDT 2021
|
||||
- add("quovadisrootca [jdk]");
|
||||
// Valid until: Wed Dec 15 08:00:00 UTC 2021
|
||||
add("globalsignr2ca [jdk]");
|
||||
}
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -998,44 +998,28 @@ index 279ff79..f9b2b3b 100644
|
||||
void MacroAssembler::verify_heapbase(const char* msg) {
|
||||
#if 0
|
||||
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
|
||||
index af8056b..44497ea 100644
|
||||
index edcfd9ceb..60b728e94 100644
|
||||
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
|
||||
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
|
||||
@@ -440,12 +440,18 @@ private:
|
||||
@@ -462,12 +462,18 @@ private:
|
||||
int push(unsigned int bitset, Register stack);
|
||||
int pop(unsigned int bitset, Register stack);
|
||||
|
||||
|
||||
+ int push_fp(unsigned int bitset, Register stack);
|
||||
+ int pop_fp(unsigned int bitset, Register stack);
|
||||
+
|
||||
void mov(Register dst, Address a);
|
||||
|
||||
|
||||
public:
|
||||
void push(RegSet regs, Register stack) { if (regs.bits()) push(regs.bits(), stack); }
|
||||
void pop(RegSet regs, Register stack) { if (regs.bits()) pop(regs.bits(), stack); }
|
||||
|
||||
|
||||
+ void push_fp(RegSet regs, Register stack) { if (regs.bits()) push_fp(regs.bits(), stack); }
|
||||
+ void pop_fp(RegSet regs, Register stack) { if (regs.bits()) pop_fp(regs.bits(), stack); }
|
||||
+
|
||||
static RegSet call_clobbered_registers();
|
||||
|
||||
// Push and pop everything that might be clobbered by a native
|
||||
// runtime call except rscratch1 and rscratch2. (They are always
|
||||
// scratch, so we don't have to protect them.) Only save the lower
|
||||
diff --git a/src/hotspot/cpu/aarch64/register_aarch64.hpp b/src/hotspot/cpu/aarch64/register_aarch64.hpp
|
||||
index 8cda52a..5f7662c 100644
|
||||
--- a/src/hotspot/cpu/aarch64/register_aarch64.hpp
|
||||
+++ b/src/hotspot/cpu/aarch64/register_aarch64.hpp
|
||||
@@ -230,6 +230,11 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
+ RegSet &operator-=(const RegSet aSet) {
|
||||
+ *this = *this - aSet;
|
||||
+ return *this;
|
||||
+ }
|
||||
+
|
||||
static RegSet of(Register r1) {
|
||||
return RegSet(r1);
|
||||
}
|
||||
diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
|
||||
index c162024..6e4eb1a 100644
|
||||
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
|
||||
@ -4695,29 +4679,10 @@ index 05ec9fa..16b80bf 100644
|
||||
case Op_LoadS:
|
||||
case Op_LoadKlass:
|
||||
diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp
|
||||
index 6aff3d5..38f0449 100644
|
||||
index d7eb3996b..366d0f378 100644
|
||||
--- a/src/hotspot/share/opto/loopnode.cpp
|
||||
+++ b/src/hotspot/share/opto/loopnode.cpp
|
||||
@@ -1005,18 +1005,6 @@ void LoopNode::verify_strip_mined(int expect_skeleton) const {
|
||||
}
|
||||
}
|
||||
|
||||
- if (UseZGC && !inner_out->in(0)->is_CountedLoopEnd()) {
|
||||
- // In some very special cases there can be a load that has no other uses than the
|
||||
- // counted loop safepoint. Then its loadbarrier will be placed between the inner
|
||||
- // loop exit and the safepoint. This is very rare
|
||||
-
|
||||
- Node* ifnode = inner_out->in(1)->in(0);
|
||||
- // Region->IfTrue->If == Region->Iffalse->If
|
||||
- if (ifnode == inner_out->in(2)->in(0)) {
|
||||
- inner_out = ifnode->in(0);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
CountedLoopEndNode* cle = inner_out->in(0)->as_CountedLoopEnd();
|
||||
assert(cle == inner->loopexit_or_null(), "mismatch");
|
||||
bool has_skeleton = outer_le->in(1)->bottom_type()->singleton() && outer_le->in(1)->bottom_type()->is_int()->get_con() == 0;
|
||||
@@ -4273,7 +4261,6 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) {
|
||||
@@ -4300,7 +4300,6 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) {
|
||||
case Op_LoadL:
|
||||
case Op_LoadS:
|
||||
case Op_LoadP:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@ diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe
|
||||
index d8f1679b4..18ea89b85 100644
|
||||
--- a/src/hotspot/share/prims/unsafe.cpp
|
||||
+++ b/src/hotspot/share/prims/unsafe.cpp
|
||||
@@ -1018,7 +1018,11 @@ UNSAFE_ENTRY(jint, Unsafe_GetLoadAverage0(JNIEnv *env, jobject unsafe, jdoubleAr
|
||||
@@ -1018,6 +1018,11 @@ UNSAFE_ENTRY(jint, Unsafe_GetLoadAverage0(JNIEnv *env, jobject unsafe, jdoubleAr
|
||||
return ret;
|
||||
} UNSAFE_END
|
||||
|
||||
@ -10,20 +10,20 @@ index d8f1679b4..18ea89b85 100644
|
||||
+ return UseHashMapIntegerCache;
|
||||
+}
|
||||
+UNSAFE_END
|
||||
|
||||
+
|
||||
UNSAFE_ENTRY(jboolean, Unsafe_GetUseFastSerializer(JNIEnv *env, jobject unsafe)) {
|
||||
return UseFastSerializer;
|
||||
}
|
||||
@@ -1108,6 +1113,7 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = {
|
||||
{CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)},
|
||||
|
||||
{CC "isBigEndian0", CC "()Z", FN_PTR(Unsafe_isBigEndian0)},
|
||||
{CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)},
|
||||
|
||||
+ {CC "getUseHashMapIntegerCache", CC "()Z", FN_PTR(Unsafe_GetUseHashMapIntegerCache)},
|
||||
{CC "getUseFastSerializer", CC "()Z", FN_PTR(Unsafe_GetUseFastSerializer)},
|
||||
{CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)}
|
||||
|
||||
};
|
||||
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
|
||||
index 47458b6c1..b8c0bec40 100644
|
||||
index 10c06c2d6..71ab94d34 100644
|
||||
--- a/src/hotspot/share/runtime/globals.hpp
|
||||
+++ b/src/hotspot/share/runtime/globals.hpp
|
||||
@@ -2677,6 +2677,11 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
@ -409,5 +409,5 @@ index d78caabdc..4d71e671e 100644
|
||||
private native long allocateMemory0(long bytes);
|
||||
private native long reallocateMemory0(long address, long bytes);
|
||||
--
|
||||
2.19.1
|
||||
2.19.0
|
||||
|
||||
|
||||
@ -74,6 +74,87 @@ index 0c62d44c7..000000000
|
||||
-iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no
|
||||
-xqE=
|
||||
------END CERTIFICATE-----
|
||||
diff --git a/make/data/cacerts/luxtrustglobalrootca b/make/data/cacerts/luxtrustglobalrootca
|
||||
deleted file mode 100644
|
||||
index 7fb3d818f..000000000
|
||||
--- a/make/data/cacerts/luxtrustglobalrootca
|
||||
+++ /dev/null
|
||||
@@ -1,28 +0,0 @@
|
||||
-Owner: CN=LuxTrust Global Root, O=LuxTrust s.a., C=LU
|
||||
-Issuer: CN=LuxTrust Global Root, O=LuxTrust s.a., C=LU
|
||||
-Serial number: bb8
|
||||
-Valid from: Thu Mar 17 09:51:37 GMT 2011 until: Wed Mar 17 09:51:37 GMT 2021
|
||||
-Signature algorithm name: SHA256withRSA
|
||||
-Subject Public Key Algorithm: 2048-bit RSA key
|
||||
-Version: 3
|
||||
------BEGIN CERTIFICATE-----
|
||||
-MIIDZDCCAkygAwIBAgICC7gwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCTFUx
|
||||
-FjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0IEdsb2Jh
|
||||
-bCBSb290MB4XDTExMDMxNzA5NTEzN1oXDTIxMDMxNzA5NTEzN1owRDELMAkGA1UE
|
||||
-BhMCTFUxFjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0
|
||||
-IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsn+n
|
||||
-QPAiygz267Hxyw6VV0B1r6A/Ps7sqjJX5hmxZ0OYWmt8s7j6eJyqpoSyYBuAQc5j
|
||||
-zR8XCJmk9e8+EsdMsFeaXHhAePxFjdqRZ9w6Ubltc+a3OY52OrQfBfVpVfmTz3iI
|
||||
-Sr6qm9d7R1tGBEyCFqY19vx039a0r9jitScRdFmiwmYsaArhmIiIPIoFdRTjuK7z
|
||||
-CISbasE/MRivJ6VLm6T9eTHemD0OYcqHmMH4ijCc+j4z1aXEAwfh95Z0GAAnOCfR
|
||||
-K6qq4UFFi2/xJcLcopeVx0IUM115hCNq52XAV6DYXaljAeew5Ivo+MVjuOVsdJA9
|
||||
-x3f8K7p56aTGEnin/wIDAQABo2AwXjAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQE
|
||||
-AwIBBjAfBgNVHSMEGDAWgBQXFYWJCS8kh28/HRvk8pZ5g0gTzjAdBgNVHQ4EFgQU
|
||||
-FxWFiQkvJIdvPx0b5PKWeYNIE84wDQYJKoZIhvcNAQELBQADggEBAFrwHNDUUM9B
|
||||
-fua4nX3DcNBeNv9ujnov3kgR1TQuPLdFwlQlp+HBHjeDtpSutkVIA+qVvuucarQ3
|
||||
-XB8u02uCgUNbCj8RVWOs+nwIAjegPDkEM/6XMshS5dklTbDG7mgfcKpzzlcD3H0K
|
||||
-DTPy0lrfCmw7zBFRlxqkIaKFNQLXgCLShLL4wKpov9XrqsMLq6F8K/f1O4fhVFfs
|
||||
-BSTveUJO84ton+Ruy4KZycwq3FPCH3CDqyEPVrRI/98HIrOM+R2mBN8tAza53W/+
|
||||
-MYhm/2xtRDSvCHc+JtJy9LtHVpM8mGPhM7uZI5K1g3noHZ9nrWLWidb2/CfeMifL
|
||||
-hNp3hSGhEiE=
|
||||
------END CERTIFICATE-----
|
||||
diff --git a/make/data/cacerts/quovadisrootca b/make/data/cacerts/quovadisrootca
|
||||
deleted file mode 100644
|
||||
index 0c195ff51..000000000
|
||||
--- a/make/data/cacerts/quovadisrootca
|
||||
+++ /dev/null
|
||||
@@ -1,41 +0,0 @@
|
||||
-Owner: CN=QuoVadis Root Certification Authority, OU=Root Certification Authority, O=QuoVadis Limited, C=BM
|
||||
-Issuer: CN=QuoVadis Root Certification Authority, OU=Root Certification Authority, O=QuoVadis Limited, C=BM
|
||||
-Serial number: 3ab6508b
|
||||
-Valid from: Mon Mar 19 18:33:33 GMT 2001 until: Wed Mar 17 18:33:33 GMT 2021
|
||||
-Signature algorithm name: SHA1withRSA
|
||||
-Subject Public Key Algorithm: 2048-bit RSA key
|
||||
-Version: 3
|
||||
------BEGIN CERTIFICATE-----
|
||||
-MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC
|
||||
-TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0
|
||||
-aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0
|
||||
-aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz
|
||||
-MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw
|
||||
-IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR
|
||||
-dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG
|
||||
-9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp
|
||||
-li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D
|
||||
-rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ
|
||||
-WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug
|
||||
-F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU
|
||||
-xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC
|
||||
-Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv
|
||||
-dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw
|
||||
-ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl
|
||||
-IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh
|
||||
-c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy
|
||||
-ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
|
||||
-Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI
|
||||
-KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T
|
||||
-KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq
|
||||
-y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p
|
||||
-dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD
|
||||
-VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL
|
||||
-MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk
|
||||
-fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8
|
||||
-7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R
|
||||
-cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y
|
||||
-mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW
|
||||
-xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK
|
||||
-SnQ2+Q==
|
||||
------END CERTIFICATE-----
|
||||
diff --git a/make/data/cacerts/utnuserfirstobjectca b/make/data/cacerts/utnuserfirstobjectca
|
||||
deleted file mode 100644
|
||||
index 80a0b5c23..000000000
|
||||
@ -114,21 +195,21 @@ index 80a0b5c23..000000000
|
||||
-Uh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g=
|
||||
------END CERTIFICATE-----
|
||||
diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
|
||||
index a0e4cf294..8b8739d33 100644
|
||||
index 91d78e8fe..68f85e215 100644
|
||||
--- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
|
||||
+++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
|
||||
@@ -53,12 +53,12 @@ public class VerifyCACerts {
|
||||
+ File.separator + "security" + File.separator + "cacerts";
|
||||
|
||||
// The numbers of certs now.
|
||||
- private static final int COUNT = 90;
|
||||
+ private static final int COUNT = 87;
|
||||
- private static final int COUNT = 89;
|
||||
+ private static final int COUNT = 84;
|
||||
|
||||
// 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
|
||||
- = "A2:36:27:B7:F6:99:7A:C7:7E:2D:55:47:66:57:08:3F:F8:8C:F2:28:77:29:30:40:A2:D3:6D:1A:B6:C7:32:6F";
|
||||
+ = "EA:29:DE:36:FD:06:0A:A1:D9:46:0B:DF:E0:B8:E7:16:40:1B:52:3B:5F:0F:58:EE:E0:2A:A9:2A:D7:8D:34:68";
|
||||
- = "CC:AD:BB:49:70:97:3F:42:AD:73:91:A0:A2:C4:B8:AA:D1:95:59:F3:B3:22:09:2A:1F:2C:AB:04:47:08:EF:AA";
|
||||
+ = "D3:05:21:64:FA:D7:CD:29:E8:CB:57:E7:47:ED:79:9B:47:D8:0E:75:2D:CA:83:BB:86:AF:D9:43:FD:3E:17:85";
|
||||
|
||||
// map of cert alias to SHA-256 fingerprint
|
||||
@SuppressWarnings("serial")
|
||||
@ -145,12 +226,35 @@ index a0e4cf294..8b8739d33 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,6 +256,8 @@ public class VerifyCACerts {
|
||||
@@ -150,10 +144,6 @@ public class VerifyCACerts {
|
||||
"5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE");
|
||||
put("letsencryptisrgx1 [jdk]",
|
||||
"96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6");
|
||||
- put("luxtrustglobalrootca [jdk]",
|
||||
- "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50");
|
||||
- put("quovadisrootca [jdk]",
|
||||
- "A4:5E:DE:3B:BB:F0:9C:8A:E1:5C:72:EF:C0:72:68:D6:93:A2:1C:99:6F:D5:1E:67:CA:07:94:60:FD:6D:88:73");
|
||||
put("quovadisrootca1g3 [jdk]",
|
||||
"8A:86:6F:D1:B2:76:B5:7E:57:8E:92:1C:65:82:8A:2B:ED:58:E9:F2:F2:88:05:41:34:B7:F1:F4:BF:C9:CC:74");
|
||||
put("quovadisrootca2 [jdk]",
|
||||
@@ -250,16 +240,14 @@ public class VerifyCACerts {
|
||||
@SuppressWarnings("serial")
|
||||
private static final HashSet<String> EXPIRY_EXC_ENTRIES = new HashSet<>() {
|
||||
{
|
||||
- // Valid until: Tue Jul 09 14:40:36 EDT 2019
|
||||
- add("utnuserfirstobjectca [jdk]");
|
||||
- // Valid until: Sat May 30 10:38:31 GMT 2020
|
||||
- add("addtrustexternalca [jdk]");
|
||||
- // Valid until: Sat May 30 10:44:50 GMT 2020
|
||||
- add("addtrustqualifiedca [jdk]");
|
||||
// Valid until: Wed Mar 17 02:51:37 PDT 2021
|
||||
add("luxtrustglobalrootca [jdk]");
|
||||
// Valid until: Wed Mar 17 11:33:33 PDT 2021
|
||||
add("quovadisrootca [jdk]");
|
||||
+ // Valid until: Wed Dec 15 08:00:00 UTC 2021
|
||||
+ add("globalsignr2ca [jdk]");
|
||||
+ // Valid until: Thu Sep 30 14:01:15 UTC 2021
|
||||
+ add("identrustdstx3 [jdk]");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
190
dfx-enhancement-of-FastSerializer.patch
Executable file
190
dfx-enhancement-of-FastSerializer.patch
Executable file
@ -0,0 +1,190 @@
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
index 78008081f..a77a5d5b6 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
@@ -306,6 +306,23 @@ public class ObjectInputStream
|
||||
filterLogger = (filterLog.isLoggable(Logger.Level.DEBUG)
|
||||
|| filterLog.isLoggable(Logger.Level.TRACE)) ? filterLog : null;
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * Logger for FastSerializer.
|
||||
+ * Setup the FastSerializer logger if it is set to DEBUG.
|
||||
+ * (Assuming it will not change).
|
||||
+ */
|
||||
+ static final System.Logger fastSerLogger;
|
||||
+
|
||||
+ static {
|
||||
+ if (printFastSerializer) {
|
||||
+ Logger fastSerLog = System.getLogger("fastSerializer");
|
||||
+ fastSerLogger = (fastSerLog.isLoggable(Logger.Level.DEBUG))
|
||||
+ ? fastSerLog : null;
|
||||
+ } else {
|
||||
+ fastSerLogger = null;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
/** filter stream for handling block data conversion */
|
||||
@@ -366,6 +383,14 @@ public class ObjectInputStream
|
||||
new sun.security.action.GetBooleanAction(
|
||||
"fastSerializerEscapeMode")).booleanValue();
|
||||
|
||||
+ /**
|
||||
+ * value of "printFastSerializer" property,
|
||||
+ * as true or false for printing FastSerializer logs.
|
||||
+ */
|
||||
+ private static final boolean printFastSerializer = java.security.AccessController.doPrivileged(
|
||||
+ new sun.security.action.GetBooleanAction(
|
||||
+ "printFastSerializer")).booleanValue();
|
||||
+
|
||||
/**
|
||||
* Creates an ObjectInputStream that reads from the specified InputStream.
|
||||
* A serialization stream header is read from the stream and verified.
|
||||
@@ -988,7 +1013,7 @@ public class ObjectInputStream
|
||||
if (s0 != STREAM_MAGIC_FAST || s1 != STREAM_VERSION) {
|
||||
if (s0 != STREAM_MAGIC) {
|
||||
throw new StreamCorruptedException(
|
||||
- String.format("invalid stream header: %04X%04X", s0, s1));
|
||||
+ String.format("invalid stream header: %04X%04X, and FastSerializer is activated", s0, s1));
|
||||
}
|
||||
|
||||
if (!fastSerializerEscapeMode) {
|
||||
@@ -999,10 +1024,18 @@ public class ObjectInputStream
|
||||
|
||||
// Escape to default serialization
|
||||
useFastSerializer = false;
|
||||
+ if (Logging.fastSerLogger != null) {
|
||||
+ Logging.fastSerLogger.log(Logger.Level.DEBUG, "[Deserialize]: Escape and disable FastSerializer");
|
||||
+ }
|
||||
}
|
||||
} else if (s0 != STREAM_MAGIC || s1 != STREAM_VERSION) {
|
||||
+ if (s0 == STREAM_MAGIC_FAST && s1 == STREAM_VERSION) {
|
||||
+ throw new StreamCorruptedException(
|
||||
+ String.format("invalid stream header: %04X%04X, and it is a FastSerializer stream", s0, s1));
|
||||
+ } else {
|
||||
throw new StreamCorruptedException(
|
||||
String.format("invalid stream header: %04X%04X", s0, s1));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2129,6 +2162,12 @@ public class ObjectInputStream
|
||||
handles.finish(descHandle);
|
||||
passHandle = descHandle;
|
||||
|
||||
+ if (Logging.fastSerLogger != null) {
|
||||
+ Logging.fastSerLogger.log(Logger.Level.DEBUG,
|
||||
+ "[Deserialize] useFastSerializer:{0}, Class name:{1}, SerialVersionUID:{2}, flags:{3}",
|
||||
+ useFastSerializer, desc.getName(), desc.getSerialVersionUID(), desc.getFlags(this));
|
||||
+ }
|
||||
+
|
||||
return desc;
|
||||
}
|
||||
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectOutputStream.java b/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
index 044924593..8935e61dc 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
@@ -175,6 +175,25 @@ public class ObjectOutputStream
|
||||
new ReferenceQueue<>();
|
||||
}
|
||||
|
||||
+ private static class Logging {
|
||||
+ /*
|
||||
+ * Logger for FastSerializer.
|
||||
+ * Setup the FastSerializer logger if it is set to DEBUG.
|
||||
+ * (Assuming it will not change).
|
||||
+ */
|
||||
+ static final System.Logger fastSerLogger;
|
||||
+
|
||||
+ static {
|
||||
+ if (printFastSerializer) {
|
||||
+ System.Logger fastSerLog = System.getLogger("fastSerializer");
|
||||
+ fastSerLogger = (fastSerLog.isLoggable(System.Logger.Level.DEBUG))
|
||||
+ ? fastSerLog : null;
|
||||
+ } else {
|
||||
+ fastSerLogger = null;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/** filter stream for handling block data conversion */
|
||||
private final BlockDataOutputStream bout;
|
||||
/** obj -> wire handle map */
|
||||
@@ -223,6 +242,14 @@ public class ObjectOutputStream
|
||||
*/
|
||||
private static final boolean useFastSerializer = UNSAFE.getUseFastSerializer();
|
||||
|
||||
+ /**
|
||||
+ * value of "printFastSerializer" property,
|
||||
+ * as true or false for printing FastSerializer logs.
|
||||
+ */
|
||||
+ private static final boolean printFastSerializer = java.security.AccessController.doPrivileged(
|
||||
+ new sun.security.action.GetBooleanAction(
|
||||
+ "printFastSerializer")).booleanValue();
|
||||
+
|
||||
/**
|
||||
* Creates an ObjectOutputStream that writes to the specified OutputStream.
|
||||
* This constructor writes the serialization stream header to the
|
||||
@@ -1301,6 +1328,12 @@ public class ObjectOutputStream
|
||||
bout.writeByte(TC_CLASSDESC);
|
||||
handles.assign(unshared ? null : desc);
|
||||
|
||||
+ if (Logging.fastSerLogger != null) {
|
||||
+ Logging.fastSerLogger.log(System.Logger.Level.DEBUG,
|
||||
+ "[Serialize] useFastSerializer:{0}, Class name:{1}, SerialVersionUID:{2}, flags:{3}, protocol:{4}",
|
||||
+ useFastSerializer, desc.getName(), desc.getSerialVersionUID(), desc.getFlags(this), protocol);
|
||||
+ }
|
||||
+
|
||||
if (protocol == PROTOCOL_VERSION_1) {
|
||||
// do not invoke class descriptor write hook with old protocol
|
||||
if (useFastSerializer) {
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
index ac3a92bef..a5d7d2d75 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
@@ -270,6 +270,40 @@ public class ObjectStreamClass implements Serializable {
|
||||
return suid.longValue();
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Return the flags for this class described by this descriptor. The flags
|
||||
+ * means a set of bit masks for ObjectStreamClass, which indicate the status
|
||||
+ * of SC_WRITE_METHOD, SC_SERIALIZABLE, SC_EXTERNALIZABLE, SC_BLOCK_DATA and
|
||||
+ * SC_ENUM.
|
||||
+ *
|
||||
+ * @param serialStream ObjectOutputStream or ObjectInputStream
|
||||
+ *
|
||||
+ * @return the flags for this class described by this descriptor
|
||||
+ */
|
||||
+ public byte getFlags(Object serialStream) {
|
||||
+ byte flags = 0;
|
||||
+ if (externalizable) {
|
||||
+ flags |= ObjectStreamConstants.SC_EXTERNALIZABLE;
|
||||
+ if (serialStream instanceof ObjectOutputStream) {
|
||||
+ int protocol = ((ObjectOutputStream)serialStream).getProtocolVersion();
|
||||
+ if (protocol != ObjectStreamConstants.PROTOCOL_VERSION_1) {
|
||||
+ flags |= ObjectStreamConstants.SC_BLOCK_DATA;
|
||||
+ }
|
||||
+ } else if (serialStream instanceof ObjectInputStream) {
|
||||
+ flags |= ObjectStreamConstants.SC_BLOCK_DATA;
|
||||
+ }
|
||||
+ } else if (serializable) {
|
||||
+ flags |= ObjectStreamConstants.SC_SERIALIZABLE;
|
||||
+ }
|
||||
+ if (hasWriteObjectData) {
|
||||
+ flags |= ObjectStreamConstants.SC_WRITE_METHOD;
|
||||
+ }
|
||||
+ if (isEnum) {
|
||||
+ flags |= ObjectStreamConstants.SC_ENUM;
|
||||
+ }
|
||||
+ return flags;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Return the class in the local VM that this version is mapped to. Null
|
||||
* is returned if there is no corresponding local class.
|
||||
--
|
||||
2.19.0
|
||||
|
||||
@ -1,41 +1,35 @@
|
||||
commit cbbef85e20818d23651e553ad9915ec8225a3456
|
||||
Date: Thu May 28 11:04:16 2020 +0800
|
||||
|
||||
Add FastSerializer
|
||||
|
||||
Summary:<core-libs>: Add FastSerializer
|
||||
LLT: jtreg
|
||||
Bug url: NA
|
||||
|
||||
diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp
|
||||
index 2f14e01ce..2f7f96aee 100644
|
||||
index 2f14e01ce..d8f1679b4 100644
|
||||
--- a/src/hotspot/share/prims/unsafe.cpp
|
||||
+++ b/src/hotspot/share/prims/unsafe.cpp
|
||||
@@ -1019,6 +1019,11 @@ UNSAFE_ENTRY(jint, Unsafe_GetLoadAverage0(JNIEnv *env, jobject unsafe, jdoubleAr
|
||||
@@ -1018,6 +1018,10 @@ UNSAFE_ENTRY(jint, Unsafe_GetLoadAverage0(JNIEnv *env, jobject unsafe, jdoubleAr
|
||||
return ret;
|
||||
} UNSAFE_END
|
||||
|
||||
|
||||
+UNSAFE_ENTRY(jboolean, Unsafe_GetUseFastSerializer(JNIEnv *env, jobject unsafe)) {
|
||||
+ return UseFastSerializer;
|
||||
+}
|
||||
+UNSAFE_END
|
||||
+
|
||||
|
||||
/// JVM_RegisterUnsafeMethods
|
||||
|
||||
#define ADR "J"
|
||||
@@ -1102,6 +1107,7 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = {
|
||||
@@ -1102,7 +1106,10 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = {
|
||||
{CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)},
|
||||
|
||||
{CC "isBigEndian0", CC "()Z", FN_PTR(Unsafe_isBigEndian0)},
|
||||
- {CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)}
|
||||
+ {CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)},
|
||||
+
|
||||
+ {CC "getUseFastSerializer", CC "()Z", FN_PTR(Unsafe_GetUseFastSerializer)},
|
||||
{CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)}
|
||||
+
|
||||
};
|
||||
|
||||
#undef CC
|
||||
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
|
||||
index 1e2408b4b..7fc3c1fb7 100644
|
||||
index 4b8dbe899..ec5a4e50c 100644
|
||||
--- a/src/hotspot/share/runtime/globals.hpp
|
||||
+++ b/src/hotspot/share/runtime/globals.hpp
|
||||
@@ -2670,6 +2670,10 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
@@ -2684,6 +2684,10 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
JFR_ONLY(product(ccstr, StartFlightRecording, NULL, \
|
||||
"Start flight recording with options")) \
|
||||
\
|
||||
@ -47,34 +41,10 @@ index 1e2408b4b..7fc3c1fb7 100644
|
||||
"Use platform unstable time where supported for timestamps only")
|
||||
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
index 3386b1a08..d71d44a98 100644
|
||||
index 939b7647e..f59a51316 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
@@ -295,6 +295,23 @@ public class ObjectInputStream
|
||||
filterLogger = (filterLog.isLoggable(Logger.Level.DEBUG)
|
||||
|| filterLog.isLoggable(Logger.Level.TRACE)) ? filterLog : null;
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * Logger for FastSerializer.
|
||||
+ * Setup the FastSerializer logger if it is set to DEBUG.
|
||||
+ * (Assuming it will not change).
|
||||
+ */
|
||||
+ static final System.Logger fastSerLogger;
|
||||
+
|
||||
+ static {
|
||||
+ if (printFastSerializer) {
|
||||
+ Logger fastSerLog = System.getLogger("fastSerializer");
|
||||
+ fastSerLogger = (fastSerLog.isLoggable(Logger.Level.DEBUG))
|
||||
+ ? fastSerLog : null;
|
||||
+ } else {
|
||||
+ fastSerLogger = null;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
/** filter stream for handling block data conversion */
|
||||
@@ -320,6 +337,9 @@ public class ObjectInputStream
|
||||
@@ -331,6 +331,9 @@ public class ObjectInputStream
|
||||
/** if true, invoke resolveObject() */
|
||||
private boolean enableResolve;
|
||||
|
||||
@ -84,7 +54,7 @@ index 3386b1a08..d71d44a98 100644
|
||||
/**
|
||||
* Context during upcalls to class-defined readObject methods; holds
|
||||
* object currently being deserialized and descriptor for current class.
|
||||
@@ -333,6 +353,33 @@ public class ObjectInputStream
|
||||
@@ -344,6 +347,25 @@ public class ObjectInputStream
|
||||
*/
|
||||
private ObjectInputFilter serialFilter;
|
||||
|
||||
@ -106,19 +76,11 @@ index 3386b1a08..d71d44a98 100644
|
||||
+ private static final boolean fastSerializerEscapeMode = java.security.AccessController.doPrivileged(
|
||||
+ new sun.security.action.GetBooleanAction(
|
||||
+ "fastSerializerEscapeMode")).booleanValue();
|
||||
+
|
||||
+ /**
|
||||
+ * value of "printFastSerializer" property,
|
||||
+ * as true or false for printing FastSerializer logs.
|
||||
+ */
|
||||
+ private static final boolean printFastSerializer = java.security.AccessController.doPrivileged(
|
||||
+ new sun.security.action.GetBooleanAction(
|
||||
+ "printFastSerializer")).booleanValue();
|
||||
+
|
||||
/**
|
||||
* Creates an ObjectInputStream that reads from the specified InputStream.
|
||||
* A serialization stream header is read from the stream and verified.
|
||||
@@ -410,6 +457,9 @@ public class ObjectInputStream
|
||||
@@ -421,6 +443,9 @@ public class ObjectInputStream
|
||||
* transitively so that a complete equivalent graph of objects is
|
||||
* reconstructed by readObject.
|
||||
*
|
||||
@ -128,7 +90,7 @@ index 3386b1a08..d71d44a98 100644
|
||||
* <p>The root object is completely restored when all of its fields and the
|
||||
* objects it references are completely restored. At this point the object
|
||||
* validation callbacks are executed in order based on their registered
|
||||
@@ -698,11 +748,20 @@ public class ObjectInputStream
|
||||
@@ -709,11 +734,20 @@ public class ObjectInputStream
|
||||
vlist.register(obj, prio);
|
||||
}
|
||||
|
||||
@ -149,7 +111,7 @@ index 3386b1a08..d71d44a98 100644
|
||||
* <p>The corresponding method in <code>ObjectOutputStream</code> is
|
||||
* <code>annotateClass</code>. This method will be invoked only once for
|
||||
* each unique class in the stream. This method can be implemented by
|
||||
@@ -741,18 +800,33 @@ public class ObjectInputStream
|
||||
@@ -752,16 +786,26 @@ public class ObjectInputStream
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
String name = desc.getName();
|
||||
@ -165,9 +127,7 @@ index 3386b1a08..d71d44a98 100644
|
||||
return cl;
|
||||
- } else {
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ } try {
|
||||
+ cl = Class.forName(name, false, latestUserDefinedLoader());
|
||||
+ } catch (ClassNotFoundException ex) {
|
||||
+ cl = primClasses.get(name);
|
||||
@ -175,20 +135,15 @@ index 3386b1a08..d71d44a98 100644
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (useFastSerializer) {
|
||||
+ nameToClass.put(name, cl);
|
||||
+ }
|
||||
+
|
||||
+ return cl;
|
||||
+
|
||||
}
|
||||
|
||||
+
|
||||
/**
|
||||
* Returns a proxy class that implements the interfaces named in a proxy
|
||||
* class descriptor; subclasses may implement this method to read custom
|
||||
@@ -924,9 +998,33 @@ public class ObjectInputStream
|
||||
@@ -935,9 +979,25 @@ public class ObjectInputStream
|
||||
{
|
||||
short s0 = bin.readShort();
|
||||
short s1 = bin.readShort();
|
||||
@ -199,7 +154,7 @@ index 3386b1a08..d71d44a98 100644
|
||||
+ if (s0 != STREAM_MAGIC_FAST || s1 != STREAM_VERSION) {
|
||||
+ if (s0 != STREAM_MAGIC) {
|
||||
+ throw new StreamCorruptedException(
|
||||
+ String.format("invalid stream header: %04X%04X, and FastSerializer is activated", s0, s1));
|
||||
+ String.format("invalid stream header: %04X%04X", s0, s1));
|
||||
+ }
|
||||
+
|
||||
+ if (!fastSerializerEscapeMode) {
|
||||
@ -210,22 +165,14 @@ index 3386b1a08..d71d44a98 100644
|
||||
+
|
||||
+ // Escape to default serialization
|
||||
+ useFastSerializer = false;
|
||||
+ if (Logging.fastSerLogger != null) {
|
||||
+ Logging.fastSerLogger.log(Logger.Level.DEBUG, "[Deserialize]: Escape and disable FastSerializer");
|
||||
+ }
|
||||
+ }
|
||||
+ } else if (s0 != STREAM_MAGIC || s1 != STREAM_VERSION) {
|
||||
+ if (s0 == STREAM_MAGIC_FAST && s1 == STREAM_VERSION) {
|
||||
+ throw new StreamCorruptedException(
|
||||
+ String.format("invalid stream header: %04X%04X, and it is a FastSerializer stream", s0, s1));
|
||||
+ } else {
|
||||
+ throw new StreamCorruptedException(
|
||||
+ String.format("invalid stream header: %04X%04X", s0, s1));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -940,6 +1038,11 @@ public class ObjectInputStream
|
||||
@@ -951,6 +1011,11 @@ public class ObjectInputStream
|
||||
* this method reads class descriptors according to the format defined in
|
||||
* the Object Serialization specification.
|
||||
*
|
||||
@ -237,7 +184,7 @@ index 3386b1a08..d71d44a98 100644
|
||||
* @return the class descriptor read
|
||||
* @throws IOException If an I/O error has occurred.
|
||||
* @throws ClassNotFoundException If the Class of a serialized object used
|
||||
@@ -950,6 +1053,29 @@ public class ObjectInputStream
|
||||
@@ -961,6 +1026,29 @@ public class ObjectInputStream
|
||||
protected ObjectStreamClass readClassDescriptor()
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
@ -267,20 +214,7 @@ index 3386b1a08..d71d44a98 100644
|
||||
ObjectStreamClass desc = new ObjectStreamClass();
|
||||
desc.readNonProxy(this);
|
||||
return desc;
|
||||
@@ -1946,10 +2072,12 @@ public class ObjectInputStream
|
||||
}
|
||||
|
||||
ObjectStreamClass desc = new ObjectStreamClass();
|
||||
+
|
||||
int descHandle = handles.assign(unshared ? unsharedMarker : desc);
|
||||
passHandle = NULL_HANDLE;
|
||||
|
||||
ObjectStreamClass readDesc;
|
||||
+
|
||||
try {
|
||||
readDesc = readClassDescriptor();
|
||||
} catch (ClassNotFoundException ex) {
|
||||
@@ -1976,17 +2104,40 @@ public class ObjectInputStream
|
||||
@@ -2008,36 +2096,52 @@ public class ObjectInputStream
|
||||
|
||||
skipCustomData();
|
||||
|
||||
@ -288,11 +222,19 @@ index 3386b1a08..d71d44a98 100644
|
||||
- totalObjectRefs++;
|
||||
- depth++;
|
||||
- desc.initNonProxy(readDesc, cl, resolveEx, readClassDesc(false));
|
||||
- } finally {
|
||||
- depth--;
|
||||
+ totalObjectRefs++;
|
||||
+ depth++;
|
||||
+
|
||||
|
||||
- if (cl != null) {
|
||||
- // Check that serial filtering has been done on the local class descriptor's superclass,
|
||||
- // in case it does not appear in the stream.
|
||||
-
|
||||
- // Find the next super descriptor that has a local class descriptor.
|
||||
- // Descriptors for which there is no local class are ignored.
|
||||
- ObjectStreamClass superLocal = null;
|
||||
- for (ObjectStreamClass sDesc = desc.getSuperDesc(); sDesc != null; sDesc = sDesc.getSuperDesc()) {
|
||||
- if ((superLocal = sDesc.getLocalDesc()) != null) {
|
||||
- break;
|
||||
+ if (useFastSerializer) {
|
||||
+ desc.initNonProxyFast(readDesc, resolveEx);
|
||||
+ ObjectStreamClass superDesc = desc.getSuperDesc();
|
||||
@ -310,33 +252,57 @@ index 3386b1a08..d71d44a98 100644
|
||||
+ } else {
|
||||
+ try {
|
||||
+ desc.initNonProxy(readDesc, cl, resolveEx, readClassDesc(false));
|
||||
+
|
||||
+ if (cl != null) {
|
||||
+ // Check that serial filtering has been done on the local class descriptor's superclass,
|
||||
+ // in case it does not appear in the stream.
|
||||
+ // Find the next super descriptor that has a local class descriptor.
|
||||
+ // Descriptors for which there is no local class are ignored.
|
||||
+ ObjectStreamClass superLocal = null;
|
||||
+ for (ObjectStreamClass sDesc = desc.getSuperDesc(); sDesc != null; sDesc = sDesc.getSuperDesc()) {
|
||||
+ if ((superLocal = sDesc.getLocalDesc()) != null) {
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
|
||||
- // Scan local descriptor superclasses for a match with the local descriptor of the super found above.
|
||||
- // For each super descriptor before the match, invoke the serial filter on the class.
|
||||
- // The filter is invoked for each class that has not already been filtered
|
||||
- // but would be filtered if the instance had been serialized by this Java runtime.
|
||||
- for (ObjectStreamClass lDesc = desc.getLocalDesc().getSuperDesc();
|
||||
- lDesc != null && lDesc != superLocal;
|
||||
- lDesc = lDesc.getSuperDesc()) {
|
||||
- filterCheck(lDesc.forClass(), -1);
|
||||
+ // Scan local descriptor superclasses for a match with the local descriptor of the super found above.
|
||||
+ // For each super descriptor before the match, invoke the serial filter on the class.
|
||||
+ // The filter is invoked for each class that has not already been filtered
|
||||
+ // but would be filtered if the instance had been serialized by this Java runtime.
|
||||
+ for (ObjectStreamClass lDesc = desc.getLocalDesc().getSuperDesc();
|
||||
+ lDesc != null && lDesc != superLocal;
|
||||
+ lDesc = lDesc.getSuperDesc()) {
|
||||
+ filterCheck(lDesc.forClass(), -1);
|
||||
+ }
|
||||
}
|
||||
+ } finally {
|
||||
+ depth--;
|
||||
+ }
|
||||
}
|
||||
- } finally {
|
||||
- depth--;
|
||||
}
|
||||
|
||||
handles.finish(descHandle);
|
||||
passHandle = descHandle;
|
||||
|
||||
+ if (Logging.fastSerLogger != null) {
|
||||
+ Logging.fastSerLogger.log(Logger.Level.DEBUG,
|
||||
+ "[Deserialize] useFastSerializer:{0}, Class name:{1}, SerialVersionUID:{2}, flags:{3}",
|
||||
+ useFastSerializer, desc.getName(), desc.getSerialVersionUID(), desc.getFlags(this));
|
||||
+ }
|
||||
+
|
||||
return desc;
|
||||
}
|
||||
|
||||
@@ -2873,7 +3024,6 @@ public class ObjectInputStream
|
||||
@@ -2936,8 +3040,6 @@ public class ObjectInputStream
|
||||
}
|
||||
}
|
||||
|
||||
- private static final Unsafe UNSAFE = Unsafe.getUnsafe();
|
||||
|
||||
-
|
||||
/**
|
||||
* Performs a "freeze" action, required to adhere to final field semantics.
|
||||
*
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectOutputStream.java b/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
index 135e5645a..8935e61dc 100644
|
||||
index 135e5645a..044924593 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
@@ -36,6 +36,7 @@ import java.util.StringJoiner;
|
||||
@ -347,33 +313,7 @@ index 135e5645a..8935e61dc 100644
|
||||
import sun.reflect.misc.ReflectUtil;
|
||||
|
||||
/**
|
||||
@@ -174,6 +175,25 @@ public class ObjectOutputStream
|
||||
new ReferenceQueue<>();
|
||||
}
|
||||
|
||||
+ private static class Logging {
|
||||
+ /*
|
||||
+ * Logger for FastSerializer.
|
||||
+ * Setup the FastSerializer logger if it is set to DEBUG.
|
||||
+ * (Assuming it will not change).
|
||||
+ */
|
||||
+ static final System.Logger fastSerLogger;
|
||||
+
|
||||
+ static {
|
||||
+ if (printFastSerializer) {
|
||||
+ System.Logger fastSerLog = System.getLogger("fastSerializer");
|
||||
+ fastSerLogger = (fastSerLog.isLoggable(System.Logger.Level.DEBUG))
|
||||
+ ? fastSerLog : null;
|
||||
+ } else {
|
||||
+ fastSerLogger = null;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/** filter stream for handling block data conversion */
|
||||
private final BlockDataOutputStream bout;
|
||||
/** obj -> wire handle map */
|
||||
@@ -192,7 +212,6 @@ public class ObjectOutputStream
|
||||
@@ -192,7 +193,6 @@ public class ObjectOutputStream
|
||||
private final boolean enableOverride;
|
||||
/** if true, invoke replaceObject() */
|
||||
private boolean enableReplace;
|
||||
@ -381,7 +321,7 @@ index 135e5645a..8935e61dc 100644
|
||||
// values below valid only during upcalls to writeObject()/writeExternal()
|
||||
/**
|
||||
* Context during upcalls to class-defined writeObject methods; holds
|
||||
@@ -215,6 +234,22 @@ public class ObjectOutputStream
|
||||
@@ -215,6 +215,14 @@ public class ObjectOutputStream
|
||||
new sun.security.action.GetBooleanAction(
|
||||
"sun.io.serialization.extendedDebugInfo")).booleanValue();
|
||||
|
||||
@ -392,19 +332,11 @@ index 135e5645a..8935e61dc 100644
|
||||
+ * on when it is true.
|
||||
+ */
|
||||
+ private static final boolean useFastSerializer = UNSAFE.getUseFastSerializer();
|
||||
+
|
||||
+ /**
|
||||
+ * value of "printFastSerializer" property,
|
||||
+ * as true or false for printing FastSerializer logs.
|
||||
+ */
|
||||
+ private static final boolean printFastSerializer = java.security.AccessController.doPrivileged(
|
||||
+ new sun.security.action.GetBooleanAction(
|
||||
+ "printFastSerializer")).booleanValue();
|
||||
+
|
||||
/**
|
||||
* Creates an ObjectOutputStream that writes to the specified OutputStream.
|
||||
* This constructor writes the serialization stream header to the
|
||||
@@ -328,6 +363,9 @@ public class ObjectOutputStream
|
||||
@@ -328,6 +336,9 @@ public class ObjectOutputStream
|
||||
* object are written transitively so that a complete equivalent graph of
|
||||
* objects can be reconstructed by an ObjectInputStream.
|
||||
*
|
||||
@ -414,7 +346,7 @@ index 135e5645a..8935e61dc 100644
|
||||
* <p>Exceptions are thrown for problems with the OutputStream and for
|
||||
* classes that should not be serialized. All exceptions are fatal to the
|
||||
* OutputStream, which is left in an indeterminate state, and it is up to
|
||||
@@ -636,7 +674,11 @@ public class ObjectOutputStream
|
||||
@@ -636,7 +647,11 @@ public class ObjectOutputStream
|
||||
* stream
|
||||
*/
|
||||
protected void writeStreamHeader() throws IOException {
|
||||
@ -427,7 +359,7 @@ index 135e5645a..8935e61dc 100644
|
||||
bout.writeShort(STREAM_VERSION);
|
||||
}
|
||||
|
||||
@@ -651,6 +693,9 @@ public class ObjectOutputStream
|
||||
@@ -651,6 +666,9 @@ public class ObjectOutputStream
|
||||
* By default, this method writes class descriptors according to the format
|
||||
* defined in the Object Serialization specification.
|
||||
*
|
||||
@ -437,7 +369,7 @@ index 135e5645a..8935e61dc 100644
|
||||
* <p>Note that this method will only be called if the ObjectOutputStream
|
||||
* is not using the old serialization stream format (set by calling
|
||||
* ObjectOutputStream's <code>useProtocolVersion</code> method). If this
|
||||
@@ -668,7 +713,14 @@ public class ObjectOutputStream
|
||||
@@ -668,7 +686,14 @@ public class ObjectOutputStream
|
||||
protected void writeClassDescriptor(ObjectStreamClass desc)
|
||||
throws IOException
|
||||
{
|
||||
@ -453,16 +385,8 @@ index 135e5645a..8935e61dc 100644
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1276,9 +1328,21 @@ public class ObjectOutputStream
|
||||
bout.writeByte(TC_CLASSDESC);
|
||||
handles.assign(unshared ? null : desc);
|
||||
@@ -1278,7 +1303,13 @@ public class ObjectOutputStream
|
||||
|
||||
+ if (Logging.fastSerLogger != null) {
|
||||
+ Logging.fastSerLogger.log(System.Logger.Level.DEBUG,
|
||||
+ "[Serialize] useFastSerializer:{0}, Class name:{1}, SerialVersionUID:{2}, flags:{3}, protocol:{4}",
|
||||
+ useFastSerializer, desc.getName(), desc.getSerialVersionUID(), desc.getFlags(this), protocol);
|
||||
+ }
|
||||
+
|
||||
if (protocol == PROTOCOL_VERSION_1) {
|
||||
// do not invoke class descriptor write hook with old protocol
|
||||
- desc.writeNonProxy(this);
|
||||
@ -476,7 +400,7 @@ index 135e5645a..8935e61dc 100644
|
||||
} else {
|
||||
writeClassDescriptor(desc);
|
||||
}
|
||||
@@ -1291,8 +1355,9 @@ public class ObjectOutputStream
|
||||
@@ -1291,8 +1322,9 @@ public class ObjectOutputStream
|
||||
annotateClass(cl);
|
||||
bout.setBlockDataMode(false);
|
||||
bout.writeByte(TC_ENDBLOCKDATA);
|
||||
@ -489,51 +413,10 @@ index 135e5645a..8935e61dc 100644
|
||||
|
||||
/**
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
index 17739cdc7..a5d7d2d75 100644
|
||||
index 17739cdc7..ac3a92bef 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
@@ -270,6 +270,40 @@ public class ObjectStreamClass implements Serializable {
|
||||
return suid.longValue();
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Return the flags for this class described by this descriptor. The flags
|
||||
+ * means a set of bit masks for ObjectStreamClass, which indicate the status
|
||||
+ * of SC_WRITE_METHOD, SC_SERIALIZABLE, SC_EXTERNALIZABLE, SC_BLOCK_DATA and
|
||||
+ * SC_ENUM.
|
||||
+ *
|
||||
+ * @param serialStream ObjectOutputStream or ObjectInputStream
|
||||
+ *
|
||||
+ * @return the flags for this class described by this descriptor
|
||||
+ */
|
||||
+ public byte getFlags(Object serialStream) {
|
||||
+ byte flags = 0;
|
||||
+ if (externalizable) {
|
||||
+ flags |= ObjectStreamConstants.SC_EXTERNALIZABLE;
|
||||
+ if (serialStream instanceof ObjectOutputStream) {
|
||||
+ int protocol = ((ObjectOutputStream)serialStream).getProtocolVersion();
|
||||
+ if (protocol != ObjectStreamConstants.PROTOCOL_VERSION_1) {
|
||||
+ flags |= ObjectStreamConstants.SC_BLOCK_DATA;
|
||||
+ }
|
||||
+ } else if (serialStream instanceof ObjectInputStream) {
|
||||
+ flags |= ObjectStreamConstants.SC_BLOCK_DATA;
|
||||
+ }
|
||||
+ } else if (serializable) {
|
||||
+ flags |= ObjectStreamConstants.SC_SERIALIZABLE;
|
||||
+ }
|
||||
+ if (hasWriteObjectData) {
|
||||
+ flags |= ObjectStreamConstants.SC_WRITE_METHOD;
|
||||
+ }
|
||||
+ if (isEnum) {
|
||||
+ flags |= ObjectStreamConstants.SC_ENUM;
|
||||
+ }
|
||||
+ return flags;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Return the class in the local VM that this version is mapped to. Null
|
||||
* is returned if there is no corresponding local class.
|
||||
@@ -560,6 +594,15 @@ public class ObjectStreamClass implements Serializable {
|
||||
@@ -560,6 +560,15 @@ public class ObjectStreamClass implements Serializable {
|
||||
ObjectStreamClass() {
|
||||
}
|
||||
|
||||
@ -549,7 +432,7 @@ index 17739cdc7..a5d7d2d75 100644
|
||||
/**
|
||||
* Creates a PermissionDomain that grants no permission.
|
||||
*/
|
||||
@@ -746,6 +789,44 @@ public class ObjectStreamClass implements Serializable {
|
||||
@@ -746,6 +755,44 @@ public class ObjectStreamClass implements Serializable {
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
@ -623,3 +506,6 @@ index 031b5aae5..d78caabdc 100644
|
||||
private native long allocateMemory0(long bytes);
|
||||
private native long reallocateMemory0(long address, long bytes);
|
||||
private native void freeMemory0(long address);
|
||||
--
|
||||
2.19.0
|
||||
|
||||
|
||||
@ -1,34 +1,20 @@
|
||||
From cd63946e80ceb3f9de8a1ee02b38548c06cf532a Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 23 Jul 2020 16:40:31 +0800
|
||||
Subject: [PATCH] fix jck failure on FastSerializer
|
||||
|
||||
Summary: <core-libs>: <fix jck failure on FastSerializer>
|
||||
LLT: jck
|
||||
Bug url: NA
|
||||
---
|
||||
src/java.base/share/classes/java/io/ObjectInputStream.java | 7 ++++++-
|
||||
src/java.base/share/classes/java/io/ObjectOutputStream.java | 5 +++++
|
||||
src/java.base/share/classes/java/io/ObjectStreamClass.java | 2 +-
|
||||
src/java.base/share/classes/java/io/ObjectStreamConstants.java | 5 -----
|
||||
4 files changed, 12 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
index d71d44a..a48e50c 100644
|
||||
index a77a5d5b6..f2791a4cb 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java
|
||||
@@ -381,6 +381,11 @@ public class ObjectInputStream
|
||||
@@ -391,6 +391,11 @@ public class ObjectInputStream
|
||||
new sun.security.action.GetBooleanAction(
|
||||
"printFastSerializer")).booleanValue();
|
||||
|
||||
/**
|
||||
+ /**
|
||||
+ * Magic number that is written to the stream header when using fastserilizer.
|
||||
+ */
|
||||
+ private static final short STREAM_MAGIC_FAST = (short)0xdeca;
|
||||
+
|
||||
+ /**
|
||||
/**
|
||||
* Creates an ObjectInputStream that reads from the specified InputStream.
|
||||
* A serialization stream header is read from the stream and verified.
|
||||
* This constructor will block until the corresponding ObjectOutputStream
|
||||
@@ -752,7 +757,7 @@ public class ObjectInputStream
|
||||
@@ -763,7 +768,7 @@ public class ObjectInputStream
|
||||
* Cache the class meta during serialization.
|
||||
* Only used in FastSerilizer.
|
||||
*/
|
||||
@ -38,23 +24,23 @@ index d71d44a..a48e50c 100644
|
||||
/**
|
||||
* Load the local class equivalent of the specified stream class
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectOutputStream.java b/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
index 8935e61..0e54763 100644
|
||||
index 8935e61dc..0e5476395 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java
|
||||
@@ -251,6 +251,11 @@ public class ObjectOutputStream
|
||||
@@ -250,6 +250,11 @@ public class ObjectOutputStream
|
||||
new sun.security.action.GetBooleanAction(
|
||||
"printFastSerializer")).booleanValue();
|
||||
|
||||
/**
|
||||
+ /**
|
||||
+ * Magic number that is written to the stream header when using fastserilizer.
|
||||
+ */
|
||||
+ private static final short STREAM_MAGIC_FAST = (short)0xdeca;
|
||||
+
|
||||
+ /**
|
||||
/**
|
||||
* Creates an ObjectOutputStream that writes to the specified OutputStream.
|
||||
* This constructor writes the serialization stream header to the
|
||||
* underlying stream; callers may wish to flush the stream immediately to
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
index a5d7d2d..e37a784 100644
|
||||
index a5d7d2d75..e37a7841e 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java
|
||||
@@ -280,7 +280,7 @@ public class ObjectStreamClass implements Serializable {
|
||||
@ -67,22 +53,21 @@ index a5d7d2d..e37a784 100644
|
||||
if (externalizable) {
|
||||
flags |= ObjectStreamConstants.SC_EXTERNALIZABLE;
|
||||
diff --git a/src/java.base/share/classes/java/io/ObjectStreamConstants.java b/src/java.base/share/classes/java/io/ObjectStreamConstants.java
|
||||
index 9615778..43a480c 100644
|
||||
index 96157782a..43a480ce4 100644
|
||||
--- a/src/java.base/share/classes/java/io/ObjectStreamConstants.java
|
||||
+++ b/src/java.base/share/classes/java/io/ObjectStreamConstants.java
|
||||
@@ -39,11 +39,6 @@ public interface ObjectStreamConstants {
|
||||
@@ -38,11 +38,6 @@ public interface ObjectStreamConstants {
|
||||
*/
|
||||
static final short STREAM_MAGIC = (short)0xaced;
|
||||
|
||||
/**
|
||||
- /**
|
||||
- * Magic number that is written to the stream header when using fastserilizer.
|
||||
- */
|
||||
- static final short STREAM_MAGIC_FAST = (short)0xdeca;
|
||||
-
|
||||
- /**
|
||||
/**
|
||||
* Version number that is written to the stream header.
|
||||
*/
|
||||
static final short STREAM_VERSION = 5;
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
2.19.0
|
||||
|
||||
|
||||
15
fix_macroAssembler_missing_matcher_header_file_causing_build_failure.patch
Executable file
15
fix_macroAssembler_missing_matcher_header_file_causing_build_failure.patch
Executable file
@ -0,0 +1,15 @@
|
||||
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
|
||||
index b6b070e62..60dc92953 100644
|
||||
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
|
||||
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "c1/c1_LIRAssembler.hpp"
|
||||
#endif
|
||||
#ifdef COMPILER2
|
||||
+#include "opto/matcher.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
#include "opto/compile.hpp"
|
||||
#include "opto/intrinsicnode.hpp"
|
||||
--
|
||||
2.19.0
|
||||
|
||||
Binary file not shown.
@ -114,7 +114,7 @@
|
||||
|
||||
# New Version-String scheme-style defines
|
||||
%global majorver 11
|
||||
%global securityver 13
|
||||
%global securityver 14
|
||||
# buildjdkver is usually same as %%{majorver},
|
||||
# but in time of bootstrap of next jdk, it is majorver-1,
|
||||
# and this it is better to change it here, on single place
|
||||
@ -135,7 +135,7 @@
|
||||
|
||||
%global project jdk-updates
|
||||
%global repo jdk11u
|
||||
%global revision jdk-11.0.13-ga
|
||||
%global revision jdk-11.0.14-ga
|
||||
%global full_revision %{project}-%{repo}-%{revision}
|
||||
# priority must be 7 digits in total
|
||||
# setting to 1, so debug ones can have 0
|
||||
@ -506,7 +506,7 @@ exit 0
|
||||
%dir %{etcjavadir -- %{?1}}/conf/security/policy/limited
|
||||
%dir %{etcjavadir -- %{?1}}/conf/security/policy/unlimited
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/default.policy
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/blacklisted.certs
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/blocked.certs
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/public_suffix_list.dat
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/exempt_local.policy
|
||||
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_local.policy
|
||||
@ -740,7 +740,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release}
|
||||
|
||||
Name: java-%{javaver}-%{origin}
|
||||
Version: %{newjavaver}.%{buildver}
|
||||
Release: 6
|
||||
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
|
||||
@ -825,7 +825,8 @@ Patch35: NUMA-Aware-Implementation-humongous-region.patch
|
||||
Patch36: ZGC-in-c1-load-barrier-d0-and-d1-registers-miss-restoring.patch
|
||||
Patch37: fix-compile-error-without-disable-precompiled-headers.patch
|
||||
Patch38: fast-serializer-jdk11.patch
|
||||
Patch39: fix-jck-failure-on-FastSerializer.patch
|
||||
Patch39: dfx-enhancement-of-FastSerializer.patch
|
||||
Patch40: fix-jck-failure-on-FastSerializer.patch
|
||||
Patch42: 8229496-SIGFPE-division-by-zero-in-C2-OSR-compiled-method.patch
|
||||
Patch45: leaf-optimize-in-ParallelScanvageGC.patch
|
||||
Patch46: ZGC-correct-free-heap-size-excluding-waste-in-rule_allocation_rate.patch
|
||||
@ -834,16 +835,17 @@ Patch48: 8205921-Optimizing-best_of_2-work-stealing-queue-selection.patch
|
||||
|
||||
# 11.0.9
|
||||
Patch55: 8215047-Task-terminators-do-not-complete-termination-in-consistent-state.patch
|
||||
Patch57: add-zgc-parameter-adaptation-feature.patch
|
||||
Patch58: add-integerCache-feature.patch
|
||||
Patch59: add-SVE-backend-feature.patch
|
||||
Patch56: add-zgc-parameter-adaptation-feature.patch
|
||||
Patch57: add-integerCache-feature.patch
|
||||
Patch58: 8231441-1-AArch64-Initial-SVE-backend-support.patch
|
||||
Patch59: 8231441-2-AArch64-Initial-SVE-backend-support.patch
|
||||
Patch60: 8231441-3-AArch64-Initial-SVE-backend-support.patch
|
||||
|
||||
# 11.0.10
|
||||
Patch61: downgrade-the-symver-of-log2f-posix-spawn.patch
|
||||
Patch62: 8254078-DataOutputStream-is-very-slow-post-disabling.patch
|
||||
Patch65: add-LazyBox-feature.patch
|
||||
Patch66: add-G1-Full-GC-optimization.patch
|
||||
Patch67: 8214535-support-Jmap-parallel.patch
|
||||
Patch68: src-openeuler-openjdk-11-resolve-code-inconsistencies.patch
|
||||
Patch69: G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch
|
||||
|
||||
@ -866,7 +868,9 @@ Patch82: PS-introduce-UsePSRelaxedForwardee-to-enable-using-r.patch
|
||||
Patch83: 8273111-Default-timezone-should-return-zone-ID-if-locatiome-is-valid-but-not-canonicalization-on-linux.patch
|
||||
Patch84: fix-memcpy-compile-warning-when-building-on-linux-x86.patch
|
||||
Patch85: 8239017-cmp-baseline-fails-because-of-differences-in-TimeZoneNames_kea.patch
|
||||
Patch86: Delete-expired-certificate-globalsignr2ca.patch
|
||||
# 11.0.14
|
||||
Patch86: 8252103-support-Jmap-parallel-heap-inspection.patch
|
||||
Patch87: fix_macroAssembler_missing_matcher_header_file_causing_build_failure.patch
|
||||
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: alsa-lib-devel
|
||||
@ -1120,20 +1124,22 @@ pushd %{top_level_dir_name}
|
||||
%patch37 -p1
|
||||
%patch38 -p1
|
||||
%patch39 -p1
|
||||
%patch40 -p1
|
||||
%patch42 -p1
|
||||
%patch45 -p1
|
||||
%patch46 -p1
|
||||
%patch47 -p1
|
||||
%patch48 -p1
|
||||
%patch55 -p1
|
||||
%patch56 -p1
|
||||
%patch57 -p1
|
||||
%patch58 -p1
|
||||
%patch59 -p1
|
||||
%patch60 -p1
|
||||
%patch61 -p1
|
||||
%patch62 -p1
|
||||
%patch65 -p1
|
||||
%patch66 -p1
|
||||
%patch67 -p1
|
||||
%patch68 -p1
|
||||
%patch69 -p1
|
||||
%patch71 -p1
|
||||
@ -1151,6 +1157,7 @@ pushd %{top_level_dir_name}
|
||||
%patch84 -p1
|
||||
%patch85 -p1
|
||||
%patch86 -p1
|
||||
%patch87 -p1
|
||||
popd # openjdk
|
||||
|
||||
# %patch1000
|
||||
@ -1653,6 +1660,9 @@ require "copy_jdk_configs.lua"
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Feb 8 2022 kuenking111 <wangkun49@huawei.com> - 1:11.0.14.9-0
|
||||
- Update to 11.0.14+9 (GA)
|
||||
|
||||
* Tue Dec 21 2021 kuenking111 <wangkun49@huawei.com> - 1:11.0.13.7-6
|
||||
- delete stack protection
|
||||
|
||||
|
||||
@ -484,19 +484,6 @@ index c60609617..f0b8638c1 100644
|
||||
case Humongous: return "Humongous";
|
||||
case NotInCSet: return "NotInCSet";
|
||||
case Young: return "Young";
|
||||
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
index c70d8e89a..c8a3abaf3 100644
|
||||
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
|
||||
@@ -542,7 +542,7 @@ public:
|
||||
// Claim the block and get the block index.
|
||||
size_t claim_and_get_block() {
|
||||
size_t block_index;
|
||||
- block_index = Atomic::add(1u, &_claimed_index) - 1; // TODO: original impl is: Atomic::fetch_and_add(&_claimed_index, 1u);
|
||||
+ block_index = Atomic::add(1u, &_claimed_index) - 1;
|
||||
|
||||
PSOldGen* old_gen = ParallelScavengeHeap::heap()->old_gen();
|
||||
size_t num_claims = old_gen->num_iterable_blocks() + NumNonOldGenClaims;
|
||||
diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
|
||||
index 8b4be7d11..1b9dd5ada 100644
|
||||
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
|
||||
@ -544,19 +531,6 @@ index 0f3c429ed..82fde2c94 100644
|
||||
do_task<T>(q, cl, live_data, &t);
|
||||
work++;
|
||||
} else {
|
||||
diff --git a/src/hotspot/share/memory/heapInspection.cpp b/src/hotspot/share/memory/heapInspection.cpp
|
||||
index dd76165a7..d492751a6 100644
|
||||
--- a/src/hotspot/share/memory/heapInspection.cpp
|
||||
+++ b/src/hotspot/share/memory/heapInspection.cpp
|
||||
@@ -746,7 +746,7 @@ class RecordInstanceClosure : public ObjectClosure {
|
||||
};
|
||||
|
||||
// Heap inspection for every worker.
|
||||
-// When native OOM hanppens for KlassInfoTable, set _success to false.
|
||||
+// When native OOM happens for KlassInfoTable, set _success to false.
|
||||
void ParHeapInspectTask::work(uint worker_id) {
|
||||
uintx missed_count = 0;
|
||||
bool merge_success = true;
|
||||
diff --git a/src/hotspot/share/opto/graphKit.cpp b/src/hotspot/share/opto/graphKit.cpp
|
||||
index 22222efbc..5849e8f86 100644
|
||||
--- a/src/hotspot/share/opto/graphKit.cpp
|
||||
@ -640,23 +614,6 @@ index 74aab91f9..6cf2d2a6d 100644
|
||||
}
|
||||
|
||||
// Verify that verify_me made the same decisions as a fresh run.
|
||||
diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp
|
||||
index 784dc782f..9158f6d36 100644
|
||||
--- a/src/hotspot/share/prims/unsafe.cpp
|
||||
+++ b/src/hotspot/share/prims/unsafe.cpp
|
||||
@@ -1100,9 +1100,11 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = {
|
||||
{CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)},
|
||||
|
||||
{CC "isBigEndian0", CC "()Z", FN_PTR(Unsafe_isBigEndian0)},
|
||||
+ {CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)},
|
||||
+
|
||||
{CC "getUseHashMapIntegerCache", CC "()Z", FN_PTR(Unsafe_GetUseHashMapIntegerCache)},
|
||||
{CC "getUseFastSerializer", CC "()Z", FN_PTR(Unsafe_GetUseFastSerializer)},
|
||||
- {CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)}
|
||||
+
|
||||
};
|
||||
|
||||
#undef CC
|
||||
diff --git a/src/hotspot/share/runtime/memcpy.cpp b/src/hotspot/share/runtime/memcpy.cpp
|
||||
new file mode 100644
|
||||
index 000000000..ed8330679
|
||||
|
||||
@ -172,13 +172,14 @@ index 4f272394b..9e93fefac 100644
|
||||
bool refs_discovery_is_mt() const {
|
||||
// Note: CMS does MT-discovery during the parallel-remark
|
||||
diff --git a/test/jdk/sun/tools/jmap/BasicJMapTest.java b/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
index 960705e24..f87774f93 100644
|
||||
index 327feb25d..ad890f880 100644
|
||||
--- a/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
+++ b/test/jdk/sun/tools/jmap/BasicJMapTest.java
|
||||
@@ -74,6 +74,20 @@ import jdk.testlibrary.ProcessTools;
|
||||
* @run main/othervm/timeout=240 -XX:+UseG1GC BasicJMapTest
|
||||
@@ -45,6 +45,21 @@ import jdk.testlibrary.ProcessTools;
|
||||
* @build jdk.test.lib.hprof.util.*
|
||||
* @run main/timeout=240 BasicJMapTest
|
||||
*/
|
||||
|
||||
+
|
||||
+/*
|
||||
+ * @test id=CMS
|
||||
+ * @summary Unit test for jmap utility (CMS GC)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user