206 // allowed to advance state |
206 // allowed to advance state |
207 in_use = 0, // executable nmethod |
207 in_use = 0, // executable nmethod |
208 not_used = 1, // not entrant, but revivable |
208 not_used = 1, // not entrant, but revivable |
209 not_entrant = 2, // marked for deoptimization but activations may still exist, |
209 not_entrant = 2, // marked for deoptimization but activations may still exist, |
210 // will be transformed to zombie when all activations are gone |
210 // will be transformed to zombie when all activations are gone |
211 zombie = 3, // no activations exist, nmethod is ready for purge |
211 unloaded = 3, // there should be no activations, should not be called, will be |
212 unloaded = 4 // there should be no activations, should not be called, |
212 // transformed to zombie by the sweeper, when not "locked in vm". |
213 // will be transformed to zombie immediately |
213 zombie = 4 // no activations exist, nmethod is ready for purge |
214 }; |
214 }; |
215 |
215 |
216 virtual bool is_in_use() const = 0; |
216 virtual bool is_in_use() const = 0; |
217 virtual bool is_not_installed() const = 0; |
|
218 virtual int comp_level() const = 0; |
217 virtual int comp_level() const = 0; |
219 virtual int compile_id() const = 0; |
218 virtual int compile_id() const = 0; |
220 |
219 |
221 virtual address verified_entry_point() const = 0; |
220 virtual address verified_entry_point() const = 0; |
222 virtual void log_identity(xmlStream* log) const = 0; |
221 virtual void log_identity(xmlStream* log) const = 0; |
243 ScopeDesc* scope_desc_near(address pc); |
242 ScopeDesc* scope_desc_near(address pc); |
244 |
243 |
245 bool is_at_poll_return(address pc); |
244 bool is_at_poll_return(address pc); |
246 bool is_at_poll_or_poll_return(address pc); |
245 bool is_at_poll_or_poll_return(address pc); |
247 |
246 |
248 bool is_marked_for_deoptimization() const { return _mark_for_deoptimization_status != not_marked; } |
247 bool is_marked_for_deoptimization() const { return _mark_for_deoptimization_status != not_marked; } |
249 void mark_for_deoptimization(bool inc_recompile_counts = true) { |
248 void mark_for_deoptimization(bool inc_recompile_counts = true); |
250 _mark_for_deoptimization_status = (inc_recompile_counts ? deoptimize : deoptimize_noupdate); |
249 |
251 } |
|
252 bool update_recompile_counts() const { |
250 bool update_recompile_counts() const { |
253 // Update recompile counts when either the update is explicitly requested (deoptimize) |
251 // Update recompile counts when either the update is explicitly requested (deoptimize) |
254 // or the nmethod is not marked for deoptimization at all (not_marked). |
252 // or the nmethod is not marked for deoptimization at all (not_marked). |
255 // The latter happens during uncommon traps when deoptimized nmethod is made not entrant. |
253 // The latter happens during uncommon traps when deoptimized nmethod is made not entrant. |
256 return _mark_for_deoptimization_status != deoptimize_noupdate; |
254 return _mark_for_deoptimization_status != deoptimize_noupdate; |
348 } |
346 } |
349 |
347 |
350 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f); |
348 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f); |
351 |
349 |
352 // implicit exceptions support |
350 // implicit exceptions support |
353 virtual address continuation_for_implicit_exception(address pc) { return NULL; } |
351 address continuation_for_implicit_div0_exception(address pc) { return continuation_for_implicit_exception(pc, true); } |
|
352 address continuation_for_implicit_null_exception(address pc) { return continuation_for_implicit_exception(pc, false); } |
354 |
353 |
355 static address get_deopt_original_pc(const frame* fr); |
354 static address get_deopt_original_pc(const frame* fr); |
356 |
355 |
357 // Inline cache support for class unloading and nmethod unloading |
356 // Inline cache support for class unloading and nmethod unloading |
358 private: |
357 private: |
359 bool cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all); |
358 bool cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all); |
|
359 |
|
360 address continuation_for_implicit_exception(address pc, bool for_div0_check); |
360 |
361 |
361 public: |
362 public: |
362 // Serial version used by sweeper and whitebox test |
363 // Serial version used by sweeper and whitebox test |
363 void cleanup_inline_caches(bool clean_all); |
364 void cleanup_inline_caches(bool clean_all); |
364 |
365 |