mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-16 17:14:41 +02:00
8292818: replace 96-bit representation for field metadata with variable-sized streams
Co-authored-by: John R Rose <jrose@openjdk.org> Co-authored-by: Chris Plummer <cjplummer@openjdk.org> Reviewed-by: dholmes, coleenp, cjplummer, dnsimon
This commit is contained in:
parent
932be3542d
commit
bfb812a8ff
54 changed files with 1302 additions and 858 deletions
|
@ -647,10 +647,15 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
|
|||
set_transitive_interfaces(nullptr);
|
||||
set_local_interfaces(nullptr);
|
||||
|
||||
if (fields() != nullptr && !fields()->is_shared()) {
|
||||
MetadataFactory::free_array<jushort>(loader_data, fields());
|
||||
if (fieldinfo_stream() != nullptr && !fieldinfo_stream()->is_shared()) {
|
||||
MetadataFactory::free_array<u1>(loader_data, fieldinfo_stream());
|
||||
}
|
||||
set_fields(nullptr, 0);
|
||||
set_fieldinfo_stream(nullptr);
|
||||
|
||||
if (fields_status() != nullptr && !fields_status()->is_shared()) {
|
||||
MetadataFactory::free_array<FieldStatus>(loader_data, fields_status());
|
||||
}
|
||||
set_fields_status(nullptr);
|
||||
|
||||
// If a method from a redefined class is using this constant pool, don't
|
||||
// delete it, yet. The new class's previous version will point to this.
|
||||
|
@ -1533,6 +1538,16 @@ bool InstanceKlass::contains_field_offset(int offset) {
|
|||
return find_field_from_offset(offset, false, &fd);
|
||||
}
|
||||
|
||||
FieldInfo InstanceKlass::field(int index) const {
|
||||
for (AllFieldStream fs(this); !fs.done(); fs.next()) {
|
||||
if (fs.index() == index) {
|
||||
return fs.to_FieldInfo();
|
||||
}
|
||||
}
|
||||
fatal("Field not found");
|
||||
return FieldInfo();
|
||||
}
|
||||
|
||||
bool InstanceKlass::find_local_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const {
|
||||
for (JavaFieldStream fs(this); !fs.done(); fs.next()) {
|
||||
Symbol* f_name = fs.name();
|
||||
|
@ -2449,8 +2464,9 @@ void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) {
|
|||
it->push(&_default_vtable_indices);
|
||||
}
|
||||
|
||||
// _fields might be written into by Rewriter::scan_method() -> fd.set_has_initialized_final_update()
|
||||
it->push(&_fields, MetaspaceClosure::_writable);
|
||||
it->push(&_fieldinfo_stream);
|
||||
// _fields_status might be written into by Rewriter::scan_method() -> fd.set_has_initialized_final_update()
|
||||
it->push(&_fields_status, MetaspaceClosure::_writable);
|
||||
|
||||
if (itable_length() > 0) {
|
||||
itableOffsetEntry* ioe = (itableOffsetEntry*)start_of_itable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue