Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[GR-43657] Merge tag jdk-11.0.19+7.
Browse files Browse the repository at this point in the history
PullRequest: labsjdk-ce-11/333
  • Loading branch information
marwan-hallaoui committed Apr 18, 2023
2 parents 19d8c74 + 9ce5210 commit 2e18fb0
Show file tree
Hide file tree
Showing 50 changed files with 504 additions and 237 deletions.
4 changes: 2 additions & 2 deletions make/autoconf/version-numbers
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -37,7 +37,7 @@ DEFAULT_VERSION_DATE=2023-04-18
DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11"
DEFAULT_PROMOTED_VERSION_PRE=ea
DEFAULT_PROMOTED_VERSION_PRE=

LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5071,8 +5071,9 @@ void CMSRefProcTaskProxy::work(uint worker_id) {
CMSParDrainMarkingStackClosure par_drain_stack(_collector, _span,
_mark_bit_map,
work_queue(worker_id));
BarrierEnqueueDiscoveredFieldClosure enqueue;
CMSIsAliveClosure is_alive_closure(_span, _mark_bit_map);
_task.work(worker_id, is_alive_closure, par_keep_alive, par_drain_stack);
_task.work(worker_id, is_alive_closure, par_keep_alive, enqueue, par_drain_stack);
if (_task.marks_oops_alive()) {
do_work_steal(worker_id, &par_drain_stack, &par_keep_alive,
_collector->hash_seed(worker_id));
Expand Down Expand Up @@ -5170,6 +5171,7 @@ void CMSCollector::refProcessingWork() {
// Setup keep_alive and complete closures.
CMSKeepAliveClosure cmsKeepAliveClosure(this, _span, &_markBitMap,
&_markStack, false /* !preclean */);
BarrierEnqueueDiscoveredFieldClosure cmsEnqueue;
CMSDrainMarkingStackClosure cmsDrainMarkingStackClosure(this,
_span, &_markBitMap, &_markStack,
&cmsKeepAliveClosure, false /* !preclean */);
Expand All @@ -5195,12 +5197,14 @@ void CMSCollector::refProcessingWork() {
CMSRefProcTaskExecutor task_executor(*this);
stats = rp->process_discovered_references(&_is_alive_closure,
&cmsKeepAliveClosure,
&cmsEnqueue,
&cmsDrainMarkingStackClosure,
&task_executor,
&pt);
} else {
stats = rp->process_discovered_references(&_is_alive_closure,
&cmsKeepAliveClosure,
&cmsEnqueue,
&cmsDrainMarkingStackClosure,
NULL,
&pt);
Expand Down
7 changes: 5 additions & 2 deletions src/hotspot/share/gc/cms/parNewGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,10 @@ void ParNewRefProcTaskProxy::work(uint worker_id) {
HandleMark hm;
ParScanThreadState& par_scan_state = _state_set.thread_state(worker_id);
par_scan_state.set_young_old_boundary(_young_old_boundary);
BarrierEnqueueDiscoveredFieldClosure enqueue;
_task.work(worker_id, par_scan_state.is_alive_closure(),
par_scan_state.keep_alive_closure(),
enqueue,
par_scan_state.evacuate_followers_closure());
}

Expand Down Expand Up @@ -948,6 +950,7 @@ void ParNewGeneration::collect(bool full,
IsAliveClosure is_alive(this);
ScanWeakRefClosure scan_weak_ref(this);
KeepAliveClosure keep_alive(&scan_weak_ref);
BarrierEnqueueDiscoveredFieldClosure enqueue;
ScanClosure scan_without_gc_barrier(this, false);
ScanClosureWithParBarrier scan_with_gc_barrier(this, true);
set_promo_failure_scan_stack_closure(&scan_without_gc_barrier);
Expand All @@ -960,13 +963,13 @@ void ParNewGeneration::collect(bool full,
ReferenceProcessorPhaseTimes pt(_gc_timer, rp->max_num_queues());
if (rp->processing_is_mt()) {
ParNewRefProcTaskExecutor task_executor(*this, *_old_gen, thread_state_set);
stats = rp->process_discovered_references(&is_alive, &keep_alive,
stats = rp->process_discovered_references(&is_alive, &keep_alive, &enqueue,
&evacuate_followers, &task_executor,
&pt);
} else {
thread_state_set.flush();
gch->save_marks();
stats = rp->process_discovered_references(&is_alive, &keep_alive,
stats = rp->process_discovered_references(&is_alive, &keep_alive, &enqueue,
&evacuate_followers, NULL,
&pt);
}
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/gc/g1/dirtyCardQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class DirtyCardQueueSet: public PtrQueueSet {

// If any threads have partial logs, add them to the global list of logs.
void concatenate_logs();
void clear_n_completed_buffers() { _n_completed_buffers = 0;}

jint processed_buffers_mut() {
return _processed_buffers_mut;
Expand Down
32 changes: 30 additions & 2 deletions src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,6 @@ void G1CollectedHeap::iterate_dirty_card_closure(CardTableEntryClosure* cl, uint
n_completed_buffers++;
}
g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers, G1GCPhaseTimes::UpdateRSProcessedBuffers);
dcqs.clear_n_completed_buffers();
assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
}

Expand Down Expand Up @@ -3844,6 +3843,31 @@ class G1CopyingKeepAliveClosure: public OopClosure {
}
};

// Special closure for enqueuing discovered fields: during enqueue the card table
// may not be in shape to properly handle normal barrier calls (e.g. card marks
// in regions that failed evacuation, scribbling of various values by card table
// scan code). Additionally the regular barrier enqueues into the "global"
// DCQS, but during GC we need these to-be-refined entries in the GC local queue
// so that after clearing the card table, the redirty cards phase will properly
// mark all dirty cards to be picked up by refinement.
class G1EnqueueDiscoveredFieldClosure : public EnqueueDiscoveredFieldClosure {
G1CollectedHeap* _g1h;
G1ParScanThreadState* _pss;

public:
G1EnqueueDiscoveredFieldClosure(G1CollectedHeap* g1h, G1ParScanThreadState* pss) : _g1h(g1h), _pss(pss) { }

virtual void enqueue(HeapWord* discovered_field_addr, oop value) {
assert(_g1h->is_in(discovered_field_addr), PTR_FORMAT " is not in heap ", p2i(discovered_field_addr));
// Store the value first, whatever it is.
RawAccess<>::oop_store(discovered_field_addr, value);
if (value == NULL) {
return;
}
_pss->write_ref_field_post(discovered_field_addr, value);
}
};

// Serial drain queue closure. Called as the 'complete_gc'
// closure for each discovered list in some of the
// reference processing phases.
Expand Down Expand Up @@ -3933,11 +3957,12 @@ class G1STWRefProcTaskProxy: public AbstractGangTask {
// Keep alive closure.
G1CopyingKeepAliveClosure keep_alive(_g1h, pss->closures()->raw_strong_oops(), pss);

G1EnqueueDiscoveredFieldClosure enqueue(_g1h, pss);
// Complete GC closure
G1ParEvacuateFollowersClosure drain_queue(_g1h, pss, _task_queues, _terminator);

// Call the reference processing task's work routine.
_proc_task.work(worker_id, is_alive, keep_alive, drain_queue);
_proc_task.work(worker_id, is_alive, keep_alive, enqueue, drain_queue);

// Note we cannot assert that the refs array is empty here as not all
// of the processing tasks (specifically phase2 - pp2_work) execute
Expand Down Expand Up @@ -3985,6 +4010,7 @@ void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per
// Keep alive closure.
G1CopyingKeepAliveClosure keep_alive(this, pss->closures()->raw_strong_oops(), pss);

G1EnqueueDiscoveredFieldClosure enqueue(this, pss);
// Serial Complete GC closure
G1STWDrainQueueClosure drain_queue(this, pss);

Expand All @@ -3998,6 +4024,7 @@ void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per
// Serial reference processing...
stats = rp->process_discovered_references(&is_alive,
&keep_alive,
&enqueue,
&drain_queue,
NULL,
pt);
Expand All @@ -4012,6 +4039,7 @@ void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per
G1STWRefProcTaskExecutor par_task_executor(this, per_thread_states, workers(), _task_queues);
stats = rp->process_discovered_references(&is_alive,
&keep_alive,
&enqueue,
&drain_queue,
&par_task_executor,
pt);
Expand Down
5 changes: 4 additions & 1 deletion src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,9 +1550,10 @@ class G1CMRefProcTaskProxy : public AbstractGangTask {
G1CMTask* task = _cm->task(worker_id);
G1CMIsAliveClosure g1_is_alive(_g1h);
G1CMKeepAliveAndDrainClosure g1_par_keep_alive(_cm, task, false /* is_serial */);
BarrierEnqueueDiscoveredFieldClosure enqueue;
G1CMDrainMarkingStackClosure g1_par_drain(_cm, task, false /* is_serial */);

_proc_task.work(worker_id, g1_is_alive, g1_par_keep_alive, g1_par_drain);
_proc_task.work(worker_id, g1_is_alive, g1_par_keep_alive, enqueue, g1_par_drain);
}
};

Expand Down Expand Up @@ -1609,6 +1610,7 @@ void G1ConcurrentMark::weak_refs_work(bool clear_all_soft_refs) {
// their own instances of these closures, which do their own
// synchronization among themselves.
G1CMKeepAliveAndDrainClosure g1_keep_alive(this, task(0), true /* is_serial */);
BarrierEnqueueDiscoveredFieldClosure g1_enqueue;
G1CMDrainMarkingStackClosure g1_drain_mark_stack(this, task(0), true /* is_serial */);

// We need at least one active thread. If reference processing
Expand Down Expand Up @@ -1640,6 +1642,7 @@ void G1ConcurrentMark::weak_refs_work(bool clear_all_soft_refs) {
const ReferenceProcessorStats& stats =
rp->process_discovered_references(&g1_is_alive,
&g1_keep_alive,
&g1_enqueue,
&g1_drain_mark_stack,
executor,
&pt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ G1FullGCReferenceProcessingExecutor::G1RefProcTaskProxy::G1RefProcTaskProxy(Proc
void G1FullGCReferenceProcessingExecutor::G1RefProcTaskProxy::work(uint worker_id) {
G1FullGCMarker* marker = _collector->marker(worker_id);
G1IsAliveClosure is_alive(_collector->mark_bitmap());
BarrierEnqueueDiscoveredFieldClosure enqueue;
G1FullKeepAliveClosure keep_alive(marker);
_proc_task.work(worker_id,
is_alive,
keep_alive,
enqueue,
*marker->stack_closure());
}

Expand All @@ -84,6 +86,7 @@ void G1FullGCReferenceProcessingExecutor::execute(STWGCTimer* timer, G1FullGCTra
G1FullGCMarker* marker = _collector->marker(0);
G1IsAliveClosure is_alive(_collector->mark_bitmap());
G1FullKeepAliveClosure keep_alive(marker);
BarrierEnqueueDiscoveredFieldClosure enqueue;
ReferenceProcessorPhaseTimes pt(timer, _reference_processor->max_num_queues());
AbstractRefProcTaskExecutor* executor = _reference_processor->processing_is_mt() ? this : NULL;

Expand All @@ -92,6 +95,7 @@ void G1FullGCReferenceProcessingExecutor::execute(STWGCTimer* timer, G1FullGCTra
const ReferenceProcessorStats& stats =
_reference_processor->process_discovered_references(&is_alive,
&keep_alive,
&enqueue,
marker->stack_closure(),
executor,
&pt);
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/share/gc/g1/g1ParScanThreadState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
template <class T> void do_oop_ext(T* ref);
template <class T> void push_on_queue(T* ref);

// Apply the post barrier to the given reference field. Enqueues the card of p
// if the barrier does not filter out the reference for some reason (e.g.
// p and q are in the same region, p is in survivor, p is in collection set)
// To be called during GC if nothing particular about p and obj are known.
template <class T> void write_ref_field_post(T* p, oop obj);

template <class T> void update_rs(HeapRegion* from, T* p, oop o) {
assert(!HeapRegion::is_in_same_region(p, o), "Caller should have filtered out cross-region references already.");
// If the field originates from the to-space, we don't need to include it
Expand Down
11 changes: 8 additions & 3 deletions src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {
"In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value());
}

write_ref_field_post(p, obj);
}

template <class T> void G1ParScanThreadState::write_ref_field_post(T* p, oop obj) {
assert(obj != NULL, "Must be");
if (!HeapRegion::is_in_same_region(p, obj)) {
HeapRegion* from = _g1h->heap_region_containing(p);
update_rs(from, p, obj);
if (HeapRegion::is_in_same_region(p, obj)) {
return;
}
HeapRegion* from = _g1h->heap_region_containing(p);
update_rs(from, p, obj);
}

template <class T> inline void G1ParScanThreadState::push_on_queue(T* ref) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/ptrQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class PtrQueueSet {
bool process_or_enqueue_complete_buffer(BufferNode* node);

bool completed_buffers_exist_dirty() {
return _n_completed_buffers > 0;
return _n_completed_buffers > 0 || _completed_buffers_head != NULL;
}

bool process_completed_buffers() { return _process_completed; }
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/parallel/pcTasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ void RefProcTaskProxy::do_it(GCTaskManager* manager, uint which)
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
BarrierEnqueueDiscoveredFieldClosure enqueue;
ParCompactionManager::FollowStackClosure follow_stack_closure(cm);
_rp_task.work(_work_id, *PSParallelCompact::is_alive_closure(),
mark_and_push_closure, follow_stack_closure);
mark_and_push_closure, enqueue, follow_stack_closure);
}

//
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/parallel/psMarkSweep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,10 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {

ref_processor()->setup_policy(clear_all_softrefs);
ReferenceProcessorPhaseTimes pt(_gc_timer, ref_processor()->max_num_queues());
BarrierEnqueueDiscoveredFieldClosure enqueue;
const ReferenceProcessorStats& stats =
ref_processor()->process_discovered_references(
is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL, &pt);
is_alive_closure(), mark_and_push_closure(), &enqueue, follow_stack_closure(), NULL, &pt);
gc_tracer()->report_gc_reference_stats(stats);
pt.print_all_references();
}
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/share/gc/parallel/psParallelCompact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2122,16 +2122,18 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
ReferenceProcessorStats stats;
ReferenceProcessorPhaseTimes pt(&_gc_timer, ref_processor()->max_num_queues());

BarrierEnqueueDiscoveredFieldClosure enqueue;

if (ref_processor()->processing_is_mt()) {
ref_processor()->set_active_mt_degree(active_gc_threads);

RefProcTaskExecutor task_executor;
stats = ref_processor()->process_discovered_references(
is_alive_closure(), &mark_and_push_closure, &follow_stack_closure,
is_alive_closure(), &mark_and_push_closure, &enqueue, &follow_stack_closure,
&task_executor, &pt);
} else {
stats = ref_processor()->process_discovered_references(
is_alive_closure(), &mark_and_push_closure, &follow_stack_closure, NULL,
is_alive_closure(), &mark_and_push_closure, &enqueue, &follow_stack_closure, NULL,
&pt);
}

Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/share/gc/parallel/psScavenge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ void PSRefProcTaskProxy::do_it(GCTaskManager* manager, uint which)
PSPromotionManager::gc_thread_promotion_manager(which);
assert(promotion_manager != NULL, "sanity check");
PSKeepAliveClosure keep_alive(promotion_manager);
BarrierEnqueueDiscoveredFieldClosure enqueue;
PSEvacuateFollowersClosure evac_followers(promotion_manager);
PSIsAliveClosure is_alive;
_rp_task.work(_work_id, is_alive, keep_alive, evac_followers);
_rp_task.work(_work_id, is_alive, keep_alive, enqueue, evac_followers);
}

class PSRefProcTaskExecutor: public AbstractRefProcTaskExecutor {
Expand Down Expand Up @@ -406,17 +407,18 @@ bool PSScavenge::invoke_no_policy() {
reference_processor()->setup_policy(false); // not always_clear
reference_processor()->set_active_mt_degree(active_workers);
PSKeepAliveClosure keep_alive(promotion_manager);
BarrierEnqueueDiscoveredFieldClosure enqueue;
PSEvacuateFollowersClosure evac_followers(promotion_manager);
ReferenceProcessorStats stats;
ReferenceProcessorPhaseTimes pt(&_gc_timer, reference_processor()->max_num_queues());
if (reference_processor()->processing_is_mt()) {
PSRefProcTaskExecutor task_executor;
stats = reference_processor()->process_discovered_references(
&_is_alive_closure, &keep_alive, &evac_followers, &task_executor,
&_is_alive_closure, &keep_alive, &enqueue, &evac_followers, &task_executor,
&pt);
} else {
stats = reference_processor()->process_discovered_references(
&_is_alive_closure, &keep_alive, &evac_followers, NULL, &pt);
&_is_alive_closure, &keep_alive, &enqueue, &evac_followers, NULL, &pt);
}

_gc_tracer.report_gc_reference_stats(stats);
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/serial/defNewGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,12 @@ void DefNewGeneration::collect(bool full,
evacuate_followers.do_void();

FastKeepAliveClosure keep_alive(this, &scan_weak_ref);
BarrierEnqueueDiscoveredFieldClosure enqueue;
ReferenceProcessor* rp = ref_processor();
rp->setup_policy(clear_all_soft_refs);
ReferenceProcessorPhaseTimes pt(_gc_timer, rp->max_num_queues());
const ReferenceProcessorStats& stats =
rp->process_discovered_references(&is_alive, &keep_alive, &evacuate_followers,
rp->process_discovered_references(&is_alive, &keep_alive, &enqueue, &evacuate_followers,
NULL, &pt);
gc_tracer.report_gc_reference_stats(stats);
gc_tracer.report_tenuring_threshold(tenuring_threshold());
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/serial/genMarkSweep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {

ref_processor()->setup_policy(clear_all_softrefs);
ReferenceProcessorPhaseTimes pt(_gc_timer, ref_processor()->max_num_queues());
BarrierEnqueueDiscoveredFieldClosure enqueue;
const ReferenceProcessorStats& stats =
ref_processor()->process_discovered_references(
&is_alive, &keep_alive, &follow_stack_closure, NULL, &pt);
&is_alive, &keep_alive, &enqueue, &follow_stack_closure, NULL, &pt);
pt.print_all_references();
gc_tracer()->report_gc_reference_stats(stats);
}
Expand Down
Loading

0 comments on commit 2e18fb0

Please sign in to comment.