hotspot/src/share/vm/code/vtableStubs.hpp
changeset 13391 30245956af37
parent 7408 c04a5c989f26
child 13728 882756847a04
equal deleted inserted replaced
13309:50c604cb0d5f 13391:30245956af37
    53           _index(index), _ame_offset(-1), _npe_offset(-1) {}
    53           _index(index), _ame_offset(-1), _npe_offset(-1) {}
    54   VtableStub* next() const                       { return _next; }
    54   VtableStub* next() const                       { return _next; }
    55   int index() const                              { return _index; }
    55   int index() const                              { return _index; }
    56   static VMReg receiver_location()               { return _receiver_location; }
    56   static VMReg receiver_location()               { return _receiver_location; }
    57   void set_next(VtableStub* n)                   { _next = n; }
    57   void set_next(VtableStub* n)                   { _next = n; }
       
    58 
       
    59  public:
    58   address code_begin() const                     { return (address)(this + 1); }
    60   address code_begin() const                     { return (address)(this + 1); }
    59   address code_end() const                       { return code_begin() + pd_code_size_limit(_is_vtable_stub); }
    61   address code_end() const                       { return code_begin() + pd_code_size_limit(_is_vtable_stub); }
    60   address entry_point() const                    { return code_begin(); }
    62   address entry_point() const                    { return code_begin(); }
    61   static int entry_offset()                      { return sizeof(class VtableStub); }
    63   static int entry_offset()                      { return sizeof(class VtableStub); }
    62 
    64 
    63   bool matches(bool is_vtable_stub, int index) const {
    65   bool matches(bool is_vtable_stub, int index) const {
    64     return _index == index && _is_vtable_stub == is_vtable_stub;
    66     return _index == index && _is_vtable_stub == is_vtable_stub;
    65   }
    67   }
    66   bool contains(address pc) const                { return code_begin() <= pc && pc < code_end(); }
    68   bool contains(address pc) const                { return code_begin() <= pc && pc < code_end(); }
    67 
    69 
       
    70  private:
    68   void set_exception_points(address npe_addr, address ame_addr) {
    71   void set_exception_points(address npe_addr, address ame_addr) {
    69     _npe_offset = npe_addr - code_begin();
    72     _npe_offset = npe_addr - code_begin();
    70     _ame_offset = ame_addr - code_begin();
    73     _ame_offset = ame_addr - code_begin();
    71     assert(is_abstract_method_error(ame_addr),   "offset must be correct");
    74     assert(is_abstract_method_error(ame_addr),   "offset must be correct");
    72     assert(is_null_pointer_exception(npe_addr),  "offset must be correct");
    75     assert(is_null_pointer_exception(npe_addr),  "offset must be correct");