src/share/vm/code/nmethod.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6893081 Sdiff src/share/vm/code

src/share/vm/code/nmethod.hpp

Print this page
rev 1081 : imported patch indy-cleanup-6893081.patch


  76   PcDesc* last_pc_desc() { return _last_pc_desc; }
  77 };
  78 
  79 
  80 // nmethods (native methods) are the compiled code versions of Java methods.
  81 
  82 struct nmFlags {
  83   friend class VMStructs;
  84   unsigned int version:8;                 // version number (0 = first version)
  85   unsigned int level:4;                   // optimization level
  86   unsigned int age:4;                     // age (in # of sweep steps)
  87 
  88   unsigned int state:2;                   // {alive, zombie, unloaded)
  89 
  90   unsigned int isUncommonRecompiled:1;    // recompiled because of uncommon trap?
  91   unsigned int isToBeRecompiled:1;        // to be recompiled as soon as it matures
  92   unsigned int hasFlushedDependencies:1;  // Used for maintenance of dependencies
  93   unsigned int markedForReclamation:1;    // Used by NMethodSweeper
  94 
  95   unsigned int has_unsafe_access:1;       // May fault due to unsafe access.

  96 
  97   void clear();
  98 };
  99 
 100 
 101 // A nmethod contains:
 102 //  - header                 (the nmethod structure)
 103 //  [Relocation]
 104 //  - relocation information
 105 //  - constant part          (doubles, longs and floats used in nmethod)
 106 //  [Code]
 107 //  - code body
 108 //  - exception handler
 109 //  - stub code
 110 //  [Debugging information]
 111 //  - oop array
 112 //  - data array
 113 //  - pcs
 114 //  [Exception handler table]
 115 //  - handler entry point array


 388   void  mark_for_deoptimization()                 { _markedForDeoptimization = true; }
 389 
 390   void  make_unloaded(BoolObjectClosure* is_alive, oop cause);
 391 
 392   bool has_dependencies()                         { return dependencies_size() != 0; }
 393   void flush_dependencies(BoolObjectClosure* is_alive);
 394   bool  has_flushed_dependencies()                { return flags.hasFlushedDependencies; }
 395   void  set_has_flushed_dependencies()            {
 396     check_safepoint();
 397     assert(!has_flushed_dependencies(), "should only happen once");
 398     flags.hasFlushedDependencies = 1;
 399   }
 400 
 401   bool  is_marked_for_reclamation() const         { return flags.markedForReclamation; }
 402   void  mark_for_reclamation()                    { check_safepoint(); flags.markedForReclamation = 1; }
 403   void  unmark_for_reclamation()                  { check_safepoint(); flags.markedForReclamation = 0; }
 404 
 405   bool  has_unsafe_access() const                 { return flags.has_unsafe_access; }
 406   void  set_has_unsafe_access(bool z)             { flags.has_unsafe_access = z; }
 407 



 408   int   level() const                             { return flags.level; }
 409   void  set_level(int newLevel)                   { check_safepoint(); flags.level = newLevel; }
 410 
 411   int   comp_level() const                        { return _comp_level; }
 412 
 413   int   version() const                           { return flags.version; }
 414   void  set_version(int v);
 415 
 416   // Non-perm oop support
 417   bool  on_scavenge_root_list() const                  { return (_scavenge_root_state & 1) != 0; }
 418  protected:
 419   enum { npl_on_list = 0x01, npl_marked = 0x10 };
 420   void  set_on_scavenge_root_list()                    { _scavenge_root_state = npl_on_list; }
 421   void  clear_on_scavenge_root_list()                  { _scavenge_root_state = 0; }
 422   // assertion-checking and pruning logic uses the bits of _scavenge_root_state
 423 #ifndef PRODUCT
 424   void  set_scavenge_root_marked()                     { _scavenge_root_state |= npl_marked; }
 425   void  clear_scavenge_root_marked()                   { _scavenge_root_state &= ~npl_marked; }
 426   bool  scavenge_root_not_marked()                     { return (_scavenge_root_state &~ npl_on_list) == 0; }
 427   // N.B. there is no positive marked query, and we only use the not_marked query for asserts.


 520   }
 521 
 522  public:
 523   // ScopeDesc retrieval operation
 524   PcDesc* pc_desc_at(address pc)   { return find_pc_desc(pc, false); }
 525   // pc_desc_near returns the first PcDesc at or after the givne pc.
 526   PcDesc* pc_desc_near(address pc) { return find_pc_desc(pc, true); }
 527 
 528  public:
 529   // copying of debugging information
 530   void copy_scopes_pcs(PcDesc* pcs, int count);
 531   void copy_scopes_data(address buffer, int size);
 532 
 533   // deopt
 534   // return true is the pc is one would expect if the frame is being deopted.
 535   bool is_deopt_pc(address pc);
 536   // Accessor/mutator for the original pc of a frame before a frame was deopted.
 537   address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }
 538   void    set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; }
 539 



 540   // jvmti support:
 541   void post_compiled_method_load_event();
 542 
 543   // verify operations
 544   void verify();
 545   void verify_scopes();
 546   void verify_interrupt_point(address interrupt_point);
 547 
 548   // printing support
 549   void print()                          const;
 550   void print_code();
 551   void print_relocations()                        PRODUCT_RETURN;
 552   void print_pcs()                                PRODUCT_RETURN;
 553   void print_scopes()                             PRODUCT_RETURN;
 554   void print_dependencies()                       PRODUCT_RETURN;
 555   void print_value_on(outputStream* st) const     PRODUCT_RETURN;
 556   void print_calls(outputStream* st)              PRODUCT_RETURN;
 557   void print_handler_table()                      PRODUCT_RETURN;
 558   void print_nul_chk_table()                      PRODUCT_RETURN;
 559   void print_nmethod(bool print_code);




  76   PcDesc* last_pc_desc() { return _last_pc_desc; }
  77 };
  78 
  79 
  80 // nmethods (native methods) are the compiled code versions of Java methods.
  81 
  82 struct nmFlags {
  83   friend class VMStructs;
  84   unsigned int version:8;                    // version number (0 = first version)
  85   unsigned int level:4;                      // optimization level
  86   unsigned int age:4;                        // age (in # of sweep steps)
  87 
  88   unsigned int state:2;                      // {alive, zombie, unloaded)
  89 
  90   unsigned int isUncommonRecompiled:1;       // recompiled because of uncommon trap?
  91   unsigned int isToBeRecompiled:1;           // to be recompiled as soon as it matures
  92   unsigned int hasFlushedDependencies:1;     // Used for maintenance of dependencies
  93   unsigned int markedForReclamation:1;       // Used by NMethodSweeper
  94 
  95   unsigned int has_unsafe_access:1;          // May fault due to unsafe access.
  96   unsigned int has_method_handle_invokes:1;  // Has this method MethodHandle invokes?
  97 
  98   void clear();
  99 };
 100 
 101 
 102 // A nmethod contains:
 103 //  - header                 (the nmethod structure)
 104 //  [Relocation]
 105 //  - relocation information
 106 //  - constant part          (doubles, longs and floats used in nmethod)
 107 //  [Code]
 108 //  - code body
 109 //  - exception handler
 110 //  - stub code
 111 //  [Debugging information]
 112 //  - oop array
 113 //  - data array
 114 //  - pcs
 115 //  [Exception handler table]
 116 //  - handler entry point array


 389   void  mark_for_deoptimization()                 { _markedForDeoptimization = true; }
 390 
 391   void  make_unloaded(BoolObjectClosure* is_alive, oop cause);
 392 
 393   bool has_dependencies()                         { return dependencies_size() != 0; }
 394   void flush_dependencies(BoolObjectClosure* is_alive);
 395   bool  has_flushed_dependencies()                { return flags.hasFlushedDependencies; }
 396   void  set_has_flushed_dependencies()            {
 397     check_safepoint();
 398     assert(!has_flushed_dependencies(), "should only happen once");
 399     flags.hasFlushedDependencies = 1;
 400   }
 401 
 402   bool  is_marked_for_reclamation() const         { return flags.markedForReclamation; }
 403   void  mark_for_reclamation()                    { check_safepoint(); flags.markedForReclamation = 1; }
 404   void  unmark_for_reclamation()                  { check_safepoint(); flags.markedForReclamation = 0; }
 405 
 406   bool  has_unsafe_access() const                 { return flags.has_unsafe_access; }
 407   void  set_has_unsafe_access(bool z)             { flags.has_unsafe_access = z; }
 408 
 409   bool  has_method_handle_invokes() const         { return flags.has_method_handle_invokes; }
 410   void  set_has_method_handle_invokes(bool z)     { flags.has_method_handle_invokes = z; }
 411 
 412   int   level() const                             { return flags.level; }
 413   void  set_level(int newLevel)                   { check_safepoint(); flags.level = newLevel; }
 414 
 415   int   comp_level() const                        { return _comp_level; }
 416 
 417   int   version() const                           { return flags.version; }
 418   void  set_version(int v);
 419 
 420   // Non-perm oop support
 421   bool  on_scavenge_root_list() const                  { return (_scavenge_root_state & 1) != 0; }
 422  protected:
 423   enum { npl_on_list = 0x01, npl_marked = 0x10 };
 424   void  set_on_scavenge_root_list()                    { _scavenge_root_state = npl_on_list; }
 425   void  clear_on_scavenge_root_list()                  { _scavenge_root_state = 0; }
 426   // assertion-checking and pruning logic uses the bits of _scavenge_root_state
 427 #ifndef PRODUCT
 428   void  set_scavenge_root_marked()                     { _scavenge_root_state |= npl_marked; }
 429   void  clear_scavenge_root_marked()                   { _scavenge_root_state &= ~npl_marked; }
 430   bool  scavenge_root_not_marked()                     { return (_scavenge_root_state &~ npl_on_list) == 0; }
 431   // N.B. there is no positive marked query, and we only use the not_marked query for asserts.


 524   }
 525 
 526  public:
 527   // ScopeDesc retrieval operation
 528   PcDesc* pc_desc_at(address pc)   { return find_pc_desc(pc, false); }
 529   // pc_desc_near returns the first PcDesc at or after the givne pc.
 530   PcDesc* pc_desc_near(address pc) { return find_pc_desc(pc, true); }
 531 
 532  public:
 533   // copying of debugging information
 534   void copy_scopes_pcs(PcDesc* pcs, int count);
 535   void copy_scopes_data(address buffer, int size);
 536 
 537   // deopt
 538   // return true is the pc is one would expect if the frame is being deopted.
 539   bool is_deopt_pc(address pc);
 540   // Accessor/mutator for the original pc of a frame before a frame was deopted.
 541   address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }
 542   void    set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; }
 543 
 544   // MethodHandle
 545   bool is_method_handle_return(address return_pc);
 546 
 547   // jvmti support:
 548   void post_compiled_method_load_event();
 549 
 550   // verify operations
 551   void verify();
 552   void verify_scopes();
 553   void verify_interrupt_point(address interrupt_point);
 554 
 555   // printing support
 556   void print()                          const;
 557   void print_code();
 558   void print_relocations()                        PRODUCT_RETURN;
 559   void print_pcs()                                PRODUCT_RETURN;
 560   void print_scopes()                             PRODUCT_RETURN;
 561   void print_dependencies()                       PRODUCT_RETURN;
 562   void print_value_on(outputStream* st) const     PRODUCT_RETURN;
 563   void print_calls(outputStream* st)              PRODUCT_RETURN;
 564   void print_handler_table()                      PRODUCT_RETURN;
 565   void print_nul_chk_table()                      PRODUCT_RETURN;
 566   void print_nmethod(bool print_code);


src/share/vm/code/nmethod.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File