comparison src/share/vm/runtime/advancedThresholdPolicy.cpp @ 21559:be896a1983c0

recast all Graal native code as JVMCI code (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 May 2015 15:36:48 +0200
parents 7848fc12602b
children 1b16dd28160c
comparison
equal deleted inserted replaced
21558:d563baeca9df 21559:be896a1983c0
159 return false; 159 return false;
160 } 160 }
161 161
162 // Called with the queue locked and with at least one element 162 // Called with the queue locked and with at least one element
163 CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { 163 CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
164 #ifdef COMPILERGRAAL 164 #ifdef COMPILERJVMCI
165 CompileTask *max_non_graal_task = NULL; 165 CompileTask *max_non_jvmci_task = NULL;
166 #endif 166 #endif
167 CompileTask *max_task = NULL; 167 CompileTask *max_task = NULL;
168 Method* max_method = NULL; 168 Method* max_method = NULL;
169 jlong t = os::javaTimeMillis(); 169 jlong t = os::javaTimeMillis();
170 // Iterate through the queue and find a method with a maximum rate. 170 // Iterate through the queue and find a method with a maximum rate.
192 if (compare_methods(method, max_method)) { 192 if (compare_methods(method, max_method)) {
193 max_task = task; 193 max_task = task;
194 max_method = method; 194 max_method = method;
195 } 195 }
196 } 196 }
197 #ifdef COMPILERGRAAL 197 #ifdef COMPILERJVMCI
198 if (GraalCompileAppFirst && (task->comp_level() == CompLevel_full_optimization || !method->has_compiled_code()) && 198 if (JVMCICompileAppFirst && (task->comp_level() == CompLevel_full_optimization || !method->has_compiled_code()) &&
199 SystemDictionary::graal_loader() != NULL && 199 SystemDictionary::jvmci_loader() != NULL &&
200 method->method_holder()->class_loader() != SystemDictionary::graal_loader()) { 200 method->method_holder()->class_loader() != SystemDictionary::jvmci_loader()) {
201 if (max_non_graal_task == NULL) { 201 if (max_non_jvmci_task == NULL) {
202 max_non_graal_task = task; 202 max_non_jvmci_task = task;
203 } else { 203 } else {
204 // Select a method with a higher rate 204 // Select a method with a higher rate
205 if (compare_methods(method, max_non_graal_task->method())) { 205 if (compare_methods(method, max_non_jvmci_task->method())) {
206 max_non_graal_task = task; 206 max_non_jvmci_task = task;
207 } 207 }
208 } 208 }
209 } 209 }
210 #endif 210 #endif
211 task = next_task; 211 task = next_task;
212 } 212 }
213 213
214 #ifdef COMPILERGRAAL 214 #ifdef COMPILERJVMCI
215 if (max_non_graal_task != NULL) { 215 if (max_non_jvmci_task != NULL) {
216 max_task = max_non_graal_task; 216 max_task = max_non_jvmci_task;
217 max_method = max_task->method(); 217 max_method = max_task->method();
218 } 218 }
219 #endif 219 #endif
220 220
221 if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile 221 if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile
371 case CompLevel_none: 371 case CompLevel_none:
372 // If we were at full profile level, would we switch to full opt? 372 // If we were at full profile level, would we switch to full opt?
373 if (common(p, method, CompLevel_full_profile, disable_feedback) == CompLevel_full_optimization) { 373 if (common(p, method, CompLevel_full_profile, disable_feedback) == CompLevel_full_optimization) {
374 next_level = CompLevel_full_optimization; 374 next_level = CompLevel_full_optimization;
375 } else if ((this->*p)(i, b, cur_level)) { 375 } else if ((this->*p)(i, b, cur_level)) {
376 #ifdef COMPILERGRAAL 376 #ifdef COMPILERJVMCI
377 // Since Graal takes a while to warm up, its queue inevitably backs up during 377 // Since JVMCI takes a while to warm up, its queue inevitably backs up during
378 // early VM execution. As of 2014-06-13, Graal's inliner assumes that the root 378 // early VM execution. As of 2014-06-13, JVMCI's inliner assumes that the root
379 // compilation method and all potential inlinees have mature profiles (which 379 // compilation method and all potential inlinees have mature profiles (which
380 // includes type profiling). If it sees immature profiles, Graal's inliner 380 // includes type profiling). If it sees immature profiles, JVMCI's inliner
381 // can perform pathologically bad (e.g., causing OutOfMemoryErrors due to 381 // can perform pathologically bad (e.g., causing OutOfMemoryErrors due to
382 // exploring/inlining too many graphs). Since a rewrite of the inliner is 382 // exploring/inlining too many graphs). Since a rewrite of the inliner is
383 // in progress, we simply disable the dialing back heuristic for now and will 383 // in progress, we simply disable the dialing back heuristic for now and will
384 // revisit this decision once the new inliner is completed. 384 // revisit this decision once the new inliner is completed.
385 next_level = CompLevel_full_profile; 385 next_level = CompLevel_full_profile;