Mercurial > hg > graal-jvmci-8
comparison src/share/vm/compiler/compileBroker.cpp @ 23295:c3ebefa1c743
Backed out changeset 5d04cfbd1945
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 29 Jan 2016 22:55:42 +0100 |
parents | 5d04cfbd1945 |
children | f41d4011035d |
comparison
equal
deleted
inserted
replaced
23294:5d04cfbd1945 | 23295:c3ebefa1c743 |
---|---|
49 #ifdef COMPILER1 | 49 #ifdef COMPILER1 |
50 #include "c1/c1_Compiler.hpp" | 50 #include "c1/c1_Compiler.hpp" |
51 #endif | 51 #endif |
52 #if INCLUDE_JVMCI | 52 #if INCLUDE_JVMCI |
53 #include "jvmci/jvmciCompiler.hpp" | 53 #include "jvmci/jvmciCompiler.hpp" |
54 #include "jvmci/jvmciJavaClasses.hpp" | |
55 #ifdef COMPILERJVMCI | 54 #ifdef COMPILERJVMCI |
56 #include "jvmci/jvmciRuntime.hpp" | 55 #include "jvmci/jvmciRuntime.hpp" |
57 #include "runtime/vframe.hpp" | 56 #include "runtime/vframe.hpp" |
58 #endif | 57 #endif |
59 #endif | 58 #endif |
929 | 928 |
930 // ------------------------------------------------------------------ | 929 // ------------------------------------------------------------------ |
931 // CompileBroker::compilation_init | 930 // CompileBroker::compilation_init |
932 // | 931 // |
933 // Initialize the Compilation object | 932 // Initialize the Compilation object |
934 void CompileBroker::compilation_init(TRAPS) { | 933 void CompileBroker::compilation_init() { |
935 _last_method_compiled[0] = '\0'; | 934 _last_method_compiled[0] = '\0'; |
936 | 935 |
937 // No need to initialize compilation system if we do not use it. | 936 // No need to initialize compilation system if we do not use it. |
938 if (!UseCompiler) { | 937 if (!UseCompiler) { |
939 return; | 938 return; |
957 c2_count = JVMCIThreads; | 956 c2_count = JVMCIThreads; |
958 } | 957 } |
959 if (FLAG_IS_DEFAULT(JVMCIHostThreads)) { | 958 if (FLAG_IS_DEFAULT(JVMCIHostThreads)) { |
960 } else { | 959 } else { |
961 c1_count = JVMCIHostThreads; | 960 c1_count = JVMCIHostThreads; |
962 } | |
963 if (!UseInterpreter || !BackgroundCompilation) { | |
964 // Force initialization of JVMCI compiler otherwise JVMCI | |
965 // compilations will not block until JVMCI is initialized | |
966 ResourceMark rm; | |
967 TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK); | |
968 TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK); | |
969 Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK); | |
970 JavaValue result(T_OBJECT); | |
971 JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK); | |
972 } | 961 } |
973 #endif // COMPILERJVMCI | 962 #endif // COMPILERJVMCI |
974 | 963 |
975 #ifdef COMPILER1 | 964 #ifdef COMPILER1 |
976 if (c1_count > 0) { | 965 if (c1_count > 0) { |
1742 * @return true if this thread needs to free/recycle the task | 1731 * @return true if this thread needs to free/recycle the task |
1743 */ | 1732 */ |
1744 bool CompileBroker::wait_for_jvmci_completion(CompileTask* task, JavaThread* thread) { | 1733 bool CompileBroker::wait_for_jvmci_completion(CompileTask* task, JavaThread* thread) { |
1745 MutexLocker waiter(task->lock(), thread); | 1734 MutexLocker waiter(task->lock(), thread); |
1746 int consecutively_blocked = 0; | 1735 int consecutively_blocked = 0; |
1747 while (!task->is_complete() && !is_compilation_disabled_forever() && | 1736 while (task->lock()->wait(!Mutex::_no_safepoint_check_flag, BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE)) { |
1748 task->lock()->wait(!Mutex::_no_safepoint_check_flag, BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE)) { | |
1749 CompilerThread* jvmci_compiler_thread = task->jvmci_compiler_thread(); | 1737 CompilerThread* jvmci_compiler_thread = task->jvmci_compiler_thread(); |
1750 if (jvmci_compiler_thread != NULL) { | 1738 if (jvmci_compiler_thread != NULL) { |
1751 JavaThreadState state; | 1739 JavaThreadState state; |
1752 { | 1740 { |
1753 // A JVMCI compiler thread should not disappear at this point | 1741 // A JVMCI compiler thread should not disappear at this point |