< prev index next >

src/share/vm/code/codeBlob.hpp

Print this page
rev 13477 : 8166317: InterpreterCodeSize should be computed
Reviewed-by: kvn, coleenp


 140   relocInfo* relocation_begin() const { return (relocInfo*) _relocation_begin; };
 141   relocInfo* relocation_end() const   { return (relocInfo*) _relocation_end; }
 142   address content_begin() const       { return _content_begin; }
 143   address content_end() const         { return _code_end; } // _code_end == _content_end is true for all types of blobs for now, it is also checked in the constructor
 144   address code_begin() const          { return _code_begin;    }
 145   address code_end() const            { return _code_end; }
 146   address data_end() const            { return _data_end;      }
 147 
 148   // This field holds the beginning of the const section in the old code buffer.
 149   // It is needed to fix relocations of pc-relative loads when resizing the
 150   // the constant pool or moving it.
 151   S390_ONLY(address ctable_begin() const { return header_begin() + _ctable_offset; })
 152   void set_ctable_begin(address ctable) { S390_ONLY(_ctable_offset = ctable - header_begin();) }
 153 
 154   // Sizes
 155   int size() const                               { return _size; }
 156   int header_size() const                        { return _header_size; }
 157   int relocation_size() const                    { return (address) relocation_end() - (address) relocation_begin(); }
 158   int content_size() const                       { return           content_end()    -           content_begin();    }
 159   int code_size() const                          { return           code_end()       -           code_begin();       }







 160 
 161   // Containment
 162   bool blob_contains(address addr) const         { return header_begin()       <= addr && addr < data_end();       }
 163   bool code_contains(address addr) const         { return code_begin()         <= addr && addr < code_end();       }
 164   bool contains(address addr) const              { return content_begin()      <= addr && addr < content_end();    }
 165   bool is_frame_complete_at(address addr) const  { return _frame_complete_offset != CodeOffsets::frame_never_safe &&
 166                                                           code_contains(addr) && addr >= code_begin() + _frame_complete_offset; }
 167 
 168   // CodeCache support: really only used by the nmethods, but in order to get
 169   // asserts and certain bookkeeping to work in the CodeCache they are defined
 170   // virtual here.
 171   virtual bool is_zombie() const                 { return false; }
 172   virtual bool is_locked_by_vm() const           { return false; }
 173 
 174   virtual bool is_unloaded() const               { return false; }
 175   virtual bool is_not_entrant() const            { return false; }
 176 
 177   // GC support
 178   virtual bool is_alive() const                  = 0;
 179 




 140   relocInfo* relocation_begin() const { return (relocInfo*) _relocation_begin; };
 141   relocInfo* relocation_end() const   { return (relocInfo*) _relocation_end; }
 142   address content_begin() const       { return _content_begin; }
 143   address content_end() const         { return _code_end; } // _code_end == _content_end is true for all types of blobs for now, it is also checked in the constructor
 144   address code_begin() const          { return _code_begin;    }
 145   address code_end() const            { return _code_end; }
 146   address data_end() const            { return _data_end;      }
 147 
 148   // This field holds the beginning of the const section in the old code buffer.
 149   // It is needed to fix relocations of pc-relative loads when resizing the
 150   // the constant pool or moving it.
 151   S390_ONLY(address ctable_begin() const { return header_begin() + _ctable_offset; })
 152   void set_ctable_begin(address ctable) { S390_ONLY(_ctable_offset = ctable - header_begin();) }
 153 
 154   // Sizes
 155   int size() const                               { return _size; }
 156   int header_size() const                        { return _header_size; }
 157   int relocation_size() const                    { return (address) relocation_end() - (address) relocation_begin(); }
 158   int content_size() const                       { return           content_end()    -           content_begin();    }
 159   int code_size() const                          { return           code_end()       -           code_begin();       }
 160   // Only used from CodeCache::free_unused_tail() after the Interpreter blob was trimmed
 161   void adjust_size(size_t used) {
 162     _size = used;
 163     _data_offset = used;
 164     _code_end = (address)this + used;
 165     _data_end = (address)this + used;
 166   }
 167 
 168   // Containment
 169   bool blob_contains(address addr) const         { return header_begin()       <= addr && addr < data_end();       }
 170   bool code_contains(address addr) const         { return code_begin()         <= addr && addr < code_end();       }
 171   bool contains(address addr) const              { return content_begin()      <= addr && addr < content_end();    }
 172   bool is_frame_complete_at(address addr) const  { return _frame_complete_offset != CodeOffsets::frame_never_safe &&
 173                                                           code_contains(addr) && addr >= code_begin() + _frame_complete_offset; }
 174 
 175   // CodeCache support: really only used by the nmethods, but in order to get
 176   // asserts and certain bookkeeping to work in the CodeCache they are defined
 177   // virtual here.
 178   virtual bool is_zombie() const                 { return false; }
 179   virtual bool is_locked_by_vm() const           { return false; }
 180 
 181   virtual bool is_unloaded() const               { return false; }
 182   virtual bool is_not_entrant() const            { return false; }
 183 
 184   // GC support
 185   virtual bool is_alive() const                  = 0;
 186 


< prev index next >