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