Mercurial > hg > graal-jvmci-8
comparison src/share/vm/jvmci/jvmciCompiler.cpp @ 23303:633cf7bea01d
thread waiting for blocking JVMCI compilation should not wait on compiler queue forever (JDK-8148507) [part 2]
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 04 Feb 2016 19:18:52 +0100 |
parents | f41d4011035d |
children | bc5552dc384b |
comparison
equal
deleted
inserted
replaced
23302:90f7b4c21cfb | 23303:633cf7bea01d |
---|---|
35 elapsedTimer JVMCICompiler::_codeInstallTimer; | 35 elapsedTimer JVMCICompiler::_codeInstallTimer; |
36 | 36 |
37 JVMCICompiler::JVMCICompiler() : AbstractCompiler(jvmci) { | 37 JVMCICompiler::JVMCICompiler() : AbstractCompiler(jvmci) { |
38 #ifdef COMPILERJVMCI | 38 #ifdef COMPILERJVMCI |
39 _bootstrapping = false; | 39 _bootstrapping = false; |
40 _methodsCompiled = 0; | 40 _methods_compiled = 0; |
41 #endif | 41 #endif |
42 assert(_instance == NULL, "only one instance allowed"); | 42 assert(_instance == NULL, "only one instance allowed"); |
43 _instance = this; | 43 _instance = this; |
44 } | 44 } |
45 | 45 |
101 os::sleep(THREAD, 100, true); | 101 os::sleep(THREAD, 100, true); |
102 qsize = CompileBroker::queue_size(CompLevel_full_optimization); | 102 qsize = CompileBroker::queue_size(CompLevel_full_optimization); |
103 } while (first_round && qsize == 0); | 103 } while (first_round && qsize == 0); |
104 first_round = false; | 104 first_round = false; |
105 if (PrintBootstrap) { | 105 if (PrintBootstrap) { |
106 while (z < (_methodsCompiled / 100)) { | 106 while (z < (_methods_compiled / 100)) { |
107 ++z; | 107 ++z; |
108 tty->print_raw("."); | 108 tty->print_raw("."); |
109 } | 109 } |
110 } | 110 } |
111 } while (qsize != 0); | 111 } while (qsize != 0); |
112 | 112 |
113 if (PrintBootstrap) { | 113 if (PrintBootstrap) { |
114 tty->print_cr(" in " JLONG_FORMAT " ms (compiled %d methods)", os::javaTimeMillis() - start, _methodsCompiled); | 114 tty->print_cr(" in " JLONG_FORMAT " ms (compiled %d methods)", os::javaTimeMillis() - start, _methods_compiled); |
115 } | 115 } |
116 _bootstrapping = false; | 116 _bootstrapping = false; |
117 } | 117 } |
118 | 118 |
119 void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JVMCIEnv* env) { | 119 void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JVMCIEnv* env) { |
170 } else { | 170 } else { |
171 if (env->task()->code() == NULL) { | 171 if (env->task()->code() == NULL) { |
172 env->set_failure("no nmethod produced", true); | 172 env->set_failure("no nmethod produced", true); |
173 } else { | 173 } else { |
174 env->task()->set_num_inlined_bytecodes(CompilationRequestResult::inlinedBytecodes(result_object)); | 174 env->task()->set_num_inlined_bytecodes(CompilationRequestResult::inlinedBytecodes(result_object)); |
175 _methodsCompiled++; | 175 Atomic::inc(&_methods_compiled); |
176 } | 176 } |
177 } | 177 } |
178 } else { | 178 } else { |
179 assert(false, "JVMCICompiler.compileMethod should always return non-null"); | 179 assert(false, "JVMCICompiler.compileMethod should always return non-null"); |
180 } | 180 } |