494 495 // Check that there are no old or obsolete methods 496 class CheckClass : public KlassClosure { 497 Thread* _thread; 498 public: 499 CheckClass(Thread* t) : _thread(t) {} 500 void do_klass(Klass* k); 501 }; 502 503 // Unevolving classes may point to methods of the_class directly 504 // from their constant pool caches, itables, and/or vtables. We 505 // use the ClassLoaderDataGraph::classes_do() facility and this helper 506 // to fix up these pointers. 507 class AdjustCpoolCacheAndVtable : public KlassClosure { 508 Thread* _thread; 509 public: 510 AdjustCpoolCacheAndVtable(Thread* t) : _thread(t) {} 511 void do_klass(Klass* k); 512 }; 513 514 public: 515 VM_RedefineClasses(jint class_count, 516 const jvmtiClassDefinition *class_defs, 517 JvmtiClassLoadKind class_load_kind); 518 VMOp_Type type() const { return VMOp_RedefineClasses; } 519 bool doit_prologue(); 520 void doit(); 521 void doit_epilogue(); 522 523 bool allow_nested_vm_operations() const { return true; } 524 jvmtiError check_error() { return _res; } 525 526 // Modifiable test must be shared between IsModifiableClass query 527 // and redefine implementation 528 static bool is_modifiable_class(oop klass_mirror); 529 530 static jint get_cached_class_file_len(JvmtiCachedClassFileData *cache) { 531 return cache == NULL ? 0 : cache->length; 532 } 533 static unsigned char * get_cached_class_file_bytes(JvmtiCachedClassFileData *cache) { | 494 495 // Check that there are no old or obsolete methods 496 class CheckClass : public KlassClosure { 497 Thread* _thread; 498 public: 499 CheckClass(Thread* t) : _thread(t) {} 500 void do_klass(Klass* k); 501 }; 502 503 // Unevolving classes may point to methods of the_class directly 504 // from their constant pool caches, itables, and/or vtables. We 505 // use the ClassLoaderDataGraph::classes_do() facility and this helper 506 // to fix up these pointers. 507 class AdjustCpoolCacheAndVtable : public KlassClosure { 508 Thread* _thread; 509 public: 510 AdjustCpoolCacheAndVtable(Thread* t) : _thread(t) {} 511 void do_klass(Klass* k); 512 }; 513 514 // Clean MethodData out 515 class MethodDataCleaner : public KlassClosure { 516 public: 517 MethodDataCleaner() {} 518 void do_klass(Klass* k); 519 }; 520 public: 521 VM_RedefineClasses(jint class_count, 522 const jvmtiClassDefinition *class_defs, 523 JvmtiClassLoadKind class_load_kind); 524 VMOp_Type type() const { return VMOp_RedefineClasses; } 525 bool doit_prologue(); 526 void doit(); 527 void doit_epilogue(); 528 529 bool allow_nested_vm_operations() const { return true; } 530 jvmtiError check_error() { return _res; } 531 532 // Modifiable test must be shared between IsModifiableClass query 533 // and redefine implementation 534 static bool is_modifiable_class(oop klass_mirror); 535 536 static jint get_cached_class_file_len(JvmtiCachedClassFileData *cache) { 537 return cache == NULL ? 0 : cache->length; 538 } 539 static unsigned char * get_cached_class_file_bytes(JvmtiCachedClassFileData *cache) { |