comparison src/share/vm/classfile/verifier.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 3a531d40ad93
comparison
equal deleted inserted replaced
6939:c284cf4781f0 6940:18fb7da42534
444 bytecode_name = Bytecodes::name(code); 444 bytecode_name = Bytecodes::name(code);
445 } else { 445 } else {
446 bytecode_name = "<illegal>"; 446 bytecode_name = "<illegal>";
447 } 447 }
448 } 448 }
449 InstanceKlass* ik = InstanceKlass::cast(method->method_holder()); 449 InstanceKlass* ik = method->method_holder();
450 ss->indent().print_cr("Location:"); 450 ss->indent().print_cr("Location:");
451 streamIndentor si2(ss); 451 streamIndentor si2(ss);
452 ss->indent().print_cr("%s.%s%s @%d: %s", 452 ss->indent().print_cr("%s.%s%s @%d: %s",
453 ik->name()->as_C_string(), method->name()->as_C_string(), 453 ik->name()->as_C_string(), method->name()->as_C_string(),
454 method->signature()->as_C_string(), _bci, bytecode_name); 454 method->signature()->as_C_string(), _bci, bytecode_name);
1848 u2 bci, constantPoolHandle cp, int index, TRAPS) { 1848 u2 bci, constantPoolHandle cp, int index, TRAPS) {
1849 int nconstants = cp->length(); 1849 int nconstants = cp->length();
1850 if ((index <= 0) || (index >= nconstants)) { 1850 if ((index <= 0) || (index >= nconstants)) {
1851 verify_error(ErrorContext::bad_cp_index(bci, index), 1851 verify_error(ErrorContext::bad_cp_index(bci, index),
1852 "Illegal constant pool index %d in class %s", 1852 "Illegal constant pool index %d in class %s",
1853 index, InstanceKlass::cast(cp->pool_holder())->external_name()); 1853 index, cp->pool_holder()->external_name());
1854 return; 1854 return;
1855 } 1855 }
1856 } 1856 }
1857 1857
1858 void ClassVerifier::verify_cp_type( 1858 void ClassVerifier::verify_cp_type(
1867 verify_cp_index(bci, cp, index, CHECK_VERIFY(this)); 1867 verify_cp_index(bci, cp, index, CHECK_VERIFY(this));
1868 unsigned int tag = cp->tag_at(index).value(); 1868 unsigned int tag = cp->tag_at(index).value();
1869 if ((types & (1 << tag)) == 0) { 1869 if ((types & (1 << tag)) == 0) {
1870 verify_error(ErrorContext::bad_cp_index(bci, index), 1870 verify_error(ErrorContext::bad_cp_index(bci, index),
1871 "Illegal type at constant pool entry %d in class %s", 1871 "Illegal type at constant pool entry %d in class %s",
1872 index, InstanceKlass::cast(cp->pool_holder())->external_name()); 1872 index, cp->pool_holder()->external_name());
1873 return; 1873 return;
1874 } 1874 }
1875 } 1875 }
1876 1876
1877 void ClassVerifier::verify_cp_class_type( 1877 void ClassVerifier::verify_cp_class_type(
1879 verify_cp_index(bci, cp, index, CHECK_VERIFY(this)); 1879 verify_cp_index(bci, cp, index, CHECK_VERIFY(this));
1880 constantTag tag = cp->tag_at(index); 1880 constantTag tag = cp->tag_at(index);
1881 if (!tag.is_klass() && !tag.is_unresolved_klass()) { 1881 if (!tag.is_klass() && !tag.is_unresolved_klass()) {
1882 verify_error(ErrorContext::bad_cp_index(bci, index), 1882 verify_error(ErrorContext::bad_cp_index(bci, index),
1883 "Illegal type at constant pool entry %d in class %s", 1883 "Illegal type at constant pool entry %d in class %s",
1884 index, InstanceKlass::cast(cp->pool_holder())->external_name()); 1884 index, cp->pool_holder()->external_name());
1885 return; 1885 return;
1886 } 1886 }
1887 } 1887 }
1888 1888
1889 void ClassVerifier::verify_error(ErrorContext ctx, const char* msg, ...) { 1889 void ClassVerifier::verify_error(ErrorContext ctx, const char* msg, ...) {