< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page

 253   } else {
 254     THROW_MSG(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string());
 255   }
 256 }
 257 
 258 // Forwards to resolve_or_null
 259 
 260 Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain,
 261                                          bool throw_error, TRAPS) {
 262   Klass* klass = resolve_or_null(class_name, class_loader, protection_domain, THREAD);
 263   // Check for pending exception or null klass, and throw exception
 264   if (HAS_PENDING_EXCEPTION || klass == NULL) {
 265     handle_resolution_exception(class_name, throw_error, CHECK_NULL);
 266   }
 267   return klass;
 268 }
 269 
 270 // Forwards to resolve_array_class_or_null or resolve_instance_class_or_null
 271 
 272 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {

 273   if (Signature::is_array(class_name)) {
 274     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
 275   } else {
 276     return resolve_instance_class_or_null_helper(class_name, class_loader, protection_domain, THREAD);
 277   }
 278 }
 279 
 280 // name may be in the form of "java/lang/Object" or "Ljava/lang/Object;"
 281 InstanceKlass* SystemDictionary::resolve_instance_class_or_null_helper(Symbol* class_name,
 282                                                                        Handle class_loader,
 283                                                                        Handle protection_domain,
 284                                                                        TRAPS) {
 285   assert(class_name != NULL && !Signature::is_array(class_name), "must be");
 286   if (Signature::has_envelope(class_name)) {
 287     ResourceMark rm(THREAD);
 288     // Ignore wrapping L and ;.
 289     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
 290                                                  class_name->utf8_length() - 2);
 291     return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
 292   } else {

 253   } else {
 254     THROW_MSG(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string());
 255   }
 256 }
 257 
 258 // Forwards to resolve_or_null
 259 
 260 Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain,
 261                                          bool throw_error, TRAPS) {
 262   Klass* klass = resolve_or_null(class_name, class_loader, protection_domain, THREAD);
 263   // Check for pending exception or null klass, and throw exception
 264   if (HAS_PENDING_EXCEPTION || klass == NULL) {
 265     handle_resolution_exception(class_name, throw_error, CHECK_NULL);
 266   }
 267   return klass;
 268 }
 269 
 270 // Forwards to resolve_array_class_or_null or resolve_instance_class_or_null
 271 
 272 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {
 273   assert(class_name != NULL, "must not be NULL");
 274   if (Signature::is_array(class_name)) {
 275     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
 276   } else {
 277     return resolve_instance_class_or_null_helper(class_name, class_loader, protection_domain, THREAD);
 278   }
 279 }
 280 
 281 // name may be in the form of "java/lang/Object" or "Ljava/lang/Object;"
 282 InstanceKlass* SystemDictionary::resolve_instance_class_or_null_helper(Symbol* class_name,
 283                                                                        Handle class_loader,
 284                                                                        Handle protection_domain,
 285                                                                        TRAPS) {
 286   assert(class_name != NULL && !Signature::is_array(class_name), "must be");
 287   if (Signature::has_envelope(class_name)) {
 288     ResourceMark rm(THREAD);
 289     // Ignore wrapping L and ;.
 290     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
 291                                                  class_name->utf8_length() - 2);
 292     return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
 293   } else {
< prev index next >