|
44 | 44 | #include "classfile/systemDictionary.hpp" |
45 | 45 | #include "classfile/vmClasses.hpp" |
46 | 46 | #include "classfile/vmSymbols.hpp" |
47 | | -#include "code/codeCache.hpp" |
48 | 47 | #include "gc/shared/gcTraceTime.inline.hpp" |
49 | 48 | #include "interpreter/bootstrapInfo.hpp" |
50 | 49 | #include "jfr/jfrEvents.hpp" |
|
70 | 69 | #include "prims/jvmtiExport.hpp" |
71 | 70 | #include "prims/methodHandles.hpp" |
72 | 71 | #include "runtime/arguments.hpp" |
73 | | -#include "runtime/deoptimization.hpp" |
74 | 72 | #include "runtime/handles.inline.hpp" |
75 | 73 | #include "runtime/java.hpp" |
76 | 74 | #include "runtime/javaCalls.hpp" |
@@ -831,7 +829,7 @@ InstanceKlass* SystemDictionary::resolve_hidden_class_from_stream( |
831 | 829 | } |
832 | 830 |
|
833 | 831 | // Add to class hierarchy, and do possible deoptimizations. |
834 | | - add_to_hierarchy(THREAD, k); |
| 832 | + k->add_to_hierarchy(THREAD); |
835 | 833 | // But, do not add to dictionary. |
836 | 834 |
|
837 | 835 | k->link_class(CHECK_NULL); |
@@ -1418,7 +1416,7 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, Handle class_load |
1418 | 1416 | } |
1419 | 1417 |
|
1420 | 1418 | // Add to class hierarchy, and do possible deoptimizations. |
1421 | | - add_to_hierarchy(THREAD, k); |
| 1419 | + k->add_to_hierarchy(THREAD); |
1422 | 1420 |
|
1423 | 1421 | { |
1424 | 1422 | MutexLocker mu_r(THREAD, Compile_lock); |
@@ -1536,49 +1534,6 @@ InstanceKlass* SystemDictionary::find_or_define_instance_class(Symbol* class_nam |
1536 | 1534 | } |
1537 | 1535 |
|
1538 | 1536 |
|
1539 | | -// ---------------------------------------------------------------------------- |
1540 | | -// Update hierarchy. This is done before the new klass has been added to the SystemDictionary. The Compile_lock |
1541 | | -// is grabbed, to ensure that the compiler is not using the class hierarchy. |
1542 | | - |
1543 | | -void SystemDictionary::add_to_hierarchy(JavaThread* current, InstanceKlass* k) { |
1544 | | - assert(k != nullptr, "just checking"); |
1545 | | - assert(!SafepointSynchronize::is_at_safepoint(), "must NOT be at safepoint"); |
1546 | | - |
1547 | | - // In case we are not using CHA based vtables we need to make sure the loaded |
1548 | | - // deopt is completed before anyone links this class. |
1549 | | - // Linking is done with _init_monitor held, by loading and deopting with it |
1550 | | - // held we make sure the deopt is completed before linking. |
1551 | | - if (!UseVtableBasedCHA) { |
1552 | | - k->init_monitor()->lock(); |
1553 | | - } |
1554 | | - |
1555 | | - DeoptimizationScope deopt_scope; |
1556 | | - { |
1557 | | - MutexLocker ml(current, Compile_lock); |
1558 | | - |
1559 | | - k->set_init_state(InstanceKlass::loaded); |
1560 | | - // make sure init_state store is already done. |
1561 | | - // The compiler reads the hierarchy outside of the Compile_lock. |
1562 | | - // Access ordering is used to add to hierarchy. |
1563 | | - |
1564 | | - // Link into hierarchy. |
1565 | | - k->append_to_sibling_list(); // add to superklass/sibling list |
1566 | | - k->process_interfaces(); // handle all "implements" declarations |
1567 | | - |
1568 | | - // Now mark all code that depended on old class hierarchy. |
1569 | | - // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97) |
1570 | | - if (Universe::is_fully_initialized()) { |
1571 | | - CodeCache::mark_dependents_on(&deopt_scope, k); |
1572 | | - } |
1573 | | - } |
1574 | | - // Perform the deopt handshake outside Compile_lock. |
1575 | | - deopt_scope.deoptimize_marked(); |
1576 | | - |
1577 | | - if (!UseVtableBasedCHA) { |
1578 | | - k->init_monitor()->unlock(); |
1579 | | - } |
1580 | | -} |
1581 | | - |
1582 | 1537 | // ---------------------------------------------------------------------------- |
1583 | 1538 | // GC support |
1584 | 1539 |
|
|
0 commit comments