mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8139163: InstanceKlass::cast passes through NULL
Reduce raw (InstanceKlass*) casts and InstanceKlass::cast, which no long allows null Reviewed-by: twisti, kbarrett
This commit is contained in:
parent
25cc742a8f
commit
5179fc3488
43 changed files with 215 additions and 252 deletions
|
@ -557,9 +557,11 @@ Klass* Klass::array_klass_impl(bool or_null, TRAPS) {
|
|||
|
||||
oop Klass::class_loader() const { return class_loader_data()->class_loader(); }
|
||||
|
||||
// In product mode, this function doesn't have virtual function calls so
|
||||
// there might be some performance advantage to handling InstanceKlass here.
|
||||
const char* Klass::external_name() const {
|
||||
if (oop_is_instance()) {
|
||||
InstanceKlass* ik = (InstanceKlass*) this;
|
||||
const InstanceKlass* ik = static_cast<const InstanceKlass*>(this);
|
||||
if (ik->is_anonymous()) {
|
||||
intptr_t hash = 0;
|
||||
if (ik->java_mirror() != NULL) {
|
||||
|
@ -687,14 +689,8 @@ void Klass::oop_verify_on(oop obj, outputStream* st) {
|
|||
#ifndef PRODUCT
|
||||
|
||||
bool Klass::verify_vtable_index(int i) {
|
||||
if (oop_is_instance()) {
|
||||
int limit = ((InstanceKlass*)this)->vtable_length()/vtableEntry::size();
|
||||
assert(i >= 0 && i < limit, "index %d out of bounds %d", i, limit);
|
||||
} else {
|
||||
assert(oop_is_array(), "Must be");
|
||||
int limit = ((ArrayKlass*)this)->vtable_length()/vtableEntry::size();
|
||||
assert(i >= 0 && i < limit, "index %d out of bounds %d", i, limit);
|
||||
}
|
||||
int limit = vtable_length()/vtableEntry::size();
|
||||
assert(i >= 0 && i < limit, "index %d out of bounds %d", i, limit);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue