Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/classFileParser.cpp @ 6983:070d523b96a7
8001471: Klass::cast() does nothing
Summary: Remove function Klass::cast() and calls to it.
Reviewed-by: dholmes, coleenp
author | hseigel |
---|---|
date | Mon, 12 Nov 2012 16:15:05 -0500 |
parents | 18fb7da42534 |
children | b2dbd323c668 90273fc0a981 |
comparison
equal
deleted
inserted
replaced
6981:8c413497f434 | 6983:070d523b96a7 |
---|---|
822 unresolved_klass, class_loader, protection_domain, | 822 unresolved_klass, class_loader, protection_domain, |
823 false, CHECK_NULL); | 823 false, CHECK_NULL); |
824 interf = KlassHandle(THREAD, k); | 824 interf = KlassHandle(THREAD, k); |
825 } | 825 } |
826 | 826 |
827 if (!Klass::cast(interf())->is_interface()) { | 827 if (!interf()->is_interface()) { |
828 THROW_MSG_(vmSymbols::java_lang_IncompatibleClassChangeError(), "Implementing class", NULL); | 828 THROW_MSG_(vmSymbols::java_lang_IncompatibleClassChangeError(), "Implementing class", NULL); |
829 } | 829 } |
830 if (InstanceKlass::cast(interf())->has_default_methods()) { | 830 if (InstanceKlass::cast(interf())->has_default_methods()) { |
831 *has_default_methods = true; | 831 *has_default_methods = true; |
832 } | 832 } |
3829 } | 3829 } |
3830 | 3830 |
3831 if (TraceClassResolution) { | 3831 if (TraceClassResolution) { |
3832 ResourceMark rm; | 3832 ResourceMark rm; |
3833 // print out the superclass. | 3833 // print out the superclass. |
3834 const char * from = Klass::cast(this_klass())->external_name(); | 3834 const char * from = this_klass()->external_name(); |
3835 if (this_klass->java_super() != NULL) { | 3835 if (this_klass->java_super() != NULL) { |
3836 tty->print("RESOLVE %s %s (super)\n", from, InstanceKlass::cast(this_klass->java_super())->external_name()); | 3836 tty->print("RESOLVE %s %s (super)\n", from, InstanceKlass::cast(this_klass->java_super())->external_name()); |
3837 } | 3837 } |
3838 // print out each of the interface classes referred to by this class. | 3838 // print out each of the interface classes referred to by this class. |
3839 Array<Klass*>* local_interfaces = this_klass->local_interfaces(); | 3839 Array<Klass*>* local_interfaces = this_klass->local_interfaces(); |
3980 // Check if this klass has a vanilla default constructor | 3980 // Check if this klass has a vanilla default constructor |
3981 if (super == NULL) { | 3981 if (super == NULL) { |
3982 // java.lang.Object has empty default constructor | 3982 // java.lang.Object has empty default constructor |
3983 k->set_has_vanilla_constructor(); | 3983 k->set_has_vanilla_constructor(); |
3984 } else { | 3984 } else { |
3985 if (Klass::cast(super)->has_vanilla_constructor() && | 3985 if (super->has_vanilla_constructor() && |
3986 _has_vanilla_constructor) { | 3986 _has_vanilla_constructor) { |
3987 k->set_has_vanilla_constructor(); | 3987 k->set_has_vanilla_constructor(); |
3988 } | 3988 } |
3989 #ifdef ASSERT | 3989 #ifdef ASSERT |
3990 bool v = false; | 3990 bool v = false; |
3991 if (Klass::cast(super)->has_vanilla_constructor()) { | 3991 if (super->has_vanilla_constructor()) { |
3992 Method* constructor = k->find_method(vmSymbols::object_initializer_name( | 3992 Method* constructor = k->find_method(vmSymbols::object_initializer_name( |
3993 ), vmSymbols::void_method_signature()); | 3993 ), vmSymbols::void_method_signature()); |
3994 if (constructor != NULL && constructor->is_vanilla_constructor()) { | 3994 if (constructor != NULL && constructor->is_vanilla_constructor()) { |
3995 v = true; | 3995 v = true; |
3996 } | 3996 } |
4128 void ClassFileParser::check_super_interface_access(instanceKlassHandle this_klass, TRAPS) { | 4128 void ClassFileParser::check_super_interface_access(instanceKlassHandle this_klass, TRAPS) { |
4129 Array<Klass*>* local_interfaces = this_klass->local_interfaces(); | 4129 Array<Klass*>* local_interfaces = this_klass->local_interfaces(); |
4130 int lng = local_interfaces->length(); | 4130 int lng = local_interfaces->length(); |
4131 for (int i = lng - 1; i >= 0; i--) { | 4131 for (int i = lng - 1; i >= 0; i--) { |
4132 Klass* k = local_interfaces->at(i); | 4132 Klass* k = local_interfaces->at(i); |
4133 assert (k != NULL && Klass::cast(k)->is_interface(), "invalid interface"); | 4133 assert (k != NULL && k->is_interface(), "invalid interface"); |
4134 if (!Reflection::verify_class_access(this_klass(), k, false)) { | 4134 if (!Reflection::verify_class_access(this_klass(), k, false)) { |
4135 ResourceMark rm(THREAD); | 4135 ResourceMark rm(THREAD); |
4136 Exceptions::fthrow( | 4136 Exceptions::fthrow( |
4137 THREAD_AND_LOCATION, | 4137 THREAD_AND_LOCATION, |
4138 vmSymbols::java_lang_IllegalAccessError(), | 4138 vmSymbols::java_lang_IllegalAccessError(), |