< prev index next >

src/hotspot/share/code/nmethod.hpp

Print this page




  95   int _metadata_offset;                   // embedded meta data table
  96   int _scopes_data_offset;
  97   int _scopes_pcs_offset;
  98   int _dependencies_offset;
  99   int _handler_table_offset;
 100   int _nul_chk_table_offset;
 101 #if INCLUDE_JVMCI
 102   int _speculations_offset;
 103   int _jvmci_data_offset;
 104 #endif
 105   int _nmethod_end_offset;
 106 
 107   int code_offset() const { return (address) code_begin() - header_begin(); }
 108 
 109   // location in frame (offset for sp) that deopt can store the original
 110   // pc during a deopt.
 111   int _orig_pc_offset;
 112 
 113   int _compile_id;                           // which compilation made this nmethod
 114   int _comp_level;                           // compilation level






 115 
 116   // protected by CodeCache_lock
 117   bool _has_flushed_dependencies;            // Used for maintenance of dependencies (CodeCache_lock)
 118 
 119   // used by jvmti to track if an unload event has been posted for this nmethod.
 120   bool _unload_reported;
 121 
 122   // Protected by Patching_lock
 123   volatile signed char _state;               // {not_installed, in_use, not_entrant, zombie, unloaded}
 124 
 125 #ifdef ASSERT
 126   bool _oops_are_stale;  // indicates that it's no longer safe to access oops section
 127 #endif
 128 
 129 #if INCLUDE_RTM_OPT
 130   // RTM state at compile time. Used during deoptimization to decide
 131   // whether to restart collecting RTM locking abort statistic again.
 132   RTMState _rtm_state;
 133 #endif
 134 


 418   // Relocation support
 419 private:
 420   void fix_oop_relocations(address begin, address end, bool initialize_immediates);
 421   inline void initialize_immediate_oop(oop* dest, jobject handle);
 422 
 423 public:
 424   void fix_oop_relocations(address begin, address end) { fix_oop_relocations(begin, end, false); }
 425   void fix_oop_relocations()                           { fix_oop_relocations(NULL, NULL, false); }
 426 
 427   // Sweeper support
 428   long  stack_traversal_mark()                    { return _stack_traversal_mark; }
 429   void  set_stack_traversal_mark(long l)          { _stack_traversal_mark = l; }
 430 
 431   // On-stack replacement support
 432   int   osr_entry_bci() const                     { assert(is_osr_method(), "wrong kind of nmethod"); return _entry_bci; }
 433   address  osr_entry() const                      { assert(is_osr_method(), "wrong kind of nmethod"); return _osr_entry_point; }
 434   void  invalidate_osr_method();
 435   nmethod* osr_link() const                       { return _osr_link; }
 436   void     set_osr_link(nmethod *n)               { _osr_link = n; }
 437 


 438   // Verify calls to dead methods have been cleaned.
 439   void verify_clean_inline_caches();
 440 
 441   // unlink and deallocate this nmethod
 442   // Only NMethodSweeper class is expected to use this. NMethodSweeper is not
 443   // expected to use any other private methods/data in this class.
 444 
 445  protected:
 446   void flush();
 447 
 448  public:
 449   // When true is returned, it is unsafe to remove this nmethod even if
 450   // it is a zombie, since the VM or the ServiceThread might still be
 451   // using it.
 452   bool is_locked_by_vm() const                    { return _lock_count >0; }
 453 
 454   // See comment at definition of _last_seen_on_stack
 455   void mark_as_seen_on_stack();
 456   bool can_convert_to_zombie();
 457 
 458   // Evolution support. We make old (discarded) compiled methods point to new Method*s.
 459   void set_method(Method* method) { _method = method; }
 460 
 461 #if INCLUDE_JVMCI
 462   // Gets the JVMCI name of this nmethod.
 463   const char* jvmci_name();
 464 
 465   // Records the pending failed speculation in the
 466   // JVMCI speculation log associated with this nmethod.
 467   void update_speculation(JavaThread* thread);
 468 
 469   // Gets the data specific to a JVMCI compiled method.
 470   // This returns a non-NULL value iff this nmethod was
 471   // compiled by the JVMCI compiler.
 472   JVMCINMethodData* jvmci_nmethod_data() const {
 473     return jvmci_data_size() == 0 ? NULL : (JVMCINMethodData*) jvmci_data_begin();
 474   }
 475 #endif
 476 
 477  public:
 478   void oops_do(OopClosure* f) { oops_do(f, false); }
 479   void oops_do(OopClosure* f, bool allow_dead);

 480 
 481   bool test_set_oops_do_mark();
 482   static void oops_do_marking_prologue();
 483   static void oops_do_marking_epilogue();
 484   static bool oops_do_marking_is_active() { return _oops_do_mark_nmethods != NULL; }
 485   bool test_oops_do_mark() { return _oops_do_mark_link != NULL; }
 486 
 487  private:
 488   ScopeDesc* scope_desc_in(address begin, address end);
 489 
 490   address* orig_pc_addr(const frame* fr);
 491 
 492  public:
 493   // copying of debugging information
 494   void copy_scopes_pcs(PcDesc* pcs, int count);
 495   void copy_scopes_data(address buffer, int size);
 496 
 497   // Accessor/mutator for the original pc of a frame before a frame was deopted.
 498   address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }
 499   void    set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; }
 500 
 501   // jvmti support:
 502   void post_compiled_method_load_event();
 503   jmethodID get_and_cache_jmethod_id();
 504 
 505   // verify operations
 506   void verify();
 507   void verify_scopes();
 508   void verify_interrupt_point(address interrupt_point);
 509 
 510   // Disassemble this nmethod with additional debug information, e.g. information about blocks.
 511   void decode2(outputStream* st) const;
 512   void print_constant_pool(outputStream* st);
 513 
 514   // Avoid hiding of parent's 'decode(outputStream*)' method.
 515   void decode(outputStream* st) const { decode2(st); } // just delegate here.
 516 
 517   // printing support
 518   void print()                          const;
 519   void print(outputStream* st)          const;




  95   int _metadata_offset;                   // embedded meta data table
  96   int _scopes_data_offset;
  97   int _scopes_pcs_offset;
  98   int _dependencies_offset;
  99   int _handler_table_offset;
 100   int _nul_chk_table_offset;
 101 #if INCLUDE_JVMCI
 102   int _speculations_offset;
 103   int _jvmci_data_offset;
 104 #endif
 105   int _nmethod_end_offset;
 106 
 107   int code_offset() const { return (address) code_begin() - header_begin(); }
 108 
 109   // location in frame (offset for sp) that deopt can store the original
 110   // pc during a deopt.
 111   int _orig_pc_offset;
 112 
 113   int _compile_id;                           // which compilation made this nmethod
 114   int _comp_level;                           // compilation level
 115   int _nr_oops;
 116  public:
 117   int nr_oops() const { return _nr_oops; }
 118   void verify_nr_oops();
 119   int count_oops();
 120  private:
 121 
 122   // protected by CodeCache_lock
 123   bool _has_flushed_dependencies;            // Used for maintenance of dependencies (CodeCache_lock)
 124 
 125   // used by jvmti to track if an unload event has been posted for this nmethod.
 126   bool _unload_reported;
 127 
 128   // Protected by Patching_lock
 129   volatile signed char _state;               // {not_installed, in_use, not_entrant, zombie, unloaded}
 130 
 131 #ifdef ASSERT
 132   bool _oops_are_stale;  // indicates that it's no longer safe to access oops section
 133 #endif
 134 
 135 #if INCLUDE_RTM_OPT
 136   // RTM state at compile time. Used during deoptimization to decide
 137   // whether to restart collecting RTM locking abort statistic again.
 138   RTMState _rtm_state;
 139 #endif
 140 


 424   // Relocation support
 425 private:
 426   void fix_oop_relocations(address begin, address end, bool initialize_immediates);
 427   inline void initialize_immediate_oop(oop* dest, jobject handle);
 428 
 429 public:
 430   void fix_oop_relocations(address begin, address end) { fix_oop_relocations(begin, end, false); }
 431   void fix_oop_relocations()                           { fix_oop_relocations(NULL, NULL, false); }
 432 
 433   // Sweeper support
 434   long  stack_traversal_mark()                    { return _stack_traversal_mark; }
 435   void  set_stack_traversal_mark(long l)          { _stack_traversal_mark = l; }
 436 
 437   // On-stack replacement support
 438   int   osr_entry_bci() const                     { assert(is_osr_method(), "wrong kind of nmethod"); return _entry_bci; }
 439   address  osr_entry() const                      { assert(is_osr_method(), "wrong kind of nmethod"); return _osr_entry_point; }
 440   void  invalidate_osr_method();
 441   nmethod* osr_link() const                       { return _osr_link; }
 442   void     set_osr_link(nmethod *n)               { _osr_link = n; }
 443 
 444   void set_immediate_oops_patched(int nr)         { _nr_oops += nr; }
 445 
 446   // Verify calls to dead methods have been cleaned.
 447   void verify_clean_inline_caches();
 448 
 449   // unlink and deallocate this nmethod
 450   // Only NMethodSweeper class is expected to use this. NMethodSweeper is not
 451   // expected to use any other private methods/data in this class.
 452 
 453  protected:
 454   void flush();
 455 
 456  public:
 457   // When true is returned, it is unsafe to remove this nmethod even if
 458   // it is a zombie, since the VM or the ServiceThread might still be
 459   // using it.
 460   bool is_locked_by_vm() const                    { return _lock_count >0; }
 461 
 462   // See comment at definition of _last_seen_on_stack
 463   void mark_as_seen_on_stack();
 464   bool can_convert_to_zombie();
 465 
 466   // Evolution support. We make old (discarded) compiled methods point to new Method*s.
 467   void set_method(Method* method) { _method = method; }
 468 
 469 #if INCLUDE_JVMCI
 470   // Gets the JVMCI name of this nmethod.
 471   const char* jvmci_name();
 472 
 473   // Records the pending failed speculation in the
 474   // JVMCI speculation log associated with this nmethod.
 475   void update_speculation(JavaThread* thread);
 476 
 477   // Gets the data specific to a JVMCI compiled method.
 478   // This returns a non-NULL value iff this nmethod was
 479   // compiled by the JVMCI compiler.
 480   JVMCINMethodData* jvmci_nmethod_data() const {
 481     return jvmci_data_size() == 0 ? NULL : (JVMCINMethodData*) jvmci_data_begin();
 482   }
 483 #endif
 484 
 485  public:
 486   void oops_do_keepalive(OopClosure* f, bool keepalive) { oops_do(f, false, false, keepalive); }
 487   void oops_do(OopClosure* f) { oops_do(f, false, false); }
 488   void oops_do(OopClosure* f, bool allow_dead, bool allow_null = false, bool shadow_is_strong = false);
 489 
 490   bool test_set_oops_do_mark();
 491   static void oops_do_marking_prologue();
 492   static void oops_do_marking_epilogue();
 493   static bool oops_do_marking_is_active() { return _oops_do_mark_nmethods != NULL; }
 494   bool test_oops_do_mark() { return _oops_do_mark_link != NULL; }
 495 
 496  private:
 497   ScopeDesc* scope_desc_in(address begin, address end);
 498 


 499  public:
 500   // copying of debugging information
 501   void copy_scopes_pcs(PcDesc* pcs, int count);
 502   void copy_scopes_data(address buffer, int size);
 503 
 504   int orig_pc_offset() { return _orig_pc_offset; }


 505 
 506   // jvmti support:
 507   void post_compiled_method_load_event();
 508   jmethodID get_and_cache_jmethod_id();
 509 
 510   // verify operations
 511   void verify();
 512   void verify_scopes();
 513   void verify_interrupt_point(address interrupt_point);
 514 
 515   // Disassemble this nmethod with additional debug information, e.g. information about blocks.
 516   void decode2(outputStream* st) const;
 517   void print_constant_pool(outputStream* st);
 518 
 519   // Avoid hiding of parent's 'decode(outputStream*)' method.
 520   void decode(outputStream* st) const { decode2(st); } // just delegate here.
 521 
 522   // printing support
 523   void print()                          const;
 524   void print(outputStream* st)          const;


< prev index next >