comparison src/share/vm/classfile/classFileParser.cpp @ 4751:5b58979183f9

7127032: fix for 7122253 adds a JvmtiThreadState earlier than necessary Summary: Use JavaThread::jvmti_thread_state() instead of JvmtiThreadState::state_for(). Reviewed-by: coleenp, poonam, acorn
author dcubed
date Thu, 05 Jan 2012 06:24:52 -0800
parents 4ceaf61479fc
children 2b3acb34791f
comparison
equal deleted inserted replaced
4750:b16494a69d3d 4751:5b58979183f9
2662 2662
2663 _has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false; 2663 _has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false;
2664 _max_bootstrap_specifier_index = -1; 2664 _max_bootstrap_specifier_index = -1;
2665 2665
2666 if (JvmtiExport::should_post_class_file_load_hook()) { 2666 if (JvmtiExport::should_post_class_file_load_hook()) {
2667 // Get the cached class file bytes (if any) from the 2667 // Get the cached class file bytes (if any) from the class that
2668 // class that is being redefined. 2668 // is being redefined or retransformed. We use jvmti_thread_state()
2669 JvmtiThreadState *state = JvmtiThreadState::state_for(jt); 2669 // instead of JvmtiThreadState::state_for(jt) so we don't allocate
2670 KlassHandle *h_class_being_redefined = 2670 // a JvmtiThreadState any earlier than necessary. This will help
2671 state->get_class_being_redefined(); 2671 // avoid the bug described by 7126851.
2672 if (h_class_being_redefined != NULL) { 2672 JvmtiThreadState *state = jt->jvmti_thread_state();
2673 instanceKlassHandle ikh_class_being_redefined = 2673 if (state != NULL) {
2674 instanceKlassHandle(THREAD, (*h_class_being_redefined)()); 2674 KlassHandle *h_class_being_redefined =
2675 cached_class_file_bytes = 2675 state->get_class_being_redefined();
2676 ikh_class_being_redefined->get_cached_class_file_bytes(); 2676 if (h_class_being_redefined != NULL) {
2677 cached_class_file_length = 2677 instanceKlassHandle ikh_class_being_redefined =
2678 ikh_class_being_redefined->get_cached_class_file_len(); 2678 instanceKlassHandle(THREAD, (*h_class_being_redefined)());
2679 cached_class_file_bytes =
2680 ikh_class_being_redefined->get_cached_class_file_bytes();
2681 cached_class_file_length =
2682 ikh_class_being_redefined->get_cached_class_file_len();
2683 }
2679 } 2684 }
2680 2685
2681 unsigned char* ptr = cfs->buffer(); 2686 unsigned char* ptr = cfs->buffer();
2682 unsigned char* end_ptr = cfs->buffer() + cfs->length(); 2687 unsigned char* end_ptr = cfs->buffer() + cfs->length();
2683 2688