< prev index next >

src/hotspot/share/memory/universe.cpp

Print this page
*** 125,10 ***
--- 125,12 ---
  LatestMethodCache* Universe::_finalizer_register_cache = NULL;
  LatestMethodCache* Universe::_loader_addClass_cache    = NULL;
  LatestMethodCache* Universe::_throw_illegal_access_error_cache = NULL;
  LatestMethodCache* Universe::_throw_no_such_method_error_cache = NULL;
  LatestMethodCache* Universe::_do_stack_walk_cache     = NULL;
+ LatestMethodCache* Universe::_is_substitutable_cache  = NULL;
+ LatestMethodCache* Universe::_primitive_type_hash_code_cache = NULL;
  
  long Universe::verify_flags                           = Universe::Verify_All;
  
  Array<int>* Universe::_the_empty_int_array            = NULL;
  Array<u2>* Universe::_the_empty_short_array           = NULL;

*** 222,10 ***
--- 224,12 ---
    _finalizer_register_cache->metaspace_pointers_do(it);
    _loader_addClass_cache->metaspace_pointers_do(it);
    _throw_illegal_access_error_cache->metaspace_pointers_do(it);
    _throw_no_such_method_error_cache->metaspace_pointers_do(it);
    _do_stack_walk_cache->metaspace_pointers_do(it);
+   _is_substitutable_cache->metaspace_pointers_do(it);
+   _primitive_type_hash_code_cache->metaspace_pointers_do(it);
  }
  
  // Serialize metadata and pointers to primitive type mirrors in and out of CDS archive
  void Universe::serialize(SerializeClosure* f) {
  

*** 269,10 ***
--- 273,12 ---
    _finalizer_register_cache->serialize(f);
    _loader_addClass_cache->serialize(f);
    _throw_illegal_access_error_cache->serialize(f);
    _throw_no_such_method_error_cache->serialize(f);
    _do_stack_walk_cache->serialize(f);
+   _is_substitutable_cache->serialize(f);
+   _primitive_type_hash_code_cache->serialize(f);
  }
  
  
  void Universe::check_alignment(uintx size, uintx alignment, const char* name) {
    if (size < alignment || size % alignment != 0) {

*** 345,10 ***
--- 351,11 ---
        // Verify shared interfaces array.
        assert(_the_array_interfaces_array->at(0) ==
               vmClasses::Cloneable_klass(), "u3");
        assert(_the_array_interfaces_array->at(1) ==
               vmClasses::Serializable_klass(), "u3");
+ 
      } else
  #endif
      {
        // Set up shared interfaces array.  (Do this before supers are set up.)
        _the_array_interfaces_array->at_put(0, vmClasses::Cloneable_klass());

*** 410,11 ***
      objArrayOop    naked_array = oopFactory::new_objArray(vmClasses::Object_klass(), size, CHECK);
      objArrayHandle dummy_array(THREAD, naked_array);
      int i = 0;
      while (i < size) {
          // Allocate dummy in old generation
!       oop dummy = vmClasses::Object_klass()->allocate_instance(CHECK);
        dummy_array->obj_at_put(i++, dummy);
      }
      {
        // Only modify the global variable inside the mutex.
        // If we had a race to here, the other dummy_array instances
--- 417,16 ---
      objArrayOop    naked_array = oopFactory::new_objArray(vmClasses::Object_klass(), size, CHECK);
      objArrayHandle dummy_array(THREAD, naked_array);
      int i = 0;
      while (i < size) {
          // Allocate dummy in old generation
!       oop dummy;
+       if(vmClasses::Object_klass()->is_abstract()) {
+         dummy = vmClasses::Identity_klass()->allocate_instance(CHECK);
+       } else {
+         dummy = vmClasses::Object_klass()->allocate_instance(CHECK);
+       }
        dummy_array->obj_at_put(i++, dummy);
      }
      {
        // Only modify the global variable inside the mutex.
        // If we had a race to here, the other dummy_array instances

*** 754,11 ***
    }
  
    Universe::initialize_tlab();
  
    Metaspace::global_initialize();
- 
    // Initialize performance counters for metaspaces
    MetaspaceCounters::initialize_performance_counters();
  
    // Checks 'AfterMemoryInit' constraints.
    if (!JVMFlagLimit::check_all_constraints(JVMFlagConstraintPhase::AfterMemoryInit)) {
--- 766,10 ---

*** 774,10 ***
--- 785,12 ---
    Universe::_finalizer_register_cache = new LatestMethodCache();
    Universe::_loader_addClass_cache    = new LatestMethodCache();
    Universe::_throw_illegal_access_error_cache = new LatestMethodCache();
    Universe::_throw_no_such_method_error_cache = new LatestMethodCache();
    Universe::_do_stack_walk_cache = new LatestMethodCache();
+   Universe::_is_substitutable_cache = new LatestMethodCache();
+   Universe::_primitive_type_hash_code_cache = new LatestMethodCache();
  
  #if INCLUDE_CDS
    DynamicArchive::check_for_dynamic_dump();
    if (UseSharedSpaces) {
      // Read the data structures supporting the shared spaces (shared

*** 940,10 ***
--- 953,21 ---
    // Set up method for stack walking
    initialize_known_method(_do_stack_walk_cache,
                            vmClasses::AbstractStackWalker_klass(),
                            "doStackWalk",
                            vmSymbols::doStackWalk_signature(), false, CHECK);
+ 
+   // Set up substitutability testing
+   ResourceMark rm;
+   initialize_known_method(_is_substitutable_cache,
+                           vmClasses::PrimitiveObjectMethods_klass(),
+                           vmSymbols::isSubstitutable_name()->as_C_string(),
+                           vmSymbols::object_object_boolean_signature(), true, CHECK);
+   initialize_known_method(_primitive_type_hash_code_cache,
+                           vmClasses::PrimitiveObjectMethods_klass(),
+                           vmSymbols::primitiveObjectHashCode_name()->as_C_string(),
+                           vmSymbols::object_int_signature(), true, CHECK);
  }
  
  void universe2_init() {
    EXCEPTION_MARK;
    Universe::genesis(CATCH);
< prev index next >