mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8307553: Remove dead code MetaspaceClosure::push_method_entry
Reviewed-by: coleenp, ccheung
This commit is contained in:
@@ -167,7 +167,6 @@ ArchiveBuilder::ArchiveBuilder() :
|
||||
{
|
||||
_klasses = new (mtClassShared) GrowableArray<Klass*>(4 * K, mtClassShared);
|
||||
_symbols = new (mtClassShared) GrowableArray<Symbol*>(256 * K, mtClassShared);
|
||||
_special_refs = new (mtClassShared) GrowableArray<SpecialRefInfo>(24 * K, mtClassShared);
|
||||
|
||||
assert(_current == nullptr, "must be");
|
||||
_current = this;
|
||||
@@ -185,7 +184,6 @@ ArchiveBuilder::~ArchiveBuilder() {
|
||||
|
||||
delete _klasses;
|
||||
delete _symbols;
|
||||
delete _special_refs;
|
||||
if (_shared_rs.is_reserved()) {
|
||||
_shared_rs.release();
|
||||
}
|
||||
@@ -422,13 +420,6 @@ public:
|
||||
return _builder->gather_one_source_obj(enclosing_ref(), ref, read_only);
|
||||
}
|
||||
|
||||
virtual void push_special(SpecialRef type, Ref* ref, intptr_t* p) {
|
||||
assert(type == _method_entry_ref, "only special type allowed for now");
|
||||
address src_obj = ref->obj();
|
||||
size_t field_offset = pointer_delta(p, src_obj, sizeof(u1));
|
||||
_builder->add_special_ref(type, src_obj, field_offset);
|
||||
};
|
||||
|
||||
virtual void do_pending_ref(Ref* ref) {
|
||||
if (ref->obj() != nullptr) {
|
||||
_builder->remember_embedded_pointer_in_copied_obj(enclosing_ref(), ref);
|
||||
@@ -470,10 +461,6 @@ bool ArchiveBuilder::gather_one_source_obj(MetaspaceClosure::Ref* enclosing_ref,
|
||||
}
|
||||
}
|
||||
|
||||
void ArchiveBuilder::add_special_ref(MetaspaceClosure::SpecialRef type, address src_obj, size_t field_offset) {
|
||||
_special_refs->append(SpecialRefInfo(type, src_obj, field_offset));
|
||||
}
|
||||
|
||||
void ArchiveBuilder::remember_embedded_pointer_in_copied_obj(MetaspaceClosure::Ref* enclosing_ref,
|
||||
MetaspaceClosure::Ref* ref) {
|
||||
assert(ref->obj() != nullptr, "should have checked");
|
||||
@@ -672,21 +659,6 @@ void ArchiveBuilder::relocate_embedded_pointers(ArchiveBuilder::SourceObjList* s
|
||||
}
|
||||
}
|
||||
|
||||
void ArchiveBuilder::update_special_refs() {
|
||||
for (int i = 0; i < _special_refs->length(); i++) {
|
||||
SpecialRefInfo s = _special_refs->at(i);
|
||||
size_t field_offset = s.field_offset();
|
||||
address src_obj = s.src_obj();
|
||||
address dst_obj = get_buffered_addr(src_obj);
|
||||
intptr_t* src_p = (intptr_t*)(src_obj + field_offset);
|
||||
intptr_t* dst_p = (intptr_t*)(dst_obj + field_offset);
|
||||
assert(s.type() == MetaspaceClosure::_method_entry_ref, "only special type allowed for now");
|
||||
|
||||
assert(*src_p == *dst_p, "must be a copy");
|
||||
ArchivePtrMarker::mark_pointer((address*)dst_p);
|
||||
}
|
||||
}
|
||||
|
||||
class RefRelocator: public MetaspaceClosure {
|
||||
ArchiveBuilder* _builder;
|
||||
|
||||
@@ -715,7 +687,6 @@ void ArchiveBuilder::relocate_metaspaceobj_embedded_pointers() {
|
||||
log_info(cds)("Relocating embedded pointers in core regions ... ");
|
||||
relocate_embedded_pointers(&_rw_src_objs);
|
||||
relocate_embedded_pointers(&_ro_src_objs);
|
||||
update_special_refs();
|
||||
}
|
||||
|
||||
// We must relocate vmClasses::_klasses[] only after we have copied the
|
||||
|
||||
@@ -122,23 +122,6 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
class SpecialRefInfo {
|
||||
// We have a "special pointer" of the given _type at _field_offset of _src_obj.
|
||||
// See MetaspaceClosure::push_special().
|
||||
MetaspaceClosure::SpecialRef _type;
|
||||
address _src_obj;
|
||||
size_t _field_offset;
|
||||
|
||||
public:
|
||||
SpecialRefInfo() {}
|
||||
SpecialRefInfo(MetaspaceClosure::SpecialRef type, address src_obj, size_t field_offset)
|
||||
: _type(type), _src_obj(src_obj), _field_offset(field_offset) {}
|
||||
|
||||
MetaspaceClosure::SpecialRef type() const { return _type; }
|
||||
address src_obj() const { return _src_obj; }
|
||||
size_t field_offset() const { return _field_offset; }
|
||||
};
|
||||
|
||||
class SourceObjInfo {
|
||||
MetaspaceClosure::Ref* _ref; // The object that's copied into the buffer
|
||||
uintx _ptrmap_start; // The bit-offset of the start of this object (inclusive)
|
||||
@@ -230,7 +213,6 @@ private:
|
||||
ResizeableResourceHashtable<address, address, AnyObj::C_HEAP, mtClassShared> _buffered_to_src_table;
|
||||
GrowableArray<Klass*>* _klasses;
|
||||
GrowableArray<Symbol*>* _symbols;
|
||||
GrowableArray<SpecialRefInfo>* _special_refs;
|
||||
|
||||
// statistics
|
||||
DumpAllocStats _alloc_stats;
|
||||
@@ -268,7 +250,6 @@ private:
|
||||
void make_shallow_copies(DumpRegion *dump_region, const SourceObjList* src_objs);
|
||||
void make_shallow_copy(DumpRegion *dump_region, SourceObjInfo* src_info);
|
||||
|
||||
void update_special_refs();
|
||||
void relocate_embedded_pointers(SourceObjList* src_objs);
|
||||
|
||||
bool is_excluded(Klass* k);
|
||||
@@ -357,7 +338,6 @@ public:
|
||||
void gather_source_objs();
|
||||
bool gather_klass_and_symbol(MetaspaceClosure::Ref* ref, bool read_only);
|
||||
bool gather_one_source_obj(MetaspaceClosure::Ref* enclosing_ref, MetaspaceClosure::Ref* ref, bool read_only);
|
||||
void add_special_ref(MetaspaceClosure::SpecialRef type, address src_obj, size_t field_offset);
|
||||
void remember_embedded_pointer_in_copied_obj(MetaspaceClosure::Ref* enclosing_ref, MetaspaceClosure::Ref* ref);
|
||||
|
||||
DumpRegion* rw_region() { return &_rw_region; }
|
||||
|
||||
@@ -78,10 +78,6 @@ public:
|
||||
_default
|
||||
};
|
||||
|
||||
enum SpecialRef {
|
||||
_method_entry_ref
|
||||
};
|
||||
|
||||
// class MetaspaceClosure::Ref --
|
||||
//
|
||||
// MetaspaceClosure can be viewed as a very simple type of copying garbage
|
||||
@@ -356,19 +352,6 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T> void push_method_entry(T** mpp, intptr_t* p) {
|
||||
Ref* ref = new MSORef<T>(mpp, _default);
|
||||
push_special(_method_entry_ref, ref, (intptr_t*)p);
|
||||
if (!ref->keep_after_pushing()) {
|
||||
delete ref;
|
||||
}
|
||||
}
|
||||
|
||||
// This is for tagging special pointers that are not a reference to MetaspaceObj. It's currently
|
||||
// used to mark the method entry points in Method/ConstMethod.
|
||||
virtual void push_special(SpecialRef type, Ref* obj, intptr_t* p) {
|
||||
assert(type == _method_entry_ref, "only special type allowed for now");
|
||||
}
|
||||
};
|
||||
|
||||
// This is a special MetaspaceClosure that visits each unique MetaspaceObj once.
|
||||
|
||||
Reference in New Issue
Block a user