< prev index next >

src/share/vm/prims/unsafe.cpp

Print this page

        

@@ -843,11 +843,11 @@
 // 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
+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,22 +930,21 @@
                                                 CHECK_NULL);
   if (anonk == NULL) {
     return NULL;
   }
 
-  return instanceKlassHandle(THREAD, anonk);
+  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);
 
-  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) {
+  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,11 +952,11 @@
   }
 
   // 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) {
+  if (anon_klass != NULL) {
     anon_klass->class_loader_data()->dec_keep_alive();
   }
 
   // let caller initialize it as needed...
 
< prev index next >