41 // Set carry flags in the counters (in Method* and MDO). |
41 // Set carry flags in the counters (in Method* and MDO). |
42 inline void handle_counter_overflow(Method* method); |
42 inline void handle_counter_overflow(Method* method); |
43 // Call and loop predicates determine whether a transition to a higher compilation |
43 // Call and loop predicates determine whether a transition to a higher compilation |
44 // level should be performed (pointers to predicate functions are passed to common_TF(). |
44 // level should be performed (pointers to predicate functions are passed to common_TF(). |
45 // Predicates also take compiler load into account. |
45 // Predicates also take compiler load into account. |
46 typedef bool (SimpleThresholdPolicy::*Predicate)(int i, int b, CompLevel cur_level); |
46 typedef bool (SimpleThresholdPolicy::*Predicate)(int i, int b, CompLevel cur_level, Method* method); |
47 bool call_predicate(int i, int b, CompLevel cur_level); |
47 bool call_predicate(int i, int b, CompLevel cur_level, Method* method); |
48 bool loop_predicate(int i, int b, CompLevel cur_level); |
48 bool loop_predicate(int i, int b, CompLevel cur_level, Method* method); |
49 // Common transition function. Given a predicate determines if a method should transition to another level. |
49 // Common transition function. Given a predicate determines if a method should transition to another level. |
50 CompLevel common(Predicate p, Method* method, CompLevel cur_level); |
50 CompLevel common(Predicate p, Method* method, CompLevel cur_level); |
51 // Transition functions. |
51 // Transition functions. |
52 // call_event determines if a method should be compiled at a different |
52 // call_event determines if a method should be compiled at a different |
53 // level with a regular invocation entry. |
53 // level with a regular invocation entry. |
74 // This function tells if it's such a function. |
74 // This function tells if it's such a function. |
75 inline bool is_trivial(Method* method); |
75 inline bool is_trivial(Method* method); |
76 |
76 |
77 // Predicate helpers are used by .*_predicate() methods as well as others. |
77 // Predicate helpers are used by .*_predicate() methods as well as others. |
78 // They check the given counter values, multiplied by the scale against the thresholds. |
78 // They check the given counter values, multiplied by the scale against the thresholds. |
79 template<CompLevel level> static inline bool call_predicate_helper(int i, int b, double scale); |
79 template<CompLevel level> static inline bool call_predicate_helper(int i, int b, double scale, Method* method); |
80 template<CompLevel level> static inline bool loop_predicate_helper(int i, int b, double scale); |
80 template<CompLevel level> static inline bool loop_predicate_helper(int i, int b, double scale, Method* method); |
81 |
81 |
82 // Get a compilation level for a given method. |
82 // Get a compilation level for a given method. |
83 static CompLevel comp_level(Method* method) { |
83 static CompLevel comp_level(Method* method) { |
84 nmethod *nm = method->code(); |
84 nmethod *nm = method->code(); |
85 if (nm != NULL && nm->is_in_use()) { |
85 if (nm != NULL && nm->is_in_use()) { |