229 }
230 bool profile_calls() {
231 return env()->comp_level() == CompLevel_full_profile &&
232 C1UpdateMethodData && C1ProfileCalls;
233 }
234 bool profile_inlined_calls() {
235 return profile_calls() && C1ProfileInlinedCalls;
236 }
237 bool profile_checkcasts() {
238 return env()->comp_level() == CompLevel_full_profile &&
239 C1UpdateMethodData && C1ProfileCheckcasts;
240 }
241
242 // will compilation make optimistic assumptions that might lead to
243 // deoptimization and that the runtime will account for?
244 bool is_optimistic() const {
245 return !TieredCompilation &&
246 (RangeCheckElimination || UseLoopInvariantCodeMotion) &&
247 method()->method_data()->trap_count(Deoptimization::Reason_none) == 0;
248 }
249 };
250
251
252 // Macro definitions for unified bailout-support
253 // The methods bailout() and bailed_out() are present in all classes
254 // that might bailout, but forward all calls to Compilation
255 #define BAILOUT(msg) { bailout(msg); return; }
256 #define BAILOUT_(msg, res) { bailout(msg); return res; }
257
258 #define CHECK_BAILOUT() { if (bailed_out()) return; }
259 #define CHECK_BAILOUT_(res) { if (bailed_out()) return res; }
260
261
262 class InstructionMark: public StackObj {
263 private:
264 Compilation* _compilation;
265 Instruction* _previous;
266
267 public:
268 InstructionMark(Compilation* compilation, Instruction* instr) {
|
229 }
230 bool profile_calls() {
231 return env()->comp_level() == CompLevel_full_profile &&
232 C1UpdateMethodData && C1ProfileCalls;
233 }
234 bool profile_inlined_calls() {
235 return profile_calls() && C1ProfileInlinedCalls;
236 }
237 bool profile_checkcasts() {
238 return env()->comp_level() == CompLevel_full_profile &&
239 C1UpdateMethodData && C1ProfileCheckcasts;
240 }
241
242 // will compilation make optimistic assumptions that might lead to
243 // deoptimization and that the runtime will account for?
244 bool is_optimistic() const {
245 return !TieredCompilation &&
246 (RangeCheckElimination || UseLoopInvariantCodeMotion) &&
247 method()->method_data()->trap_count(Deoptimization::Reason_none) == 0;
248 }
249
250 ciKlass* cha_exact_type(ciType* type);
251 };
252
253
254 // Macro definitions for unified bailout-support
255 // The methods bailout() and bailed_out() are present in all classes
256 // that might bailout, but forward all calls to Compilation
257 #define BAILOUT(msg) { bailout(msg); return; }
258 #define BAILOUT_(msg, res) { bailout(msg); return res; }
259
260 #define CHECK_BAILOUT() { if (bailed_out()) return; }
261 #define CHECK_BAILOUT_(res) { if (bailed_out()) return res; }
262
263
264 class InstructionMark: public StackObj {
265 private:
266 Compilation* _compilation;
267 Instruction* _previous;
268
269 public:
270 InstructionMark(Compilation* compilation, Instruction* instr) {
|