src/hotspot/share/classfile/systemDictionary.cpp
changeset 53335 585902b2bfcb
parent 53322 8ba5b3c76857
parent 53225 b11483a74e5d
child 53338 5afdd1100a20
equal deleted inserted replaced
53334:b94283cb226b 53335:585902b2bfcb
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1793 
  1793 
  1794 void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) {
  1794 void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) {
  1795   assert(k != NULL, "just checking");
  1795   assert(k != NULL, "just checking");
  1796   assert_locked_or_safepoint(Compile_lock);
  1796   assert_locked_or_safepoint(Compile_lock);
  1797 
  1797 
  1798   // Link into hierachy. Make sure the vtables are initialized before linking into
  1798   k->set_init_state(InstanceKlass::loaded);
       
  1799   // make sure init_state store is already done.
       
  1800   // The compiler reads the hierarchy outside of the Compile_lock.
       
  1801   // Access ordering is used to add to hierarchy.
       
  1802 
       
  1803   // Link into hierachy.
  1799   k->append_to_sibling_list();                    // add to superklass/sibling list
  1804   k->append_to_sibling_list();                    // add to superklass/sibling list
  1800   k->process_interfaces(THREAD);                  // handle all "implements" declarations
  1805   k->process_interfaces(THREAD);                  // handle all "implements" declarations
  1801   k->set_init_state(InstanceKlass::loaded);
  1806 
  1802   // Now flush all code that depended on old class hierarchy.
  1807   // Now flush all code that depended on old class hierarchy.
  1803   // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97)
  1808   // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97)
  1804   // Also, first reinitialize vtable because it may have gotten out of synch
       
  1805   // while the new class wasn't connected to the class hierarchy.
       
  1806   CodeCache::flush_dependents_on(k);
  1809   CodeCache::flush_dependents_on(k);
  1807 }
  1810 }
  1808 
  1811 
  1809 // ----------------------------------------------------------------------------
  1812 // ----------------------------------------------------------------------------
  1810 // GC support
  1813 // GC support