< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "aot/aotLoader.hpp"
  28 #include "classfile/classLoader.hpp"
  29 #include "classfile/javaClasses.hpp"
  30 #include "classfile/moduleEntry.hpp"
  31 #include "classfile/systemDictionary.hpp"
  32 #include "classfile/vmSymbols.hpp"
  33 #include "code/codeCache.hpp"
  34 #include "code/scopeDesc.hpp"
  35 #include "compiler/compileBroker.hpp"
  36 #include "compiler/compileTask.hpp"
  37 #include "gc/shared/barrierSet.hpp"
  38 #include "gc/shared/gcId.hpp"
  39 #include "gc/shared/gcLocker.inline.hpp"
  40 #include "gc/shared/workgroup.hpp"
  41 #include "interpreter/interpreter.hpp"
  42 #include "interpreter/linkResolver.hpp"
  43 #include "interpreter/oopMapCache.hpp"
  44 #include "jfr/jfrEvents.hpp"
  45 #include "jvmtifiles/jvmtiEnv.hpp"
  46 #include "logging/log.hpp"
  47 #include "logging/logConfiguration.hpp"


1575 jlong* JavaThread::_jvmci_old_thread_counters;
1576 
1577 bool jvmci_counters_include(JavaThread* thread) {
1578   return !JVMCICountersExcludeCompiler || !thread->is_Compiler_thread();
1579 }
1580 
1581 void JavaThread::collect_counters(jlong* array, int length) {
1582   assert(length == JVMCICounterSize, "wrong value");
1583   for (int i = 0; i < length; i++) {
1584     array[i] = _jvmci_old_thread_counters[i];
1585   }
1586   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *tp = jtiwh.next(); ) {
1587     if (jvmci_counters_include(tp)) {
1588       for (int i = 0; i < length; i++) {
1589         array[i] += tp->_jvmci_counters[i];
1590       }
1591     }
1592   }
1593 }
1594 
1595 // Attempt to enlarge the array for per thread counters.
1596 jlong* resize_counters_array(jlong* old_counters, int current_size, int new_size) {
1597   jlong* new_counters = NEW_C_HEAP_ARRAY(jlong, new_size, mtJVMCI);
1598   if (new_counters == NULL) {
1599     return NULL;
1600   }
1601   if (old_counters == NULL) {
1602     old_counters = new_counters;
1603     memset(old_counters, 0, sizeof(jlong) * new_size);
1604   } else {
1605     for (int i = 0; i < MIN2((int) current_size, new_size); i++) {
1606       new_counters[i] = old_counters[i];
1607     }
1608     if (new_size > current_size) {
1609       memset(new_counters + current_size, 0, sizeof(jlong) * (new_size - current_size));
1610     }
1611     FREE_C_HEAP_ARRAY(jlong, old_counters);
1612   }
1613   return new_counters;
1614 }
1615 
1616 // Attempt to enlarge the array for per thread counters.
1617 bool JavaThread::resize_counters(int current_size, int new_size) {
1618   jlong* new_counters = resize_counters_array(_jvmci_counters, current_size, new_size);
1619   if (new_counters == NULL) {
1620     return false;
1621   } else {
1622     _jvmci_counters = new_counters;
1623     return true;
1624   }
1625 }
1626 
1627 class VM_JVMCIResizeCounters : public VM_Operation {
1628  private:
1629   int _new_size;
1630   bool _failed;
1631 
1632  public:
1633   VM_JVMCIResizeCounters(int new_size) : _new_size(new_size), _failed(false) { }
1634   VMOp_Type type()                  const        { return VMOp_JVMCIResizeCounters; }
1635   bool allow_nested_vm_operations() const        { return true; }
1636   void doit() {
1637     // Resize the old thread counters array
1638     jlong* new_counters = resize_counters_array(JavaThread::_jvmci_old_thread_counters, JVMCICounterSize, _new_size);
1639     if (new_counters == NULL) {
1640       _failed = true;
1641       return;
1642     } else {
1643       JavaThread::_jvmci_old_thread_counters = new_counters;
1644     }
1645 
1646     // Now resize each threads array
1647     for (JavaThreadIteratorWithHandle jtiwh; JavaThread *tp = jtiwh.next(); ) {
1648       if (!tp->resize_counters(JVMCICounterSize, _new_size)) {
1649         _failed = true;
1650         break;
1651       }
1652     }
1653     if (!_failed) {
1654       JVMCICounterSize = _new_size;
1655     }
1656   }
1657 
1658   bool failed() { return _failed; }
1659 };
1660 
1661 bool JavaThread::resize_all_jvmci_counters(int new_size) {
1662   VM_JVMCIResizeCounters op(new_size);
1663   VMThread::execute(&op);
1664   return !op.failed();
1665 }
1666 
1667 #endif // INCLUDE_JVMCI
1668 
1669 // A JavaThread is a normal Java thread
1670 
1671 void JavaThread::initialize() {
1672   // Initialize fields
1673 
1674   set_saved_exception_pc(NULL);
1675   set_threadObj(NULL);
1676   _anchor.clear();
1677   set_entry_point(NULL);
1678   set_jni_functions(jni_functions());
1679   set_callee_target(NULL);
1680   set_vm_result(NULL);
1681   set_vm_result_2(NULL);
1682   set_vframe_array_head(NULL);
1683   set_vframe_array_last(NULL);
1684   set_deferred_locals(NULL);
1685   set_deopt_mark(NULL);
1686   set_deopt_compiled_method(NULL);
1687   clear_must_deopt_id();
1688   set_monitor_chunks(NULL);
1689   _on_thread_list = false;
1690   set_thread_state(_thread_new);
1691   _terminated = _not_terminated;
1692   _array_for_gc = NULL;
1693   _suspend_equivalent = false;
1694   _in_deopt_handler = 0;
1695   _doing_unsafe_access = false;
1696   _stack_guard_state = stack_guard_unused;
1697 #if INCLUDE_JVMCI
1698   _pending_monitorenter = false;
1699   _pending_deoptimization = -1;
1700   _pending_failed_speculation = 0;
1701   _pending_transfer_to_interpreter = false;
1702   _in_retryable_allocation = false;
1703   _jvmci._alternate_call_target = NULL;
1704   assert(_jvmci._implicit_exception_pc == NULL, "must be");
1705   _jvmci_counters = NULL;
1706   if (JVMCICounterSize > 0) {
1707     resize_counters(0, (int) JVMCICounterSize);



1708   }
1709 #endif // INCLUDE_JVMCI
1710   _reserved_stack_activation = NULL;  // stack base not known yet
1711   (void)const_cast<oop&>(_exception_oop = oop(NULL));
1712   _exception_pc  = 0;
1713   _exception_handler_pc = 0;
1714   _is_method_handle_return = 0;
1715   _jvmti_thread_state= NULL;
1716   _should_post_on_exceptions_flag = JNI_FALSE;
1717   _interp_only_mode    = 0;
1718   _special_runtime_exit_condition = _no_async_condition;
1719   _pending_async_exception = NULL;
1720   _thread_stat = NULL;
1721   _thread_stat = new ThreadStatistics();
1722   _blocked_on_compilation = false;
1723   _jni_active_critical = 0;
1724   _pending_jni_exception_check_fn = NULL;
1725   _do_not_unlock_if_synchronized = false;
1726   _cached_monitor_info = NULL;
1727   _parker = Parker::Allocate(this);


3704   // The VM preresolves methods to these classes. Make sure that they get initialized
3705   initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK);
3706   initialize_class(vmSymbols::java_lang_ref_Finalizer(), CHECK);
3707 
3708   // Phase 1 of the system initialization in the library, java.lang.System class initialization
3709   call_initPhase1(CHECK);
3710 
3711   // get the Java runtime name after java.lang.System is initialized
3712   JDK_Version::set_runtime_name(get_java_runtime_name(THREAD));
3713   JDK_Version::set_runtime_version(get_java_runtime_version(THREAD));
3714 
3715   // an instance of OutOfMemory exception has been allocated earlier
3716   initialize_class(vmSymbols::java_lang_OutOfMemoryError(), CHECK);
3717   initialize_class(vmSymbols::java_lang_NullPointerException(), CHECK);
3718   initialize_class(vmSymbols::java_lang_ClassCastException(), CHECK);
3719   initialize_class(vmSymbols::java_lang_ArrayStoreException(), CHECK);
3720   initialize_class(vmSymbols::java_lang_ArithmeticException(), CHECK);
3721   initialize_class(vmSymbols::java_lang_StackOverflowError(), CHECK);
3722   initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK);
3723   initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK);
3724 
3725   // Eager box cache initialization only if AOT is on and any library is loaded.
3726   AOTLoader::initialize_box_caches(CHECK);
3727 }
3728 
3729 void Threads::initialize_jsr292_core_classes(TRAPS) {
3730   TraceTime timer("Initialize java.lang.invoke classes", TRACETIME_LOG(Info, startuptime));
3731 
3732   initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK);
3733   initialize_class(vmSymbols::java_lang_invoke_ResolvedMethodName(), CHECK);
3734   initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK);
3735   initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK);
3736 }
3737 
3738 jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
3739   extern void JDK_Version_init();
3740 
3741   // Preinitialize version info.
3742   VM_Version::early_initialize();
3743 
3744   // Check version
3745   if (!is_supported_jni_version(args->version)) return JNI_EVERSION;
3746 


3826   // Convert -Xrun to -agentlib: if there is no JVM_OnLoad
3827   // Must be before create_vm_init_agents()
3828   if (Arguments::init_libraries_at_startup()) {
3829     convert_vm_init_libraries_to_agents();
3830   }
3831 
3832   // Launch -agentlib/-agentpath and converted -Xrun agents
3833   if (Arguments::init_agents_at_startup()) {
3834     create_vm_init_agents();
3835   }
3836 
3837   // Initialize Threads state
3838   _number_of_threads = 0;
3839   _number_of_non_daemon_threads = 0;
3840 
3841   // Initialize global data structures and create system classes in heap
3842   vm_init_globals();
3843 
3844 #if INCLUDE_JVMCI
3845   if (JVMCICounterSize > 0) {
3846     JavaThread::_jvmci_old_thread_counters = NEW_C_HEAP_ARRAY(jlong, JVMCICounterSize, mtJVMCI);
3847     memset(JavaThread::_jvmci_old_thread_counters, 0, sizeof(jlong) * JVMCICounterSize);
3848   } else {
3849     JavaThread::_jvmci_old_thread_counters = NULL;
3850   }
3851 #endif // INCLUDE_JVMCI
3852 
3853   // Attach the main thread to this os thread
3854   JavaThread* main_thread = new JavaThread();
3855   main_thread->set_thread_state(_thread_in_vm);
3856   main_thread->initialize_thread_current();
3857   // must do this before set_active_handles
3858   main_thread->record_stack_base_and_size();
3859   main_thread->register_thread_stack_with_NMT();
3860   main_thread->set_active_handles(JNIHandleBlock::allocate_block());
3861 
3862   if (!main_thread->set_as_starting_thread()) {
3863     vm_shutdown_during_initialization(
3864                                       "Failed necessary internal allocation. Out of swap space");
3865     main_thread->smr_delete();
3866     *canTryAgain = false; // don't let caller call JNI_CreateJavaVM again


3968   os::initialize_jdk_signal_support(CHECK_JNI_ERR);
3969 
3970   // Start Attach Listener if +StartAttachListener or it can't be started lazily
3971   if (!DisableAttachMechanism) {
3972     AttachListener::vm_start();
3973     if (StartAttachListener || AttachListener::init_at_startup()) {
3974       AttachListener::init();
3975     }
3976   }
3977 
3978   // Launch -Xrun agents
3979   // Must be done in the JVMTI live phase so that for backward compatibility the JDWP
3980   // back-end can launch with -Xdebug -Xrunjdwp.
3981   if (!EagerXrunInit && Arguments::init_libraries_at_startup()) {
3982     create_vm_init_libraries();
3983   }
3984 
3985   if (CleanChunkPoolAsync) {
3986     Chunk::start_chunk_pool_cleaner_task();
3987   }
3988 
3989 
3990   // initialize compiler(s)
3991 #if defined(COMPILER1) || COMPILER2_OR_JVMCI
3992 #if INCLUDE_JVMCI
3993   bool force_JVMCI_intialization = false;
3994   if (EnableJVMCI) {
3995     // Initialize JVMCI eagerly when it is explicitly requested.
3996     // Or when JVMCILibDumpJNIConfig or JVMCIPrintProperties is enabled.
3997     force_JVMCI_intialization = EagerJVMCI || JVMCIPrintProperties || JVMCILibDumpJNIConfig;
3998 
3999     if (!force_JVMCI_intialization) {
4000       // 8145270: Force initialization of JVMCI runtime otherwise requests for blocking
4001       // compilations via JVMCI will not actually block until JVMCI is initialized.
4002       force_JVMCI_intialization = UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation);
4003     }
4004   }
4005 #endif
4006   CompileBroker::compilation_init_phase1(CHECK_JNI_ERR);
4007   // Postpone completion of compiler initialization to after JVMCI
4008   // is initialized to avoid timeouts of blocking compilations.




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "jvm.h"

  27 #include "classfile/classLoader.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "classfile/moduleEntry.hpp"
  30 #include "classfile/systemDictionary.hpp"
  31 #include "classfile/vmSymbols.hpp"
  32 #include "code/codeCache.hpp"
  33 #include "code/scopeDesc.hpp"
  34 #include "compiler/compileBroker.hpp"
  35 #include "compiler/compileTask.hpp"
  36 #include "gc/shared/barrierSet.hpp"
  37 #include "gc/shared/gcId.hpp"
  38 #include "gc/shared/gcLocker.inline.hpp"
  39 #include "gc/shared/workgroup.hpp"
  40 #include "interpreter/interpreter.hpp"
  41 #include "interpreter/linkResolver.hpp"
  42 #include "interpreter/oopMapCache.hpp"
  43 #include "jfr/jfrEvents.hpp"
  44 #include "jvmtifiles/jvmtiEnv.hpp"
  45 #include "logging/log.hpp"
  46 #include "logging/logConfiguration.hpp"


1574 jlong* JavaThread::_jvmci_old_thread_counters;
1575 
1576 bool jvmci_counters_include(JavaThread* thread) {
1577   return !JVMCICountersExcludeCompiler || !thread->is_Compiler_thread();
1578 }
1579 
1580 void JavaThread::collect_counters(jlong* array, int length) {
1581   assert(length == JVMCICounterSize, "wrong value");
1582   for (int i = 0; i < length; i++) {
1583     array[i] = _jvmci_old_thread_counters[i];
1584   }
1585   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *tp = jtiwh.next(); ) {
1586     if (jvmci_counters_include(tp)) {
1587       for (int i = 0; i < length; i++) {
1588         array[i] += tp->_jvmci_counters[i];
1589       }
1590     }
1591   }
1592 }
1593 








































































1594 #endif // INCLUDE_JVMCI
1595 
1596 // A JavaThread is a normal Java thread
1597 
1598 void JavaThread::initialize() {
1599   // Initialize fields
1600 
1601   set_saved_exception_pc(NULL);
1602   set_threadObj(NULL);
1603   _anchor.clear();
1604   set_entry_point(NULL);
1605   set_jni_functions(jni_functions());
1606   set_callee_target(NULL);
1607   set_vm_result(NULL);
1608   set_vm_result_2(NULL);
1609   set_vframe_array_head(NULL);
1610   set_vframe_array_last(NULL);
1611   set_deferred_locals(NULL);
1612   set_deopt_mark(NULL);
1613   set_deopt_compiled_method(NULL);
1614   clear_must_deopt_id();
1615   set_monitor_chunks(NULL);
1616   _on_thread_list = false;
1617   set_thread_state(_thread_new);
1618   _terminated = _not_terminated;
1619   _array_for_gc = NULL;
1620   _suspend_equivalent = false;
1621   _in_deopt_handler = 0;
1622   _doing_unsafe_access = false;
1623   _stack_guard_state = stack_guard_unused;
1624 #if INCLUDE_JVMCI
1625   _pending_monitorenter = false;
1626   _pending_deoptimization = -1;
1627   _pending_failed_speculation = 0;
1628   _pending_transfer_to_interpreter = false;
1629   _in_retryable_allocation = false;
1630   _jvmci._alternate_call_target = NULL;
1631   assert(_jvmci._implicit_exception_pc == NULL, "must be");

1632   if (JVMCICounterSize > 0) {
1633     _jvmci_counters = NEW_C_HEAP_ARRAY(jlong, JVMCICounterSize, mtInternal);
1634     memset(_jvmci_counters, 0, sizeof(jlong) * JVMCICounterSize);
1635   } else {
1636     _jvmci_counters = NULL;
1637   }
1638 #endif // INCLUDE_JVMCI
1639   _reserved_stack_activation = NULL;  // stack base not known yet
1640   (void)const_cast<oop&>(_exception_oop = oop(NULL));
1641   _exception_pc  = 0;
1642   _exception_handler_pc = 0;
1643   _is_method_handle_return = 0;
1644   _jvmti_thread_state= NULL;
1645   _should_post_on_exceptions_flag = JNI_FALSE;
1646   _interp_only_mode    = 0;
1647   _special_runtime_exit_condition = _no_async_condition;
1648   _pending_async_exception = NULL;
1649   _thread_stat = NULL;
1650   _thread_stat = new ThreadStatistics();
1651   _blocked_on_compilation = false;
1652   _jni_active_critical = 0;
1653   _pending_jni_exception_check_fn = NULL;
1654   _do_not_unlock_if_synchronized = false;
1655   _cached_monitor_info = NULL;
1656   _parker = Parker::Allocate(this);


3633   // The VM preresolves methods to these classes. Make sure that they get initialized
3634   initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK);
3635   initialize_class(vmSymbols::java_lang_ref_Finalizer(), CHECK);
3636 
3637   // Phase 1 of the system initialization in the library, java.lang.System class initialization
3638   call_initPhase1(CHECK);
3639 
3640   // get the Java runtime name after java.lang.System is initialized
3641   JDK_Version::set_runtime_name(get_java_runtime_name(THREAD));
3642   JDK_Version::set_runtime_version(get_java_runtime_version(THREAD));
3643 
3644   // an instance of OutOfMemory exception has been allocated earlier
3645   initialize_class(vmSymbols::java_lang_OutOfMemoryError(), CHECK);
3646   initialize_class(vmSymbols::java_lang_NullPointerException(), CHECK);
3647   initialize_class(vmSymbols::java_lang_ClassCastException(), CHECK);
3648   initialize_class(vmSymbols::java_lang_ArrayStoreException(), CHECK);
3649   initialize_class(vmSymbols::java_lang_ArithmeticException(), CHECK);
3650   initialize_class(vmSymbols::java_lang_StackOverflowError(), CHECK);
3651   initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK);
3652   initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK);



3653 }
3654 
3655 void Threads::initialize_jsr292_core_classes(TRAPS) {
3656   TraceTime timer("Initialize java.lang.invoke classes", TRACETIME_LOG(Info, startuptime));
3657 
3658   initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK);
3659   initialize_class(vmSymbols::java_lang_invoke_ResolvedMethodName(), CHECK);
3660   initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK);
3661   initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK);
3662 }
3663 
3664 jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
3665   extern void JDK_Version_init();
3666 
3667   // Preinitialize version info.
3668   VM_Version::early_initialize();
3669 
3670   // Check version
3671   if (!is_supported_jni_version(args->version)) return JNI_EVERSION;
3672 


3752   // Convert -Xrun to -agentlib: if there is no JVM_OnLoad
3753   // Must be before create_vm_init_agents()
3754   if (Arguments::init_libraries_at_startup()) {
3755     convert_vm_init_libraries_to_agents();
3756   }
3757 
3758   // Launch -agentlib/-agentpath and converted -Xrun agents
3759   if (Arguments::init_agents_at_startup()) {
3760     create_vm_init_agents();
3761   }
3762 
3763   // Initialize Threads state
3764   _number_of_threads = 0;
3765   _number_of_non_daemon_threads = 0;
3766 
3767   // Initialize global data structures and create system classes in heap
3768   vm_init_globals();
3769 
3770 #if INCLUDE_JVMCI
3771   if (JVMCICounterSize > 0) {
3772     JavaThread::_jvmci_old_thread_counters = NEW_C_HEAP_ARRAY(jlong, JVMCICounterSize, mtInternal);
3773     memset(JavaThread::_jvmci_old_thread_counters, 0, sizeof(jlong) * JVMCICounterSize);
3774   } else {
3775     JavaThread::_jvmci_old_thread_counters = NULL;
3776   }
3777 #endif // INCLUDE_JVMCI
3778 
3779   // Attach the main thread to this os thread
3780   JavaThread* main_thread = new JavaThread();
3781   main_thread->set_thread_state(_thread_in_vm);
3782   main_thread->initialize_thread_current();
3783   // must do this before set_active_handles
3784   main_thread->record_stack_base_and_size();
3785   main_thread->register_thread_stack_with_NMT();
3786   main_thread->set_active_handles(JNIHandleBlock::allocate_block());
3787 
3788   if (!main_thread->set_as_starting_thread()) {
3789     vm_shutdown_during_initialization(
3790                                       "Failed necessary internal allocation. Out of swap space");
3791     main_thread->smr_delete();
3792     *canTryAgain = false; // don't let caller call JNI_CreateJavaVM again


3894   os::initialize_jdk_signal_support(CHECK_JNI_ERR);
3895 
3896   // Start Attach Listener if +StartAttachListener or it can't be started lazily
3897   if (!DisableAttachMechanism) {
3898     AttachListener::vm_start();
3899     if (StartAttachListener || AttachListener::init_at_startup()) {
3900       AttachListener::init();
3901     }
3902   }
3903 
3904   // Launch -Xrun agents
3905   // Must be done in the JVMTI live phase so that for backward compatibility the JDWP
3906   // back-end can launch with -Xdebug -Xrunjdwp.
3907   if (!EagerXrunInit && Arguments::init_libraries_at_startup()) {
3908     create_vm_init_libraries();
3909   }
3910 
3911   if (CleanChunkPoolAsync) {
3912     Chunk::start_chunk_pool_cleaner_task();
3913   }

3914 
3915   // initialize compiler(s)
3916 #if defined(COMPILER1) || COMPILER2_OR_JVMCI
3917 #if INCLUDE_JVMCI
3918   bool force_JVMCI_intialization = false;
3919   if (EnableJVMCI) {
3920     // Initialize JVMCI eagerly when it is explicitly requested.
3921     // Or when JVMCILibDumpJNIConfig or JVMCIPrintProperties is enabled.
3922     force_JVMCI_intialization = EagerJVMCI || JVMCIPrintProperties || JVMCILibDumpJNIConfig;
3923 
3924     if (!force_JVMCI_intialization) {
3925       // 8145270: Force initialization of JVMCI runtime otherwise requests for blocking
3926       // compilations via JVMCI will not actually block until JVMCI is initialized.
3927       force_JVMCI_intialization = UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation);
3928     }
3929   }
3930 #endif
3931   CompileBroker::compilation_init_phase1(CHECK_JNI_ERR);
3932   // Postpone completion of compiler initialization to after JVMCI
3933   // is initialized to avoid timeouts of blocking compilations.


< prev index next >