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. |
1786 |
1786 |
1787 void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) { |
1787 void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) { |
1788 assert(k != NULL, "just checking"); |
1788 assert(k != NULL, "just checking"); |
1789 assert_locked_or_safepoint(Compile_lock); |
1789 assert_locked_or_safepoint(Compile_lock); |
1790 |
1790 |
1791 // Link into hierachy. Make sure the vtables are initialized before linking into |
1791 k->set_init_state(InstanceKlass::loaded); |
|
1792 // make sure init_state store is already done. |
|
1793 // The compiler reads the hierarchy outside of the Compile_lock. |
|
1794 // Access ordering is used to add to hierarchy. |
|
1795 |
|
1796 // Link into hierachy. |
1792 k->append_to_sibling_list(); // add to superklass/sibling list |
1797 k->append_to_sibling_list(); // add to superklass/sibling list |
1793 k->process_interfaces(THREAD); // handle all "implements" declarations |
1798 k->process_interfaces(THREAD); // handle all "implements" declarations |
1794 k->set_init_state(InstanceKlass::loaded); |
1799 |
1795 // Now flush all code that depended on old class hierarchy. |
1800 // Now flush all code that depended on old class hierarchy. |
1796 // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97) |
1801 // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97) |
1797 // Also, first reinitialize vtable because it may have gotten out of synch |
|
1798 // while the new class wasn't connected to the class hierarchy. |
|
1799 CodeCache::flush_dependents_on(k); |
1802 CodeCache::flush_dependents_on(k); |
1800 } |
1803 } |
1801 |
1804 |
1802 // ---------------------------------------------------------------------------- |
1805 // ---------------------------------------------------------------------------- |
1803 // GC support |
1806 // GC support |