37 (i > Tier4MinInvocationThreshold * scale && i + b > Tier4CompileThreshold * scale);
38 }
39 return true;
40 }
41
42 template<CompLevel level>
43 bool SimpleThresholdPolicy::loop_predicate_helper(int i, int b, double scale) {
44 switch(level) {
45 case CompLevel_none:
46 case CompLevel_limited_profile:
47 return b > Tier3BackEdgeThreshold * scale;
48 case CompLevel_full_profile:
49 return b > Tier4BackEdgeThreshold * scale;
50 }
51 return true;
52 }
53
54 // Simple methods are as good being compiled with C1 as C2.
55 // Determine if a given method is such a case.
56 bool SimpleThresholdPolicy::is_trivial(Method* method) {
57 if (method->is_accessor()) return true;
58 if (method->code() != NULL) {
59 MethodData* mdo = method->method_data();
60 if (mdo != NULL && mdo->num_loops() == 0 &&
61 (method->code_size() < 5 || (mdo->num_blocks() < 4) && (method->code_size() < 15))) {
62 return !mdo->would_profile();
63 }
64 }
65 return false;
66 }
67
68 #endif // SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
|
37 (i > Tier4MinInvocationThreshold * scale && i + b > Tier4CompileThreshold * scale);
38 }
39 return true;
40 }
41
42 template<CompLevel level>
43 bool SimpleThresholdPolicy::loop_predicate_helper(int i, int b, double scale) {
44 switch(level) {
45 case CompLevel_none:
46 case CompLevel_limited_profile:
47 return b > Tier3BackEdgeThreshold * scale;
48 case CompLevel_full_profile:
49 return b > Tier4BackEdgeThreshold * scale;
50 }
51 return true;
52 }
53
54 // Simple methods are as good being compiled with C1 as C2.
55 // Determine if a given method is such a case.
56 bool SimpleThresholdPolicy::is_trivial(Method* method) {
57 if (method->is_accessor() ||
58 method->is_constant_getter()) {
59 return true;
60 }
61 if (method->has_loops() || method->code_size() >= 15) {
62 return false;
63 }
64 MethodData* mdo = method->method_data();
65 if (mdo != NULL && !mdo->would_profile() &&
66 (method->code_size() < 5 || (mdo->num_blocks() < 4))) {
67 return true;
68 }
69 return false;
70 }
71
72 #endif // SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
|