< prev index next >

src/share/vm/asm/codeBuffer.hpp

Print this page




 156   relocInfo*  locs_limit() const    { return _locs_limit; }
 157   address     locs_point() const    { return _locs_point; }
 158   csize_t     locs_point_off() const{ return (csize_t)(_locs_point - _start); }
 159   csize_t     locs_capacity() const { return (csize_t)(_locs_limit - _locs_start); }
 160   csize_t     locs_remaining()const { return (csize_t)(_locs_limit - _locs_end); }
 161 
 162   int         index() const         { return _index; }
 163   bool        is_allocated() const  { return _start != NULL; }
 164   bool        is_empty() const      { return _start == _end; }
 165   bool        is_frozen() const     { return _frozen; }
 166   bool        has_locs() const      { return _locs_end != NULL; }
 167 
 168   CodeBuffer* outer() const         { return _outer; }
 169 
 170   // is a given address in this section?  (2nd version is end-inclusive)
 171   bool contains(address pc) const   { return pc >= _start && pc <  _end; }
 172   bool contains2(address pc) const  { return pc >= _start && pc <= _end; }
 173   bool allocates(address pc) const  { return pc >= _start && pc <  _limit; }
 174   bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
 175 
 176   void    set_end(address pc)       { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit))); _end = pc; }
 177   void    set_mark(address pc)      { assert(contains2(pc), "not in codeBuffer");
 178                                       _mark = pc; }
 179   void    set_mark_off(int offset)  { assert(contains2(offset+_start),"not in codeBuffer");
 180                                       _mark = offset + _start; }
 181   void    set_mark()                { _mark = _end; }
 182   void    clear_mark()              { _mark = NULL; }
 183 
 184   void    set_locs_end(relocInfo* p) {
 185     assert(p <= locs_limit(), "locs data fits in allocated buffer");
 186     _locs_end = p;
 187   }
 188   void    set_locs_point(address pc) {
 189     assert(pc >= locs_point(), "relocation addr may not decrease");
 190     assert(allocates2(pc),     "relocation addr must be in this section");
 191     _locs_point = pc;
 192   }
 193 
 194   // Code emission
 195   void emit_int8 ( int8_t  x)  { *((int8_t*)  end()) = x; set_end(end() + sizeof(int8_t)); }
 196   void emit_int16( int16_t x)  { *((int16_t*) end()) = x; set_end(end() + sizeof(int16_t)); }




 156   relocInfo*  locs_limit() const    { return _locs_limit; }
 157   address     locs_point() const    { return _locs_point; }
 158   csize_t     locs_point_off() const{ return (csize_t)(_locs_point - _start); }
 159   csize_t     locs_capacity() const { return (csize_t)(_locs_limit - _locs_start); }
 160   csize_t     locs_remaining()const { return (csize_t)(_locs_limit - _locs_end); }
 161 
 162   int         index() const         { return _index; }
 163   bool        is_allocated() const  { return _start != NULL; }
 164   bool        is_empty() const      { return _start == _end; }
 165   bool        is_frozen() const     { return _frozen; }
 166   bool        has_locs() const      { return _locs_end != NULL; }
 167 
 168   CodeBuffer* outer() const         { return _outer; }
 169 
 170   // is a given address in this section?  (2nd version is end-inclusive)
 171   bool contains(address pc) const   { return pc >= _start && pc <  _end; }
 172   bool contains2(address pc) const  { return pc >= _start && pc <= _end; }
 173   bool allocates(address pc) const  { return pc >= _start && pc <  _limit; }
 174   bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
 175 
 176   void    set_end(address pc)       { assert(allocates2(pc), "not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit)); _end = pc; }
 177   void    set_mark(address pc)      { assert(contains2(pc), "not in codeBuffer");
 178                                       _mark = pc; }
 179   void    set_mark_off(int offset)  { assert(contains2(offset+_start),"not in codeBuffer");
 180                                       _mark = offset + _start; }
 181   void    set_mark()                { _mark = _end; }
 182   void    clear_mark()              { _mark = NULL; }
 183 
 184   void    set_locs_end(relocInfo* p) {
 185     assert(p <= locs_limit(), "locs data fits in allocated buffer");
 186     _locs_end = p;
 187   }
 188   void    set_locs_point(address pc) {
 189     assert(pc >= locs_point(), "relocation addr may not decrease");
 190     assert(allocates2(pc),     "relocation addr must be in this section");
 191     _locs_point = pc;
 192   }
 193 
 194   // Code emission
 195   void emit_int8 ( int8_t  x)  { *((int8_t*)  end()) = x; set_end(end() + sizeof(int8_t)); }
 196   void emit_int16( int16_t x)  { *((int16_t*) end()) = x; set_end(end() + sizeof(int16_t)); }


< prev index next >