Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/simpleThresholdPolicy.cpp @ 20588:41dcdd636080
8040798: compiler/startup/SmallCodeCacheStartup.java timed out in RT_Baseline
Summary: Fixes broken memory freeing of compile queue tasks and makes sure that blocking compiles do not hang the VM if compilation gets disabled due to a full code cache.
Reviewed-by: kvn, iveresov
author | anoll |
---|---|
date | Tue, 29 Apr 2014 07:59:22 +0200 |
parents | 653e11c86c5a |
children | 468850e35e48 |
comparison
equal
deleted
inserted
replaced
20584:ef9eda2c1abe | 20588:41dcdd636080 |
---|---|
237 return; | 237 return; |
238 } | 238 } |
239 if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) { | 239 if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) { |
240 return; | 240 return; |
241 } | 241 } |
242 if (!CompileBroker::compilation_is_in_queue(mh, bci)) { | 242 if (!CompileBroker::compilation_is_in_queue(mh)) { |
243 if (PrintTieredEvents) { | 243 if (PrintTieredEvents) { |
244 print_event(COMPILE, mh, mh, bci, level); | 244 print_event(COMPILE, mh, mh, bci, level); |
245 } | 245 } |
246 submit_compile(mh, bci, level, thread); | 246 submit_compile(mh, bci, level, thread); |
247 } | 247 } |
376 | 376 |
377 | 377 |
378 // Handle the invocation event. | 378 // Handle the invocation event. |
379 void SimpleThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh, | 379 void SimpleThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh, |
380 CompLevel level, nmethod* nm, JavaThread* thread) { | 380 CompLevel level, nmethod* nm, JavaThread* thread) { |
381 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, InvocationEntryBci)) { | 381 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
382 CompLevel next_level = call_event(mh(), level); | 382 CompLevel next_level = call_event(mh(), level); |
383 if (next_level != level) { | 383 if (next_level != level) { |
384 compile(mh, InvocationEntryBci, next_level, thread); | 384 compile(mh, InvocationEntryBci, next_level, thread); |
385 } | 385 } |
386 } | 386 } |
389 // Handle the back branch event. Notice that we can compile the method | 389 // Handle the back branch event. Notice that we can compile the method |
390 // with a regular entry from here. | 390 // with a regular entry from here. |
391 void SimpleThresholdPolicy::method_back_branch_event(methodHandle mh, methodHandle imh, | 391 void SimpleThresholdPolicy::method_back_branch_event(methodHandle mh, methodHandle imh, |
392 int bci, CompLevel level, nmethod* nm, JavaThread* thread) { | 392 int bci, CompLevel level, nmethod* nm, JavaThread* thread) { |
393 // If the method is already compiling, quickly bail out. | 393 // If the method is already compiling, quickly bail out. |
394 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, bci)) { | 394 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
395 // Use loop event as an opportinity to also check there's been | 395 // Use loop event as an opportunity to also check there's been |
396 // enough calls. | 396 // enough calls. |
397 CompLevel cur_level = comp_level(mh()); | 397 CompLevel cur_level = comp_level(mh()); |
398 CompLevel next_level = call_event(mh(), cur_level); | 398 CompLevel next_level = call_event(mh(), cur_level); |
399 CompLevel next_osr_level = loop_event(mh(), level); | 399 CompLevel next_osr_level = loop_event(mh(), level); |
400 | 400 |