Mercurial > hg > truffle
diff src/share/vm/oops/constantPool.cpp @ 6940:18fb7da42534
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
Summary: Change types of above methods and field to InstanceKlass and remove unneeded casts from the source files.
Reviewed-by: dholmes, coleenp, zgu
Contributed-by: harold.seigel@oracle.com
author | coleenp |
---|---|
date | Tue, 06 Nov 2012 15:09:37 -0500 |
parents | 4735d2c84362 |
children | e522a00b91aa 90273fc0a981 |
line wrap: on
line diff
--- a/src/share/vm/oops/constantPool.cpp Thu Oct 04 14:55:57 2012 +0200 +++ b/src/share/vm/oops/constantPool.cpp Tue Nov 06 15:09:37 2012 -0500 @@ -228,7 +228,7 @@ } else { do_resolve = true; name = this_oop->unresolved_klass_at(which); - loader = Handle(THREAD, InstanceKlass::cast(this_oop->pool_holder())->class_loader()); + loader = Handle(THREAD, this_oop->pool_holder()->class_loader()); } } } // unlocking constantPool @@ -247,7 +247,7 @@ if (do_resolve) { // this_oop must be unlocked during resolve_or_fail - oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain(); + oop protection_domain = this_oop->pool_holder()->protection_domain(); Handle h_prot (THREAD, protection_domain); Klass* k_oop = SystemDictionary::resolve_or_fail(name, loader, h_prot, true, THREAD); KlassHandle k; @@ -315,7 +315,7 @@ vframeStream vfst(JavaThread::current()); if (!vfst.at_end()) { line_number = vfst.method()->line_number_from_bci(vfst.bci()); - Symbol* s = InstanceKlass::cast(vfst.method()->method_holder())->source_file_name(); + Symbol* s = vfst.method()->method_holder()->source_file_name(); if (s != NULL) { source_file = s->as_C_string(); } @@ -325,11 +325,11 @@ // only print something if the classes are different if (source_file != NULL) { tty->print("RESOLVE %s %s %s:%d\n", - InstanceKlass::cast(this_oop->pool_holder())->external_name(), + this_oop->pool_holder()->external_name(), InstanceKlass::cast(k())->external_name(), source_file, line_number); } else { tty->print("RESOLVE %s %s\n", - InstanceKlass::cast(this_oop->pool_holder())->external_name(), + this_oop->pool_holder()->external_name(), InstanceKlass::cast(k())->external_name()); } } @@ -339,7 +339,7 @@ // Only updated constant pool - if it is resolved. do_resolve = this_oop->tag_at(which).is_unresolved_klass(); if (do_resolve) { - ClassLoaderData* this_key = InstanceKlass::cast(this_oop->pool_holder())->class_loader_data(); + ClassLoaderData* this_key = this_oop->pool_holder()->class_loader_data(); if (!this_key->is_the_null_class_loader_data()) { this_key->record_dependency(k(), CHECK_NULL); // Can throw OOM } @@ -367,8 +367,8 @@ assert(entry.is_unresolved(), "must be either symbol or klass"); Thread *thread = Thread::current(); Symbol* name = entry.get_symbol(); - oop loader = InstanceKlass::cast(this_oop->pool_holder())->class_loader(); - oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain(); + oop loader = this_oop->pool_holder()->class_loader(); + oop protection_domain = this_oop->pool_holder()->protection_domain(); Handle h_prot (thread, protection_domain); Handle h_loader (thread, loader); Klass* k = SystemDictionary::find(name, h_loader, h_prot, thread); @@ -409,8 +409,8 @@ } else { assert(entry.is_unresolved(), "must be either symbol or klass"); Symbol* name = entry.get_symbol(); - oop loader = InstanceKlass::cast(this_oop->pool_holder())->class_loader(); - oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain(); + oop loader = this_oop->pool_holder()->class_loader(); + oop protection_domain = this_oop->pool_holder()->protection_domain(); Handle h_loader(THREAD, loader); Handle h_prot (THREAD, protection_domain); KlassHandle k(THREAD, SystemDictionary::find(name, h_loader, h_prot, THREAD)); @@ -1790,7 +1790,7 @@ assert(cp_patches->at(index).is_null(), err_msg("Unused constant pool patch at %d in class file %s", index, - InstanceKlass::cast(pool_holder())->external_name())); + pool_holder()->external_name())); } #endif // ASSERT } @@ -1948,7 +1948,7 @@ st->print(" for "); pool_holder()->print_value_on(st); if (pool_holder() != NULL) { - bool extra = (InstanceKlass::cast(pool_holder())->constants() != this); + bool extra = (pool_holder()->constants() != this); if (extra) st->print(" (extra)"); } if (cache() != NULL) {