157 * - TieredRateUpdateMinTime and TieredRateUpdateMaxTime are parameters of the rate computation. 158 * Basically, the rate is not computed more frequently than TieredRateUpdateMinTime and is considered 159 * to be zero if no events occurred in TieredRateUpdateMaxTime. 160 */ 161 162 163 class AdvancedThresholdPolicy : public SimpleThresholdPolicy { 164 jlong _start_time; 165 166 // Call and loop predicates determine whether a transition to a higher compilation 167 // level should be performed (pointers to predicate functions are passed to common(). 168 // Predicates also take compiler load into account. 169 typedef bool (AdvancedThresholdPolicy::*Predicate)(int i, int b, CompLevel cur_level, Method* method); 170 bool call_predicate(int i, int b, CompLevel cur_level, Method* method); 171 bool loop_predicate(int i, int b, CompLevel cur_level, Method* method); 172 // Common transition function. Given a predicate determines if a method should transition to another level. 173 CompLevel common(Predicate p, Method* method, CompLevel cur_level, bool disable_feedback = false); 174 // Transition functions. 175 // call_event determines if a method should be compiled at a different 176 // level with a regular invocation entry. 177 CompLevel call_event(Method* method, CompLevel cur_level); 178 // loop_event checks if a method should be OSR compiled at a different 179 // level. 180 CompLevel loop_event(Method* method, CompLevel cur_level); 181 // Has a method been long around? 182 // We don't remove old methods from the compile queue even if they have 183 // very low activity (see select_task()). 184 inline bool is_old(Method* method); 185 // Was a given method inactive for a given number of milliseconds. 186 // If it is, we would remove it from the queue (see select_task()). 187 inline bool is_stale(jlong t, jlong timeout, Method* m); 188 // Compute the weight of the method for the compilation scheduling 189 inline double weight(Method* method); 190 // Apply heuristics and return true if x should be compiled before y 191 inline bool compare_methods(Method* x, Method* y); 192 // Compute event rate for a given method. The rate is the number of event (invocations + backedges) 193 // per millisecond. 194 inline void update_rate(jlong t, Method* m); 195 // Compute threshold scaling coefficient 196 inline double threshold_scale(CompLevel level, int feedback_k); 197 // If a method is old enough and is still in the interpreter we would want to 198 // start profiling without waiting for the compiled method to arrive. This function 199 // determines whether we should do that. 200 inline bool should_create_mdo(Method* method, CompLevel cur_level); | 157 * - TieredRateUpdateMinTime and TieredRateUpdateMaxTime are parameters of the rate computation. 158 * Basically, the rate is not computed more frequently than TieredRateUpdateMinTime and is considered 159 * to be zero if no events occurred in TieredRateUpdateMaxTime. 160 */ 161 162 163 class AdvancedThresholdPolicy : public SimpleThresholdPolicy { 164 jlong _start_time; 165 166 // Call and loop predicates determine whether a transition to a higher compilation 167 // level should be performed (pointers to predicate functions are passed to common(). 168 // Predicates also take compiler load into account. 169 typedef bool (AdvancedThresholdPolicy::*Predicate)(int i, int b, CompLevel cur_level, Method* method); 170 bool call_predicate(int i, int b, CompLevel cur_level, Method* method); 171 bool loop_predicate(int i, int b, CompLevel cur_level, Method* method); 172 // Common transition function. Given a predicate determines if a method should transition to another level. 173 CompLevel common(Predicate p, Method* method, CompLevel cur_level, bool disable_feedback = false); 174 // Transition functions. 175 // call_event determines if a method should be compiled at a different 176 // level with a regular invocation entry. 177 CompLevel call_event(Method* method, CompLevel cur_level, JavaThread * thread); 178 // loop_event checks if a method should be OSR compiled at a different 179 // level. 180 CompLevel loop_event(Method* method, CompLevel cur_level, JavaThread * thread); 181 // Has a method been long around? 182 // We don't remove old methods from the compile queue even if they have 183 // very low activity (see select_task()). 184 inline bool is_old(Method* method); 185 // Was a given method inactive for a given number of milliseconds. 186 // If it is, we would remove it from the queue (see select_task()). 187 inline bool is_stale(jlong t, jlong timeout, Method* m); 188 // Compute the weight of the method for the compilation scheduling 189 inline double weight(Method* method); 190 // Apply heuristics and return true if x should be compiled before y 191 inline bool compare_methods(Method* x, Method* y); 192 // Compute event rate for a given method. The rate is the number of event (invocations + backedges) 193 // per millisecond. 194 inline void update_rate(jlong t, Method* m); 195 // Compute threshold scaling coefficient 196 inline double threshold_scale(CompLevel level, int feedback_k); 197 // If a method is old enough and is still in the interpreter we would want to 198 // start profiling without waiting for the compiled method to arrive. This function 199 // determines whether we should do that. 200 inline bool should_create_mdo(Method* method, CompLevel cur_level); |