@@ -154,6 +154,7 @@ ciEnv::ciEnv(CompileTask* task)
154
154
_the_null_string = NULL ;
155
155
_the_min_jint_string = NULL ;
156
156
157
+ _jvmti_redefinition_count = 0 ;
157
158
_jvmti_can_hotswap_or_post_breakpoint = false ;
158
159
_jvmti_can_access_local_variables = false ;
159
160
_jvmti_can_post_on_exceptions = false ;
@@ -209,6 +210,7 @@ ciEnv::ciEnv(Arena* arena) : _ciEnv_arena(mtCompiler) {
209
210
_the_null_string = NULL ;
210
211
_the_min_jint_string = NULL ;
211
212
213
+ _jvmti_redefinition_count = 0 ;
212
214
_jvmti_can_hotswap_or_post_breakpoint = false ;
213
215
_jvmti_can_access_local_variables = false ;
214
216
_jvmti_can_post_on_exceptions = false ;
@@ -231,13 +233,19 @@ void ciEnv::cache_jvmti_state() {
231
233
VM_ENTRY_MARK;
232
234
// Get Jvmti capabilities under lock to get consistant values.
233
235
MutexLocker mu (JvmtiThreadState_lock);
236
+ _jvmti_redefinition_count = JvmtiExport::redefinition_count ();
234
237
_jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint ();
235
238
_jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables ();
236
239
_jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions ();
237
240
_jvmti_can_pop_frame = JvmtiExport::can_pop_frame ();
238
241
}
239
242
240
243
bool ciEnv::jvmti_state_changed () const {
244
+ // Some classes were redefined
245
+ if (_jvmti_redefinition_count != JvmtiExport::redefinition_count ()) {
246
+ return true ;
247
+ }
248
+
241
249
if (!_jvmti_can_access_local_variables &&
242
250
JvmtiExport::can_access_local_variables ()) {
243
251
return true ;
@@ -254,6 +262,7 @@ bool ciEnv::jvmti_state_changed() const {
254
262
JvmtiExport::can_pop_frame ()) {
255
263
return true ;
256
264
}
265
+
257
266
return false ;
258
267
}
259
268
0 commit comments