Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompiler.cpp @ 10056:a323a9e20f9d
Fixed a few race conditions in the compilation queue.
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Fri, 14 Jun 2013 19:12:56 +0200 |
parents | 0f7ca53be929 |
children | 36bcc10e01c0 |
comparison
equal
deleted
inserted
replaced
10055:9469034773b2 | 10056:a323a9e20f9d |
---|---|
161 } | 161 } |
162 | 162 |
163 void GraalCompiler::compile_method(methodHandle method, int entry_bci, jboolean blocking) { | 163 void GraalCompiler::compile_method(methodHandle method, int entry_bci, jboolean blocking) { |
164 GRAAL_EXCEPTION_CONTEXT | 164 GRAAL_EXCEPTION_CONTEXT |
165 if (!_initialized) { | 165 if (!_initialized) { |
166 method->clear_queued_for_compilation(); | 166 CompilationPolicy::policy()->delay_compilation(method()); |
167 method->invocation_counter()->reset(); | |
168 method->backedge_counter()->reset(); | |
169 return; | 167 return; |
170 } | 168 } |
171 | 169 |
172 assert(_initialized, "must already be initialized"); | 170 assert(_initialized, "must already be initialized"); |
173 ResourceMark rm; | 171 ResourceMark rm; |
174 JavaThread::current()->set_is_compiling(true); | 172 JavaThread::current()->set_is_compiling(true); |
175 Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK); | 173 Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK); |
176 jboolean success = VMToCompiler::compileMethod(method(), holder, entry_bci, blocking, method->graal_priority()); | 174 VMToCompiler::compileMethod(method(), holder, entry_bci, blocking, method->graal_priority()); |
177 JavaThread::current()->set_is_compiling(false); | 175 JavaThread::current()->set_is_compiling(false); |
178 if (success != JNI_TRUE) { | |
179 method->clear_queued_for_compilation(); | |
180 CompilationPolicy::policy()->delay_compilation(method()); | |
181 } | |
182 } | 176 } |
183 | 177 |
184 // Compilation entry point for methods | 178 // Compilation entry point for methods |
185 void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { | 179 void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { |
186 ShouldNotReachHere(); | 180 ShouldNotReachHere(); |