< prev index next >

src/hotspot/share/code/nmethod.hpp

Print this page
*** 29,10 ***
--- 29,11 ---
  
  class DepChange;
  class DirectiveSet;
  class DebugInformationRecorder;
  class JvmtiThreadState;
+ class OopIterateClosure;
  
  // nmethods (native methods) are the compiled code versions of Java methods.
  //
  // An nmethod contains:
  //  - header                 (the nmethod structure)

*** 71,10 ***
--- 72,12 ---
  
   private:
    // Shared fields for all nmethod's
    int       _entry_bci;        // != InvocationEntryBci if this nmethod is an on-stack replacement method
  
+   uint64_t  _marking_cycle;
+ 
    // To support simple linked-list chaining of nmethods:
    nmethod*  _osr_link;         // from InstanceKlass::osr_nmethods_head
  
    // STW two-phase nmethod root processing helpers.
    //

*** 222,10 ***
--- 225,16 ---
    // pc during a deopt.
    int _orig_pc_offset;
  
    int _compile_id;                           // which compilation made this nmethod
    int _comp_level;                           // compilation level
+   int _nr_oops;
+  public:
+   int nr_oops() const { return _nr_oops; }
+   void verify_nr_oops();
+   int count_oops();
+  private:
  
    // protected by CodeCache_lock
    bool _has_flushed_dependencies;            // Used for maintenance of dependencies (CodeCache_lock)
  
    // used by jvmti to track if an event has been posted for this nmethod.

*** 383,11 ***
                                       int vep_offset,
                                       int frame_complete,
                                       int frame_size,
                                       ByteSize receiver_sp_offset,
                                       ByteSize basic_lock_sp_offset,
!                                      OopMapSet* oop_maps);
  
    // type info
    bool is_nmethod() const                         { return true; }
    bool is_osr_method() const                      { return _entry_bci != InvocationEntryBci; }
  
--- 392,12 ---
                                       int vep_offset,
                                       int frame_complete,
                                       int frame_size,
                                       ByteSize receiver_sp_offset,
                                       ByteSize basic_lock_sp_offset,
!                                      OopMapSet* oop_maps,
+                                      int exception_handler = -1);
  
    // type info
    bool is_nmethod() const                         { return true; }
    bool is_osr_method() const                      { return _entry_bci != InvocationEntryBci; }
  

*** 546,10 ***
--- 556,12 ---
    address  osr_entry() const                      { assert(is_osr_method(), "wrong kind of nmethod"); return _osr_entry_point; }
    void  invalidate_osr_method();
    nmethod* osr_link() const                       { return _osr_link; }
    void     set_osr_link(nmethod *n)               { _osr_link = n; }
  
+   void set_immediate_oops_patched(int nr)         { _nr_oops += nr; }
+ 
    // Verify calls to dead methods have been cleaned.
    void verify_clean_inline_caches();
  
    // unlink and deallocate this nmethod
    // Only NMethodSweeper class is expected to use this. NMethodSweeper is not

*** 564,10 ***
--- 576,12 ---
    // using it.
    bool is_locked_by_vm() const                    { return _lock_count >0; }
  
    // See comment at definition of _last_seen_on_stack
    void mark_as_seen_on_stack();
+   void mark_as_maybe_on_continuation();
+   bool is_not_on_continuation_stack();
    bool can_convert_to_zombie();
  
    // Evolution support. We make old (discarded) compiled methods point to new Method*s.
    void set_method(Method* method) { _method = method; }
  

*** 586,17 ***
      return jvmci_data_size() == 0 ? NULL : (JVMCINMethodData*) jvmci_data_begin();
    }
  #endif
  
   public:
!   void oops_do(OopClosure* f) { oops_do(f, false); }
!   void oops_do(OopClosure* f, bool allow_dead);
  
    // All-in-one claiming of nmethods: returns true if the caller successfully claimed that
    // nmethod.
    bool oops_do_try_claim();
  
    // Class containing callbacks for the oops_do_process_weak/strong() methods
    // below.
    class OopsDoProcessor {
    public:
      // Process the oops of the given nmethod based on whether it has been called
--- 600,20 ---
      return jvmci_data_size() == 0 ? NULL : (JVMCINMethodData*) jvmci_data_begin();
    }
  #endif
  
   public:
!   void oops_do(OopClosure* f) { oops_do(f, false, false); }
!   void oops_do(OopClosure* f, bool allow_dead, bool allow_null = false);
  
    // All-in-one claiming of nmethods: returns true if the caller successfully claimed that
    // nmethod.
    bool oops_do_try_claim();
  
+   // Loom support for following nmethods on the stack
+   void follow_nmethod(OopIterateClosure* cl);
+ 
    // Class containing callbacks for the oops_do_process_weak/strong() methods
    // below.
    class OopsDoProcessor {
    public:
      // Process the oops of the given nmethod based on whether it has been called

*** 630,13 ***
   public:
    // copying of debugging information
    void copy_scopes_pcs(PcDesc* pcs, int count);
    void copy_scopes_data(address buffer, int size);
  
!   // Accessor/mutator for the original pc of a frame before a frame was deopted.
-   address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }
-   void    set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; }
  
    // jvmti support:
    void post_compiled_method_load_event(JvmtiThreadState* state = NULL);
  
    // verify operations
--- 647,11 ---
   public:
    // copying of debugging information
    void copy_scopes_pcs(PcDesc* pcs, int count);
    void copy_scopes_data(address buffer, int size);
  
!   int orig_pc_offset() { return _orig_pc_offset; }
  
    // jvmti support:
    void post_compiled_method_load_event(JvmtiThreadState* state = NULL);
  
    // verify operations

*** 752,10 ***
--- 767,12 ---
    address call_instruction_address(address pc) const;
  
    virtual CompiledStaticCall* compiledStaticCall_at(Relocation* call_site) const;
    virtual CompiledStaticCall* compiledStaticCall_at(address addr) const;
    virtual CompiledStaticCall* compiledStaticCall_before(address addr) const;
+ 
+   virtual void  make_deoptimized();
  };
  
  // Locks an nmethod so its code will not get removed and it will not
  // be made into a zombie, even if it is a not_entrant method. After the
  // nmethod becomes a zombie, if CompiledMethodUnload event processing
< prev index next >