1.1 --- a/src/share/vm/runtime/advancedThresholdPolicy.cpp Thu Jan 26 16:49:22 2012 +0100 1.2 +++ b/src/share/vm/runtime/advancedThresholdPolicy.cpp Thu Jan 26 12:15:24 2012 -0800 1.3 @@ -271,13 +271,10 @@ 1.4 } 1.5 1.6 // Create MDO if necessary. 1.7 -void AdvancedThresholdPolicy::create_mdo(methodHandle mh, TRAPS) { 1.8 +void AdvancedThresholdPolicy::create_mdo(methodHandle mh, JavaThread* THREAD) { 1.9 if (mh->is_native() || mh->is_abstract() || mh->is_accessor()) return; 1.10 if (mh->method_data() == NULL) { 1.11 - methodOopDesc::build_interpreter_method_data(mh, THREAD); 1.12 - if (HAS_PENDING_EXCEPTION) { 1.13 - CLEAR_PENDING_EXCEPTION; 1.14 - } 1.15 + methodOopDesc::build_interpreter_method_data(mh, CHECK_AND_CLEAR); 1.16 } 1.17 } 1.18 1.19 @@ -426,22 +423,22 @@ 1.20 } 1.21 1.22 // Update the rate and submit compile 1.23 -void AdvancedThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, TRAPS) { 1.24 +void AdvancedThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread) { 1.25 int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count(); 1.26 update_rate(os::javaTimeMillis(), mh()); 1.27 - CompileBroker::compile_method(mh, bci, level, mh, hot_count, "tiered", THREAD); 1.28 + CompileBroker::compile_method(mh, bci, level, mh, hot_count, "tiered", thread); 1.29 } 1.30 1.31 // Handle the invocation event. 1.32 void AdvancedThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh, 1.33 - CompLevel level, nmethod* nm, TRAPS) { 1.34 + CompLevel level, nmethod* nm, JavaThread* thread) { 1.35 if (should_create_mdo(mh(), level)) { 1.36 - create_mdo(mh, THREAD); 1.37 + create_mdo(mh, thread); 1.38 } 1.39 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, InvocationEntryBci)) { 1.40 CompLevel next_level = call_event(mh(), level); 1.41 if (next_level != level) { 1.42 - compile(mh, InvocationEntryBci, next_level, THREAD); 1.43 + compile(mh, InvocationEntryBci, next_level, thread); 1.44 } 1.45 } 1.46 } 1.47 @@ -449,13 +446,13 @@ 1.48 // Handle the back branch event. Notice that we can compile the method 1.49 // with a regular entry from here. 1.50 void AdvancedThresholdPolicy::method_back_branch_event(methodHandle mh, methodHandle imh, 1.51 - int bci, CompLevel level, nmethod* nm, TRAPS) { 1.52 + int bci, CompLevel level, nmethod* nm, JavaThread* thread) { 1.53 if (should_create_mdo(mh(), level)) { 1.54 - create_mdo(mh, THREAD); 1.55 + create_mdo(mh, thread); 1.56 } 1.57 // Check if MDO should be created for the inlined method 1.58 if (should_create_mdo(imh(), level)) { 1.59 - create_mdo(imh, THREAD); 1.60 + create_mdo(imh, thread); 1.61 } 1.62 1.63 if (is_compilation_enabled()) { 1.64 @@ -463,7 +460,7 @@ 1.65 CompLevel max_osr_level = (CompLevel)imh->highest_osr_comp_level(); 1.66 // At the very least compile the OSR version 1.67 if (!CompileBroker::compilation_is_in_queue(imh, bci) && next_osr_level != level) { 1.68 - compile(imh, bci, next_osr_level, THREAD); 1.69 + compile(imh, bci, next_osr_level, thread); 1.70 } 1.71 1.72 // Use loop event as an opportunity to also check if there's been 1.73 @@ -502,14 +499,14 @@ 1.74 next_level = CompLevel_full_profile; 1.75 } 1.76 if (cur_level != next_level) { 1.77 - compile(mh, InvocationEntryBci, next_level, THREAD); 1.78 + compile(mh, InvocationEntryBci, next_level, thread); 1.79 } 1.80 } 1.81 } else { 1.82 cur_level = comp_level(imh()); 1.83 next_level = call_event(imh(), cur_level); 1.84 if (!CompileBroker::compilation_is_in_queue(imh, bci) && next_level != cur_level) { 1.85 - compile(imh, InvocationEntryBci, next_level, THREAD); 1.86 + compile(imh, InvocationEntryBci, next_level, thread); 1.87 } 1.88 } 1.89 }