460 // In either case the index must not be encoded or byte-swapped in any way. 461 ConstantPoolCacheEntry* entry_at(int i) const { 462 assert(0 <= i && i < length(), "index out of bounds"); 463 return base() + i; 464 } 465 466 // Code generation 467 static ByteSize base_offset() { return in_ByteSize(sizeof(ConstantPoolCache)); } 468 static ByteSize entry_offset(int raw_index) { 469 int index = raw_index; 470 return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index); 471 } 472 473 #if INCLUDE_JVMTI 474 // RedefineClasses() API support: 475 // If any entry of this ConstantPoolCache points to any of 476 // old_methods, replace it with the corresponding new_method. 477 // trace_name_printed is set to true if the current call has 478 // printed the klass name so that other routines in the adjust_* 479 // group don't print the klass name. 480 void adjust_method_entries(Method** old_methods, Method** new_methods, 481 int methods_length, bool* trace_name_printed); 482 void adjust_method_entries(InstanceKlass* holder, bool* trace_name_printed); 483 bool check_no_old_or_obsolete_entries(); 484 void dump_cache(); 485 #endif // INCLUDE_JVMTI 486 487 // Deallocate - no fields to deallocate 488 DEBUG_ONLY(bool on_stack() { return false; }) 489 void deallocate_contents(ClassLoaderData* data) {} 490 bool is_klass() const { return false; } 491 492 // Printing 493 void print_on(outputStream* st) const; 494 void print_value_on(outputStream* st) const; 495 496 const char* internal_name() const { return "{constant pool cache}"; } 497 498 // Verify 499 void verify_on(outputStream* st); 500 }; 501 | 460 // In either case the index must not be encoded or byte-swapped in any way. 461 ConstantPoolCacheEntry* entry_at(int i) const { 462 assert(0 <= i && i < length(), "index out of bounds"); 463 return base() + i; 464 } 465 466 // Code generation 467 static ByteSize base_offset() { return in_ByteSize(sizeof(ConstantPoolCache)); } 468 static ByteSize entry_offset(int raw_index) { 469 int index = raw_index; 470 return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index); 471 } 472 473 #if INCLUDE_JVMTI 474 // RedefineClasses() API support: 475 // If any entry of this ConstantPoolCache points to any of 476 // old_methods, replace it with the corresponding new_method. 477 // trace_name_printed is set to true if the current call has 478 // printed the klass name so that other routines in the adjust_* 479 // group don't print the klass name. 480 void adjust_method_entries(InstanceKlass* holder, bool* trace_name_printed); 481 bool check_no_old_or_obsolete_entries(); 482 void dump_cache(); 483 #endif // INCLUDE_JVMTI 484 485 // Deallocate - no fields to deallocate 486 DEBUG_ONLY(bool on_stack() { return false; }) 487 void deallocate_contents(ClassLoaderData* data) {} 488 bool is_klass() const { return false; } 489 490 // Printing 491 void print_on(outputStream* st) const; 492 void print_value_on(outputStream* st) const; 493 494 const char* internal_name() const { return "{constant pool cache}"; } 495 496 // Verify 497 void verify_on(outputStream* st); 498 }; 499 |