155 inline InstanceKlass* ik() const; 156 }; 157 158 159 // private helper class for klassVtable 160 // description of entry points: 161 // destination is interpreted: 162 // from_compiled_code_entry_point -> c2iadapter 163 // from_interpreter_entry_point -> interpreter entry point 164 // destination is compiled: 165 // from_compiled_code_entry_point -> nmethod entry point 166 // from_interpreter_entry_point -> i2cadapter 167 class vtableEntry VALUE_OBJ_CLASS_SPEC { 168 friend class VMStructs; 169 170 public: 171 // size in words 172 static int size() { 173 return sizeof(vtableEntry) / sizeof(HeapWord); 174 } 175 static int method_offset_in_bytes() { return offset_of(vtableEntry, _method); } 176 Method* method() const { return _method; } 177 178 private: 179 Method* _method; 180 void set(Method* method) { assert(method != NULL, "use clear"); _method = method; } 181 void clear() { _method = NULL; } 182 void print() PRODUCT_RETURN; 183 void verify(klassVtable* vt, outputStream* st); 184 185 friend class klassVtable; 186 }; 187 188 189 inline Method* klassVtable::method_at(int i) const { 190 assert(i >= 0 && i < _length, "index out of bounds"); 191 assert(table()[i].method() != NULL, "should not be null"); 192 assert(((Metadata*)table()[i].method())->is_method(), "should be method"); 193 return table()[i].method(); 194 } | 155 inline InstanceKlass* ik() const; 156 }; 157 158 159 // private helper class for klassVtable 160 // description of entry points: 161 // destination is interpreted: 162 // from_compiled_code_entry_point -> c2iadapter 163 // from_interpreter_entry_point -> interpreter entry point 164 // destination is compiled: 165 // from_compiled_code_entry_point -> nmethod entry point 166 // from_interpreter_entry_point -> i2cadapter 167 class vtableEntry VALUE_OBJ_CLASS_SPEC { 168 friend class VMStructs; 169 170 public: 171 // size in words 172 static int size() { 173 return sizeof(vtableEntry) / sizeof(HeapWord); 174 } 175 static int size_in_bytes() { 176 return sizeof(vtableEntry); 177 } 178 static int method_offset_in_bytes() { return offset_of(vtableEntry, _method); } 179 Method* method() const { return _method; } 180 181 private: 182 Method* _method; 183 void set(Method* method) { assert(method != NULL, "use clear"); _method = method; } 184 void clear() { _method = NULL; } 185 void print() PRODUCT_RETURN; 186 void verify(klassVtable* vt, outputStream* st); 187 188 friend class klassVtable; 189 }; 190 191 192 inline Method* klassVtable::method_at(int i) const { 193 assert(i >= 0 && i < _length, "index out of bounds"); 194 assert(table()[i].method() != NULL, "should not be null"); 195 assert(((Metadata*)table()[i].method())->is_method(), "should be method"); 196 return table()[i].method(); 197 } |