mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
6830542: Performance: JVM_DefineClass already verified
Reviewed-by: kamg, phh
This commit is contained in:
parent
c04761e799
commit
488e99efd8
19 changed files with 103 additions and 34 deletions
|
@ -762,7 +762,11 @@ static void is_lock_held_by_thread(Handle loader, PerfCounter* counter, TRAPS) {
|
|||
}
|
||||
|
||||
// common code for JVM_DefineClass() and JVM_DefineClassWithSource()
|
||||
static jclass jvm_define_class_common(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd, const char *source, TRAPS) {
|
||||
// and JVM_DefineClassWithSourceCond()
|
||||
static jclass jvm_define_class_common(JNIEnv *env, const char *name,
|
||||
jobject loader, const jbyte *buf,
|
||||
jsize len, jobject pd, const char *source,
|
||||
jboolean verify, TRAPS) {
|
||||
if (source == NULL) source = "__JVM_DefineClass__";
|
||||
|
||||
assert(THREAD->is_Java_thread(), "must be a JavaThread");
|
||||
|
@ -803,6 +807,7 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name, jobject loa
|
|||
Handle protection_domain (THREAD, JNIHandles::resolve(pd));
|
||||
klassOop k = SystemDictionary::resolve_from_stream(class_name, class_loader,
|
||||
protection_domain, &st,
|
||||
verify != 0,
|
||||
CHECK_NULL);
|
||||
|
||||
if (TraceClassResolution && k != NULL) {
|
||||
|
@ -816,16 +821,24 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name, jobject loa
|
|||
JVM_ENTRY(jclass, JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd))
|
||||
JVMWrapper2("JVM_DefineClass %s", name);
|
||||
|
||||
return jvm_define_class_common(env, name, loader, buf, len, pd, NULL, THREAD);
|
||||
return jvm_define_class_common(env, name, loader, buf, len, pd, NULL, true, THREAD);
|
||||
JVM_END
|
||||
|
||||
|
||||
JVM_ENTRY(jclass, JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd, const char *source))
|
||||
JVMWrapper2("JVM_DefineClassWithSource %s", name);
|
||||
|
||||
return jvm_define_class_common(env, name, loader, buf, len, pd, source, THREAD);
|
||||
return jvm_define_class_common(env, name, loader, buf, len, pd, source, true, THREAD);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(jclass, JVM_DefineClassWithSourceCond(JNIEnv *env, const char *name,
|
||||
jobject loader, const jbyte *buf,
|
||||
jsize len, jobject pd,
|
||||
const char *source, jboolean verify))
|
||||
JVMWrapper2("JVM_DefineClassWithSourceCond %s", name);
|
||||
|
||||
return jvm_define_class_common(env, name, loader, buf, len, pd, source, verify, THREAD);
|
||||
JVM_END
|
||||
|
||||
JVM_ENTRY(jclass, JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name))
|
||||
JVMWrapper("JVM_FindLoadedClass");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue