hotspot/src/share/vm/memory/universe.cpp
changeset 18056 0e99ee964114
parent 16672 152c041083e1
child 18061 cd92ca4c1331
equal deleted inserted replaced
18055:ba8c01e0d016 18056:0e99ee964114
   106 Array<Klass*>* Universe::_the_array_interfaces_array = NULL;
   106 Array<Klass*>* Universe::_the_array_interfaces_array = NULL;
   107 oop Universe::_the_null_string                        = NULL;
   107 oop Universe::_the_null_string                        = NULL;
   108 oop Universe::_the_min_jint_string                   = NULL;
   108 oop Universe::_the_min_jint_string                   = NULL;
   109 LatestMethodOopCache* Universe::_finalizer_register_cache = NULL;
   109 LatestMethodOopCache* Universe::_finalizer_register_cache = NULL;
   110 LatestMethodOopCache* Universe::_loader_addClass_cache    = NULL;
   110 LatestMethodOopCache* Universe::_loader_addClass_cache    = NULL;
       
   111 LatestMethodOopCache* Universe::_pd_implies_cache         = NULL;
   111 ActiveMethodOopsCache* Universe::_reflect_invoke_cache    = NULL;
   112 ActiveMethodOopsCache* Universe::_reflect_invoke_cache    = NULL;
   112 oop Universe::_out_of_memory_error_java_heap          = NULL;
   113 oop Universe::_out_of_memory_error_java_heap          = NULL;
   113 oop Universe::_out_of_memory_error_perm_gen           = NULL;
   114 oop Universe::_out_of_memory_error_perm_gen           = NULL;
   114 oop Universe::_out_of_memory_error_array_size         = NULL;
   115 oop Universe::_out_of_memory_error_array_size         = NULL;
   115 oop Universe::_out_of_memory_error_gc_overhead_limit  = NULL;
   116 oop Universe::_out_of_memory_error_gc_overhead_limit  = NULL;
   222   f->do_ptr((void**)&_the_empty_method_array);
   223   f->do_ptr((void**)&_the_empty_method_array);
   223   f->do_ptr((void**)&_the_empty_klass_array);
   224   f->do_ptr((void**)&_the_empty_klass_array);
   224   _finalizer_register_cache->serialize(f);
   225   _finalizer_register_cache->serialize(f);
   225   _loader_addClass_cache->serialize(f);
   226   _loader_addClass_cache->serialize(f);
   226   _reflect_invoke_cache->serialize(f);
   227   _reflect_invoke_cache->serialize(f);
       
   228   _pd_implies_cache->serialize(f);
   227 }
   229 }
   228 
   230 
   229 void Universe::check_alignment(uintx size, uintx alignment, const char* name) {
   231 void Universe::check_alignment(uintx size, uintx alignment, const char* name) {
   230   if (size < alignment || size % alignment != 0) {
   232   if (size < alignment || size % alignment != 0) {
   231     ResourceMark rm;
   233     ResourceMark rm;
   646 
   648 
   647   // We have a heap so create the Method* caches before
   649   // We have a heap so create the Method* caches before
   648   // Metaspace::initialize_shared_spaces() tries to populate them.
   650   // Metaspace::initialize_shared_spaces() tries to populate them.
   649   Universe::_finalizer_register_cache = new LatestMethodOopCache();
   651   Universe::_finalizer_register_cache = new LatestMethodOopCache();
   650   Universe::_loader_addClass_cache    = new LatestMethodOopCache();
   652   Universe::_loader_addClass_cache    = new LatestMethodOopCache();
       
   653   Universe::_pd_implies_cache         = new LatestMethodOopCache();
   651   Universe::_reflect_invoke_cache     = new ActiveMethodOopsCache();
   654   Universe::_reflect_invoke_cache     = new ActiveMethodOopsCache();
   652 
   655 
   653   if (UseSharedSpaces) {
   656   if (UseSharedSpaces) {
   654     // Read the data structures supporting the shared spaces (shared
   657     // Read the data structures supporting the shared spaces (shared
   655     // system dictionary, symbol table, etc.).  After that, access to
   658     // system dictionary, symbol table, etc.).  After that, access to
  1080       "java.lang.ClassLoader.addClass", false);
  1083       "java.lang.ClassLoader.addClass", false);
  1081   }
  1084   }
  1082   Universe::_loader_addClass_cache->init(
  1085   Universe::_loader_addClass_cache->init(
  1083     SystemDictionary::ClassLoader_klass(), m, CHECK_false);
  1086     SystemDictionary::ClassLoader_klass(), m, CHECK_false);
  1084 
  1087 
       
  1088   // Setup method for checking protection domain
       
  1089   InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->link_class(CHECK_false);
       
  1090   m = InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->
       
  1091             find_method(vmSymbols::impliesCreateAccessControlContext_name(),
       
  1092                         vmSymbols::void_boolean_signature());
       
  1093   // Allow NULL which should only happen with bootstrapping.
       
  1094   if (m != NULL) {
       
  1095     if (m->is_static()) {
       
  1096       // NoSuchMethodException doesn't actually work because it tries to run the
       
  1097       // <init> function before java_lang_Class is linked. Print error and exit.
       
  1098       tty->print_cr("ProtectionDomain.impliesCreateAccessControlContext() has the wrong linkage");
       
  1099       return false; // initialization failed
       
  1100     }
       
  1101     Universe::_pd_implies_cache->init(
       
  1102       SystemDictionary::ProtectionDomain_klass(), m, CHECK_false);;
       
  1103   }
       
  1104 
  1085   // The folowing is initializing converter functions for serialization in
  1105   // The folowing is initializing converter functions for serialization in
  1086   // JVM.cpp. If we clean up the StrictMath code above we may want to find
  1106   // JVM.cpp. If we clean up the StrictMath code above we may want to find
  1087   // a better solution for this as well.
  1107   // a better solution for this as well.
  1088   initialize_converter_functions();
  1108   initialize_converter_functions();
  1089 
  1109 
  1495   return false;
  1515   return false;
  1496 }
  1516 }
  1497 
  1517 
  1498 
  1518 
  1499 Method* LatestMethodOopCache::get_Method() {
  1519 Method* LatestMethodOopCache::get_Method() {
       
  1520   if (klass() == NULL) return NULL;
  1500   InstanceKlass* ik = InstanceKlass::cast(klass());
  1521   InstanceKlass* ik = InstanceKlass::cast(klass());
  1501   Method* m = ik->method_with_idnum(method_idnum());
  1522   Method* m = ik->method_with_idnum(method_idnum());
  1502   assert(m != NULL, "sanity check");
  1523   assert(m != NULL, "sanity check");
  1503   return m;
  1524   return m;
  1504 }
  1525 }