diff src/share/vm/compiler/compileBroker.cpp @ 7409:30866cd626b0

8004883: NPG: clean up anonymous class fix Summary: Add klass_holder() to return either mirror or class_loader depending on if the class is anonymous or not. Reviewed-by: stefank, jrose
author coleenp
date Wed, 12 Dec 2012 11:39:29 -0500
parents 90273fc0a981
children 989155e2d07a 9deda4d8e126 606eada1bf86
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp	Fri Dec 07 10:55:16 2012 -0800
+++ b/src/share/vm/compiler/compileBroker.cpp	Wed Dec 12 11:39:29 2012 -0500
@@ -269,12 +269,10 @@
                              const char* comment,
                              bool is_blocking) {
   assert(!_lock->is_locked(), "bad locking");
-  InstanceKlass* holder = method->method_holder();
 
   _compile_id = compile_id;
   _method = method();
-  _method_holder = JNIHandles::make_global(
-        holder->is_anonymous() ? holder->java_mirror(): holder->class_loader());
+  _method_holder = JNIHandles::make_global(method->method_holder()->klass_holder());
   _osr_bci = osr_bci;
   _is_blocking = is_blocking;
   _comp_level = comp_level;
@@ -298,10 +296,7 @@
       } else {
         _hot_method = hot_method();
         // only add loader or mirror if different from _method_holder
-        InstanceKlass* hot_holder = hot_method->method_holder();
-        _hot_method_holder = JNIHandles::make_global(
-               hot_holder->is_anonymous() ? hot_holder->java_mirror() :
-                                            hot_holder->class_loader());
+        _hot_method_holder = JNIHandles::make_global(hot_method->method_holder()->klass_holder());
       }
     }
   }