Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Automatic merge of jdk:master into master
  • Loading branch information
duke committed Mar 6, 2021
2 parents 21bee5f + e1cad97 commit 587d6c046c1cfc40c771e5e073ae8b1d6d2e281a
Showing with 742 additions and 186 deletions.
  1. +16 −0 src/hotspot/share/gc/parallel/psCompactionManager.cpp
  2. +7 −12 src/hotspot/share/gc/parallel/psCompactionManager.hpp
  3. +21 −14 src/hotspot/share/gc/parallel/psParallelCompact.cpp
  4. +3 −1 src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp
  5. +132 −78 src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
  6. +24 −0 src/hotspot/share/opto/compile.cpp
  7. +4 −3 src/hotspot/share/opto/compile.hpp
  8. +3 −0 src/hotspot/share/opto/macro.cpp
  9. +25 −13 src/hotspot/share/opto/memnode.cpp
  10. +6 −7 src/hotspot/share/opto/parse2.cpp
  11. +34 −1 src/hotspot/share/opto/vectorIntrinsics.cpp
  12. +1 −7 src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java
  13. +44 −1 src/java.base/share/classes/java/util/Collections.java
  14. +5 −0 src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java
  15. +0 −4 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
  16. +4 −0 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java
  17. +24 −18 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
  18. +0 −2 test/hotspot/gtest/gc/parallel/test_psParallelCompact.cpp
  19. +108 −0 test/hotspot/jtreg/compiler/escapeAnalysis/TestValAtSafepointOverflowsInt.java
  20. +58 −0 test/hotspot/jtreg/compiler/vectorapi/TestIntrinsicBailOut.java
  21. +102 −0 test/jdk/java/util/Collections/WrappedUnmodifiableCollections.java
  22. +5 −10 test/jdk/sun/security/krb5/canonicalize/Test.java
  23. +7 −15 test/jdk/sun/security/x509/URICertStore/ExtensionsWithLDAP.java
  24. +109 −0 test/langtools/jdk/javadoc/doclet/testExceptionInheritance/TestExceptionInheritance.java
@@ -179,3 +179,19 @@ void ParCompactionManager::push_shadow_region(size_t shadow_region) {
void ParCompactionManager::remove_all_shadow_regions() {
_shadow_region_array->clear();
}

#ifdef ASSERT
void ParCompactionManager::verify_all_marking_stack_empty() {
uint parallel_gc_threads = ParallelGCThreads;
for (uint i = 0; i <= parallel_gc_threads; i++) {
assert(_manager_array[i]->marking_stacks_empty(), "Marking stack should be empty");
}
}

void ParCompactionManager::verify_all_region_stack_empty() {
uint parallel_gc_threads = ParallelGCThreads;
for (uint i = 0; i <= parallel_gc_threads; i++) {
assert(_manager_array[i]->region_stack()->is_empty(), "Region stack should be empty");
}
}
#endif
@@ -46,10 +46,6 @@ class ParCompactionManager : public CHeapObj<mtGC> {
friend class PCRefProcTask;
friend class MarkFromRootsTask;
friend class UpdateDensePrefixAndCompactionTask;

public:


private:
typedef GenericTaskQueue<oop, mtGC> OopTaskQueue;
typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
@@ -69,7 +65,6 @@ class ParCompactionManager : public CHeapObj<mtGC> {
static RegionTaskQueueSet* _region_task_queues;
static PSOldGen* _old_gen;

private:
OverflowTaskQueue<oop, mtGC> _marking_stack;
ObjArrayTaskQueue _objarray_stack;
size_t _next_shadow_region;
@@ -143,7 +138,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {

RegionTaskQueue* region_stack() { return &_region_stack; }

inline static ParCompactionManager* manager_array(uint index);
static ParCompactionManager* get_vmthread_cm() { return _manager_array[ParallelGCThreads]; }

ParCompactionManager();

@@ -196,13 +191,13 @@ class ParCompactionManager : public CHeapObj<mtGC> {
FollowStackClosure(ParCompactionManager* cm) : _compaction_manager(cm) { }
virtual void do_void();
};
};

inline ParCompactionManager* ParCompactionManager::manager_array(uint index) {
assert(_manager_array != NULL, "access of NULL manager_array");
assert(index <= ParallelGCThreads, "out of range manager_array access");
return _manager_array[index];
}
// Called after marking.
static void verify_all_marking_stack_empty() NOT_DEBUG_RETURN;

// Region staks hold regions in from-space; called after compaction.
static void verify_all_region_stack_empty() NOT_DEBUG_RETURN;
};

bool ParCompactionManager::marking_stacks_empty() const {
return _marking_stack.is_empty() && _objarray_stack.is_empty();
@@ -1784,8 +1784,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
const PreGenGCValues pre_gc_values = heap->get_pre_gc_values();

// Get the compaction manager reserved for the VM thread.
ParCompactionManager* const vmthread_cm =
ParCompactionManager::manager_array(ParallelScavengeHeap::heap()->workers().total_workers());
ParCompactionManager* const vmthread_cm = ParCompactionManager::get_vmthread_cm();

{
const uint active_workers =
@@ -1837,6 +1836,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
compaction_start.update();
compact();

ParCompactionManager::verify_all_region_stack_empty();

// Reset the mark bitmap, summary data, and do other bookkeeping. Must be
// done before resizing.
post_compact();
@@ -1933,15 +1934,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
heap->post_full_gc_dump(&_gc_timer);
}

#ifdef ASSERT
for (size_t i = 0; i < ParallelGCThreads + 1; ++i) {
ParCompactionManager* const cm =
ParCompactionManager::manager_array(int(i));
assert(cm->marking_stack()->is_empty(), "should be empty");
assert(cm->region_stack()->is_empty(), "Region stack " SIZE_FORMAT " is not empty", i);
}
#endif // ASSERT

if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
Universe::verify("After GC");
}
@@ -2181,7 +2173,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
}

// This is the point where the entire marking should have completed.
assert(cm->marking_stacks_empty(), "Marking should have completed");
ParCompactionManager::verify_all_marking_stack_empty();

{
GCTraceTime(Debug, gc, phases) tm("Weak Processing", &_gc_timer);
@@ -2207,6 +2199,19 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
_gc_tracer.report_object_count_after_gc(is_alive_closure());
}

#ifdef ASSERT
void PCAdjustPointerClosure::verify_cm(ParCompactionManager* cm) {
assert(cm != NULL, "associate ParCompactionManage should not be NULL");
auto vmthread_cm = ParCompactionManager::get_vmthread_cm();
if (Thread::current()->is_VM_thread()) {
assert(cm == vmthread_cm, "VM threads should use ParCompactionManager from get_vmthread_cm()");
} else {
assert(Thread::current()->is_GC_task_thread(), "Must be a GC thread");
assert(cm != vmthread_cm, "GC threads should use ParCompactionManager from gc_thread_compaction_manager()");
}
}
#endif

class PSAdjustTask final : public AbstractGangTask {
SubTasksDone _sub_tasks;
WeakProcessor::Task _weak_proc_task;
@@ -2614,9 +2619,11 @@ void PSParallelCompact::compact() {
}

{
// Update the deferred objects, if any. Any compaction manager can be used.
GCTraceTime(Trace, gc, phases) tm("Deferred Updates", &_gc_timer);
ParCompactionManager* cm = ParCompactionManager::manager_array(0);
// Update the deferred objects, if any. In principle, any compaction
// manager can be used. However, since the current thread is VM thread, we
// use the rightful one to keep the verification logic happy.
ParCompactionManager* cm = ParCompactionManager::get_vmthread_cm();
for (unsigned int id = old_space_id; id < last_space_id; ++id) {
update_deferred_objects(cm, SpaceId(id));
}
@@ -126,7 +126,7 @@ inline void PSParallelCompact::adjust_pointer(T* p, ParCompactionManager* cm) {
class PCAdjustPointerClosure: public BasicOopIterateClosure {
public:
PCAdjustPointerClosure(ParCompactionManager* cm) {
assert(cm != NULL, "associate ParCompactionManage should not be NULL");
verify_cm(cm);
_cm = cm;
}
template <typename T> void do_oop_nv(T* p) { PSParallelCompact::adjust_pointer(p, _cm); }
@@ -136,6 +136,8 @@ class PCAdjustPointerClosure: public BasicOopIterateClosure {
virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
private:
ParCompactionManager* _cm;

static void verify_cm(ParCompactionManager* cm) NOT_DEBUG_RETURN;
};

#endif // SHARE_GC_PARALLEL_PSPARALLELCOMPACT_INLINE_HPP
@@ -1636,46 +1636,74 @@ void BytecodeInterpreter::run(interpreterState istate) {
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
OrderAccess::fence();
}
if (tos_type == atos) {
VERIFY_OOP(obj->obj_field_acquire(field_offset));
SET_STACK_OBJECT(obj->obj_field_acquire(field_offset), -1);
} else if (tos_type == itos) {
SET_STACK_INT(obj->int_field_acquire(field_offset), -1);
} else if (tos_type == ltos) {
SET_STACK_LONG(obj->long_field_acquire(field_offset), 0);
MORE_STACK(1);
} else if (tos_type == btos || tos_type == ztos) {
SET_STACK_INT(obj->byte_field_acquire(field_offset), -1);
} else if (tos_type == ctos) {
SET_STACK_INT(obj->char_field_acquire(field_offset), -1);
} else if (tos_type == stos) {
SET_STACK_INT(obj->short_field_acquire(field_offset), -1);
} else if (tos_type == ftos) {
SET_STACK_FLOAT(obj->float_field_acquire(field_offset), -1);
} else {
SET_STACK_DOUBLE(obj->double_field_acquire(field_offset), 0);
MORE_STACK(1);
switch (tos_type) {
case btos:
case ztos:
SET_STACK_INT(obj->byte_field_acquire(field_offset), -1);
break;
case ctos:
SET_STACK_INT(obj->char_field_acquire(field_offset), -1);
break;
case stos:
SET_STACK_INT(obj->short_field_acquire(field_offset), -1);
break;
case itos:
SET_STACK_INT(obj->int_field_acquire(field_offset), -1);
break;
case ftos:
SET_STACK_FLOAT(obj->float_field_acquire(field_offset), -1);
break;
case ltos:
SET_STACK_LONG(obj->long_field_acquire(field_offset), 0);
MORE_STACK(1);
break;
case dtos:
SET_STACK_DOUBLE(obj->double_field_acquire(field_offset), 0);
MORE_STACK(1);
break;
case atos: {
oop val = obj->obj_field_acquire(field_offset);
VERIFY_OOP(val);
SET_STACK_OBJECT(val, -1);
break;
}
default:
ShouldNotReachHere();
}
} else {
if (tos_type == atos) {
VERIFY_OOP(obj->obj_field(field_offset));
SET_STACK_OBJECT(obj->obj_field(field_offset), -1);
} else if (tos_type == itos) {
SET_STACK_INT(obj->int_field(field_offset), -1);
} else if (tos_type == ltos) {
SET_STACK_LONG(obj->long_field(field_offset), 0);
MORE_STACK(1);
} else if (tos_type == btos || tos_type == ztos) {
SET_STACK_INT(obj->byte_field(field_offset), -1);
} else if (tos_type == ctos) {
SET_STACK_INT(obj->char_field(field_offset), -1);
} else if (tos_type == stos) {
SET_STACK_INT(obj->short_field(field_offset), -1);
} else if (tos_type == ftos) {
SET_STACK_FLOAT(obj->float_field(field_offset), -1);
} else {
SET_STACK_DOUBLE(obj->double_field(field_offset), 0);
MORE_STACK(1);
switch (tos_type) {
case btos:
case ztos:
SET_STACK_INT(obj->byte_field(field_offset), -1);
break;
case ctos:
SET_STACK_INT(obj->char_field(field_offset), -1);
break;
case stos:
SET_STACK_INT(obj->short_field(field_offset), -1);
break;
case itos:
SET_STACK_INT(obj->int_field(field_offset), -1);
break;
case ftos:
SET_STACK_FLOAT(obj->float_field(field_offset), -1);
break;
case ltos:
SET_STACK_LONG(obj->long_field(field_offset), 0);
MORE_STACK(1);
break;
case dtos:
SET_STACK_DOUBLE(obj->double_field(field_offset), 0);
MORE_STACK(1);
break;
case atos: {
oop val = obj->obj_field(field_offset);
VERIFY_OOP(val);
SET_STACK_OBJECT(val, -1);
break;
}
default:
ShouldNotReachHere();
}
}

@@ -1745,49 +1773,75 @@ void BytecodeInterpreter::run(interpreterState istate) {
//
int field_offset = cache->f2_as_index();
if (cache->is_volatile()) {
if (tos_type == itos) {
obj->release_int_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == atos) {
VERIFY_OOP(STACK_OBJECT(-1));
obj->release_obj_field_put(field_offset, STACK_OBJECT(-1));
} else if (tos_type == btos) {
obj->release_byte_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == ztos) {
int bool_field = STACK_INT(-1); // only store LSB
obj->release_byte_field_put(field_offset, (bool_field & 1));
} else if (tos_type == ltos) {
obj->release_long_field_put(field_offset, STACK_LONG(-1));
} else if (tos_type == ctos) {
obj->release_char_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == stos) {
obj->release_short_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == ftos) {
obj->release_float_field_put(field_offset, STACK_FLOAT(-1));
} else {
obj->release_double_field_put(field_offset, STACK_DOUBLE(-1));
switch (tos_type) {
case ztos:
obj->release_byte_field_put(field_offset, (STACK_INT(-1) & 1)); // only store LSB
break;
case btos:
obj->release_byte_field_put(field_offset, STACK_INT(-1));
break;
case ctos:
obj->release_char_field_put(field_offset, STACK_INT(-1));
break;
case stos:
obj->release_short_field_put(field_offset, STACK_INT(-1));
break;
case itos:
obj->release_int_field_put(field_offset, STACK_INT(-1));
break;
case ftos:
obj->release_float_field_put(field_offset, STACK_FLOAT(-1));
break;
case ltos:
obj->release_long_field_put(field_offset, STACK_LONG(-1));
break;
case dtos:
obj->release_double_field_put(field_offset, STACK_DOUBLE(-1));
break;
case atos: {
oop val = STACK_OBJECT(-1);
VERIFY_OOP(val);
obj->release_obj_field_put(field_offset, val);
break;
}
default:
ShouldNotReachHere();
}
OrderAccess::storeload();
} else {
if (tos_type == itos) {
obj->int_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == atos) {
VERIFY_OOP(STACK_OBJECT(-1));
obj->obj_field_put(field_offset, STACK_OBJECT(-1));
} else if (tos_type == btos) {
obj->byte_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == ztos) {
int bool_field = STACK_INT(-1); // only store LSB
obj->byte_field_put(field_offset, (bool_field & 1));
} else if (tos_type == ltos) {
obj->long_field_put(field_offset, STACK_LONG(-1));
} else if (tos_type == ctos) {
obj->char_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == stos) {
obj->short_field_put(field_offset, STACK_INT(-1));
} else if (tos_type == ftos) {
obj->float_field_put(field_offset, STACK_FLOAT(-1));
} else {
obj->double_field_put(field_offset, STACK_DOUBLE(-1));
switch (tos_type) {
case ztos:
obj->byte_field_put(field_offset, (STACK_INT(-1) & 1)); // only store LSB
break;
case btos:
obj->byte_field_put(field_offset, STACK_INT(-1));
break;
case ctos:
obj->char_field_put(field_offset, STACK_INT(-1));
break;
case stos:
obj->short_field_put(field_offset, STACK_INT(-1));
break;
case itos:
obj->int_field_put(field_offset, STACK_INT(-1));
break;
case ftos:
obj->float_field_put(field_offset, STACK_FLOAT(-1));
break;
case ltos:
obj->long_field_put(field_offset, STACK_LONG(-1));
break;
case dtos:
obj->double_field_put(field_offset, STACK_DOUBLE(-1));
break;
case atos: {
oop val = STACK_OBJECT(-1);
VERIFY_OOP(val);
obj->obj_field_put(field_offset, val);
break;
}
default:
ShouldNotReachHere();
}
}

0 comments on commit 587d6c0

Please sign in to comment.