174 175 // set during construction 176 unsigned int _has_unsafe_access:1; // May fault due to unsafe access. 177 unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes? 178 179 // Protected by Patching_lock 180 unsigned char _state; // {alive, not_entrant, zombie, unloaded} 181 182 #ifdef ASSERT 183 bool _oops_are_stale; // indicates that it's no longer safe to access oops section 184 #endif 185 186 enum { alive = 0, 187 not_entrant = 1, // uncommon trap has happened but activations may still exist 188 zombie = 2, 189 unloaded = 3 }; 190 191 192 jbyte _scavenge_root_state; 193 194 NOT_PRODUCT(bool _has_debug_info; ) 195 196 // Nmethod Flushing lock. If non-zero, then the nmethod is not removed 197 // and is not made into a zombie. However, once the nmethod is made into 198 // a zombie, it will be locked one final time if CompiledMethodUnload 199 // event processing needs to be done. 200 jint _lock_count; 201 202 // not_entrant method removal. Each mark_sweep pass will update 203 // this mark to current sweep invocation count if it is seen on the 204 // stack. An not_entrant method can be removed when there is no 205 // more activations, i.e., when the _stack_traversal_mark is less than 206 // current sweep traversal index. 207 long _stack_traversal_mark; 208 209 ExceptionCache *_exception_cache; 210 PcDescCache _pc_desc_cache; 211 212 // These are used for compiled synchronized native methods to 213 // locate the owner and stack slot for the BasicLock so that we can 214 // properly revoke the bias of the owner if necessary. They are 215 // needed because there is no debug information for compiled native 312 #ifdef HAVE_DTRACE_H 313 // The method we generate for a dtrace probe has to look 314 // like an nmethod as far as the rest of the system is concerned 315 // which is somewhat unfortunate. 316 static nmethod* new_dtrace_nmethod(methodHandle method, 317 CodeBuffer *code_buffer, 318 int vep_offset, 319 int trap_offset, 320 int frame_complete, 321 int frame_size); 322 323 int trap_offset() const { return _trap_offset; } 324 address trap_address() const { return insts_begin() + _trap_offset; } 325 326 #endif // def HAVE_DTRACE_H 327 328 // accessors 329 methodOop method() const { return _method; } 330 AbstractCompiler* compiler() const { return _compiler; } 331 332 #ifndef PRODUCT 333 bool has_debug_info() const { return _has_debug_info; } 334 void set_has_debug_info(bool f) { _has_debug_info = false; } 335 #endif // NOT PRODUCT 336 337 // type info 338 bool is_nmethod() const { return true; } 339 bool is_java_method() const { return !method()->is_native(); } 340 bool is_native_method() const { return method()->is_native(); } 341 bool is_osr_method() const { return _entry_bci != InvocationEntryBci; } 342 343 bool is_compiled_by_c1() const; 344 bool is_compiled_by_c2() const; 345 bool is_compiled_by_shark() const; 346 347 // boundaries for different parts 348 address consts_begin () const { return header_begin() + _consts_offset ; } 349 address consts_end () const { return header_begin() + code_offset() ; } 350 address insts_begin () const { return header_begin() + code_offset() ; } 351 address insts_end () const { return header_begin() + _stub_offset ; } 352 address stub_begin () const { return header_begin() + _stub_offset ; } 353 address stub_end () const { return header_begin() + _oops_offset ; } 354 address exception_begin () const { return header_begin() + _exception_offset ; } 355 address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } 356 address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } | 174 175 // set during construction 176 unsigned int _has_unsafe_access:1; // May fault due to unsafe access. 177 unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes? 178 179 // Protected by Patching_lock 180 unsigned char _state; // {alive, not_entrant, zombie, unloaded} 181 182 #ifdef ASSERT 183 bool _oops_are_stale; // indicates that it's no longer safe to access oops section 184 #endif 185 186 enum { alive = 0, 187 not_entrant = 1, // uncommon trap has happened but activations may still exist 188 zombie = 2, 189 unloaded = 3 }; 190 191 192 jbyte _scavenge_root_state; 193 194 // Nmethod Flushing lock. If non-zero, then the nmethod is not removed 195 // and is not made into a zombie. However, once the nmethod is made into 196 // a zombie, it will be locked one final time if CompiledMethodUnload 197 // event processing needs to be done. 198 jint _lock_count; 199 200 // not_entrant method removal. Each mark_sweep pass will update 201 // this mark to current sweep invocation count if it is seen on the 202 // stack. An not_entrant method can be removed when there is no 203 // more activations, i.e., when the _stack_traversal_mark is less than 204 // current sweep traversal index. 205 long _stack_traversal_mark; 206 207 ExceptionCache *_exception_cache; 208 PcDescCache _pc_desc_cache; 209 210 // These are used for compiled synchronized native methods to 211 // locate the owner and stack slot for the BasicLock so that we can 212 // properly revoke the bias of the owner if necessary. They are 213 // needed because there is no debug information for compiled native 310 #ifdef HAVE_DTRACE_H 311 // The method we generate for a dtrace probe has to look 312 // like an nmethod as far as the rest of the system is concerned 313 // which is somewhat unfortunate. 314 static nmethod* new_dtrace_nmethod(methodHandle method, 315 CodeBuffer *code_buffer, 316 int vep_offset, 317 int trap_offset, 318 int frame_complete, 319 int frame_size); 320 321 int trap_offset() const { return _trap_offset; } 322 address trap_address() const { return insts_begin() + _trap_offset; } 323 324 #endif // def HAVE_DTRACE_H 325 326 // accessors 327 methodOop method() const { return _method; } 328 AbstractCompiler* compiler() const { return _compiler; } 329 330 // type info 331 bool is_nmethod() const { return true; } 332 bool is_java_method() const { return !method()->is_native(); } 333 bool is_native_method() const { return method()->is_native(); } 334 bool is_osr_method() const { return _entry_bci != InvocationEntryBci; } 335 336 bool is_compiled_by_c1() const; 337 bool is_compiled_by_c2() const; 338 bool is_compiled_by_shark() const; 339 340 // boundaries for different parts 341 address consts_begin () const { return header_begin() + _consts_offset ; } 342 address consts_end () const { return header_begin() + code_offset() ; } 343 address insts_begin () const { return header_begin() + code_offset() ; } 344 address insts_end () const { return header_begin() + _stub_offset ; } 345 address stub_begin () const { return header_begin() + _stub_offset ; } 346 address stub_end () const { return header_begin() + _oops_offset ; } 347 address exception_begin () const { return header_begin() + _exception_offset ; } 348 address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } 349 address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } |