< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page




 229     if (throw_error) {
 230       THROW_MSG_NULL(vmSymbols::java_lang_NoClassDefFoundError(), class_name->as_C_string());
 231     } else {
 232       THROW_MSG_NULL(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string());
 233     }
 234   }
 235   return klass;
 236 }
 237 
 238 
 239 Klass* SystemDictionary::resolve_or_fail(Symbol* class_name,
 240                                            bool throw_error, TRAPS)
 241 {
 242   return resolve_or_fail(class_name, Handle(), Handle(), throw_error, THREAD);
 243 }
 244 
 245 
 246 // Forwards to resolve_array_class_or_null or resolve_instance_class_or_null
 247 
 248 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {

 249   if (FieldType::is_array(class_name)) {
 250     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
 251   } else {
 252     return resolve_instance_class_or_null_helper(class_name, class_loader, protection_domain, THREAD);
 253   }
 254 }
 255 
 256 // name may be in the form of "java/lang/Object" or "Ljava/lang/Object;"
 257 InstanceKlass* SystemDictionary::resolve_instance_class_or_null_helper(Symbol* class_name,
 258                                                                        Handle class_loader,
 259                                                                        Handle protection_domain,
 260                                                                        TRAPS) {
 261   assert(class_name != NULL && !FieldType::is_array(class_name), "must be");
 262   if (FieldType::is_obj(class_name)) {
 263     ResourceMark rm(THREAD);
 264     // Ignore wrapping L and ;.
 265     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
 266                                                  class_name->utf8_length() - 2);
 267     return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
 268   } else {




 229     if (throw_error) {
 230       THROW_MSG_NULL(vmSymbols::java_lang_NoClassDefFoundError(), class_name->as_C_string());
 231     } else {
 232       THROW_MSG_NULL(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string());
 233     }
 234   }
 235   return klass;
 236 }
 237 
 238 
 239 Klass* SystemDictionary::resolve_or_fail(Symbol* class_name,
 240                                            bool throw_error, TRAPS)
 241 {
 242   return resolve_or_fail(class_name, Handle(), Handle(), throw_error, THREAD);
 243 }
 244 
 245 
 246 // Forwards to resolve_array_class_or_null or resolve_instance_class_or_null
 247 
 248 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {
 249   assert(class_name != NULL, "must not be NULL");
 250   if (FieldType::is_array(class_name)) {
 251     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
 252   } else {
 253     return resolve_instance_class_or_null_helper(class_name, class_loader, protection_domain, THREAD);
 254   }
 255 }
 256 
 257 // name may be in the form of "java/lang/Object" or "Ljava/lang/Object;"
 258 InstanceKlass* SystemDictionary::resolve_instance_class_or_null_helper(Symbol* class_name,
 259                                                                        Handle class_loader,
 260                                                                        Handle protection_domain,
 261                                                                        TRAPS) {
 262   assert(class_name != NULL && !FieldType::is_array(class_name), "must be");
 263   if (FieldType::is_obj(class_name)) {
 264     ResourceMark rm(THREAD);
 265     // Ignore wrapping L and ;.
 266     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
 267                                                  class_name->utf8_length() - 2);
 268     return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
 269   } else {


< prev index next >