< prev index next >

src/share/vm/prims/unsafe.cpp

Print this page

        

*** 843,853 **** // various kinds of metaobjects must be introduced as constants into bytecode. // Note the cast (Object), which tells the verifier to expect an arbitrary object, // not just a literal string. For such ldc instructions, the verifier uses the // type Object instead of String, if the loaded constant is not in fact a String. ! static instanceKlassHandle Unsafe_DefineAnonymousClass_impl(JNIEnv *env, jclass host_class, jbyteArray data, jobjectArray cp_patches_jh, u1** temp_alloc, TRAPS) { assert(host_class != NULL, "host_class must not be NULL"); --- 843,853 ---- // various kinds of metaobjects must be introduced as constants into bytecode. // Note the cast (Object), which tells the verifier to expect an arbitrary object, // not just a literal string. For such ldc instructions, the verifier uses the // type Object instead of String, if the loaded constant is not in fact a String. ! static InstanceKlass* Unsafe_DefineAnonymousClass_impl(JNIEnv *env, jclass host_class, jbyteArray data, jobjectArray cp_patches_jh, u1** temp_alloc, TRAPS) { assert(host_class != NULL, "host_class must not be NULL");
*** 930,951 **** CHECK_NULL); if (anonk == NULL) { return NULL; } ! return instanceKlassHandle(THREAD, anonk); } UNSAFE_ENTRY(jclass, Unsafe_DefineAnonymousClass0(JNIEnv *env, jobject unsafe, jclass host_class, jbyteArray data, jobjectArray cp_patches_jh)) { ResourceMark rm(THREAD); - instanceKlassHandle anon_klass; jobject res_jh = NULL; u1* temp_alloc = NULL; ! anon_klass = Unsafe_DefineAnonymousClass_impl(env, host_class, data, cp_patches_jh, &temp_alloc, THREAD); ! if (anon_klass() != NULL) { res_jh = JNIHandles::make_local(env, anon_klass->java_mirror()); } // try/finally clause: if (temp_alloc != NULL) { --- 930,950 ---- CHECK_NULL); if (anonk == NULL) { return NULL; } ! return InstanceKlass::cast(anonk); } UNSAFE_ENTRY(jclass, Unsafe_DefineAnonymousClass0(JNIEnv *env, jobject unsafe, jclass host_class, jbyteArray data, jobjectArray cp_patches_jh)) { ResourceMark rm(THREAD); jobject res_jh = NULL; u1* temp_alloc = NULL; ! InstanceKlass* anon_klass = Unsafe_DefineAnonymousClass_impl(env, host_class, data, cp_patches_jh, &temp_alloc, THREAD); ! if (anon_klass != NULL) { res_jh = JNIHandles::make_local(env, anon_klass->java_mirror()); } // try/finally clause: if (temp_alloc != NULL) {
*** 953,963 **** } // The anonymous class loader data has been artificially been kept alive to // this point. The mirror and any instances of this class have to keep // it alive afterwards. ! if (anon_klass() != NULL) { anon_klass->class_loader_data()->dec_keep_alive(); } // let caller initialize it as needed... --- 952,962 ---- } // The anonymous class loader data has been artificially been kept alive to // this point. The mirror and any instances of this class have to keep // it alive afterwards. ! if (anon_klass != NULL) { anon_klass->class_loader_data()->dec_keep_alive(); } // let caller initialize it as needed...
< prev index next >