comparison src/share/vm/runtime/advancedThresholdPolicy.cpp @ 19945:f2bdbfe9201b

Experimentally disallow Graal compiling itself in tiered
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Tue, 17 Mar 2015 19:21:57 -0700
parents 5119e7f07d93
children 7848fc12602b
comparison
equal deleted inserted replaced
19944:077c16efeb6d 19945:f2bdbfe9201b
155 return false; 155 return false;
156 } 156 }
157 157
158 // Called with the queue locked and with at least one element 158 // Called with the queue locked and with at least one element
159 CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { 159 CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
160 #ifdef COMPILERGRAAL
161 CompileTask *max_non_graal_task = NULL;
162 #endif
160 CompileTask *max_task = NULL; 163 CompileTask *max_task = NULL;
161 Method* max_method = NULL; 164 Method* max_method = NULL;
162 jlong t = os::javaTimeMillis(); 165 jlong t = os::javaTimeMillis();
163 // Iterate through the queue and find a method with a maximum rate. 166 // Iterate through the queue and find a method with a maximum rate.
164 for (CompileTask* task = compile_queue->first(); task != NULL;) { 167 for (CompileTask* task = compile_queue->first(); task != NULL;) {
187 if (compare_methods(method, max_method)) { 190 if (compare_methods(method, max_method)) {
188 max_task = task; 191 max_task = task;
189 max_method = method; 192 max_method = method;
190 } 193 }
191 } 194 }
195 #ifdef COMPILERGRAAL
196 if (GraalCompileAppFirst && (task->comp_level() == CompLevel_full_optimization || !method->has_compiled_code()) &&
197 SystemDictionary::graal_loader() != NULL &&
198 method->method_holder()->class_loader() != SystemDictionary::graal_loader()) {
199 if (max_non_graal_task == NULL) {
200 max_non_graal_task = task;
201 } else {
202 // Select a method with a higher rate
203 if (compare_methods(method, max_non_graal_task->method())) {
204 max_non_graal_task = task;
205 }
206 }
207 }
208 #endif
192 task = next_task; 209 task = next_task;
193 } 210 }
211
212 #ifdef COMPILERGRAAL
213 if (max_non_graal_task != NULL) {
214 max_task = max_non_graal_task;
215 max_method = max_task->method();
216 }
217 #endif
194 218
195 if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile 219 if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile
196 && is_method_profiled(max_method)) { 220 && is_method_profiled(max_method)) {
197 max_task->set_comp_level(CompLevel_limited_profile); 221 max_task->set_comp_level(CompLevel_limited_profile);
198 if (PrintTieredEvents) { 222 if (PrintTieredEvents) {