80 inline bool is_client_compilation_mode_vm() {
81 return Compilation_mode == CompMode_client;
82 }
83
84 inline bool is_c1_compile(int comp_level) {
85 return comp_level > CompLevel_none && comp_level < CompLevel_full_optimization;
86 }
87
88 inline bool is_c2_compile(int comp_level) {
89 return comp_level == CompLevel_full_optimization;
90 }
91
92 inline bool is_highest_tier_compile(int comp_level) {
93 return comp_level == CompLevel_highest_tier;
94 }
95
96 inline bool is_compile(int comp_level) {
97 return is_c1_compile(comp_level) || is_c2_compile(comp_level);
98 }
99
100 // States of Restricted Transactional Memory usage.
101 enum RTMState {
102 NoRTM = 0x2, // Don't use RTM
103 UseRTM = 0x1, // Use RTM
104 ProfileRTM = 0x0 // Use RTM with abort ratio calculation
105 };
106
107 #ifndef INCLUDE_RTM_OPT
108 #define INCLUDE_RTM_OPT 0
109 #endif
110 #if INCLUDE_RTM_OPT
111 #define RTM_OPT_ONLY(code) code
112 #else
113 #define RTM_OPT_ONLY(code)
114 #endif
115
116 class CompilerConfig : public AllStatic {
117 public:
118 // Scale compile thresholds
119 // Returns threshold scaled with CompileThresholdScaling
|
80 inline bool is_client_compilation_mode_vm() {
81 return Compilation_mode == CompMode_client;
82 }
83
84 inline bool is_c1_compile(int comp_level) {
85 return comp_level > CompLevel_none && comp_level < CompLevel_full_optimization;
86 }
87
88 inline bool is_c2_compile(int comp_level) {
89 return comp_level == CompLevel_full_optimization;
90 }
91
92 inline bool is_highest_tier_compile(int comp_level) {
93 return comp_level == CompLevel_highest_tier;
94 }
95
96 inline bool is_compile(int comp_level) {
97 return is_c1_compile(comp_level) || is_c2_compile(comp_level);
98 }
99
100 inline char tier_digit(int comp_level) {
101 return (char)(comp_level + (int)'0');
102 }
103
104 // States of Restricted Transactional Memory usage.
105 enum RTMState {
106 NoRTM = 0x2, // Don't use RTM
107 UseRTM = 0x1, // Use RTM
108 ProfileRTM = 0x0 // Use RTM with abort ratio calculation
109 };
110
111 #ifndef INCLUDE_RTM_OPT
112 #define INCLUDE_RTM_OPT 0
113 #endif
114 #if INCLUDE_RTM_OPT
115 #define RTM_OPT_ONLY(code) code
116 #else
117 #define RTM_OPT_ONLY(code)
118 #endif
119
120 class CompilerConfig : public AllStatic {
121 public:
122 // Scale compile thresholds
123 // Returns threshold scaled with CompileThresholdScaling
|