< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page

1056       *_data_ptr = NEW_RESOURCE_ARRAY(u1, _curr_len);
1057       memcpy(*_data_ptr, _curr_data, _curr_len);
1058       *_end_ptr = *_data_ptr + _curr_len;
1059       _curr_env->Deallocate(_curr_data);
1060     }
1061   }
1062 };
1063 
1064 bool JvmtiExport::is_early_phase() {
1065   return JvmtiEnvBase::get_phase() <= JVMTI_PHASE_PRIMORDIAL;
1066 }
1067 
1068 bool JvmtiExport::has_early_class_hook_env() {
1069   JvmtiEnvIterator it;
1070   for (JvmtiEnv* env = it.first(); env != nullptr; env = it.next(env)) {
1071     if (env->early_class_hook_env()) {
1072       return true;
1073     }
1074   }
1075   return false;










1076 }
1077 
1078 bool JvmtiExport::_should_post_class_file_load_hook = false;
1079 
1080 // This flag is read by C2 during VM internal objects allocation
1081 int JvmtiExport::_should_notify_object_alloc = 0;
1082 
1083 // this entry is for class file load hook on class load, redefine and retransform
1084 bool JvmtiExport::post_class_file_load_hook(Symbol* h_name,
1085                                             Handle class_loader,
1086                                             Handle h_protection_domain,
1087                                             unsigned char **data_ptr,
1088                                             unsigned char **end_ptr,
1089                                             JvmtiCachedClassFileData **cache_ptr) {
1090   if (JvmtiEnv::get_phase() < JVMTI_PHASE_PRIMORDIAL) {
1091     return false;
1092   }
1093 
1094   if (JavaThread::current()->is_in_any_VTMS_transition()) {
1095     return false; // no events should be posted if thread is in any VTMS transition

1056       *_data_ptr = NEW_RESOURCE_ARRAY(u1, _curr_len);
1057       memcpy(*_data_ptr, _curr_data, _curr_len);
1058       *_end_ptr = *_data_ptr + _curr_len;
1059       _curr_env->Deallocate(_curr_data);
1060     }
1061   }
1062 };
1063 
1064 bool JvmtiExport::is_early_phase() {
1065   return JvmtiEnvBase::get_phase() <= JVMTI_PHASE_PRIMORDIAL;
1066 }
1067 
1068 bool JvmtiExport::has_early_class_hook_env() {
1069   JvmtiEnvIterator it;
1070   for (JvmtiEnv* env = it.first(); env != nullptr; env = it.next(env)) {
1071     if (env->early_class_hook_env()) {
1072       return true;
1073     }
1074   }
1075   return false;
1076 }
1077 
1078 bool JvmtiExport::has_early_vmstart_env() {
1079   JvmtiEnvIterator it;
1080   for (JvmtiEnv* env = it.first(); env != nullptr; env = it.next(env)) {
1081     if (env->early_vmstart_env()) {
1082       return true;
1083     }
1084   }
1085   return false;
1086 }
1087 
1088 bool JvmtiExport::_should_post_class_file_load_hook = false;
1089 
1090 // This flag is read by C2 during VM internal objects allocation
1091 int JvmtiExport::_should_notify_object_alloc = 0;
1092 
1093 // this entry is for class file load hook on class load, redefine and retransform
1094 bool JvmtiExport::post_class_file_load_hook(Symbol* h_name,
1095                                             Handle class_loader,
1096                                             Handle h_protection_domain,
1097                                             unsigned char **data_ptr,
1098                                             unsigned char **end_ptr,
1099                                             JvmtiCachedClassFileData **cache_ptr) {
1100   if (JvmtiEnv::get_phase() < JVMTI_PHASE_PRIMORDIAL) {
1101     return false;
1102   }
1103 
1104   if (JavaThread::current()->is_in_any_VTMS_transition()) {
1105     return false; // no events should be posted if thread is in any VTMS transition
< prev index next >