Skip to content

Commit 13c2eff

Browse files
Merge tag 'jdk-22+29' into labsjdk/automation-12-22-2023-2614
Added tag jdk-22+29 for changeset ea6d79f
2 parents df24566 + ea6d79f commit 13c2eff

File tree

60 files changed

+737
-431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+737
-431
lines changed

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2771,7 +2771,7 @@ void MacroAssembler::load_reserved(Register dst,
27712771
break;
27722772
case uint32:
27732773
lr_w(dst, addr, acquire);
2774-
zero_extend(t0, t0, 32);
2774+
zero_extend(dst, dst, 32);
27752775
break;
27762776
default:
27772777
ShouldNotReachHere();

src/hotspot/cpu/x86/vm_version_x86.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ void VM_Version::get_processor_features() {
11301130
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
11311131
}
11321132

1133+
#ifdef _LP64
11331134
// ChaCha20 Intrinsics
11341135
// As long as the system supports AVX as a baseline we can do a
11351136
// SIMD-enabled block function. StubGenerator makes the determination
@@ -1145,6 +1146,13 @@ void VM_Version::get_processor_features() {
11451146
}
11461147
FLAG_SET_DEFAULT(UseChaCha20Intrinsics, false);
11471148
}
1149+
#else
1150+
// No support currently for ChaCha20 intrinsics on 32-bit platforms
1151+
if (UseChaCha20Intrinsics) {
1152+
warning("ChaCha20 intrinsics are not available on this CPU.");
1153+
FLAG_SET_DEFAULT(UseChaCha20Intrinsics, false);
1154+
}
1155+
#endif // _LP64
11481156

11491157
// Base64 Intrinsics (Check the condition for which the intrinsic will be active)
11501158
if (UseAVX >= 2) {

src/hotspot/share/c1/c1_globals.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -275,9 +275,11 @@
275275
develop(bool, InstallMethods, true, \
276276
"Install methods at the end of successful compilations") \
277277
\
278+
/* The compiler assumes, in many places, that methods are at most 1MB. */ \
279+
/* Therefore, we restrict this flag to at most 1MB. */ \
278280
develop(intx, NMethodSizeLimit, (64*K)*wordSize, \
279281
"Maximum size of a compiled method.") \
280-
range(0, max_jint) \
282+
range(0, 1*M) \
281283
\
282284
develop(bool, TraceFPUStack, false, \
283285
"Trace emulation of the FPU stack (intel only)") \

src/hotspot/share/gc/z/zBarrierSet.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,19 @@ void ZBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) {
152152
deoptimize_allocation(thread);
153153
}
154154

155+
void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj, size_t size) {
156+
volatile zpointer* src = (volatile zpointer*)src_obj->base();
157+
volatile zpointer* dst = (volatile zpointer*)dst_obj->base();
158+
159+
for (const zpointer* const end = cast_from_oop<const zpointer*>(src_obj) + size; src < end; src++, dst++) {
160+
zaddress elem = ZBarrier::load_barrier_on_oop_field(src);
161+
// We avoid healing here because the store below colors the pointer store good,
162+
// hence avoiding the cost of a CAS.
163+
ZBarrier::store_barrier_on_heap_oop_field(dst, false /* heal */);
164+
Atomic::store(dst, ZAddress::store_good(elem));
165+
}
166+
}
167+
155168
void ZBarrierSet::print_on(outputStream* st) const {
156169
st->print_cr("ZBarrierSet");
157170
}

src/hotspot/share/gc/z/zBarrierSet.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class ZBarrierSet : public BarrierSet {
3939
static ZBarrierSetAssembler* assembler();
4040
static bool barrier_needed(DecoratorSet decorators, BasicType type);
4141

42+
static void clone_obj_array(objArrayOop src, objArrayOop dst, size_t size);
43+
4244
virtual void on_thread_create(Thread* thread);
4345
virtual void on_thread_destroy(Thread* thread);
4446
virtual void on_thread_attach(Thread* thread);

src/hotspot/share/gc/z/zBarrierSet.inline.hpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,13 @@ inline bool ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_arraycopy_i
403403
return oop_arraycopy_in_heap_no_check_cast(dst, src, length);
404404
}
405405

406-
class ZStoreBarrierOopClosure : public BasicOopIterateClosure {
406+
class ZColorStoreGoodOopClosure : public BasicOopIterateClosure {
407407
public:
408408
virtual void do_oop(oop* p_) {
409409
volatile zpointer* const p = (volatile zpointer*)p_;
410410
const zpointer ptr = ZBarrier::load_atomic(p);
411411
const zaddress addr = ZPointer::uncolor(ptr);
412-
ZBarrier::store_barrier_on_heap_oop_field(p, false /* heal */);
413-
*p = ZAddress::store_good(addr);
412+
Atomic::store(p, ZAddress::store_good(addr));
414413
}
415414

416415
virtual void do_oop(narrowOop* p) {
@@ -433,17 +432,28 @@ template <DecoratorSet decorators, typename BarrierSetT>
433432
inline void ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(oop src, oop dst, size_t size) {
434433
assert_is_valid(to_zaddress(src));
435434

435+
if (dst->is_objArray()) {
436+
// Cloning an object array is similar to performing array copy.
437+
// If an array is large enough to have its allocation segmented,
438+
// this operation might require GC barriers. However, the intrinsics
439+
// for cloning arrays transform the clone to an optimized allocation
440+
// and arraycopy sequence, so the performance of this runtime call
441+
// does not matter for object arrays.
442+
clone_obj_array(objArrayOop(src), objArrayOop(dst), size);
443+
return;
444+
}
445+
436446
// Fix the oops
437447
ZLoadBarrierOopClosure cl;
438448
ZIterator::oop_iterate(src, &cl);
439449

440450
// Clone the object
441451
Raw::clone_in_heap(src, dst, size);
442452

443-
assert(ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects");
453+
assert(dst->is_typeArray() || ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects");
444454

445455
// Color store good before handing out
446-
ZStoreBarrierOopClosure cl_sg;
456+
ZColorStoreGoodOopClosure cl_sg;
447457
ZIterator::oop_iterate(dst, &cl_sg);
448458
}
449459

src/hotspot/share/opto/type.cpp

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4664,7 +4664,7 @@ template <class T1, class T2> bool TypePtr::is_meet_subtype_of_helper_for_array
46644664
}
46654665

46664666
if (other_elem == nullptr && this_elem == nullptr) {
4667-
return this_one->_klass->is_subtype_of(other->_klass);
4667+
return this_one->klass()->is_subtype_of(other->klass());
46684668
}
46694669

46704670
return false;
@@ -5993,7 +5993,7 @@ template <class T1, class T2> bool TypePtr::is_java_subtype_of_helper_for_instan
59935993
return true;
59945994
}
59955995

5996-
return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces);
5996+
return this_one->klass()->is_subtype_of(other->klass()) && this_one->_interfaces->contains(other->_interfaces);
59975997
}
59985998

59995999
bool TypeInstKlassPtr::is_java_subtype_of_helper(const TypeKlassPtr* other, bool this_exact, bool other_exact) const {
@@ -6008,7 +6008,7 @@ template <class T1, class T2> bool TypePtr::is_same_java_type_as_helper_for_inst
60086008
if (!this_one->is_instance_type(other)) {
60096009
return false;
60106010
}
6011-
return this_one->_klass->equals(other->_klass) && this_one->_interfaces->eq(other->_interfaces);
6011+
return this_one->klass()->equals(other->klass()) && this_one->_interfaces->eq(other->_interfaces);
60126012
}
60136013

60146014
bool TypeInstKlassPtr::is_same_java_type_as_helper(const TypeKlassPtr* other) const {
@@ -6022,7 +6022,7 @@ template <class T1, class T2> bool TypePtr::maybe_java_subtype_of_helper_for_ins
60226022
}
60236023

60246024
if (this_one->is_array_type(other)) {
6025-
return !this_exact && this_one->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces->contains(this_one->_interfaces);
6025+
return !this_exact && this_one->klass()->equals(ciEnv::current()->Object_klass()) && other->_interfaces->contains(this_one->_interfaces);
60266026
}
60276027

60286028
assert(this_one->is_instance_type(other), "unsupported");
@@ -6031,12 +6031,12 @@ template <class T1, class T2> bool TypePtr::maybe_java_subtype_of_helper_for_ins
60316031
return this_one->is_java_subtype_of(other);
60326032
}
60336033

6034-
if (!this_one->_klass->is_subtype_of(other->_klass) && !other->_klass->is_subtype_of(this_one->_klass)) {
6034+
if (!this_one->klass()->is_subtype_of(other->klass()) && !other->klass()->is_subtype_of(this_one->klass())) {
60356035
return false;
60366036
}
60376037

60386038
if (this_exact) {
6039-
return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces);
6039+
return this_one->klass()->is_subtype_of(other->klass()) && this_one->_interfaces->contains(other->_interfaces);
60406040
}
60416041

60426042
return true;
@@ -6116,7 +6116,7 @@ uint TypeAryKlassPtr::hash(void) const {
61166116

61176117
//----------------------compute_klass------------------------------------------
61186118
// Compute the defining klass for this class
6119-
ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
6119+
ciKlass* TypeAryPtr::compute_klass() const {
61206120
// Compute _klass based on element type.
61216121
ciKlass* k_ary = nullptr;
61226122
const TypeInstPtr *tinst;
@@ -6137,28 +6137,7 @@ ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
61376137
// and object; Top occurs when doing join on Bottom.
61386138
// Leave k_ary at null.
61396139
} else {
6140-
// Cannot compute array klass directly from basic type,
6141-
// since subtypes of TypeInt all have basic type T_INT.
6142-
#ifdef ASSERT
6143-
if (verify && el->isa_int()) {
6144-
// Check simple cases when verifying klass.
6145-
BasicType bt = T_ILLEGAL;
6146-
if (el == TypeInt::BYTE) {
6147-
bt = T_BYTE;
6148-
} else if (el == TypeInt::SHORT) {
6149-
bt = T_SHORT;
6150-
} else if (el == TypeInt::CHAR) {
6151-
bt = T_CHAR;
6152-
} else if (el == TypeInt::INT) {
6153-
bt = T_INT;
6154-
} else {
6155-
return _klass; // just return specified klass
6156-
}
6157-
return ciTypeArrayKlass::make(bt);
6158-
}
6159-
#endif
6160-
assert(!el->isa_int(),
6161-
"integral arrays must be pre-equipped with a class");
6140+
assert(!el->isa_int(), "integral arrays must be pre-equipped with a class");
61626141
// Compute array klass directly from basic type
61636142
k_ary = ciTypeArrayKlass::make(el->basic_type());
61646143
}
@@ -6434,7 +6413,7 @@ template <class T1, class T2> bool TypePtr::is_java_subtype_of_helper_for_array(
64346413
return this_one->is_reference_type(this_elem)->is_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact);
64356414
}
64366415
if (this_elem == nullptr && other_elem == nullptr) {
6437-
return this_one->_klass->is_subtype_of(other->_klass);
6416+
return this_one->klass()->is_subtype_of(other->klass());
64386417
}
64396418
return false;
64406419
}
@@ -6466,8 +6445,7 @@ template <class T1, class T2> bool TypePtr::is_same_java_type_as_helper_for_arra
64666445
return this_one->is_reference_type(this_elem)->is_same_java_type_as(this_one->is_reference_type(other_elem));
64676446
}
64686447
if (other_elem == nullptr && this_elem == nullptr) {
6469-
assert(this_one->_klass != nullptr && other->_klass != nullptr, "");
6470-
return this_one->_klass->equals(other->_klass);
6448+
return this_one->klass()->equals(other->klass());
64716449
}
64726450
return false;
64736451
}
@@ -6487,7 +6465,7 @@ template <class T1, class T2> bool TypePtr::maybe_java_subtype_of_helper_for_arr
64876465
return true;
64886466
}
64896467
if (this_one->is_instance_type(other)) {
6490-
return other->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces);
6468+
return other->klass()->equals(ciEnv::current()->Object_klass()) && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces);
64916469
}
64926470
assert(this_one->is_array_type(other), "");
64936471

@@ -6506,7 +6484,7 @@ template <class T1, class T2> bool TypePtr::maybe_java_subtype_of_helper_for_arr
65066484
return this_one->is_reference_type(this_elem)->maybe_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact);
65076485
}
65086486
if (other_elem == nullptr && this_elem == nullptr) {
6509-
return this_one->_klass->is_subtype_of(other->_klass);
6487+
return this_one->klass()->is_subtype_of(other->klass());
65106488
}
65116489
return false;
65126490
}

src/hotspot/share/opto/type.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ class TypeAryPtr : public TypeOopPtr {
14131413
const TypeAry *_ary; // Array we point into
14141414
const bool _is_autobox_cache;
14151415

1416-
ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const;
1416+
ciKlass* compute_klass() const;
14171417

14181418
// A pointer to delay allocation to Type::Initialize_shared()
14191419

0 commit comments

Comments
 (0)