hotspot/src/share/vm/prims/jni.cpp
changeset 2269 ee9da33d43ab
parent 2105 347008ce7984
child 3820 0a8fbbe180db
equal deleted inserted replaced
2267:2e18a3d0155b 2269:ee9da33d43ab
   299     }
   299     }
   300   }
   300   }
   301   klassOop k = SystemDictionary::resolve_from_stream(class_name, class_loader,
   301   klassOop k = SystemDictionary::resolve_from_stream(class_name, class_loader,
   302                                                      Handle(), &st, CHECK_NULL);
   302                                                      Handle(), &st, CHECK_NULL);
   303 
   303 
       
   304   if (TraceClassResolution && k != NULL) {
       
   305     trace_class_resolution(k);
       
   306   }
       
   307 
   304   cls = (jclass)JNIHandles::make_local(
   308   cls = (jclass)JNIHandles::make_local(
   305     env, Klass::cast(k)->java_mirror());
   309     env, Klass::cast(k)->java_mirror());
   306   return cls;
   310   return cls;
   307 JNI_END
   311 JNI_END
   308 
   312 
   362   }
   366   }
   363 
   367 
   364   symbolHandle sym = oopFactory::new_symbol_handle(name, CHECK_NULL);
   368   symbolHandle sym = oopFactory::new_symbol_handle(name, CHECK_NULL);
   365   result = find_class_from_class_loader(env, sym, true, loader,
   369   result = find_class_from_class_loader(env, sym, true, loader,
   366                                         protection_domain, true, thread);
   370                                         protection_domain, true, thread);
       
   371 
       
   372   if (TraceClassResolution && result != NULL) {
       
   373     trace_class_resolution(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(result)));
       
   374   }
   367 
   375 
   368   // If we were the first invocation of jni_FindClass, we enable compilation again
   376   // If we were the first invocation of jni_FindClass, we enable compilation again
   369   // rather than just allowing invocation counter to overflow and decay.
   377   // rather than just allowing invocation counter to overflow and decay.
   370   // Controlled by flag DelayCompilationDuringStartup.
   378   // Controlled by flag DelayCompilationDuringStartup.
   371   if (first_time && !CompileTheWorld)
   379   if (first_time && !CompileTheWorld)
  2644 static jclass lookupOne(JNIEnv* env, const char* name, TRAPS) {
  2652 static jclass lookupOne(JNIEnv* env, const char* name, TRAPS) {
  2645   Handle loader;            // null (bootstrap) loader
  2653   Handle loader;            // null (bootstrap) loader
  2646   Handle protection_domain; // null protection domain
  2654   Handle protection_domain; // null protection domain
  2647 
  2655 
  2648   symbolHandle sym = oopFactory::new_symbol_handle(name, CHECK_NULL);
  2656   symbolHandle sym = oopFactory::new_symbol_handle(name, CHECK_NULL);
  2649   return find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL);
  2657   jclass result =  find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL);
       
  2658 
       
  2659   if (TraceClassResolution && result != NULL) {
       
  2660     trace_class_resolution(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(result)));
       
  2661   }
       
  2662   return result;
  2650 }
  2663 }
  2651 
  2664 
  2652 // These lookups are done with the NULL (bootstrap) ClassLoader to
  2665 // These lookups are done with the NULL (bootstrap) ClassLoader to
  2653 // circumvent any security checks that would be done by jni_FindClass.
  2666 // circumvent any security checks that would be done by jni_FindClass.
  2654 JNI_ENTRY(bool, lookupDirectBufferClasses(JNIEnv* env))
  2667 JNI_ENTRY(bool, lookupDirectBufferClasses(JNIEnv* env))