8214728: Unnecessary InstanceKlass::cast at few places

Reviewed-by: lfoltan, jiangli, coleenp
This commit is contained in:
Calvin Cheung 2018-12-04 11:54:09 -08:00
parent 3d0ccc7ec9
commit 4e935d302a
3 changed files with 3 additions and 4 deletions

View File

@ -2017,8 +2017,7 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
if (kls != NULL) {
current_class()->class_loader_data()->record_dependency(kls);
if (log_is_enabled(Debug, class, resolve)) {
InstanceKlass* cur_class = InstanceKlass::cast(current_class());
Verifier::trace_class_resolution(kls, cur_class);
Verifier::trace_class_resolution(kls, current_class());
}
}
return kls;

View File

@ -728,7 +728,7 @@ void InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code byt
// class is initialized. This is required so that access to the static
// field will call the initialization function every time until the class
// is completely initialized ala. in 2.17.5 in JVM Specification.
InstanceKlass* klass = InstanceKlass::cast(info.field_holder());
InstanceKlass* klass = info.field_holder();
bool uninitialized_static = is_static && !klass->is_initialized();
bool has_initialized_final_update = info.field_holder()->major_version() >= 53 &&
info.has_initialized_final_update();

View File

@ -1151,7 +1151,7 @@ methodHandle LinkResolver::linktime_resolve_special_method(const LinkInfo& link_
InstanceKlass* ck = InstanceKlass::cast(current_klass);
InstanceKlass *klass_to_check = !ck->is_unsafe_anonymous() ?
ck :
InstanceKlass::cast(ck->unsafe_anonymous_host());
ck->unsafe_anonymous_host();
// Disable verification for the dynamically-generated reflection bytecodes.
bool is_reflect = klass_to_check->is_subclass_of(
SystemDictionary::reflect_MagicAccessorImpl_klass());