提交 b1d76a37 编写于 作者: D dcubed

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
上级 9d599e1e
...@@ -2664,18 +2664,23 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, ...@@ -2664,18 +2664,23 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
_max_bootstrap_specifier_index = -1; _max_bootstrap_specifier_index = -1;
if (JvmtiExport::should_post_class_file_load_hook()) { if (JvmtiExport::should_post_class_file_load_hook()) {
// Get the cached class file bytes (if any) from the // Get the cached class file bytes (if any) from the class that
// class that is being redefined. // is being redefined or retransformed. We use jvmti_thread_state()
JvmtiThreadState *state = JvmtiThreadState::state_for(jt); // instead of JvmtiThreadState::state_for(jt) so we don't allocate
KlassHandle *h_class_being_redefined = // a JvmtiThreadState any earlier than necessary. This will help
state->get_class_being_redefined(); // avoid the bug described by 7126851.
if (h_class_being_redefined != NULL) { JvmtiThreadState *state = jt->jvmti_thread_state();
instanceKlassHandle ikh_class_being_redefined = if (state != NULL) {
instanceKlassHandle(THREAD, (*h_class_being_redefined)()); KlassHandle *h_class_being_redefined =
cached_class_file_bytes = state->get_class_being_redefined();
ikh_class_being_redefined->get_cached_class_file_bytes(); if (h_class_being_redefined != NULL) {
cached_class_file_length = instanceKlassHandle ikh_class_being_redefined =
ikh_class_being_redefined->get_cached_class_file_len(); instanceKlassHandle(THREAD, (*h_class_being_redefined)());
cached_class_file_bytes =
ikh_class_being_redefined->get_cached_class_file_bytes();
cached_class_file_length =
ikh_class_being_redefined->get_cached_class_file_len();
}
} }
unsigned char* ptr = cfs->buffer(); unsigned char* ptr = cfs->buffer();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册