250 |
250 |
251 // helper methods |
251 // helper methods |
252 void* operator new(size_t size, int nmethod_size); |
252 void* operator new(size_t size, int nmethod_size); |
253 |
253 |
254 const char* reloc_string_for(u_char* begin, u_char* end); |
254 const char* reloc_string_for(u_char* begin, u_char* end); |
255 void make_not_entrant_or_zombie(int state); |
255 // Returns true if this thread changed the state of the nmethod or |
|
256 // false if another thread performed the transition. |
|
257 bool make_not_entrant_or_zombie(int state); |
256 void inc_decompile_count(); |
258 void inc_decompile_count(); |
257 |
259 |
258 // used to check that writes to nmFlags are done consistently. |
260 // used to check that writes to nmFlags are done consistently. |
259 static void check_safepoint() PRODUCT_RETURN; |
261 static void check_safepoint() PRODUCT_RETURN; |
260 |
262 |
373 bool is_alive() const { return flags.state == alive || flags.state == not_entrant; } |
375 bool is_alive() const { return flags.state == alive || flags.state == not_entrant; } |
374 bool is_not_entrant() const { return flags.state == not_entrant; } |
376 bool is_not_entrant() const { return flags.state == not_entrant; } |
375 bool is_zombie() const { return flags.state == zombie; } |
377 bool is_zombie() const { return flags.state == zombie; } |
376 bool is_unloaded() const { return flags.state == unloaded; } |
378 bool is_unloaded() const { return flags.state == unloaded; } |
377 |
379 |
378 // Make the nmethod non entrant. The nmethod will continue to be alive. |
380 // Make the nmethod non entrant. The nmethod will continue to be |
379 // It is used when an uncommon trap happens. |
381 // alive. It is used when an uncommon trap happens. Returns true |
380 void make_not_entrant() { make_not_entrant_or_zombie(not_entrant); } |
382 // if this thread changed the state of the nmethod or false if |
381 void make_zombie() { make_not_entrant_or_zombie(zombie); } |
383 // another thread performed the transition. |
|
384 bool make_not_entrant() { return make_not_entrant_or_zombie(not_entrant); } |
|
385 bool make_zombie() { return make_not_entrant_or_zombie(zombie); } |
382 |
386 |
383 // used by jvmti to track if the unload event has been reported |
387 // used by jvmti to track if the unload event has been reported |
384 bool unload_reported() { return _unload_reported; } |
388 bool unload_reported() { return _unload_reported; } |
385 void set_unload_reported() { _unload_reported = true; } |
389 void set_unload_reported() { _unload_reported = true; } |
386 |
390 |
561 void print_on(outputStream* st, const char* title) const; |
565 void print_on(outputStream* st, const char* title) const; |
562 |
566 |
563 // Logging |
567 // Logging |
564 void log_identity(xmlStream* log) const; |
568 void log_identity(xmlStream* log) const; |
565 void log_new_nmethod() const; |
569 void log_new_nmethod() const; |
566 void log_state_change(int state) const; |
570 void log_state_change() const; |
567 |
571 |
568 // Prints a comment for one native instruction (reloc info, pc desc) |
572 // Prints a comment for one native instruction (reloc info, pc desc) |
569 void print_code_comment_on(outputStream* st, int column, address begin, address end); |
573 void print_code_comment_on(outputStream* st, int column, address begin, address end); |
570 static void print_statistics() PRODUCT_RETURN; |
574 static void print_statistics() PRODUCT_RETURN; |
571 |
575 |