Skip to content

Re-work of arrays meta-data #1452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: lworld
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,16 +747,16 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
__ stop("assert(is a type array klass)");
break;
case C1StubId::new_object_array_id:
__ cmpw(t0, Klass::_lh_array_tag_obj_value); // new "[Ljava/lang/Object;"
__ cmpw(t0, Klass::_lh_array_tag_ref_value); // new "[Ljava/lang/Object;"
__ br(Assembler::EQ, ok);
__ cmpw(t0, Klass::_lh_array_tag_vt_value); // new "[LVT;"
__ cmpw(t0, Klass::_lh_array_tag_flat_value); // new "[LVT;"
__ br(Assembler::EQ, ok);
__ stop("assert(is an object or inline type array klass)");
break;
case C1StubId::new_null_free_array_id:
__ cmpw(t0, Klass::_lh_array_tag_vt_value); // the array can be a flat array.
__ cmpw(t0, Klass::_lh_array_tag_flat_value); // the array can be a flat array.
__ br(Assembler::EQ, ok);
__ cmpw(t0, Klass::_lh_array_tag_obj_value); // the array cannot be a flat array (due to InlineArrayElementMaxFlatSize, etc)
__ cmpw(t0, Klass::_lh_array_tag_ref_value); // the array cannot be a flat array (due to the InlineArrayElementMaxFlatSize, etc.)
__ br(Assembler::EQ, ok);
__ stop("assert(is an object or inline type array klass)");
break;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
#ifdef ASSERT
// Assert object type is really an array of the proper kind.
{
int tag = (id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value;
int tag = (id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_ref_value;
Label ok;
__ lwz(R0, in_bytes(Klass::layout_helper_offset()), R4_ARG2);
__ srawi(R0, R0, Klass::_lh_array_tag_shift);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
Register tmp = obj;
__ lwu(tmp, Address(klass, Klass::layout_helper_offset()));
__ sraiw(tmp, tmp, Klass::_lh_array_tag_shift);
int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value);
int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_ref_value);
__ mv(t0, tag);
__ beq(t0, tmp, ok);
__ stop("assert(is an array klass)");
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/cpu/s390/c1_Runtime1_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
__ mem2reg_opt(t0, Address(klass, Klass::layout_helper_offset()), false);
__ z_sra(t0, Klass::_lh_array_tag_shift);
int tag = ((id == C1StubId::new_type_array_id)
? Klass::_lh_array_tag_type_value
: Klass::_lh_array_tag_obj_value);
? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_ref_value);
__ compare32_and_branch(t0, tag, Assembler::bcondEqual, ok);
__ stop("assert(is an array klass)");
__ should_not_reach_here();
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/x86/c1_Runtime1_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,16 +911,16 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
__ stop("assert(is a type array klass)");
break;
case C1StubId::new_object_array_id:
__ cmpl(t0, Klass::_lh_array_tag_obj_value); // new "[Ljava/lang/Object;"
__ cmpl(t0, (Klass::_lh_array_tag_ref_value)); // new "[Ljava/lang/Object;"
__ jcc(Assembler::equal, ok);
__ cmpl(t0, Klass::_lh_array_tag_vt_value); // new "[LVT;"
__ cmpl(t0, Klass::_lh_array_tag_flat_value); // new "[LVT;"
__ jcc(Assembler::equal, ok);
__ stop("assert(is an object or inline type array klass)");
break;
case C1StubId::new_null_free_array_id:
__ cmpl(t0, Klass::_lh_array_tag_vt_value); // the array can be a flat array.
__ cmpl(t0, Klass::_lh_array_tag_flat_value); // the array can be a flat array.
__ jcc(Assembler::equal, ok);
__ cmpl(t0, Klass::_lh_array_tag_obj_value); // the array cannot be a flat array (due to InlineArrayElementMaxFlatSize, etc)
__ cmpl(t0, (Klass::_lh_array_tag_ref_value)); // the array cannot be a flat array (due to InlineArrayElementMaxFlatSize, etc)
__ jcc(Assembler::equal, ok);
__ stop("assert(is an object or inline type array klass)");
break;
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/share/c1/c1_Runtime1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ JRT_ENTRY(void, Runtime1::new_object_array(JavaThread* current, Klass* array_kla
// (This may have to change if this code changes!)
assert(array_klass->is_klass(), "not a class");
Handle holder(current, array_klass->klass_holder()); // keep the klass alive
Klass* elem_klass = ArrayKlass::cast(array_klass)->element_klass();
Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass();
objArrayOop obj = oopFactory::new_objArray(elem_klass, length, CHECK);
current->set_vm_result_oop(obj);
// This is pretty rare but this runtime patch is stressful to deoptimization
Expand All @@ -439,14 +439,14 @@ JRT_ENTRY(void, Runtime1::new_null_free_array(JavaThread* current, Klass* array_
// (This may have to change if this code changes!)
assert(array_klass->is_klass(), "not a class");
Handle holder(THREAD, array_klass->klass_holder()); // keep the klass alive
Klass* elem_klass = ArrayKlass::cast(array_klass)->element_klass();
Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass();
assert(elem_klass->is_inline_klass(), "must be");
InlineKlass* vk = InlineKlass::cast(elem_klass);
// Logically creates elements, ensure klass init
elem_klass->initialize(CHECK);
arrayOop obj= nullptr;
if (UseArrayFlattening && vk->has_non_atomic_layout()) {
obj = oopFactory::new_flatArray(elem_klass, length, LayoutKind::NON_ATOMIC_FLAT, CHECK);
obj = oopFactory::new_flatArray(elem_klass, length, ArrayKlass::ArrayProperties::NULL_RESTRICTED, LayoutKind::NON_ATOMIC_FLAT, CHECK);
} else {
obj = oopFactory::new_null_free_objArray(elem_klass, length, CHECK);
}
Expand Down Expand Up @@ -516,7 +516,7 @@ JRT_ENTRY(void, Runtime1::load_flat_array(JavaThread* current, flatArrayOopDesc*
NOT_PRODUCT(_load_flat_array_slowcase_cnt++;)
assert(array->length() > 0 && index < array->length(), "already checked");
flatArrayHandle vah(current, array);
oop obj = array->read_value_from_flat_array(index, CHECK);
oop obj = array->obj_at(index, CHECK);
current->set_vm_result_oop(obj);
JRT_END

Expand All @@ -531,7 +531,7 @@ JRT_ENTRY(void, Runtime1::store_flat_array(JavaThread* current, flatArrayOopDesc
SharedRuntime::throw_and_post_jvmti_exception(current, vmSymbols::java_lang_NullPointerException());
} else {
assert(array->klass()->is_flatArray_klass(), "should not be called");
array->write_value_to_flat_array(value, index, CHECK);
array->obj_at_put(index, value, CHECK);
}
JRT_END

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/archiveHeapWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void ArchiveHeapWriter::ensure_buffer_space(size_t min_bytes) {

objArrayOop ArchiveHeapWriter::allocate_root_segment(size_t offset, int element_count) {
HeapWord* mem = offset_to_buffered_address<HeapWord *>(offset);
memset(mem, 0, objArrayOopDesc::object_size(element_count));
memset(mem, 0, refArrayOopDesc::object_size(element_count));

// The initialization code is copied from MemAllocator::finish and ObjArrayAllocator::initialize.
if (UseCompactObjectHeaders) {
Expand Down Expand Up @@ -220,7 +220,7 @@ void ArchiveHeapWriter::copy_roots_to_buffer(GrowableArrayCHeap<oop, mtClassShar
"Pre-condition: Roots start at aligned boundary: %zu", _buffer_used);

int max_elem_count = ((MIN_GC_REGION_ALIGNMENT - arrayOopDesc::header_size_in_bytes()) / heapOopSize);
assert(objArrayOopDesc::object_size(max_elem_count)*HeapWordSize == MIN_GC_REGION_ALIGNMENT,
assert(refArrayOopDesc::object_size(max_elem_count)*HeapWordSize == MIN_GC_REGION_ALIGNMENT,
"Should match exactly");

HeapRootSegments segments(_buffer_used,
Expand Down Expand Up @@ -334,7 +334,7 @@ void ArchiveHeapWriter::copy_source_objs_to_buffer(GrowableArrayCHeap<oop, mtCla
}

size_t ArchiveHeapWriter::filler_array_byte_size(int length) {
size_t byte_size = objArrayOopDesc::object_size(length) * HeapWordSize;
size_t byte_size = refArrayOopDesc::object_size(length) * HeapWordSize;
return byte_size;
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/archiveUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ bool ArchiveUtils::has_aot_initialized_mirror(InstanceKlass* src_ik) {

size_t HeapRootSegments::size_in_bytes(size_t seg_idx) {
assert(seg_idx < _count, "In range");
return objArrayOopDesc::object_size(size_in_elems(seg_idx)) * HeapWordSize;
return refArrayOopDesc::object_size(size_in_elems(seg_idx)) * HeapWordSize;
}

int HeapRootSegments::size_in_elems(size_t seg_idx) {
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/cds/cdsProtectionDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/refArrayOop.hpp"
#include "oops/symbol.hpp"
#include "runtime/javaCalls.hpp"

Expand Down Expand Up @@ -296,7 +297,8 @@ void CDSProtectionDomain::atomic_set_array_index(OopHandle array, int index, oop
// The important thing here is that all threads pick up the same result.
// It doesn't matter which racing thread wins, as long as only one
// result is used by all threads, and all future queries.
((objArrayOop)array.resolve())->replace_if_null(index, o);
// ((objArrayOop)array.resolve())->replace_if_null(index, o);
refArrayOopDesc::cast(array.resolve())->replace_if_null(index, o);
}

oop CDSProtectionDomain::shared_protection_domain(int index) {
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/cds/cppVtables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "oops/instanceStackChunkKlass.hpp"
#include "oops/methodData.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/refArrayKlass.hpp"
#include "oops/typeArrayKlass.hpp"
#include "runtime/arguments.hpp"
#include "utilities/globalDefinitions.hpp"
Expand Down Expand Up @@ -67,7 +68,8 @@
f(ObjArrayKlass) \
f(TypeArrayKlass) \
f(FlatArrayKlass) \
f(InlineKlass)
f(InlineKlass) \
f(RefArrayKlass)

class CppVtableInfo {
intptr_t _vtable_size;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/metaspaceShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void MetaspaceShared::serialize(SerializeClosure* soc) {
soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE));
soc->do_tag(sizeof(ConstantPool));
soc->do_tag(sizeof(ConstantPoolCache));
soc->do_tag(objArrayOopDesc::base_offset_in_bytes());
soc->do_tag(refArrayOopDesc::base_offset_in_bytes());
soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE));
soc->do_tag(sizeof(Symbol));

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/ci/ciArrayKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ciArrayKlass* ciArrayKlass::make(ciType* element_type, bool flat, bool null_free
lk = LayoutKind::NULLABLE_ATOMIC_FLAT;
}
}
ak = vk->flat_array_klass(lk, THREAD);
ak = vk->flat_array_klass(ArrayKlass::ArrayProperties::DUMMY, lk, THREAD);
} else if (null_free) {
ak = vk->null_free_reference_array(THREAD);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/ci/ciObjectFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ ciMetadata* ciObjectFactory::create_new_metadata(Metadata* o) {
return new (arena()) ciInstanceKlass(k);
} else if (k->is_flatArray_klass()) {
return new (arena()) ciFlatArrayKlass(k);
} else if (k->is_objArray_klass()) {
} else if (k->is_refArray_klass()) {
return new (arena()) ciObjArrayKlass(k);
} else if (k->is_typeArray_klass()) {
return new (arena()) ciTypeArrayKlass(k);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ void java_lang_Class::allocate_mirror(Klass* k, bool is_scratch, Handle protecti
comp_mirror = Handle(THREAD, Universe::java_mirror(type));
}
} else {
assert(k->is_objArray_klass(), "Must be");
assert(k->is_refArray_klass(), "Must be");
Klass* element_klass = ObjArrayKlass::cast(k)->element_klass();
assert(element_klass != nullptr, "Must have an element klass");
oop comp_oop = element_klass->java_mirror();
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/classfile/stringTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
}

int total = (int)_items_count;
size_t single_array_size = objArrayOopDesc::object_size(total);
size_t single_array_size = refArrayOopDesc::object_size(total);

log_info(cds)("allocated string table for %d strings", total);

Expand All @@ -963,8 +963,8 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
} else {
// Split the table in two levels of arrays.
int primary_array_length = (total + _secondary_array_max_length - 1) / _secondary_array_max_length;
size_t primary_array_size = objArrayOopDesc::object_size(primary_array_length);
size_t secondary_array_size = objArrayOopDesc::object_size(_secondary_array_max_length);
size_t primary_array_size = refArrayOopDesc::object_size(primary_array_length);
size_t secondary_array_size = refArrayOopDesc::object_size(_secondary_array_max_length);

if (ArchiveHeapWriter::is_too_large_to_archive(secondary_array_size)) {
// This can only happen if you have an extremely large number of classes that
Expand Down Expand Up @@ -1004,7 +1004,7 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
void StringTable::verify_secondary_array_index_bits() {
int max;
for (max = 1; ; max++) {
size_t next_size = objArrayOopDesc::object_size(1 << (max + 1));
size_t next_size = refArrayOopDesc::object_size(1 << (max + 1));
if (ArchiveHeapWriter::is_too_large_to_archive(next_size)) {
break;
}
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ void G1FullGCMarker::follow_array_chunk(objArrayOop array, int index) {
if (end_index < len) {
push_objarray(array, end_index);
}

array->oop_iterate_range(mark_closure(), beg_index, end_index);
assert(array->is_refArray(), "Must be");
refArrayOop(array)->oop_iterate_range(mark_closure(), beg_index, end_index);
}

inline void G1FullGCMarker::follow_object(oop obj) {
assert(_bitmap->is_marked(obj), "should be marked");
if (obj->is_objArray()) {
if (obj->is_refArray()) {
// Handle object arrays explicitly to allow them to
// be split into chunks if needed.
follow_array((objArrayOop)obj);
Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ void G1ParScanThreadState::do_partial_array(PartialArrayState* state, bool stole
G1HeapRegionAttr dest_attr = _g1h->region_attr(to_array);
G1SkipCardEnqueueSetter x(&_scanner, dest_attr.is_new_survivor());
// Process claimed task.
to_array->oop_iterate_range(&_scanner,
assert(to_array->is_refArray(), "Must be");
refArrayOop(to_array)->oop_iterate_range(&_scanner,
checked_cast<int>(claim._start),
checked_cast<int>(claim._end));
}
Expand All @@ -254,7 +255,8 @@ void G1ParScanThreadState::start_partial_objarray(oop from_obj,
// Process the initial chunk. No need to process the type in the
// klass, as it will already be handled by processing the built-in
// module.
to_array->oop_iterate_range(&_scanner, 0, checked_cast<int>(initial_chunk_size));
assert(to_array->is_refArray(), "Must be");
refArrayOop(to_array)->oop_iterate_range(&_scanner, 0, checked_cast<int>(initial_chunk_size));
}

MAYBE_INLINE_EVACUATION
Expand Down Expand Up @@ -428,7 +430,7 @@ void G1ParScanThreadState::do_iterate_object(oop const obj,
if (klass->is_array_klass() && !klass->is_flatArray_klass()) {
assert(!klass->is_stack_chunk_instance_klass(), "must be");

if (klass->is_objArray_klass()) {
if (klass->is_refArray_klass()) {
start_partial_objarray(old, obj);
} else {
// Nothing needs to be done for typeArrays. Body doesn't contain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ inline void ParCompactionManager::follow_contents(const ScannerTask& task, bool
} else {
oop obj = task.to_oop();
assert(PSParallelCompact::mark_bitmap()->is_marked(obj), "should be marked");
if (obj->is_objArray()) {
if (obj->is_refArray()) {
push_objArray(obj);
} else {
obj->oop_iterate(&_mark_and_push_closure);
Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/share/gc/serial/serialFullGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ template <class T> void SerialFullGC::KeepAliveClosure::do_oop_work(T* p) {
}

void SerialFullGC::push_objarray(oop obj, size_t index) {
assert(obj->is_refArray(), "Must be");
ObjArrayTask task(obj, index);
assert(task.is_valid(), "bad ObjArrayTask");
_objarray_stack.push(task);
Expand All @@ -395,7 +396,7 @@ void SerialFullGC::follow_array(objArrayOop array) {

void SerialFullGC::follow_object(oop obj) {
assert(obj->is_gc_marked(), "should be marked");
if (obj->is_objArray()) {
if (obj->is_refArray()) {
// Handle object arrays explicitly to allow them to
// be split into chunks if needed.
SerialFullGC::follow_array((objArrayOop)obj);
Expand All @@ -412,7 +413,7 @@ void SerialFullGC::follow_array_chunk(objArrayOop array, int index) {
const int stride = MIN2(len - beg_index, (int) ObjArrayMarkingStride);
const int end_index = beg_index + stride;

array->oop_iterate_range(&mark_and_push_closure, beg_index, end_index);
refArrayOop(array)->oop_iterate_range(&mark_and_push_closure, beg_index, end_index);

if (end_index < len) {
SerialFullGC::push_objarray(array, end_index); // Push the continuation.
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shared/memAllocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"

// These fascilities are used for allocating, and initializing newly allocated objects.
// These facilities are used for allocating, and initializing newly allocated objects.

class MemAllocator: StackObj {
protected:
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void ShenandoahMark::do_task(ShenandoahObjToScanQueue* q, T* cl, ShenandoahLiveD

obj->oop_iterate(cl);
dedup_string<STRING_DEDUP>(obj, req);
} else if (obj->is_objArray()) {
} else if (obj->is_refArray()) {
// Case 2: Object array instance and no chunk is set. Must be the first
// time we visit it, start the chunked processing.
do_chunked_array_start<T>(q, cl, obj, weak);
Expand Down Expand Up @@ -156,7 +156,7 @@ inline void ShenandoahMark::count_liveness(ShenandoahLiveData* live_data, oop ob

template <class T>
inline void ShenandoahMark::do_chunked_array_start(ShenandoahObjToScanQueue* q, T* cl, oop obj, bool weak) {
assert(obj->is_objArray(), "expect object array");
assert(obj->is_refArray(), "expect object array");
objArrayOop array = objArrayOop(obj);
int len = array->length();

Expand Down Expand Up @@ -223,7 +223,7 @@ inline void ShenandoahMark::do_chunked_array_start(ShenandoahObjToScanQueue* q,

template <class T>
inline void ShenandoahMark::do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop obj, int chunk, int pow, bool weak) {
assert(obj->is_objArray(), "expect object array");
assert(obj->is_refArray(), "expect object array");
objArrayOop array = objArrayOop(obj);

assert (ObjArrayMarkingStride > 0, "sanity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void ShenandoahScanRemembered::process_clusters(size_t first_cluster, size_t cou
// PREFIX: The object that straddles into this range of dirty cards
// from the left may be subject to special treatment unless
// it is an object array.
if (p < left && !obj->is_objArray()) {
if (p < left && !obj->is_refArray()) {
// The mutator (both compiler and interpreter, but not JNI?)
// typically dirty imprecisely (i.e. only the head of an object),
// but GC closures typically dirty the object precisely. (It would
Expand Down Expand Up @@ -253,7 +253,7 @@ void ShenandoahScanRemembered::process_clusters(size_t first_cluster, size_t cou
assert(last_p < right, "Error");
// check if last_p suffix needs scanning
const oop last_obj = cast_to_oop(last_p);
if (!last_obj->is_objArray()) {
if (!last_obj->is_refArray()) {
// scan the remaining suffix of the object
const MemRegion last_mr(right, p);
assert(p == last_p + last_obj->size(), "Would miss portion of last_obj");
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/z/zBarrierSet.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ template <DecoratorSet decorators, typename BarrierSetT>
inline void ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(oop src, oop dst, size_t size) {
check_is_valid_zaddress(src);

if (dst->is_objArray()) {
if (dst->is_refArray()) {
// 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
Expand Down
Loading