src/share/vm/memory/universe.cpp

changeset 5338
cedf20e2a655
parent 5337
de2d15ce3d4a
parent 5321
2b9380b0bf0b
child 5369
71180a6e5080
     1.1 --- a/src/share/vm/memory/universe.cpp	Tue Jul 02 08:42:37 2013 -0400
     1.2 +++ b/src/share/vm/memory/universe.cpp	Tue Jul 02 16:54:24 2013 +0200
     1.3 @@ -108,6 +108,7 @@
     1.4  oop Universe::_the_min_jint_string                   = NULL;
     1.5  LatestMethodOopCache* Universe::_finalizer_register_cache = NULL;
     1.6  LatestMethodOopCache* Universe::_loader_addClass_cache    = NULL;
     1.7 +LatestMethodOopCache* Universe::_pd_implies_cache         = NULL;
     1.8  ActiveMethodOopsCache* Universe::_reflect_invoke_cache    = NULL;
     1.9  oop Universe::_out_of_memory_error_java_heap          = NULL;
    1.10  oop Universe::_out_of_memory_error_metaspace          = NULL;
    1.11 @@ -226,6 +227,7 @@
    1.12    _finalizer_register_cache->serialize(f);
    1.13    _loader_addClass_cache->serialize(f);
    1.14    _reflect_invoke_cache->serialize(f);
    1.15 +  _pd_implies_cache->serialize(f);
    1.16  }
    1.17  
    1.18  void Universe::check_alignment(uintx size, uintx alignment, const char* name) {
    1.19 @@ -650,6 +652,7 @@
    1.20    // Metaspace::initialize_shared_spaces() tries to populate them.
    1.21    Universe::_finalizer_register_cache = new LatestMethodOopCache();
    1.22    Universe::_loader_addClass_cache    = new LatestMethodOopCache();
    1.23 +  Universe::_pd_implies_cache         = new LatestMethodOopCache();
    1.24    Universe::_reflect_invoke_cache     = new ActiveMethodOopsCache();
    1.25  
    1.26    if (UseSharedSpaces) {
    1.27 @@ -1116,6 +1119,23 @@
    1.28    Universe::_loader_addClass_cache->init(
    1.29      SystemDictionary::ClassLoader_klass(), m, CHECK_false);
    1.30  
    1.31 +  // Setup method for checking protection domain
    1.32 +  InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->link_class(CHECK_false);
    1.33 +  m = InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->
    1.34 +            find_method(vmSymbols::impliesCreateAccessControlContext_name(),
    1.35 +                        vmSymbols::void_boolean_signature());
    1.36 +  // Allow NULL which should only happen with bootstrapping.
    1.37 +  if (m != NULL) {
    1.38 +    if (m->is_static()) {
    1.39 +      // NoSuchMethodException doesn't actually work because it tries to run the
    1.40 +      // <init> function before java_lang_Class is linked. Print error and exit.
    1.41 +      tty->print_cr("ProtectionDomain.impliesCreateAccessControlContext() has the wrong linkage");
    1.42 +      return false; // initialization failed
    1.43 +    }
    1.44 +    Universe::_pd_implies_cache->init(
    1.45 +      SystemDictionary::ProtectionDomain_klass(), m, CHECK_false);;
    1.46 +  }
    1.47 +
    1.48    // The folowing is initializing converter functions for serialization in
    1.49    // JVM.cpp. If we clean up the StrictMath code above we may want to find
    1.50    // a better solution for this as well.
    1.51 @@ -1133,6 +1153,7 @@
    1.52  
    1.53    // Initialize performance counters for metaspaces
    1.54    MetaspaceCounters::initialize_performance_counters();
    1.55 +  MemoryService::add_metaspace_memory_pools();
    1.56  
    1.57    GC_locker::unlock();  // allow gc after bootstrapping
    1.58  
    1.59 @@ -1533,6 +1554,7 @@
    1.60  
    1.61  
    1.62  Method* LatestMethodOopCache::get_Method() {
    1.63 +  if (klass() == NULL) return NULL;
    1.64    InstanceKlass* ik = InstanceKlass::cast(klass());
    1.65    Method* m = ik->method_with_idnum(method_idnum());
    1.66    assert(m != NULL, "sanity check");

mercurial