Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/thread.cpp @ 16447:ce6696559683
better fix for deadlock in GraalVM under -Xcomp (JBS:GRAAL-48)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 10 Jul 2014 12:33:32 +0200 |
parents | b20d00b2ac2e |
children | a29e6e7b7a86 |
comparison
equal
deleted
inserted
replaced
16446:4584f29431be | 16447:ce6696559683 |
---|---|
3743 return status; | 3743 return status; |
3744 } | 3744 } |
3745 #endif | 3745 #endif |
3746 | 3746 |
3747 // initialize compiler(s) | 3747 // initialize compiler(s) |
3748 #if defined(COMPILERGRAAL) | 3748 #if defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) || defined(COMPILERGRAAL) |
3749 if (Arguments::mode() != Arguments::_comp) { | |
3750 // Only initialize compilation if not -Xcomp. Deadlock can | |
3751 // occur during the class initialization below as follows: | |
3752 // 1. This thread acquires the initialization lock for a class | |
3753 // and then blocks while waiting for some method to be compiled. | |
3754 // 2. Graal compilation thread(s) try to access the locked class | |
3755 // and will block waiting for the initialization lock. This | |
3756 // prevents the requested compilation in 1 from completing. | |
3757 CompileBroker::compilation_init(); | |
3758 } | |
3759 #elif defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) || defined(COMPILERGRAAL) | |
3760 CompileBroker::compilation_init(); | 3749 CompileBroker::compilation_init(); |
3761 #endif | 3750 #endif |
3762 | 3751 |
3763 if (EnableInvokeDynamic) { | 3752 if (EnableInvokeDynamic) { |
3764 // Pre-initialize some JSR292 core classes to avoid deadlock during class loading. | 3753 // Pre-initialize some JSR292 core classes to avoid deadlock during class loading. |
3767 // (see SystemDictionary::find_method_handle_intrinsic). | 3756 // (see SystemDictionary::find_method_handle_intrinsic). |
3768 initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK_0); | 3757 initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK_0); |
3769 initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK_0); | 3758 initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK_0); |
3770 initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK_0); | 3759 initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK_0); |
3771 } | 3760 } |
3772 | |
3773 #if defined(COMPILERGRAAL) | |
3774 if (Arguments::mode() == Arguments::_comp) { | |
3775 // Do deferred compilation initialization (see above) now. | |
3776 CompileBroker::compilation_init(); | |
3777 } | |
3778 #endif | |
3779 | 3761 |
3780 #if INCLUDE_MANAGEMENT | 3762 #if INCLUDE_MANAGEMENT |
3781 Management::initialize(THREAD); | 3763 Management::initialize(THREAD); |
3782 #endif // INCLUDE_MANAGEMENT | 3764 #endif // INCLUDE_MANAGEMENT |
3783 | 3765 |