Skip to content

Commit 8edf64d

Browse files
committedOct 8, 2019
8232006: Remove dead code from klassVtable
Reviewed-by: coleenp, jiangli, lfoltan
1 parent 422a77c commit 8edf64d

File tree

2 files changed

+0
-67
lines changed

2 files changed

+0
-67
lines changed
 

‎src/hotspot/share/oops/klassVtable.cpp

-40
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ void klassVtable::compute_vtable_size_and_num_mirandas(
128128
*vtable_length_ret = vtable_length;
129129
}
130130

131-
int klassVtable::index_of(Method* m, int len) const {
132-
assert(m->has_vtable_index(), "do not ask this of non-vtable methods");
133-
return m->vtable_index();
134-
}
135-
136131
// Copy super class's vtable to the first part (prefix) of this class's vtable,
137132
// and return the number of entries copied. Expects that 'super' is the Java
138133
// super class (arrays can have "array" super classes that must be skipped).
@@ -169,7 +164,6 @@ void klassVtable::initialize_vtable(bool checkconstraints, TRAPS) {
169164

170165
// Note: Arrays can have intermediate array supers. Use java_super to skip them.
171166
InstanceKlass* super = _klass->java_super();
172-
int nofNewEntries = 0;
173167

174168
bool is_shared = _klass->is_shared();
175169

@@ -1029,15 +1023,6 @@ void klassVtable::dump_vtable() {
10291023
}
10301024
#endif // INCLUDE_JVMTI
10311025

1032-
// CDS/RedefineClasses support - clear vtables so they can be reinitialized
1033-
void klassVtable::clear_vtable() {
1034-
for (int i = 0; i < _length; i++) table()[i].clear();
1035-
}
1036-
1037-
bool klassVtable::is_initialized() {
1038-
return _length == 0 || table()[0].method() != NULL;
1039-
}
1040-
10411026
//-----------------------------------------------------------------------------------------
10421027
// Itable code
10431028

@@ -1468,31 +1453,6 @@ void klassItable::setup_itable_offset_table(InstanceKlass* klass) {
14681453
#endif
14691454
}
14701455

1471-
1472-
// inverse to itable_index
1473-
Method* klassItable::method_for_itable_index(InstanceKlass* intf, int itable_index) {
1474-
assert(intf->is_interface(), "sanity check");
1475-
assert(intf->verify_itable_index(itable_index), "");
1476-
Array<Method*>* methods = InstanceKlass::cast(intf)->methods();
1477-
1478-
if (itable_index < 0 || itable_index >= method_count_for_interface(intf))
1479-
return NULL; // help caller defend against bad indices
1480-
1481-
int index = itable_index;
1482-
Method* m = methods->at(index);
1483-
int index2 = -1;
1484-
while (!m->has_itable_index() ||
1485-
(index2 = m->itable_index()) != itable_index) {
1486-
assert(index2 < itable_index, "monotonic");
1487-
if (++index == methods->length())
1488-
return NULL;
1489-
m = methods->at(index);
1490-
}
1491-
assert(m->itable_index() == itable_index, "correct inverse");
1492-
1493-
return m;
1494-
}
1495-
14961456
void klassVtable::verify(outputStream* st, bool forced) {
14971457
// make sure table is initialized
14981458
if (!Universe::is_fully_initialized()) return;

‎src/hotspot/share/oops/klassVtable.hpp

-27
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ class klassVtable {
4848
int _verify_count; // to make verify faster
4949
#endif
5050

51-
// Ordering important, so greater_than (>) can be used as an merge operator.
52-
enum AccessType {
53-
acc_private = 0,
54-
acc_package_private = 1,
55-
acc_publicprotected = 2
56-
};
57-
5851
public:
5952
klassVtable(Klass* klass, void* base, int length) : _klass(klass) {
6053
_tableOffset = (address)base - (address)klass; _length = length;
@@ -66,22 +59,12 @@ class klassVtable {
6659
int length() const { return _length; }
6760
inline Method* method_at(int i) const;
6861
inline Method* unchecked_method_at(int i) const;
69-
inline Method** adr_method_at(int i) const;
7062

7163
// searching; all methods return -1 if not found
72-
int index_of(Method* m) const { return index_of(m, _length); }
7364
int index_of_miranda(Symbol* name, Symbol* signature);
7465

7566
void initialize_vtable(bool checkconstraints, TRAPS); // initialize vtable of a new klass
7667

77-
// CDS/RedefineClasses support - clear vtables so they can be reinitialized
78-
// at dump time. Clearing gives us an easy way to tell if the vtable has
79-
// already been reinitialized at dump time (see dump.cpp). Vtables can
80-
// be initialized at run time by RedefineClasses so dumping the right order
81-
// is necessary.
82-
void clear_vtable();
83-
bool is_initialized();
84-
8568
// computes vtable length (in words) and the number of miranda methods
8669
static void compute_vtable_size_and_num_mirandas(int* vtable_length,
8770
int* num_new_mirandas,
@@ -125,7 +108,6 @@ class klassVtable {
125108
private:
126109
void copy_vtable_to(vtableEntry* start);
127110
int initialize_from_super(Klass* super);
128-
int index_of(Method* m, int len) const; // same as index_of, but search only up to len
129111
void put_method_at(Method* m, int index);
130112
static bool needs_new_vtable_entry(const methodHandle& m,
131113
const Klass* super,
@@ -223,12 +205,6 @@ inline Method* klassVtable::unchecked_method_at(int i) const {
223205
return table()[i].method();
224206
}
225207

226-
inline Method** klassVtable::adr_method_at(int i) const {
227-
// Allow one past the last entry to be referenced; useful for loop bounds.
228-
assert(i >= 0 && i <= _length, "index out of bounds");
229-
return (Method**)(address(table() + i) + vtableEntry::method_offset_in_bytes());
230-
}
231-
232208
// --------------------------------------------------------------------------------
233209
class klassItable;
234210
class itableMethodEntry;
@@ -333,9 +309,6 @@ class klassItable {
333309
static int compute_itable_size(Array<InstanceKlass*>* transitive_interfaces);
334310
static void setup_itable_offset_table(InstanceKlass* klass);
335311

336-
// Resolving of method to index
337-
static Method* method_for_itable_index(InstanceKlass* klass, int itable_index);
338-
339312
// Debugging/Statistics
340313
static void print_statistics() PRODUCT_RETURN;
341314
private:

0 commit comments

Comments
 (0)
Please sign in to comment.