66 friend class VMStructs;
67 friend class JVMCIVMStructs;
68 friend class NMethodSweeper;
69 friend class CodeCache; // scavengable oops
70 friend class JVMCINMethodData;
71 private:
72
73 // Shared fields for all nmethod's
74 int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method
75 jmethodID _jmethod_id; // Cache of method()->jmethod_id()
76
77 // To support simple linked-list chaining of nmethods:
78 nmethod* _osr_link; // from InstanceKlass::osr_nmethods_head
79
80 static nmethod* volatile _oops_do_mark_nmethods;
81 nmethod* volatile _oops_do_mark_link;
82
83 // offsets for entry points
84 address _entry_point; // entry point with class check
85 address _verified_entry_point; // entry point without class check
86 address _verified_value_entry_point; // value type entry point (unpack all value args) without class check
87 address _verified_value_ro_entry_point; // value type entry point (unpack receiver only) without class check
88 address _osr_entry_point; // entry point for on stack replacement
89
90 // Offsets for different nmethod parts
91 int _exception_offset;
92 // Offset of the unwind handler if it exists
93 int _unwind_handler_offset;
94
95 int _consts_offset;
96 int _stub_offset;
97 int _oops_offset; // offset to where embedded oop table begins (inside data)
98 int _metadata_offset; // embedded meta data table
99 int _scopes_data_offset;
100 int _scopes_pcs_offset;
101 int _dependencies_offset;
102 int _handler_table_offset;
103 int _nul_chk_table_offset;
104 #if INCLUDE_JVMCI
105 int _speculations_offset;
321 #endif
322
323 int oops_count() const { assert(oops_size() % oopSize == 0, ""); return (oops_size() / oopSize) + 1; }
324 int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
325
326 int total_size () const;
327
328 void dec_hotness_counter() { _hotness_counter--; }
329 void set_hotness_counter(int val) { _hotness_counter = val; }
330 int hotness_counter() const { return _hotness_counter; }
331
332 // Containment
333 bool oops_contains (oop* addr) const { return oops_begin () <= addr && addr < oops_end (); }
334 bool metadata_contains (Metadata** addr) const { return metadata_begin () <= addr && addr < metadata_end (); }
335 bool scopes_data_contains (address addr) const { return scopes_data_begin () <= addr && addr < scopes_data_end (); }
336 bool scopes_pcs_contains (PcDesc* addr) const { return scopes_pcs_begin () <= addr && addr < scopes_pcs_end (); }
337
338 // entry points
339 address entry_point() const { return _entry_point; } // normal entry point
340 address verified_entry_point() const { return _verified_entry_point; } // normal entry point without class check
341 address verified_value_entry_point() const { return _verified_value_entry_point; } // value type entry point (unpack all value args) without class check
342 address verified_value_ro_entry_point() const { return _verified_value_ro_entry_point; } // value type entry point (only unpack receiver) without class check
343
344 // flag accessing and manipulation
345 bool is_not_installed() const { return _state == not_installed; }
346 bool is_in_use() const { return _state <= in_use; }
347 bool is_alive() const { return _state < zombie; }
348 bool is_not_entrant() const { return _state == not_entrant; }
349 bool is_zombie() const { return _state == zombie; }
350 bool is_unloaded() const { return _state == unloaded; }
351
352 void clear_unloading_state();
353 virtual bool is_unloading();
354 virtual void do_unloading(bool unloading_occurred);
355
356 #if INCLUDE_RTM_OPT
357 // rtm state accessing and manipulating
358 RTMState rtm_state() const { return _rtm_state; }
359 void set_rtm_state(RTMState state) { _rtm_state = state; }
360 #endif
|
66 friend class VMStructs;
67 friend class JVMCIVMStructs;
68 friend class NMethodSweeper;
69 friend class CodeCache; // scavengable oops
70 friend class JVMCINMethodData;
71 private:
72
73 // Shared fields for all nmethod's
74 int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method
75 jmethodID _jmethod_id; // Cache of method()->jmethod_id()
76
77 // To support simple linked-list chaining of nmethods:
78 nmethod* _osr_link; // from InstanceKlass::osr_nmethods_head
79
80 static nmethod* volatile _oops_do_mark_nmethods;
81 nmethod* volatile _oops_do_mark_link;
82
83 // offsets for entry points
84 address _entry_point; // entry point with class check
85 address _verified_entry_point; // entry point without class check
86 address _value_entry_point; // value type entry point (unpack all value args) with class check
87 address _verified_value_entry_point; // value type entry point (unpack all value args) without class check
88 address _verified_value_ro_entry_point; // value type entry point (unpack receiver only) without class check
89 address _osr_entry_point; // entry point for on stack replacement
90
91 // Offsets for different nmethod parts
92 int _exception_offset;
93 // Offset of the unwind handler if it exists
94 int _unwind_handler_offset;
95
96 int _consts_offset;
97 int _stub_offset;
98 int _oops_offset; // offset to where embedded oop table begins (inside data)
99 int _metadata_offset; // embedded meta data table
100 int _scopes_data_offset;
101 int _scopes_pcs_offset;
102 int _dependencies_offset;
103 int _handler_table_offset;
104 int _nul_chk_table_offset;
105 #if INCLUDE_JVMCI
106 int _speculations_offset;
322 #endif
323
324 int oops_count() const { assert(oops_size() % oopSize == 0, ""); return (oops_size() / oopSize) + 1; }
325 int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
326
327 int total_size () const;
328
329 void dec_hotness_counter() { _hotness_counter--; }
330 void set_hotness_counter(int val) { _hotness_counter = val; }
331 int hotness_counter() const { return _hotness_counter; }
332
333 // Containment
334 bool oops_contains (oop* addr) const { return oops_begin () <= addr && addr < oops_end (); }
335 bool metadata_contains (Metadata** addr) const { return metadata_begin () <= addr && addr < metadata_end (); }
336 bool scopes_data_contains (address addr) const { return scopes_data_begin () <= addr && addr < scopes_data_end (); }
337 bool scopes_pcs_contains (PcDesc* addr) const { return scopes_pcs_begin () <= addr && addr < scopes_pcs_end (); }
338
339 // entry points
340 address entry_point() const { return _entry_point; } // normal entry point
341 address verified_entry_point() const { return _verified_entry_point; } // normal entry point without class check
342 address value_entry_point() const { return _value_entry_point; } // value type entry point (unpack all value args)
343 address verified_value_entry_point() const { return _verified_value_entry_point; } // value type entry point (unpack all value args) without class check
344 address verified_value_ro_entry_point() const { return _verified_value_ro_entry_point; } // value type entry point (only unpack receiver) without class check
345
346 // flag accessing and manipulation
347 bool is_not_installed() const { return _state == not_installed; }
348 bool is_in_use() const { return _state <= in_use; }
349 bool is_alive() const { return _state < zombie; }
350 bool is_not_entrant() const { return _state == not_entrant; }
351 bool is_zombie() const { return _state == zombie; }
352 bool is_unloaded() const { return _state == unloaded; }
353
354 void clear_unloading_state();
355 virtual bool is_unloading();
356 virtual void do_unloading(bool unloading_occurred);
357
358 #if INCLUDE_RTM_OPT
359 // rtm state accessing and manipulating
360 RTMState rtm_state() const { return _rtm_state; }
361 void set_rtm_state(RTMState state) { _rtm_state = state; }
362 #endif
|