< prev index next >

src/hotspot/share/prims/unsafe.cpp

Print this page




 784         Handle patch(THREAD, p);
 785 
 786         if (cp_patches == NULL) {
 787           cp_patches = new GrowableArray<Handle>(i+1, i+1, Handle());
 788         }
 789 
 790         cp_patches->at_put(i, patch);
 791       }
 792     }
 793   }
 794 
 795   ClassFileStream st(class_bytes, class_bytes_length, host_source, ClassFileStream::verify);
 796 
 797   Symbol* no_class_name = NULL;
 798   Klass* anonk = SystemDictionary::parse_stream(no_class_name,
 799                                                 host_loader,
 800                                                 host_domain,
 801                                                 &st,
 802                                                 InstanceKlass::cast(host_klass),
 803                                                 cp_patches,





 804                                                 CHECK_NULL);
 805   if (anonk == NULL) {
 806     return NULL;
 807   }
 808 
 809   return InstanceKlass::cast(anonk);
 810 }
 811 
 812 UNSAFE_ENTRY(jclass, Unsafe_DefineAnonymousClass0(JNIEnv *env, jobject unsafe, jclass host_class, jbyteArray data, jobjectArray cp_patches_jh)) {
 813   ResourceMark rm(THREAD);
 814 
 815   jobject res_jh = NULL;
 816   u1* temp_alloc = NULL;
 817 
 818   InstanceKlass* anon_klass = Unsafe_DefineAnonymousClass_impl(env, host_class, data, cp_patches_jh, &temp_alloc, THREAD);
 819   if (anon_klass != NULL) {
 820     res_jh = JNIHandles::make_local(env, anon_klass->java_mirror());
 821   }
 822 
 823   // try/finally clause:




 784         Handle patch(THREAD, p);
 785 
 786         if (cp_patches == NULL) {
 787           cp_patches = new GrowableArray<Handle>(i+1, i+1, Handle());
 788         }
 789 
 790         cp_patches->at_put(i, patch);
 791       }
 792     }
 793   }
 794 
 795   ClassFileStream st(class_bytes, class_bytes_length, host_source, ClassFileStream::verify);
 796 
 797   Symbol* no_class_name = NULL;
 798   Klass* anonk = SystemDictionary::parse_stream(no_class_name,
 799                                                 host_loader,
 800                                                 host_domain,
 801                                                 &st,
 802                                                 InstanceKlass::cast(host_klass),
 803                                                 cp_patches,
 804                                                 false, // is_nonfindable
 805                                                 false, // is_weak
 806                                                 false, // can_access_vm_annotations
 807                                                 NULL,  // dynamic_nest_host 
 808                                                 Handle(), // classData
 809                                                 CHECK_NULL);
 810   if (anonk == NULL) {
 811     return NULL;
 812   }
 813 
 814   return InstanceKlass::cast(anonk);
 815 }
 816 
 817 UNSAFE_ENTRY(jclass, Unsafe_DefineAnonymousClass0(JNIEnv *env, jobject unsafe, jclass host_class, jbyteArray data, jobjectArray cp_patches_jh)) {
 818   ResourceMark rm(THREAD);
 819 
 820   jobject res_jh = NULL;
 821   u1* temp_alloc = NULL;
 822 
 823   InstanceKlass* anon_klass = Unsafe_DefineAnonymousClass_impl(env, host_class, data, cp_patches_jh, &temp_alloc, THREAD);
 824   if (anon_klass != NULL) {
 825     res_jh = JNIHandles::make_local(env, anon_klass->java_mirror());
 826   }
 827 
 828   // try/finally clause:


< prev index next >