Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCompiler.cpp @ 15487:07fac8558d7b
update state flag after initialization to allow other compiler threads to execute
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Fri, 02 May 2014 17:03:10 -0700 |
parents | a20be10ad437 |
children | 9c66a589ef63 |
comparison
equal
deleted
inserted
replaced
15486:8f09b84f325f | 15487:07fac8558d7b |
---|---|
56 uintptr_t allocation_end = heap_end + ((uintptr_t)16) * 1024 * 1024 * 1024; | 56 uintptr_t allocation_end = heap_end + ((uintptr_t)16) * 1024 * 1024 * 1024; |
57 AMD64_ONLY(guarantee(heap_end < allocation_end, "heap end too close to end of address space (might lead to erroneous TLAB allocations)")); | 57 AMD64_ONLY(guarantee(heap_end < allocation_end, "heap end too close to end of address space (might lead to erroneous TLAB allocations)")); |
58 NOT_LP64(error("check TLAB allocation code for address space conflicts")); | 58 NOT_LP64(error("check TLAB allocation code for address space conflicts")); |
59 | 59 |
60 BufferBlob* buffer_blob = initialize_buffer_blob(); | 60 BufferBlob* buffer_blob = initialize_buffer_blob(); |
61 if (buffer_blob == NULL) { | 61 #ifdef COMPILERGRAAL |
62 // If we are called from JNI_CreateJavaVM we cannot use set_state yet because it takes a lock. | 62 if (!UseGraalCompilationQueue) { |
63 // set_state(failed); | 63 // This path is used for initialization both by the native queue and the graal queue |
64 } else { | 64 // but set_state acquired a lock which might not be safe during JVM_CreateJavaVM, so |
65 // set_state(initialized); | 65 // only update the state flag for the native queue. |
66 } | 66 if (buffer_blob == NULL) { |
67 set_state(failed); | |
68 } else { | |
69 set_state(initialized); | |
70 } | |
71 } | |
72 #endif | |
67 | 73 |
68 JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment(); | 74 JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment(); |
69 jclass klass = env->FindClass("com/oracle/graal/hotspot/bridge/CompilerToVMImpl"); | 75 jclass klass = env->FindClass("com/oracle/graal/hotspot/bridge/CompilerToVMImpl"); |
70 if (klass == NULL) { | 76 if (klass == NULL) { |
71 tty->print_cr("graal CompilerToVMImpl class not found"); | 77 tty->print_cr("graal CompilerToVMImpl class not found"); |