Skip to content

Commit

Permalink
[GR-51116] Merge in tag jdk-22+29
Browse files Browse the repository at this point in the history
PullRequest: labsjdk-ce-22/3
  • Loading branch information
OracleLabsAutomation committed Jan 4, 2024
2 parents df24566 + e8f120d commit bbe8a59
Show file tree
Hide file tree
Showing 61 changed files with 738 additions and 432 deletions.
2 changes: 1 addition & 1 deletion ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ local contains(str, needle) = std.findSubstr(needle, str) != [];

CompilerTests(defs, conf, fastdebug):: conf + requireLabsJDK(conf) + clone_graal(defs) + {
name: "test-compiler" + (if fastdebug then "-fastdebug" else "") + conf.name,
timelimit: "1:30:00",
timelimit: "1:45:00",
logs: ["*.log"],
targets: ["gate"],
environment+: {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2771,7 +2771,7 @@ void MacroAssembler::load_reserved(Register dst,
break;
case uint32:
lr_w(dst, addr, acquire);
zero_extend(t0, t0, 32);
zero_extend(dst, dst, 32);
break;
default:
ShouldNotReachHere();
Expand Down
8 changes: 8 additions & 0 deletions src/hotspot/cpu/x86/vm_version_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
}

#ifdef _LP64
// ChaCha20 Intrinsics
// As long as the system supports AVX as a baseline we can do a
// SIMD-enabled block function. StubGenerator makes the determination
Expand All @@ -1145,6 +1146,13 @@ void VM_Version::get_processor_features() {
}
FLAG_SET_DEFAULT(UseChaCha20Intrinsics, false);
}
#else
// No support currently for ChaCha20 intrinsics on 32-bit platforms
if (UseChaCha20Intrinsics) {
warning("ChaCha20 intrinsics are not available on this CPU.");
FLAG_SET_DEFAULT(UseChaCha20Intrinsics, false);
}
#endif // _LP64

// Base64 Intrinsics (Check the condition for which the intrinsic will be active)
if (UseAVX >= 2) {
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/share/c1/c1_globals.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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 @@ -275,9 +275,11 @@
develop(bool, InstallMethods, true, \
"Install methods at the end of successful compilations") \
\
/* The compiler assumes, in many places, that methods are at most 1MB. */ \
/* Therefore, we restrict this flag to at most 1MB. */ \
develop(intx, NMethodSizeLimit, (64*K)*wordSize, \
"Maximum size of a compiled method.") \
range(0, max_jint) \
range(0, 1*M) \
\
develop(bool, TraceFPUStack, false, \
"Trace emulation of the FPU stack (intel only)") \
Expand Down
13 changes: 13 additions & 0 deletions src/hotspot/share/gc/z/zBarrierSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ void ZBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) {
deoptimize_allocation(thread);
}

void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj, size_t size) {
volatile zpointer* src = (volatile zpointer*)src_obj->base();
volatile zpointer* dst = (volatile zpointer*)dst_obj->base();

for (const zpointer* const end = cast_from_oop<const zpointer*>(src_obj) + size; src < end; src++, dst++) {
zaddress elem = ZBarrier::load_barrier_on_oop_field(src);
// We avoid healing here because the store below colors the pointer store good,
// hence avoiding the cost of a CAS.
ZBarrier::store_barrier_on_heap_oop_field(dst, false /* heal */);
Atomic::store(dst, ZAddress::store_good(elem));
}
}

void ZBarrierSet::print_on(outputStream* st) const {
st->print_cr("ZBarrierSet");
}
2 changes: 2 additions & 0 deletions src/hotspot/share/gc/z/zBarrierSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class ZBarrierSet : public BarrierSet {
static ZBarrierSetAssembler* assembler();
static bool barrier_needed(DecoratorSet decorators, BasicType type);

static void clone_obj_array(objArrayOop src, objArrayOop dst, size_t size);

virtual void on_thread_create(Thread* thread);
virtual void on_thread_destroy(Thread* thread);
virtual void on_thread_attach(Thread* thread);
Expand Down
20 changes: 15 additions & 5 deletions src/hotspot/share/gc/z/zBarrierSet.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,13 @@ inline bool ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_arraycopy_i
return oop_arraycopy_in_heap_no_check_cast(dst, src, length);
}

class ZStoreBarrierOopClosure : public BasicOopIterateClosure {
class ZColorStoreGoodOopClosure : public BasicOopIterateClosure {
public:
virtual void do_oop(oop* p_) {
volatile zpointer* const p = (volatile zpointer*)p_;
const zpointer ptr = ZBarrier::load_atomic(p);
const zaddress addr = ZPointer::uncolor(ptr);
ZBarrier::store_barrier_on_heap_oop_field(p, false /* heal */);
*p = ZAddress::store_good(addr);
Atomic::store(p, ZAddress::store_good(addr));
}

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

if (dst->is_objArray()) {
// Cloning an object array is similar to performing array copy.
// If an array is large enough to have its allocation segmented,
// this operation might require GC barriers. However, the intrinsics
// for cloning arrays transform the clone to an optimized allocation
// and arraycopy sequence, so the performance of this runtime call
// does not matter for object arrays.
clone_obj_array(objArrayOop(src), objArrayOop(dst), size);
return;
}

// Fix the oops
ZLoadBarrierOopClosure cl;
ZIterator::oop_iterate(src, &cl);

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

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

// Color store good before handing out
ZStoreBarrierOopClosure cl_sg;
ZColorStoreGoodOopClosure cl_sg;
ZIterator::oop_iterate(dst, &cl_sg);
}

Expand Down
46 changes: 12 additions & 34 deletions src/hotspot/share/opto/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4664,7 +4664,7 @@ template <class T1, class T2> bool TypePtr::is_meet_subtype_of_helper_for_array
}

if (other_elem == nullptr && this_elem == nullptr) {
return this_one->_klass->is_subtype_of(other->_klass);
return this_one->klass()->is_subtype_of(other->klass());
}

return false;
Expand Down Expand Up @@ -5993,7 +5993,7 @@ template <class T1, class T2> bool TypePtr::is_java_subtype_of_helper_for_instan
return true;
}

return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces);
return this_one->klass()->is_subtype_of(other->klass()) && this_one->_interfaces->contains(other->_interfaces);
}

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

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

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

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

if (!this_one->_klass->is_subtype_of(other->_klass) && !other->_klass->is_subtype_of(this_one->_klass)) {
if (!this_one->klass()->is_subtype_of(other->klass()) && !other->klass()->is_subtype_of(this_one->klass())) {
return false;
}

if (this_exact) {
return this_one->_klass->is_subtype_of(other->_klass) && this_one->_interfaces->contains(other->_interfaces);
return this_one->klass()->is_subtype_of(other->klass()) && this_one->_interfaces->contains(other->_interfaces);
}

return true;
Expand Down Expand Up @@ -6116,7 +6116,7 @@ uint TypeAryKlassPtr::hash(void) const {

//----------------------compute_klass------------------------------------------
// Compute the defining klass for this class
ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
ciKlass* TypeAryPtr::compute_klass() const {
// Compute _klass based on element type.
ciKlass* k_ary = nullptr;
const TypeInstPtr *tinst;
Expand All @@ -6137,28 +6137,7 @@ ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
// and object; Top occurs when doing join on Bottom.
// Leave k_ary at null.
} else {
// Cannot compute array klass directly from basic type,
// since subtypes of TypeInt all have basic type T_INT.
#ifdef ASSERT
if (verify && el->isa_int()) {
// Check simple cases when verifying klass.
BasicType bt = T_ILLEGAL;
if (el == TypeInt::BYTE) {
bt = T_BYTE;
} else if (el == TypeInt::SHORT) {
bt = T_SHORT;
} else if (el == TypeInt::CHAR) {
bt = T_CHAR;
} else if (el == TypeInt::INT) {
bt = T_INT;
} else {
return _klass; // just return specified klass
}
return ciTypeArrayKlass::make(bt);
}
#endif
assert(!el->isa_int(),
"integral arrays must be pre-equipped with a class");
assert(!el->isa_int(), "integral arrays must be pre-equipped with a class");
// Compute array klass directly from basic type
k_ary = ciTypeArrayKlass::make(el->basic_type());
}
Expand Down Expand Up @@ -6434,7 +6413,7 @@ template <class T1, class T2> bool TypePtr::is_java_subtype_of_helper_for_array(
return this_one->is_reference_type(this_elem)->is_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact);
}
if (this_elem == nullptr && other_elem == nullptr) {
return this_one->_klass->is_subtype_of(other->_klass);
return this_one->klass()->is_subtype_of(other->klass());
}
return false;
}
Expand Down Expand Up @@ -6466,8 +6445,7 @@ template <class T1, class T2> bool TypePtr::is_same_java_type_as_helper_for_arra
return this_one->is_reference_type(this_elem)->is_same_java_type_as(this_one->is_reference_type(other_elem));
}
if (other_elem == nullptr && this_elem == nullptr) {
assert(this_one->_klass != nullptr && other->_klass != nullptr, "");
return this_one->_klass->equals(other->_klass);
return this_one->klass()->equals(other->klass());
}
return false;
}
Expand All @@ -6487,7 +6465,7 @@ template <class T1, class T2> bool TypePtr::maybe_java_subtype_of_helper_for_arr
return true;
}
if (this_one->is_instance_type(other)) {
return other->_klass->equals(ciEnv::current()->Object_klass()) && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces);
return other->klass()->equals(ciEnv::current()->Object_klass()) && other->_interfaces->intersection_with(this_one->_interfaces)->eq(other->_interfaces);
}
assert(this_one->is_array_type(other), "");

Expand All @@ -6506,7 +6484,7 @@ template <class T1, class T2> bool TypePtr::maybe_java_subtype_of_helper_for_arr
return this_one->is_reference_type(this_elem)->maybe_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact);
}
if (other_elem == nullptr && this_elem == nullptr) {
return this_one->_klass->is_subtype_of(other->_klass);
return this_one->klass()->is_subtype_of(other->klass());
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ class TypeAryPtr : public TypeOopPtr {
const TypeAry *_ary; // Array we point into
const bool _is_autobox_cache;

ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const;
ciKlass* compute_klass() const;

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

Expand Down
Loading

0 comments on commit bbe8a59

Please sign in to comment.