Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/advancedThresholdPolicy.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 | 7301840ea20e |
children | 600c44255e5f |
comparison
equal
deleted
inserted
replaced
20584:ef9eda2c1abe | 20588:41dcdd636080 |
---|---|
449 void AdvancedThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh, | 449 void AdvancedThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh, |
450 CompLevel level, nmethod* nm, JavaThread* thread) { | 450 CompLevel level, nmethod* nm, JavaThread* thread) { |
451 if (should_create_mdo(mh(), level)) { | 451 if (should_create_mdo(mh(), level)) { |
452 create_mdo(mh, thread); | 452 create_mdo(mh, thread); |
453 } | 453 } |
454 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, InvocationEntryBci)) { | 454 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
455 CompLevel next_level = call_event(mh(), level); | 455 CompLevel next_level = call_event(mh(), level); |
456 if (next_level != level) { | 456 if (next_level != level) { |
457 compile(mh, InvocationEntryBci, next_level, thread); | 457 compile(mh, InvocationEntryBci, next_level, thread); |
458 } | 458 } |
459 } | 459 } |
473 | 473 |
474 if (is_compilation_enabled()) { | 474 if (is_compilation_enabled()) { |
475 CompLevel next_osr_level = loop_event(imh(), level); | 475 CompLevel next_osr_level = loop_event(imh(), level); |
476 CompLevel max_osr_level = (CompLevel)imh->highest_osr_comp_level(); | 476 CompLevel max_osr_level = (CompLevel)imh->highest_osr_comp_level(); |
477 // At the very least compile the OSR version | 477 // At the very least compile the OSR version |
478 if (!CompileBroker::compilation_is_in_queue(imh, bci) && next_osr_level != level) { | 478 if (!CompileBroker::compilation_is_in_queue(imh) && (next_osr_level != level)) { |
479 compile(imh, bci, next_osr_level, thread); | 479 compile(imh, bci, next_osr_level, thread); |
480 } | 480 } |
481 | 481 |
482 // Use loop event as an opportunity to also check if there's been | 482 // Use loop event as an opportunity to also check if there's been |
483 // enough calls. | 483 // enough calls. |
507 print_event(MAKE_NOT_ENTRANT, mh(), mh(), osr_bci, level); | 507 print_event(MAKE_NOT_ENTRANT, mh(), mh(), osr_bci, level); |
508 } | 508 } |
509 nm->make_not_entrant(); | 509 nm->make_not_entrant(); |
510 } | 510 } |
511 } | 511 } |
512 if (!CompileBroker::compilation_is_in_queue(mh, InvocationEntryBci)) { | 512 if (!CompileBroker::compilation_is_in_queue(mh)) { |
513 // Fix up next_level if necessary to avoid deopts | 513 // Fix up next_level if necessary to avoid deopts |
514 if (next_level == CompLevel_limited_profile && max_osr_level == CompLevel_full_profile) { | 514 if (next_level == CompLevel_limited_profile && max_osr_level == CompLevel_full_profile) { |
515 next_level = CompLevel_full_profile; | 515 next_level = CompLevel_full_profile; |
516 } | 516 } |
517 if (cur_level != next_level) { | 517 if (cur_level != next_level) { |
519 } | 519 } |
520 } | 520 } |
521 } else { | 521 } else { |
522 cur_level = comp_level(imh()); | 522 cur_level = comp_level(imh()); |
523 next_level = call_event(imh(), cur_level); | 523 next_level = call_event(imh(), cur_level); |
524 if (!CompileBroker::compilation_is_in_queue(imh, bci) && next_level != cur_level) { | 524 if (!CompileBroker::compilation_is_in_queue(imh) && (next_level != cur_level)) { |
525 compile(imh, InvocationEntryBci, next_level, thread); | 525 compile(imh, InvocationEntryBci, next_level, thread); |
526 } | 526 } |
527 } | 527 } |
528 } | 528 } |
529 } | 529 } |