< prev index next >

src/hotspot/share/prims/jni.cpp

Print this page




 335     }
 336     class_name = SymbolTable::new_symbol(name, CHECK_NULL);
 337   }
 338   ResourceMark rm(THREAD);
 339   ClassFileStream st((u1*)buf, bufLen, NULL, ClassFileStream::verify);
 340   Handle class_loader (THREAD, JNIHandles::resolve(loaderRef));
 341 
 342   if (UsePerfData && !class_loader.is_null()) {
 343     // check whether the current caller thread holds the lock or not.
 344     // If not, increment the corresponding counter
 345     if (ObjectSynchronizer::
 346         query_lock_ownership((JavaThread*)THREAD, class_loader) !=
 347         ObjectSynchronizer::owner_self) {
 348       ClassLoader::sync_JNIDefineClassLockFreeCounter()->inc();
 349     }
 350   }
 351   Klass* k = SystemDictionary::resolve_from_stream(class_name,
 352                                                    class_loader,
 353                                                    Handle(),
 354                                                    &st,

 355                                                    CHECK_NULL);
 356 
 357   if (log_is_enabled(Debug, class, resolve) && k != NULL) {
 358     trace_class_resolution(k);
 359   }
 360 
 361   cls = (jclass)JNIHandles::make_local(
 362     env, k->java_mirror());
 363   return cls;
 364 JNI_END
 365 
 366 
 367 
 368 DT_RETURN_MARK_DECL(FindClass, jclass
 369                     , HOTSPOT_JNI_FINDCLASS_RETURN(_ret_ref));
 370 
 371 JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
 372   JNIWrapper("FindClass");
 373 
 374   HOTSPOT_JNI_FINDCLASS_ENTRY(env, (char *)name);




 335     }
 336     class_name = SymbolTable::new_symbol(name, CHECK_NULL);
 337   }
 338   ResourceMark rm(THREAD);
 339   ClassFileStream st((u1*)buf, bufLen, NULL, ClassFileStream::verify);
 340   Handle class_loader (THREAD, JNIHandles::resolve(loaderRef));
 341 
 342   if (UsePerfData && !class_loader.is_null()) {
 343     // check whether the current caller thread holds the lock or not.
 344     // If not, increment the corresponding counter
 345     if (ObjectSynchronizer::
 346         query_lock_ownership((JavaThread*)THREAD, class_loader) !=
 347         ObjectSynchronizer::owner_self) {
 348       ClassLoader::sync_JNIDefineClassLockFreeCounter()->inc();
 349     }
 350   }
 351   Klass* k = SystemDictionary::resolve_from_stream(class_name,
 352                                                    class_loader,
 353                                                    Handle(),
 354                                                    &st,
 355                                                    NULL,  // dynamic_nest_host
 356                                                    CHECK_NULL);
 357 
 358   if (log_is_enabled(Debug, class, resolve) && k != NULL) {
 359     trace_class_resolution(k);
 360   }
 361 
 362   cls = (jclass)JNIHandles::make_local(
 363     env, k->java_mirror());
 364   return cls;
 365 JNI_END
 366 
 367 
 368 
 369 DT_RETURN_MARK_DECL(FindClass, jclass
 370                     , HOTSPOT_JNI_FINDCLASS_RETURN(_ret_ref));
 371 
 372 JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
 373   JNIWrapper("FindClass");
 374 
 375   HOTSPOT_JNI_FINDCLASS_ENTRY(env, (char *)name);


< prev index next >