Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/code/codeBlob.hpp
          +++ new/src/share/vm/code/codeBlob.hpp
↓ open down ↓ 46 lines elided ↑ open up ↑
  47   47    const char* _name;
  48   48    int        _size;                              // total size of CodeBlob in bytes
  49   49    int        _header_size;                       // size of header (depends on subclass)
  50   50    int        _relocation_size;                   // size of relocation
  51   51    int        _instructions_offset;               // offset to where instructions region begins
  52   52    int        _frame_complete_offset;             // instruction offsets in [0.._frame_complete_offset) have
  53   53                                                   // not finished setting up their frame. Beware of pc's in
  54   54                                                   // that range. There is a similar range(s) on returns
  55   55                                                   // which we don't detect.
  56   56    int        _data_offset;                       // offset to where data region begins
  57      -  int        _oops_offset;                       // offset to where embedded oop table begins (inside data)
  58      -  int        _oops_length;                       // number of embedded oops
  59   57    int        _frame_size;                        // size of stack frame
  60   58    OopMapSet* _oop_maps;                          // OopMap for this CodeBlob
  61   59    CodeComments _comments;
  62   60  
  63   61    friend class OopRecorder;
  64   62  
  65      -  void fix_oop_relocations(address begin, address end, bool initialize_immediates);
  66      -  inline void initialize_immediate_oop(oop* dest, jobject handle);
  67      -
  68   63   public:
  69   64    // Returns the space needed for CodeBlob
  70   65    static unsigned int allocation_size(CodeBuffer* cb, int header_size);
  71   66  
  72   67    // Creation
  73   68    // a) simple CodeBlob
  74   69    // frame_complete is the offset from the beginning of the instructions
  75   70    // to where the frame setup (from stackwalk viewpoint) is complete.
  76   71    CodeBlob(const char* name, int header_size, int size, int frame_complete, int locs_size);
  77   72  
↓ open down ↓ 30 lines elided ↑ open up ↑
 108  103  
 109  104    // Boundaries
 110  105    address    header_begin() const                { return (address)    this; }
 111  106    address    header_end() const                  { return ((address)   this) + _header_size; };
 112  107    relocInfo* relocation_begin() const            { return (relocInfo*) header_end(); };
 113  108    relocInfo* relocation_end() const              { return (relocInfo*)(header_end()   + _relocation_size); }
 114  109    address    instructions_begin() const          { return (address)    header_begin() + _instructions_offset;  }
 115  110    address    instructions_end() const            { return (address)    header_begin() + _data_offset; }
 116  111    address    data_begin() const                  { return (address)    header_begin() + _data_offset; }
 117  112    address    data_end() const                    { return (address)    header_begin() + _size; }
 118      -  oop*       oops_begin() const                  { return (oop*)      (header_begin() + _oops_offset); }
 119      -  oop*       oops_end() const                    { return                oops_begin() + _oops_length; }
 120  113  
 121  114    // Offsets
 122  115    int relocation_offset() const                  { return _header_size; }
 123  116    int instructions_offset() const                { return _instructions_offset; }
 124  117    int data_offset() const                        { return _data_offset; }
 125      -  int oops_offset() const                        { return _oops_offset; }
 126  118  
 127  119    // Sizes
 128  120    int size() const                               { return _size; }
 129  121    int header_size() const                        { return _header_size; }
 130  122    int relocation_size() const                    { return (address) relocation_end() - (address) relocation_begin(); }
 131  123    int instructions_size() const                  { return instructions_end() - instructions_begin();  }
 132  124    int data_size() const                          { return data_end() - data_begin(); }
 133      -  int oops_size() const                          { return (address) oops_end() - (address) oops_begin(); }
 134  125  
 135  126    // Containment
 136  127    bool blob_contains(address addr) const         { return header_begin()       <= addr && addr < data_end(); }
 137  128    bool relocation_contains(relocInfo* addr) const{ return relocation_begin()   <= addr && addr < relocation_end(); }
 138  129    bool instructions_contains(address addr) const { return instructions_begin() <= addr && addr < instructions_end(); }
 139  130    bool data_contains(address addr) const         { return data_begin()         <= addr && addr < data_end(); }
 140      -  bool oops_contains(oop* addr) const            { return oops_begin()         <= addr && addr < oops_end(); }
 141  131    bool contains(address addr) const              { return instructions_contains(addr); }
 142  132    bool is_frame_complete_at(address addr) const  { return instructions_contains(addr) &&
 143  133                                                            addr >= instructions_begin() + _frame_complete_offset; }
 144  134  
 145      -  // Relocation support
 146      -  void fix_oop_relocations(address begin, address end) {
 147      -    fix_oop_relocations(begin, end, false);
 148      -  }
 149      -  void fix_oop_relocations() {
 150      -    fix_oop_relocations(NULL, NULL, false);
 151      -  }
 152      -  relocInfo::relocType reloc_type_for_address(address pc);
 153      -  bool is_at_poll_return(address pc);
 154      -  bool is_at_poll_or_poll_return(address pc);
 155      -
 156      -  // Support for oops in scopes and relocs:
 157      -  // Note: index 0 is reserved for null.
 158      -  oop  oop_at(int index) const                   { return index == 0? (oop)NULL: *oop_addr_at(index); }
 159      -  oop* oop_addr_at(int index) const{             // for GC
 160      -    // relocation indexes are biased by 1 (because 0 is reserved)
 161      -    assert(index > 0 && index <= _oops_length, "must be a valid non-zero index");
 162      -    return &oops_begin()[index-1];
 163      -  }
 164      -
 165      -  void copy_oops(GrowableArray<jobject>* oops);
 166      -
 167  135    // CodeCache support: really only used by the nmethods, but in order to get
 168  136    // asserts and certain bookkeeping to work in the CodeCache they are defined
 169  137    // virtual here.
 170  138    virtual bool is_zombie() const                 { return false; }
 171  139    virtual bool is_locked_by_vm() const           { return false; }
 172  140  
 173  141    virtual bool is_unloaded() const               { return false; }
 174  142    virtual bool is_not_entrant() const            { return false; }
 175  143  
 176  144    // GC support
 177  145    virtual bool is_alive() const                  = 0;
 178  146    virtual void do_unloading(BoolObjectClosure* is_alive,
 179  147                              OopClosure* keep_alive,
 180  148                              bool unloading_occurred);
 181      -  virtual void oops_do(OopClosure* f) = 0;
 182      -  // (All CodeBlob subtypes other than NMethod currently have
 183      -  // an empty oops_do() method.
 184  149  
 185  150    // OopMap for frame
 186  151    OopMapSet* oop_maps() const                    { return _oop_maps; }
 187  152    void set_oop_maps(OopMapSet* p);
 188  153    OopMap* oop_map_for_return_address(address return_address);
 189  154    virtual void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f)  { ShouldNotReachHere(); }
 190  155  
 191  156    // Frame support
 192  157    int  frame_size() const                        { return _frame_size; }
 193  158    void set_frame_size(int size)                  { _frame_size = size; }
↓ open down ↓ 361 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX