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