< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page
rev 56101 : 8227745: Enable Escape Analysis for better performance when debugging
Reviewed-by: ???

*** 733,754 **** string, CHECK_NH); } ! JavaThread* CompileBroker::make_thread(jobject thread_handle, CompileQueue* queue, AbstractCompiler* comp, TRAPS) { JavaThread* thread = NULL; { MutexLocker mu(Threads_lock, THREAD); ! if (comp != NULL) { if (!InjectCompilerCreationFailure || comp->num_compiler_threads() == 0) { CompilerCounters* counters = new CompilerCounters(); thread = new CompilerThread(queue, counters); } ! } else { thread = new CodeCacheSweeperThread(); } // At this point the new CompilerThread data-races with this startup // thread (which I believe is the primoridal thread and NOT the VM // thread). This means Java bytecodes being executed at startup can // queue compile jobs which will run at whatever default priority the // newly created CompilerThread runs at. --- 733,759 ---- string, CHECK_NH); } ! JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, CompileQueue* queue, AbstractCompiler* comp, TRAPS) { JavaThread* thread = NULL; { MutexLocker mu(Threads_lock, THREAD); ! if (type == compiler_t) { if (!InjectCompilerCreationFailure || comp->num_compiler_threads() == 0) { CompilerCounters* counters = new CompilerCounters(); thread = new CompilerThread(queue, counters); } ! } else if (type == sweeper_t) { thread = new CodeCacheSweeperThread(); } + #if defined(ASSERT) && COMPILER2_OR_JVMCI + else { + thread = new DeoptimizeObjectsALotThread(); + } + #endif // ASSERT // At this point the new CompilerThread data-races with this startup // thread (which I believe is the primoridal thread and NOT the VM // thread). This means Java bytecodes being executed at startup can // queue compile jobs which will run at whatever default priority the // newly created CompilerThread runs at.
*** 786,806 **** os::set_native_priority(thread, native_prio); java_lang_Thread::set_daemon(JNIHandles::resolve_non_null(thread_handle)); thread->set_threadObj(JNIHandles::resolve_non_null(thread_handle)); ! if (comp != NULL) { thread->as_CompilerThread()->set_compiler(comp); } Threads::add(thread); Thread::start(thread); } } // First release lock before aborting VM. if (thread == NULL || thread->osthread() == NULL) { ! if (UseDynamicNumberOfCompilerThreads && comp != NULL && comp->num_compiler_threads() > 0) { if (thread != NULL) { thread->smr_delete(); } return NULL; } --- 791,811 ---- os::set_native_priority(thread, native_prio); java_lang_Thread::set_daemon(JNIHandles::resolve_non_null(thread_handle)); thread->set_threadObj(JNIHandles::resolve_non_null(thread_handle)); ! if (type == compiler_t) { thread->as_CompilerThread()->set_compiler(comp); } Threads::add(thread); Thread::start(thread); } } // First release lock before aborting VM. if (thread == NULL || thread->osthread() == NULL) { ! if (UseDynamicNumberOfCompilerThreads && type == compiler_t && comp->num_compiler_threads() > 0) { if (thread != NULL) { thread->smr_delete(); } return NULL; }
*** 842,852 **** jobject thread_handle = JNIHandles::make_global(thread_oop); _compiler2_objects[i] = thread_handle; _compiler2_logs[i] = NULL; if (!UseDynamicNumberOfCompilerThreads || i == 0) { ! JavaThread *ct = make_thread(thread_handle, _c2_compile_queue, _compilers[1], CHECK); assert(ct != NULL, "should have been handled for initial thread"); _compilers[1]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock); --- 847,857 ---- jobject thread_handle = JNIHandles::make_global(thread_oop); _compiler2_objects[i] = thread_handle; _compiler2_logs[i] = NULL; if (!UseDynamicNumberOfCompilerThreads || i == 0) { ! JavaThread *ct = make_thread(compiler_t, thread_handle, _c2_compile_queue, _compilers[1], CHECK); assert(ct != NULL, "should have been handled for initial thread"); _compilers[1]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock);
*** 862,872 **** jobject thread_handle = JNIHandles::make_global(thread_oop); _compiler1_objects[i] = thread_handle; _compiler1_logs[i] = NULL; if (!UseDynamicNumberOfCompilerThreads || i == 0) { ! JavaThread *ct = make_thread(thread_handle, _c1_compile_queue, _compilers[0], CHECK); assert(ct != NULL, "should have been handled for initial thread"); _compilers[0]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock); --- 867,877 ---- jobject thread_handle = JNIHandles::make_global(thread_oop); _compiler1_objects[i] = thread_handle; _compiler1_logs[i] = NULL; if (!UseDynamicNumberOfCompilerThreads || i == 0) { ! JavaThread *ct = make_thread(compiler_t, thread_handle, _c1_compile_queue, _compilers[0], CHECK); assert(ct != NULL, "should have been handled for initial thread"); _compilers[0]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock);
*** 881,892 **** if (MethodFlushing) { // Initialize the sweeper thread Handle thread_oop = create_thread_oop("Sweeper thread", CHECK); jobject thread_handle = JNIHandles::make_local(THREAD, thread_oop()); ! make_thread(thread_handle, NULL, NULL, CHECK); } } void CompileBroker::possibly_add_compiler_threads() { EXCEPTION_MARK; --- 886,906 ---- if (MethodFlushing) { // Initialize the sweeper thread Handle thread_oop = create_thread_oop("Sweeper thread", CHECK); jobject thread_handle = JNIHandles::make_local(THREAD, thread_oop()); ! make_thread(sweeper_t, thread_handle, NULL, NULL, CHECK); ! } ! ! #if defined(ASSERT) && COMPILER2_OR_JVMCI ! if (DeoptimizeObjectsALot == 2) { ! // Initialize and start the object deoptimizer thread ! Handle thread_oop = create_thread_oop("Deoptimize objects a lot thread", CHECK); ! jobject thread_handle = JNIHandles::make_local(THREAD, thread_oop()); ! make_thread(deoptimizer_t, thread_handle, NULL, NULL, CHECK); } + #endif // defined(ASSERT) && COMPILER2_OR_JVMCI } void CompileBroker::possibly_add_compiler_threads() { EXCEPTION_MARK;
*** 904,914 **** _c2_compile_queue->size() / 2, (int)(available_memory / (200*M)), (int)(available_cc_np / (128*K))); for (int i = old_c2_count; i < new_c2_count; i++) { ! JavaThread *ct = make_thread(compiler2_object(i), _c2_compile_queue, _compilers[1], CHECK); if (ct == NULL) break; _compilers[1]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock); --- 918,928 ---- _c2_compile_queue->size() / 2, (int)(available_memory / (200*M)), (int)(available_cc_np / (128*K))); for (int i = old_c2_count; i < new_c2_count; i++) { ! JavaThread *ct = make_thread(compiler_t, compiler2_object(i), _c2_compile_queue, _compilers[1], CHECK); if (ct == NULL) break; _compilers[1]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock);
*** 924,934 **** _c1_compile_queue->size() / 4, (int)(available_memory / (100*M)), (int)(available_cc_p / (128*K))); for (int i = old_c1_count; i < new_c1_count; i++) { ! JavaThread *ct = make_thread(compiler1_object(i), _c1_compile_queue, _compilers[0], CHECK); if (ct == NULL) break; _compilers[0]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock); --- 938,948 ---- _c1_compile_queue->size() / 4, (int)(available_memory / (100*M)), (int)(available_cc_p / (128*K))); for (int i = old_c1_count; i < new_c1_count; i++) { ! JavaThread *ct = make_thread(compiler_t, compiler1_object(i), _c1_compile_queue, _compilers[0], CHECK); if (ct == NULL) break; _compilers[0]->set_num_compiler_threads(i + 1); if (TraceCompilerThreads) { ResourceMark rm; MutexLocker mu(Threads_lock);
< prev index next >