--- a/hotspot/src/share/vm/prims/jvm.cpp Tue Sep 01 23:34:08 2009 -0700
+++ b/hotspot/src/share/vm/prims/jvm.cpp Fri Sep 04 12:53:02 2009 -0400
@@ -762,7 +762,11 @@
}
// 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 @@
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 @@
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);
-JVM_END
-
+ 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");