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