277 //
278 class klassItable {
279 private:
280 InstanceKlass* _klass; // my klass
281 int _table_offset; // offset of start of itable data within klass (in words)
282 int _size_offset_table; // size of offset table (in itableOffset entries)
283 int _size_method_table; // size of methodtable (in itableMethodEntry entries)
284
285 void initialize_itable_for_interface(int method_table_offset, InstanceKlass* interf_h,
286 GrowableArray<Method*>* supers, int start_offset);
287 void check_constraints(GrowableArray<Method*>* supers, TRAPS);
288 public:
289 klassItable(InstanceKlass* klass);
290
291 itableOffsetEntry* offset_entry(int i) { assert(0 <= i && i <= _size_offset_table, "index out of bounds");
292 return &((itableOffsetEntry*)vtable_start())[i]; }
293
294 itableMethodEntry* method_entry(int i) { assert(0 <= i && i <= _size_method_table, "index out of bounds");
295 return &((itableMethodEntry*)method_start())[i]; }
296
297 int size_offset_table() { return _size_offset_table; }
298
299 // Initialization
300 void initialize_itable_and_check_constraints(TRAPS);
301 void initialize_itable(GrowableArray<Method*>* supers = NULL);
302
303 #if INCLUDE_JVMTI
304 // RedefineClasses() API support:
305 // if any entry of this itable points to any of old_methods,
306 // replace it with the corresponding new_method.
307 // trace_name_printed is set to true if the current call has
308 // printed the klass name so that other routines in the adjust_*
309 // group don't print the klass name.
310 void adjust_method_entries(bool* trace_name_printed);
311 bool check_no_old_or_obsolete_entries();
312 void dump_itable();
313 #endif // INCLUDE_JVMTI
314
315 // Setup of itable
316 static int assign_itable_indices_for_interface(InstanceKlass* klass);
317 static int method_count_for_interface(InstanceKlass* klass);
|
277 //
278 class klassItable {
279 private:
280 InstanceKlass* _klass; // my klass
281 int _table_offset; // offset of start of itable data within klass (in words)
282 int _size_offset_table; // size of offset table (in itableOffset entries)
283 int _size_method_table; // size of methodtable (in itableMethodEntry entries)
284
285 void initialize_itable_for_interface(int method_table_offset, InstanceKlass* interf_h,
286 GrowableArray<Method*>* supers, int start_offset);
287 void check_constraints(GrowableArray<Method*>* supers, TRAPS);
288 public:
289 klassItable(InstanceKlass* klass);
290
291 itableOffsetEntry* offset_entry(int i) { assert(0 <= i && i <= _size_offset_table, "index out of bounds");
292 return &((itableOffsetEntry*)vtable_start())[i]; }
293
294 itableMethodEntry* method_entry(int i) { assert(0 <= i && i <= _size_method_table, "index out of bounds");
295 return &((itableMethodEntry*)method_start())[i]; }
296
297 InstanceKlass* klass() const { return _klass; }
298 int table_offset() const { return _table_offset; }
299 int size_offset_table() const { return _size_offset_table; }
300 int size_method_table() const { return _size_method_table; }
301
302 // Initialization
303 void initialize_itable_and_check_constraints(TRAPS);
304 void initialize_itable(GrowableArray<Method*>* supers = NULL);
305
306 #if INCLUDE_JVMTI
307 // RedefineClasses() API support:
308 // if any entry of this itable points to any of old_methods,
309 // replace it with the corresponding new_method.
310 // trace_name_printed is set to true if the current call has
311 // printed the klass name so that other routines in the adjust_*
312 // group don't print the klass name.
313 void adjust_method_entries(bool* trace_name_printed);
314 bool check_no_old_or_obsolete_entries();
315 void dump_itable();
316 #endif // INCLUDE_JVMTI
317
318 // Setup of itable
319 static int assign_itable_indices_for_interface(InstanceKlass* klass);
320 static int method_count_for_interface(InstanceKlass* klass);
|