329 // we have permission to do this, VM op doesn't |
329 // we have permission to do this, VM op doesn't |
330 JvmtiExport::set_should_post_single_step(on); |
330 JvmtiExport::set_should_post_single_step(on); |
331 } |
331 } |
332 |
332 |
333 |
333 |
334 // This change must always be occur when at a safepoint. |
334 // When _on == true, we use the safepoint interpreter dispatch table |
335 // Being at a safepoint causes the interpreter to use the |
335 // to allow us to find the single step points. Otherwise, we switch |
336 // safepoint dispatch table which we overload to find single |
336 // back to the regular interpreter dispatch table. |
337 // step points. Just to be sure that it has been set, we |
337 // Note: We call Interpreter::notice_safepoints() and ignore_safepoints() |
338 // call notice_safepoints when turning on single stepping. |
338 // in a VM_Operation to safely make the dispatch table switch. We |
339 // When we leave our current safepoint, should_post_single_step |
339 // no longer rely on the safepoint mechanism to do any of this work |
340 // will be checked by the interpreter, and the table kept |
340 // for us. |
341 // or changed accordingly. |
|
342 void VM_ChangeSingleStep::doit() { |
341 void VM_ChangeSingleStep::doit() { |
|
342 log_debug(interpreter, safepoint)("changing single step to '%s'", _on ? "on" : "off"); |
343 JvmtiEventControllerPrivate::set_should_post_single_step(_on); |
343 JvmtiEventControllerPrivate::set_should_post_single_step(_on); |
344 if (_on) { |
344 if (_on) { |
345 Interpreter::notice_safepoints(); |
345 Interpreter::notice_safepoints(); |
|
346 } else { |
|
347 Interpreter::ignore_safepoints(); |
346 } |
348 } |
347 } |
349 } |
348 |
350 |
349 |
351 |
350 void JvmtiEventControllerPrivate::enter_interp_only_mode(JvmtiThreadState *state) { |
352 void JvmtiEventControllerPrivate::enter_interp_only_mode(JvmtiThreadState *state) { |