Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 8314225_is_lock_o…
Browse files Browse the repository at this point in the history
…wned_no_monitor_chunks_check
  • Loading branch information
kevinjwalls committed May 8, 2024
2 parents 0662ba7 + 2baacfc commit f4fe65d
Show file tree
Hide file tree
Showing 146 changed files with 3,140 additions and 611 deletions.
4 changes: 3 additions & 1 deletion make/modules/jdk.httpserver/Java.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
# 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 All @@ -24,3 +24,5 @@
#

DISABLED_WARNINGS_java += missing-explicit-ctor this-escape

COPY += .ico
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/aarch64_vector.ad
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2020, 2023, Arm Limited. All rights reserved.
// Copyright (c) 2020, 2024, 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
Expand Down
10 changes: 7 additions & 3 deletions src/hotspot/cpu/aarch64/aarch64_vector_ad.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2020, 2023, Arm Limited. All rights reserved.
// Copyright (c) 2020, 2024, 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
Expand Down Expand Up @@ -159,9 +159,7 @@ source %{
case Op_VectorMaskGen:
case Op_LoadVectorMasked:
case Op_StoreVectorMasked:
case Op_LoadVectorGather:
case Op_StoreVectorScatter:
case Op_LoadVectorGatherMasked:
case Op_StoreVectorScatterMasked:
case Op_PopulateIndex:
case Op_CompressM:
Expand All @@ -170,6 +168,12 @@ source %{
return false;
}
break;
case Op_LoadVectorGather:
case Op_LoadVectorGatherMasked:
if (UseSVE == 0 || is_subword_type(bt)) {
return false;
}
break;
case Op_MulAddVS2VI:
if (length_in_bytes != 16) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ void SaveLiveRegisters::initialize(BarrierStubC2* stub) {
GrowableArray<RegisterData> registers;
VMReg prev_vm_reg = VMRegImpl::Bad();

RegMaskIterator rmi(stub->live());
RegMaskIterator rmi(stub->preserve_set());
while (rmi.has_next()) {
OptoReg::Name opto_reg = rmi.next();
VMReg vm_reg = OptoReg::as_VMReg(opto_reg);
Expand All @@ -491,7 +491,7 @@ void SaveLiveRegisters::initialize(BarrierStubC2* stub) {
index = registers.append(reg_data);
}
} else if (vm_reg->is_FloatRegister()) {
// We have size encoding in OptoReg of stub->live()
// We have size encoding in OptoReg of stub->preserve_set()
// After encoding, float/neon/sve register has only one slot in regmask
// Decode it to get the actual size
VMReg vm_reg_base = vm_reg->as_FloatRegister()->as_VMReg();
Expand Down Expand Up @@ -532,12 +532,8 @@ void SaveLiveRegisters::initialize(BarrierStubC2* stub) {
}
}

// Remove C-ABI SOE registers, scratch regs and _ref register that will be updated
if (stub->result() != noreg) {
_gp_regs -= RegSet::range(r19, r30) + RegSet::of(r8, r9, stub->result());
} else {
_gp_regs -= RegSet::range(r19, r30) + RegSet::of(r8, r9);
}
// Remove C-ABI SOE registers and scratch regs
_gp_regs -= RegSet::range(r19, r30) + RegSet::of(r8, r9);

// Remove C-ABI SOE fp registers
_fp_regs -= FloatRegSet::range(v8, v15);
Expand Down
7 changes: 1 addition & 6 deletions src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Na
#define __ _masm->

SaveLiveRegisters::SaveLiveRegisters(MacroAssembler *masm, BarrierStubC2 *stub)
: _masm(masm), _reg_mask(stub->live()), _result_reg(stub->result()) {
: _masm(masm), _reg_mask(stub->preserve_set()) {

const int register_save_size = iterate_over_register_mask(ACTION_COUNT_ONLY) * BytesPerWord;
_frame_size = align_up(register_save_size, frame::alignment_in_bytes)
Expand Down Expand Up @@ -317,11 +317,6 @@ int SaveLiveRegisters::iterate_over_register_mask(IterationAction action, int of
if (vm_reg->is_Register()) {
Register std_reg = vm_reg->as_Register();

// '_result_reg' will hold the end result of the operation. Its content must thus not be preserved.
if (std_reg == _result_reg) {
continue;
}

if (std_reg->encoding() >= R2->encoding() && std_reg->encoding() <= R12->encoding()) {
reg_save_index++;

Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class BarrierSetAssembler: public CHeapObj<mtGC> {
class SaveLiveRegisters {
MacroAssembler* _masm;
RegMask _reg_mask;
Register _result_reg;
int _frame_size;

public:
Expand Down
10 changes: 3 additions & 7 deletions src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Na

void SaveLiveRegisters::initialize(BarrierStubC2* stub) {
// Record registers that needs to be saved/restored
RegMaskIterator rmi(stub->live());
RegMaskIterator rmi(stub->preserve_set());
while (rmi.has_next()) {
const OptoReg::Name opto_reg = rmi.next();
if (OptoReg::is_reg(opto_reg)) {
Expand All @@ -414,12 +414,8 @@ void SaveLiveRegisters::initialize(BarrierStubC2* stub) {
}
}

// Remove C-ABI SOE registers, tmp regs and _ref register that will be updated
if (stub->result() != noreg) {
_gp_regs -= RegSet::range(x18, x27) + RegSet::of(x2) + RegSet::of(x8, x9) + RegSet::of(x5, stub->result());
} else {
_gp_regs -= RegSet::range(x18, x27) + RegSet::of(x2, x5) + RegSet::of(x8, x9);
}
// Remove C-ABI SOE registers and tmp regs
_gp_regs -= RegSet::range(x18, x27) + RegSet::of(x2, x5) + RegSet::of(x8, x9);
}

SaveLiveRegisters::SaveLiveRegisters(MacroAssembler* masm, BarrierStubC2* stub)
Expand Down
9 changes: 1 addition & 8 deletions src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,19 +613,12 @@ void SaveLiveRegisters::initialize(BarrierStubC2* stub) {
caller_saved.Insert(OptoReg::as_OptoReg(r10->as_VMReg()));
caller_saved.Insert(OptoReg::as_OptoReg(r11->as_VMReg()));

if (stub->result() != noreg) {
caller_saved.Remove(OptoReg::as_OptoReg(stub->result()->as_VMReg()));
}

// Create mask of live registers
RegMask live = stub->live();

int gp_spill_size = 0;
int opmask_spill_size = 0;
int xmm_spill_size = 0;

// Record registers that needs to be saved/restored
RegMaskIterator rmi(live);
RegMaskIterator rmi(stub->preserve_set());
while (rmi.has_next()) {
const OptoReg::Name opto_reg = rmi.next();
const VMReg vm_reg = OptoReg::as_VMReg(opto_reg);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,7 @@ void G1CollectedHeap::expand_heap_after_young_collection(){

bool G1CollectedHeap::do_collection_pause_at_safepoint() {
assert_at_safepoint_on_vm_thread();
guarantee(!is_gc_active(), "collection is not reentrant");
guarantee(!is_stw_gc_active(), "collection is not reentrant");

do_collection_pause_at_safepoint_helper();
return true;
Expand Down Expand Up @@ -2469,7 +2469,7 @@ void G1CollectedHeap::flush_region_pin_cache() {
void G1CollectedHeap::do_collection_pause_at_safepoint_helper() {
ResourceMark rm;

IsGCActiveMark active_gc_mark;
IsSTWGCActiveMark active_gc_mark;
GCIdMark gc_id_mark;
SvcGCMarker sgcm(SvcGCMarker::MINOR);

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1CollectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ class G1CollectedHeap : public CollectedHeap {
// false if unable to do the collection due to the GC locker being
// active, true otherwise.
// precondition: at safepoint on VM thread
// precondition: !is_gc_active()
// precondition: !is_stw_gc_active()
bool do_collection_pause_at_safepoint();

// Helper for do_collection_pause_at_safepoint, containing the guts
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ inline bool G1CollectedHeap::is_obj_dead(const oop obj, const HeapRegion* hr) co

inline void G1CollectedHeap::pin_object(JavaThread* thread, oop obj) {
assert(obj != nullptr, "obj must not be null");
assert(!is_gc_active(), "must not pin objects during a GC");
assert(!is_stw_gc_active(), "must not pin objects during a GC pause");
assert(obj->is_typeArray(), "must be typeArray");

uint obj_region_idx = heap_region_containing(obj)->hrm_index();
Expand All @@ -274,7 +274,7 @@ inline void G1CollectedHeap::pin_object(JavaThread* thread, oop obj) {

inline void G1CollectedHeap::unpin_object(JavaThread* thread, oop obj) {
assert(obj != nullptr, "obj must not be null");
assert(!is_gc_active(), "must not unpin objects during a GC");
assert(!is_stw_gc_active(), "must not unpin objects during a GC pause");

uint obj_region_idx = heap_region_containing(obj)->hrm_index();
G1ThreadLocalData::pin_count_cache(thread).dec_count(obj_region_idx);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1FullGCScope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class G1FullGCScope : public StackObj {
SvcGCMarker _svc_marker;
STWGCTimer _timer;
G1FullGCTracer* _tracer;
IsGCActiveMark _active;
IsSTWGCActiveMark _active;
G1FullGCJFRTracerMark _tracer_mark;
ClearedAllSoftRefs _soft_refs;
G1FullGCMonitoringScope _monitoring_scope;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1RemSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ bool G1RemSet::clean_card_before_refine(CardValue** const card_ptr_addr) {

void G1RemSet::refine_card_concurrently(CardValue* const card_ptr,
const uint worker_id) {
assert(!_g1h->is_gc_active(), "Only call concurrently");
assert(!_g1h->is_stw_gc_active(), "Only call concurrently");
check_card_ptr(card_ptr, _ct);

// Construct the MemRegion representing the card.
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1VMOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void VM_G1PauseConcurrent::doit() {

G1ConcGCMonitoringScope monitoring_scope(g1h->monitoring_support());
SvcGCMarker sgcm(SvcGCMarker::CONCURRENT);
IsGCActiveMark x;
IsSTWGCActiveMark x;

work();
}
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "gc/parallel/objectStartArray.inline.hpp"
#include "gc/parallel/parallelArguments.hpp"
#include "gc/parallel/parallelInitLogger.hpp"
Expand All @@ -35,7 +34,6 @@
#include "gc/parallel/psScavenge.hpp"
#include "gc/parallel/psVMOperations.hpp"
#include "gc/shared/gcHeapSummary.hpp"
#include "gc/shared/gcInitLogger.hpp"
#include "gc/shared/gcLocker.inline.hpp"
#include "gc/shared/gcWhen.hpp"
#include "gc/shared/genArguments.hpp"
Expand Down Expand Up @@ -459,7 +457,7 @@ void ParallelScavengeHeap::do_full_collection(bool clear_all_soft_refs) {
HeapWord* ParallelScavengeHeap::failed_mem_allocate(size_t size) {
assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint");
assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread");
assert(!is_gc_active(), "not reentrant");
assert(!is_stw_gc_active(), "not reentrant");
assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock");

// We assume that allocation in eden will fail unless we collect.
Expand Down
7 changes: 1 addition & 6 deletions src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* 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 All @@ -25,7 +25,6 @@
#ifndef SHARE_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP
#define SHARE_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP

#include "gc/parallel/objectStartArray.hpp"
#include "gc/parallel/psGCAdaptivePolicyCounters.hpp"
#include "gc/parallel/psOldGen.hpp"
#include "gc/parallel/psYoungGen.hpp"
Expand All @@ -34,13 +33,9 @@
#include "gc/shared/gcPolicyCounters.hpp"
#include "gc/shared/gcWhen.hpp"
#include "gc/shared/preGCValues.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/softRefPolicy.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/workerThread.hpp"
#include "logging/log.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/ostream.hpp"

class GCHeapSummary;
class HeapBlockClaimer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
* 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 @@ -27,7 +27,6 @@

#include "gc/parallel/parallelScavengeHeap.hpp"

#include "gc/parallel/psParallelCompact.inline.hpp"
#include "gc/parallel/psScavenge.hpp"

inline bool ParallelScavengeHeap::should_alloc_in_eden(const size_t size) const {
Expand Down
11 changes: 6 additions & 5 deletions src/hotspot/share/gc/parallel/psParallelCompact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/referenceProcessorPhaseTimes.hpp"
#include "gc/shared/spaceDecorator.inline.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/taskTerminator.hpp"
#include "gc/shared/weakProcessor.inline.hpp"
#include "gc/shared/workerPolicy.hpp"
Expand Down Expand Up @@ -1269,9 +1270,9 @@ bool PSParallelCompact::invoke(bool maximum_heap_compaction) {
"should be in vm thread");

ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
assert(!heap->is_gc_active(), "not reentrant");
assert(!heap->is_stw_gc_active(), "not reentrant");

IsGCActiveMark mark;
IsSTWGCActiveMark mark;

const bool clear_all_soft_refs =
heap->soft_ref_policy()->should_clear_all_soft_refs();
Expand Down Expand Up @@ -1492,7 +1493,7 @@ class PCAddThreadRootsMarkingTaskClosure : public ThreadClosure {
public:
PCAddThreadRootsMarkingTaskClosure(uint worker_id) : _worker_id(worker_id) { }
void do_thread(Thread* thread) {
assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
assert(ParallelScavengeHeap::heap()->is_stw_gc_active(), "called outside gc");

ResourceMark rm;

Expand All @@ -1509,7 +1510,7 @@ class PCAddThreadRootsMarkingTaskClosure : public ThreadClosure {
};

void steal_marking_work(TaskTerminator& terminator, uint worker_id) {
assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
assert(ParallelScavengeHeap::heap()->is_stw_gc_active(), "called outside gc");

ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(worker_id);
Expand Down Expand Up @@ -1986,7 +1987,7 @@ void PSParallelCompact::write_block_fill_histogram()
#endif // #ifdef ASSERT

static void compaction_with_stealing_work(TaskTerminator* terminator, uint worker_id) {
assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
assert(ParallelScavengeHeap::heap()->is_stw_gc_active(), "called outside gc");

ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(worker_id);
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/parallel/psParallelCompact.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* 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 @@ -31,6 +31,7 @@
#include "gc/parallel/parMarkBitMap.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/collectorCounters.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/taskTerminator.hpp"
#include "oops/oop.hpp"
#include "runtime/atomic.hpp"
Expand Down
Loading

0 comments on commit f4fe65d

Please sign in to comment.