266 jobject _jloader; |
266 jobject _jloader; |
267 jobject _protection_domain; |
267 jobject _protection_domain; |
268 jclass _class_being_redefined; |
268 jclass _class_being_redefined; |
269 |
269 |
270 public: |
270 public: |
271 JvmtiClassFileLoadEventMark(JavaThread *thread, symbolHandle name, |
271 JvmtiClassFileLoadEventMark(JavaThread *thread, Symbol* name, |
272 Handle class_loader, Handle prot_domain, KlassHandle *class_being_redefined) : JvmtiThreadEventMark(thread) { |
272 Handle class_loader, Handle prot_domain, KlassHandle *class_being_redefined) : JvmtiThreadEventMark(thread) { |
273 _class_name = name() != NULL? name->as_utf8() : NULL; |
273 _class_name = name != NULL? name->as_utf8() : NULL; |
274 _jloader = (jobject)to_jobject(class_loader()); |
274 _jloader = (jobject)to_jobject(class_loader()); |
275 _protection_domain = (jobject)to_jobject(prot_domain()); |
275 _protection_domain = (jobject)to_jobject(prot_domain()); |
276 if (class_being_redefined == NULL) { |
276 if (class_being_redefined == NULL) { |
277 _class_being_redefined = NULL; |
277 _class_being_redefined = NULL; |
278 } else { |
278 } else { |
504 } |
504 } |
505 } |
505 } |
506 |
506 |
507 class JvmtiClassFileLoadHookPoster : public StackObj { |
507 class JvmtiClassFileLoadHookPoster : public StackObj { |
508 private: |
508 private: |
509 symbolHandle _h_name; |
509 Symbol* _h_name; |
510 Handle _class_loader; |
510 Handle _class_loader; |
511 Handle _h_protection_domain; |
511 Handle _h_protection_domain; |
512 unsigned char ** _data_ptr; |
512 unsigned char ** _data_ptr; |
513 unsigned char ** _end_ptr; |
513 unsigned char ** _end_ptr; |
514 JavaThread * _thread; |
514 JavaThread * _thread; |
520 JvmtiThreadState * _state; |
520 JvmtiThreadState * _state; |
521 KlassHandle * _h_class_being_redefined; |
521 KlassHandle * _h_class_being_redefined; |
522 JvmtiClassLoadKind _load_kind; |
522 JvmtiClassLoadKind _load_kind; |
523 |
523 |
524 public: |
524 public: |
525 inline JvmtiClassFileLoadHookPoster(symbolHandle h_name, Handle class_loader, |
525 inline JvmtiClassFileLoadHookPoster(Symbol* h_name, Handle class_loader, |
526 Handle h_protection_domain, |
526 Handle h_protection_domain, |
527 unsigned char **data_ptr, unsigned char **end_ptr, |
527 unsigned char **data_ptr, unsigned char **end_ptr, |
528 unsigned char **cached_data_ptr, |
528 unsigned char **cached_data_ptr, |
529 jint *cached_length_ptr) { |
529 jint *cached_length_ptr) { |
530 _h_name = h_name; |
530 _h_name = h_name; |
595 unsigned char *new_data = NULL; |
595 unsigned char *new_data = NULL; |
596 jint new_len = 0; |
596 jint new_len = 0; |
597 // EVT_TRACE(JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, |
597 // EVT_TRACE(JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, |
598 // ("JVMTI [%s] class file load hook event sent %s data_ptr = %d, data_len = %d", |
598 // ("JVMTI [%s] class file load hook event sent %s data_ptr = %d, data_len = %d", |
599 // JvmtiTrace::safe_get_thread_name(_thread), |
599 // JvmtiTrace::safe_get_thread_name(_thread), |
600 // _h_name.is_null() ? "NULL" : _h_name->as_utf8(), |
600 // _h_name == NULL ? "NULL" : _h_name->as_utf8(), |
601 // _curr_data, _curr_len )); |
601 // _curr_data, _curr_len )); |
602 JvmtiClassFileLoadEventMark jem(_thread, _h_name, _class_loader, |
602 JvmtiClassFileLoadEventMark jem(_thread, _h_name, _class_loader, |
603 _h_protection_domain, |
603 _h_protection_domain, |
604 _h_class_being_redefined); |
604 _h_class_being_redefined); |
605 JvmtiJavaThreadEventTransition jet(_thread); |
605 JvmtiJavaThreadEventTransition jet(_thread); |
653 }; |
653 }; |
654 |
654 |
655 bool JvmtiExport::_should_post_class_file_load_hook = false; |
655 bool JvmtiExport::_should_post_class_file_load_hook = false; |
656 |
656 |
657 // this entry is for class file load hook on class load, redefine and retransform |
657 // this entry is for class file load hook on class load, redefine and retransform |
658 void JvmtiExport::post_class_file_load_hook(symbolHandle h_name, |
658 void JvmtiExport::post_class_file_load_hook(Symbol* h_name, |
659 Handle class_loader, |
659 Handle class_loader, |
660 Handle h_protection_domain, |
660 Handle h_protection_domain, |
661 unsigned char **data_ptr, |
661 unsigned char **data_ptr, |
662 unsigned char **end_ptr, |
662 unsigned char **end_ptr, |
663 unsigned char **cached_data_ptr, |
663 unsigned char **cached_data_ptr, |