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