Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d8ed52a
8319115
eme64 Dec 1, 2023
426f6e0
small fix, still all in WIP
eme64 Dec 1, 2023
c360bfe
wip on new test setup in test_growableArray.cpp
eme64 Dec 1, 2023
374c1b7
WIP added modify closure
eme64 Dec 1, 2023
7dc6e30
small test refactoring
eme64 Dec 4, 2023
24a645f
add pointer class to test
eme64 Dec 4, 2023
fd5b87c
add ptr type
eme64 Dec 4, 2023
66b18e4
test: more modify
eme64 Dec 4, 2023
f7c1d09
add arena allocator to test
eme64 Dec 4, 2023
a2a30eb
add cheap and embedded to test
eme64 Dec 4, 2023
49c949d
move shrink and deallocate to CHeap only
eme64 Dec 4, 2023
2124f98
rm old test code, and add bad allocation examples
eme64 Dec 4, 2023
00fdda8
remove obsolete CHeap tests
eme64 Dec 4, 2023
00cae3b
add find_if wip
eme64 Dec 4, 2023
3c00870
a bit more refactoring
eme64 Dec 4, 2023
93c60ac
test: add check for no construction after initialization -> fails as …
eme64 Dec 5, 2023
e2216b6
added todos for construction / deconstruction
eme64 Dec 5, 2023
65cc475
manual merge
eme64 Dec 5, 2023
ad06519
fix include / ifdef / etc
eme64 Dec 5, 2023
2b92a3c
wip fix no constructor on init
eme64 Dec 5, 2023
90b0812
wip fix up constructor calls
eme64 Dec 5, 2023
a2ffdd4
fixed up pop, clear and trunc_to
eme64 Dec 6, 2023
6f0ef9e
cheap verification not necessary, operator new does not allow alterna…
eme64 Dec 7, 2023
119e0cc
deconstructor -> destructor
eme64 Dec 7, 2023
0deea88
require elements of GrowableArray to be trivially destructible
eme64 Dec 7, 2023
52a7ec2
systematically check live elements
eme64 Dec 7, 2023
74cd9a5
wip on default or not, and at_grow / at_put_grow
eme64 Dec 7, 2023
a6a0737
more of the same wip
eme64 Dec 7, 2023
4176f29
finished tests for at_grow / at_put_grow, with and without default
eme64 Dec 8, 2023
712cc80
dispatch refactoring wip with args
eme64 Dec 8, 2023
63f4e54
dispatch refactoring 2 wip
eme64 Dec 8, 2023
bea58eb
use macros to do args cases (wip)
eme64 Dec 8, 2023
a37b28e
all macros for CASES, but now tests are failing
eme64 Dec 8, 2023
becac25
passes again, with different len and capacity
eme64 Dec 8, 2023
e4b4359
small improvement to last commit
eme64 Dec 8, 2023
b211a44
cleanup GrowableArrayFilterIterator and add more TODOs for test
eme64 Dec 8, 2023
06cb248
fix remove and add some access test
eme64 Dec 8, 2023
904b38b
create no-assign type
eme64 Dec 11, 2023
3ca73d6
at_swap and trunc_to tested
eme64 Dec 11, 2023
664122e
remove_till and remove_range
eme64 Dec 11, 2023
536c70c
fix and test delete_at
eme64 Dec 11, 2023
f7a59af
push and append_if_missing
eme64 Dec 11, 2023
9ee1980
insert_before etc
eme64 Dec 11, 2023
5692b43
compare, insert_before, appendAll
eme64 Dec 12, 2023
6f16eb4
test 2 versions of sort
eme64 Dec 12, 2023
b999306
find_sorted and insert_sorted
eme64 Dec 13, 2023
e0ff66c
refactor and test swap
eme64 Dec 13, 2023
8a8383b
2 negative tests: nested ra, insert_before to itself
eme64 Dec 14, 2023
bebc290
test shallow assign / copy
eme64 Dec 14, 2023
0e4e6e9
fix some comments
eme64 Dec 14, 2023
e2f7eee
fix small comment
eme64 Dec 14, 2023
1dd5a51
Merge branch 'master' into JDK-8319115
eme64 Dec 15, 2023
e5eb360
fix issue with clang, need explicit copy constructor if assignment op…
eme64 Dec 15, 2023
1ed037f
whitespaces
eme64 Dec 15, 2023
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
2 changes: 1 addition & 1 deletion src/hotspot/os/linux/gc/x/xPhysicalMemoryBacking_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ bool XPhysicalMemoryBacking::commit_inner(size_t offset, size_t length) const {
}

static int offset_to_node(size_t offset) {
const GrowableArray<int>* mapping = os::Linux::numa_nindex_to_node();
const GrowableArrayCHeap<int, mtInternal>* mapping = os::Linux::numa_nindex_to_node();
const size_t nindex = (offset >> XGranuleSizeShift) % mapping->length();
return mapping->at((int)nindex);
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ bool ZPhysicalMemoryBacking::commit_inner(zoffset offset, size_t length) const {
}

static int offset_to_node(zoffset offset) {
const GrowableArray<int>* mapping = os::Linux::numa_nindex_to_node();
const GrowableArrayCHeap<int, mtInternal>* mapping = os::Linux::numa_nindex_to_node();
const size_t nindex = (untype(offset) >> ZGranuleSizeShift) % mapping->length();
return mapping->at((int)nindex);
}
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/os/linux/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3145,10 +3145,10 @@ bool os::Linux::libnuma_init() {
set_numa_interleave_bitmask(_numa_get_interleave_mask());
set_numa_membind_bitmask(_numa_get_membind());
// Create an index -> node mapping, since nodes are not always consecutive
_nindex_to_node = new (mtInternal) GrowableArray<int>(0, mtInternal);
_nindex_to_node = new GrowableArrayCHeap<int, mtInternal>(0);
rebuild_nindex_to_node_map();
// Create a cpu -> node mapping
_cpu_to_node = new (mtInternal) GrowableArray<int>(0, mtInternal);
_cpu_to_node = new GrowableArrayCHeap<int, mtInternal>(0);
rebuild_cpu_to_node_map();
return true;
}
Expand Down Expand Up @@ -3307,8 +3307,8 @@ int os::Linux::get_node_by_cpu(int cpu_id) {
return -1;
}

GrowableArray<int>* os::Linux::_cpu_to_node;
GrowableArray<int>* os::Linux::_nindex_to_node;
GrowableArrayCHeap<int, mtInternal>* os::Linux::_cpu_to_node;
GrowableArrayCHeap<int, mtInternal>* os::Linux::_nindex_to_node;
os::Linux::sched_getcpu_func_t os::Linux::_sched_getcpu;
os::Linux::numa_node_to_cpus_func_t os::Linux::_numa_node_to_cpus;
os::Linux::numa_node_to_cpus_v2_func_t os::Linux::_numa_node_to_cpus_v2;
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/os/linux/os_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class os::Linux {

static bool _supports_fast_thread_cpu_time;

static GrowableArray<int>* _cpu_to_node;
static GrowableArray<int>* _nindex_to_node;
static GrowableArrayCHeap<int, mtInternal>* _cpu_to_node;
static GrowableArrayCHeap<int, mtInternal>* _nindex_to_node;

static julong available_memory_in_container();

Expand All @@ -71,8 +71,8 @@ class os::Linux {

static void rebuild_cpu_to_node_map();
static void rebuild_nindex_to_node_map();
static GrowableArray<int>* cpu_to_node() { return _cpu_to_node; }
static GrowableArray<int>* nindex_to_node() { return _nindex_to_node; }
static GrowableArrayCHeap<int, mtInternal>* cpu_to_node() { return _cpu_to_node; }
static GrowableArrayCHeap<int, mtInternal>* nindex_to_node() { return _nindex_to_node; }

static void print_process_memory_info(outputStream* st);
static void print_system_memory_info(outputStream* st);
Expand Down Expand Up @@ -384,7 +384,7 @@ class os::Linux {
}
}

static const GrowableArray<int>* numa_nindex_to_node() {
static const GrowableArrayCHeap<int, mtInternal>* numa_nindex_to_node() {
return _nindex_to_node;
}

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/archiveBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ArchiveBuilder::OtherROAllocMark::~OtherROAllocMark() {

ArchiveBuilder::SourceObjList::SourceObjList() : _ptrmap(16 * K, mtClassShared) {
_total_bytes = 0;
_objs = new (mtClassShared) GrowableArray<SourceObjInfo*>(128 * K, mtClassShared);
_objs = new GrowableArrayCHeap<SourceObjInfo*, mtClassShared>(128 * K);
}

ArchiveBuilder::SourceObjList::~SourceObjList() {
Expand Down Expand Up @@ -166,8 +166,8 @@ ArchiveBuilder::ArchiveBuilder() :
_estimated_metaspaceobj_bytes(0),
_estimated_hashtable_bytes(0)
{
_klasses = new (mtClassShared) GrowableArray<Klass*>(4 * K, mtClassShared);
_symbols = new (mtClassShared) GrowableArray<Symbol*>(256 * K, mtClassShared);
_klasses = new GrowableArrayCHeap<Klass*, mtClassShared>(4 * K);
_symbols = new GrowableArrayCHeap<Symbol*, mtClassShared>(256 * K);

assert(_current == nullptr, "must be");
_current = this;
Expand Down
12 changes: 6 additions & 6 deletions src/hotspot/share/cds/archiveBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ class ArchiveBuilder : public StackObj {

class SourceObjList {
uintx _total_bytes;
GrowableArray<SourceObjInfo*>* _objs; // Source objects to be archived
GrowableArrayCHeap<SourceObjInfo*, mtClassShared>* _objs; // Source objects to be archived
CHeapBitMap _ptrmap; // Marks the addresses of the pointer fields
// in the source objects
public:
SourceObjList();
~SourceObjList();

GrowableArray<SourceObjInfo*>* objs() const { return _objs; }
GrowableArrayCHeap<SourceObjInfo*, mtClassShared>* objs() const { return _objs; }

void append(SourceObjInfo* src_info);
void remember_embedded_pointer(SourceObjInfo* pointing_obj, MetaspaceClosure::Ref* ref);
Expand All @@ -210,8 +210,8 @@ class ArchiveBuilder : public StackObj {
SourceObjList _ro_src_objs; // objs to put in ro region
ResizeableResourceHashtable<address, SourceObjInfo, AnyObj::C_HEAP, mtClassShared> _src_obj_table;
ResizeableResourceHashtable<address, address, AnyObj::C_HEAP, mtClassShared> _buffered_to_src_table;
GrowableArray<Klass*>* _klasses;
GrowableArray<Symbol*>* _symbols;
GrowableArrayCHeap<Klass*, mtClassShared>* _klasses;
GrowableArrayCHeap<Symbol*, mtClassShared>* _symbols;

// statistics
DumpAllocStats _alloc_stats;
Expand Down Expand Up @@ -401,8 +401,8 @@ class ArchiveBuilder : public StackObj {
}

// All klasses and symbols that will be copied into the archive
GrowableArray<Klass*>* klasses() const { return _klasses; }
GrowableArray<Symbol*>* symbols() const { return _symbols; }
GrowableArrayCHeap<Klass*, mtClassShared>* klasses() const { return _klasses; }
GrowableArrayCHeap<Symbol*, mtClassShared>* symbols() const { return _symbols; }

static bool is_active() {
return (_current != nullptr);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/classListParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ ClassListParser::ClassListParser(const char* file, ParseMode parse_mode) : _id2k
}
_line_no = 0;
_token = _line;
_interfaces = new (mtClass) GrowableArray<int>(10, mtClass);
_indy_items = new (mtClass) GrowableArray<const char*>(9, mtClass);
_interfaces = new GrowableArrayCHeap<int, mtClass>(10);
_indy_items = new GrowableArrayCHeap<const char*, mtClass>(9);
_parse_mode = parse_mode;

// _instance should only be accessed by the thread that created _instance.
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/classListParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ class ClassListParser : public StackObj {
int _line_len; // Original length of the input line.
int _line_no; // Line number for current line being parsed
const char* _class_name;
GrowableArray<const char*>* _indy_items; // items related to invoke dynamic for archiving lambda proxy classes
GrowableArrayCHeap<const char*, mtClass>* _indy_items; // items related to invoke dynamic for archiving lambda proxy classes
int _id;
int _super;
GrowableArray<int>* _interfaces;
GrowableArrayCHeap<int, mtClass>* _interfaces;
bool _interfaces_specified;
const char* _source;
bool _lambda_form_line;
Expand Down
12 changes: 6 additions & 6 deletions src/hotspot/share/cds/dumpTimeClassInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ size_t DumpTimeClassInfo::runtime_info_bytesize() const {
void DumpTimeClassInfo::add_verification_constraint(InstanceKlass* k, Symbol* name,
Symbol* from_name, bool from_field_is_protected, bool from_is_array, bool from_is_object) {
if (_verifier_constraints == nullptr) {
_verifier_constraints = new (mtClass) GrowableArray<DTVerifierConstraint>(4, mtClass);
_verifier_constraints = new GrowableArrayCHeap<DTVerifierConstraint, mtClass>(4);
}
if (_verifier_constraint_flags == nullptr) {
_verifier_constraint_flags = new (mtClass) GrowableArray<char>(4, mtClass);
_verifier_constraint_flags = new GrowableArrayCHeap<char, mtClass>(4);
}
GrowableArray<DTVerifierConstraint>* vc_array = _verifier_constraints;
GrowableArrayCHeap<DTVerifierConstraint, mtClass>* vc_array = _verifier_constraints;
for (int i = 0; i < vc_array->length(); i++) {
if (vc_array->at(i).equals(name, from_name)) {
return;
Expand All @@ -65,7 +65,7 @@ void DumpTimeClassInfo::add_verification_constraint(InstanceKlass* k, Symbol* na
DTVerifierConstraint cons(name, from_name);
vc_array->append(cons);

GrowableArray<char>* vcflags_array = _verifier_constraint_flags;
GrowableArrayCHeap<char, mtClass>* vcflags_array = _verifier_constraint_flags;
char c = 0;
c |= from_field_is_protected ? SystemDictionaryShared::FROM_FIELD_IS_PROTECTED : 0;
c |= from_is_array ? SystemDictionaryShared::FROM_IS_ARRAY : 0;
Expand Down Expand Up @@ -96,7 +96,7 @@ void DumpTimeClassInfo::record_linking_constraint(Symbol* name, Handle loader1,
assert(loader1 != loader2, "sanity");
LogTarget(Info, class, loader, constraints) log;
if (_loader_constraints == nullptr) {
_loader_constraints = new (mtClass) GrowableArray<DTLoaderConstraint>(4, mtClass);
_loader_constraints = new GrowableArrayCHeap<DTLoaderConstraint, mtClass>(4);
}
char lt1 = get_loader_type_by(loader1());
char lt2 = get_loader_type_by(loader2());
Expand Down Expand Up @@ -128,7 +128,7 @@ void DumpTimeClassInfo::record_linking_constraint(Symbol* name, Handle loader1,

void DumpTimeClassInfo::add_enum_klass_static_field(int archived_heap_root_index) {
if (_enum_klass_static_fields == nullptr) {
_enum_klass_static_fields = new (mtClass) GrowableArray<int>(20, mtClass);
_enum_klass_static_fields = new GrowableArrayCHeap<int, mtClass>(20);
}
_enum_klass_static_fields->append(archived_heap_root_index);
}
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/share/cds/dumpTimeClassInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ class DumpTimeClassInfo: public CHeapObj<mtClass> {
int _id;
int _clsfile_size;
int _clsfile_crc32;
GrowableArray<DTVerifierConstraint>* _verifier_constraints;
GrowableArray<char>* _verifier_constraint_flags;
GrowableArray<DTLoaderConstraint>* _loader_constraints;
GrowableArray<int>* _enum_klass_static_fields;
GrowableArrayCHeap<DTVerifierConstraint, mtClass>* _verifier_constraints;
GrowableArrayCHeap<char, mtClass>* _verifier_constraint_flags;
GrowableArrayCHeap<DTLoaderConstraint, mtClass>* _loader_constraints;
GrowableArrayCHeap<int, mtClass>* _enum_klass_static_fields;

DumpTimeClassInfo() {
_klass = nullptr;
Expand Down Expand Up @@ -159,7 +159,7 @@ class DumpTimeClassInfo: public CHeapObj<mtClass> {

private:
template <typename T>
static int array_length_or_zero(GrowableArray<T>* array) {
static int array_length_or_zero(GrowableArrayCHeap<T, mtClass>* array) {
if (array == nullptr) {
return 0;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/dynamicArchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,12 @@ class VM_PopulateDynamicDumpSharedSpace: public VM_GC_Sync_Operation {

// _array_klasses and _dynamic_archive_array_klasses only hold the array klasses
// which have element klass in the static archive.
GrowableArray<ObjArrayKlass*>* DynamicArchive::_array_klasses = nullptr;
GrowableArrayCHeap<ObjArrayKlass*, mtClassShared>* DynamicArchive::_array_klasses = nullptr;
Array<ObjArrayKlass*>* DynamicArchive::_dynamic_archive_array_klasses = nullptr;

void DynamicArchive::append_array_klass(ObjArrayKlass* ak) {
if (_array_klasses == nullptr) {
_array_klasses = new (mtClassShared) GrowableArray<ObjArrayKlass*>(50, mtClassShared);
_array_klasses = new GrowableArrayCHeap<ObjArrayKlass*, mtClassShared>(50);
}
_array_klasses->append(ak);
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/dynamicArchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DynamicArchiveHeader : public FileMapHeader {

class DynamicArchive : AllStatic {
private:
static GrowableArray<ObjArrayKlass*>* _array_klasses;
static GrowableArrayCHeap<ObjArrayKlass*, mtClassShared>* _array_klasses;
static Array<ObjArrayKlass*>* _dynamic_archive_array_klasses;
public:
static void check_for_dynamic_dump();
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/filemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ void FileMapInfo::record_non_existent_class_path_entry(const char* path) {
assert(CDSConfig::is_dumping_archive(), "sanity");
log_info(class, path)("non-existent Class-Path entry %s", path);
if (_non_existent_class_paths == nullptr) {
_non_existent_class_paths = new (mtClass) GrowableArray<const char*>(10, mtClass);
_non_existent_class_paths = new GrowableArrayCHeap<const char*, mtClass>(10);
}
_non_existent_class_paths->append(os::strdup(path));
}
Expand Down Expand Up @@ -2246,7 +2246,7 @@ bool FileMapInfo::_heap_pointers_need_patching = false;
SharedPathTable FileMapInfo::_shared_path_table;
bool FileMapInfo::_validating_shared_path_table = false;
bool FileMapInfo::_memory_mapping_failed = false;
GrowableArray<const char*>* FileMapInfo::_non_existent_class_paths = nullptr;
GrowableArrayCHeap<const char*, mtClass>* FileMapInfo::_non_existent_class_paths = nullptr;

// Open the shared archive file, read and validate the header
// information (version, boot classpath, etc.). If initialization
Expand Down
5 changes: 4 additions & 1 deletion src/hotspot/share/cds/filemap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class ClassLoaderData;
class ClassPathEntry;
class outputStream;

template<class E> class GrowableArray;
template<class E, MEMFLAGS F> class GrowableArrayCHeap;

class SharedClassPathEntry : public MetaspaceObj {
enum {
modules_image_entry,
Expand Down Expand Up @@ -342,7 +345,7 @@ class FileMapInfo : public CHeapObj<mtInternal> {
static FileMapInfo* _dynamic_archive_info;
static bool _heap_pointers_need_patching;
static bool _memory_mapping_failed;
static GrowableArray<const char*>* _non_existent_class_paths;
static GrowableArrayCHeap<const char*, mtClass>* _non_existent_class_paths;

public:
FileMapHeader *header() const { return _header; }
Expand Down
14 changes: 6 additions & 8 deletions src/hotspot/share/cds/heapShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void HeapShared::archive_java_mirrors() {
}
}

GrowableArray<Klass*>* klasses = ArchiveBuilder::current()->klasses();
GrowableArrayCHeap<Klass*, mtClassShared>* klasses = ArchiveBuilder::current()->klasses();
assert(klasses != nullptr, "sanity");
for (int i = 0; i < klasses->length(); i++) {
Klass* orig_k = klasses->at(i);
Expand Down Expand Up @@ -621,8 +621,7 @@ KlassSubGraphInfo* HeapShared::get_subgraph_info(Klass* k) {
void KlassSubGraphInfo::add_subgraph_entry_field(int static_field_offset, oop v) {
assert(CDSConfig::is_dumping_heap(), "dump time only");
if (_subgraph_entry_fields == nullptr) {
_subgraph_entry_fields =
new (mtClass) GrowableArray<int>(10, mtClass);
_subgraph_entry_fields = new GrowableArrayCHeap<int, mtClass>(10);
}
_subgraph_entry_fields->append(static_field_offset);
_subgraph_entry_fields->append(HeapShared::append_root(v));
Expand All @@ -635,8 +634,7 @@ void KlassSubGraphInfo::add_subgraph_object_klass(Klass* orig_k) {
Klass* buffered_k = ArchiveBuilder::get_buffered_klass(orig_k);

if (_subgraph_object_klasses == nullptr) {
_subgraph_object_klasses =
new (mtClass) GrowableArray<Klass*>(50, mtClass);
_subgraph_object_klasses = new GrowableArrayCHeap<Klass*, mtClass>(50);
}

assert(ArchiveBuilder::current()->is_in_buffer_space(buffered_k), "must be a shared class");
Expand Down Expand Up @@ -751,7 +749,7 @@ void ArchivedKlassSubGraphInfoRecord::init(KlassSubGraphInfo* info) {
}

// populate the entry fields
GrowableArray<int>* entry_fields = info->subgraph_entry_fields();
GrowableArrayCHeap<int, mtClass>* entry_fields = info->subgraph_entry_fields();
if (entry_fields != nullptr) {
int num_entry_fields = entry_fields->length();
assert(num_entry_fields % 2 == 0, "sanity");
Expand All @@ -763,7 +761,7 @@ void ArchivedKlassSubGraphInfoRecord::init(KlassSubGraphInfo* info) {
}

// the Klasses of the objects in the sub-graphs
GrowableArray<Klass*>* subgraph_object_klasses = info->subgraph_object_klasses();
GrowableArrayCHeap<Klass*, mtClass>* subgraph_object_klasses = info->subgraph_object_klasses();
if (subgraph_object_klasses != nullptr) {
int num_subgraphs_klasses = subgraph_object_klasses->length();
_subgraph_object_klasses =
Expand Down Expand Up @@ -1341,7 +1339,7 @@ void HeapShared::verify_reachable_objects_from(oop obj) {
// Make sure that these are only instances of the very few specific types
// that we can handle.
void HeapShared::check_default_subgraph_classes() {
GrowableArray<Klass*>* klasses = _default_subgraph_info->subgraph_object_klasses();
GrowableArrayCHeap<Klass*, mtClass>* klasses = _default_subgraph_info->subgraph_object_klasses();
int num = klasses->length();
for (int i = 0; i < num; i++) {
Klass* subgraph_k = klasses->at(i);
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/cds/heapShared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ class KlassSubGraphInfo: public CHeapObj<mtClass> {
Klass* _k;
// A list of classes need to be loaded and initialized before the archived
// object sub-graphs can be accessed at runtime.
GrowableArray<Klass*>* _subgraph_object_klasses;
GrowableArrayCHeap<Klass*, mtClass>* _subgraph_object_klasses;
// A list of _k's static fields as the entry points of archived sub-graphs.
// For each entry field, it is a tuple of field_offset, field_value
GrowableArray<int>* _subgraph_entry_fields;
GrowableArrayCHeap<int, mtClass>* _subgraph_entry_fields;

// Does this KlassSubGraphInfo belong to the archived full module graph
bool _is_full_module_graph;
Expand Down Expand Up @@ -94,10 +94,10 @@ class KlassSubGraphInfo: public CHeapObj<mtClass> {
};

Klass* klass() { return _k; }
GrowableArray<Klass*>* subgraph_object_klasses() {
GrowableArrayCHeap<Klass*, mtClass>* subgraph_object_klasses() {
return _subgraph_object_klasses;
}
GrowableArray<int>* subgraph_entry_fields() {
GrowableArrayCHeap<int, mtClass>* subgraph_entry_fields() {
return _subgraph_entry_fields;
}
void add_subgraph_entry_field(int static_field_offset, oop v);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/lambdaProxyClassDictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ class LambdaProxyClassKey {

class DumpTimeLambdaProxyClassInfo {
public:
GrowableArray<InstanceKlass*>* _proxy_klasses;
GrowableArrayCHeap<InstanceKlass*, mtClassShared>* _proxy_klasses;
DumpTimeLambdaProxyClassInfo() : _proxy_klasses(nullptr) {}
DumpTimeLambdaProxyClassInfo& operator=(const DumpTimeLambdaProxyClassInfo&) = delete;
~DumpTimeLambdaProxyClassInfo();

void add_proxy_klass(InstanceKlass* proxy_klass) {
if (_proxy_klasses == nullptr) {
_proxy_klasses = new (mtClassShared) GrowableArray<InstanceKlass*>(5, mtClassShared);
_proxy_klasses = new GrowableArrayCHeap<InstanceKlass*, mtClassShared>(5);
}
assert(_proxy_klasses != nullptr, "sanity");
_proxy_klasses->append(proxy_klass);
Expand Down
Loading