mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
6603316: Improve instrumentation for classes loaded at startup
Reviewed-by: xlu, mchung
This commit is contained in:
parent
472349069b
commit
101468324d
4 changed files with 37 additions and 9 deletions
|
@ -301,6 +301,10 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR
|
|||
klassOop k = SystemDictionary::resolve_from_stream(class_name, class_loader,
|
||||
Handle(), &st, CHECK_NULL);
|
||||
|
||||
if (TraceClassResolution && k != NULL) {
|
||||
trace_class_resolution(k);
|
||||
}
|
||||
|
||||
cls = (jclass)JNIHandles::make_local(
|
||||
env, Klass::cast(k)->java_mirror());
|
||||
return cls;
|
||||
|
@ -365,6 +369,10 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
|
|||
result = find_class_from_class_loader(env, sym, true, loader,
|
||||
protection_domain, true, thread);
|
||||
|
||||
if (TraceClassResolution && result != NULL) {
|
||||
trace_class_resolution(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(result)));
|
||||
}
|
||||
|
||||
// If we were the first invocation of jni_FindClass, we enable compilation again
|
||||
// rather than just allowing invocation counter to overflow and decay.
|
||||
// Controlled by flag DelayCompilationDuringStartup.
|
||||
|
@ -2646,7 +2654,12 @@ static jclass lookupOne(JNIEnv* env, const char* name, TRAPS) {
|
|||
Handle protection_domain; // null protection domain
|
||||
|
||||
symbolHandle sym = oopFactory::new_symbol_handle(name, CHECK_NULL);
|
||||
return find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL);
|
||||
jclass result = find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL);
|
||||
|
||||
if (TraceClassResolution && result != NULL) {
|
||||
trace_class_resolution(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(result)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// These lookups are done with the NULL (bootstrap) ClassLoader to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue