mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8148481: Devirtualize Klass::vtable
Move remainder of vtable related methods to Klass Reviewed-by: cjplummer, coleenp
This commit is contained in:
parent
211dc93a85
commit
3cda485fe5
12 changed files with 44 additions and 73 deletions
|
@ -659,6 +659,24 @@ void Klass::oop_verify_on(oop obj, outputStream* st) {
|
|||
guarantee(obj->klass()->is_klass(), "klass field is not a klass");
|
||||
}
|
||||
|
||||
klassVtable* Klass::vtable() const {
|
||||
return new klassVtable(this, start_of_vtable(), vtable_length() / vtableEntry::size());
|
||||
}
|
||||
|
||||
vtableEntry* Klass::start_of_vtable() const {
|
||||
return (vtableEntry*) ((address)this + in_bytes(vtable_start_offset()));
|
||||
}
|
||||
|
||||
Method* Klass::method_at_vtable(int index) {
|
||||
#ifndef PRODUCT
|
||||
assert(index >= 0, "valid vtable index");
|
||||
if (DebugVtables) {
|
||||
verify_vtable_index(index);
|
||||
}
|
||||
#endif
|
||||
return start_of_vtable()[index].method();
|
||||
}
|
||||
|
||||
ByteSize Klass::vtable_start_offset() {
|
||||
return in_ByteSize(InstanceKlass::header_size() * wordSize);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue