# HG changeset patch # User dcubed # Date 1562187891 14400 # Wed Jul 03 17:04:51 2019 -0400 # Node ID c1f1f8b93b1d8cdf37d34100e4c88345fde2a684 # Parent 4d193e40e7afcf87012e93c415589323fc5bd057 imported patch 8227117.txt.00 diff --git a/src/hotspot/share/interpreter/templateInterpreter.cpp b/src/hotspot/share/interpreter/templateInterpreter.cpp --- a/src/hotspot/share/interpreter/templateInterpreter.cpp +++ b/src/hotspot/share/interpreter/templateInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ #include "interpreter/templateInterpreter.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "runtime/timerTrace.hpp" @@ -283,9 +284,13 @@ void TemplateInterpreter::notice_safepoints() { if (!_notice_safepoints) { + log_debug(interpreter, safepoint)("switching active_table to safept_table."); // switch to safepoint dispatch table _notice_safepoints = true; copy_table((address*)&_safept_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address)); + } else { + log_debug(interpreter, safepoint)("active_table is already safept_table; " + "notice_safepoints() call is no-op."); } } @@ -297,10 +302,17 @@ void TemplateInterpreter::ignore_safepoints() { if (_notice_safepoints) { if (!JvmtiExport::should_post_single_step()) { + log_debug(interpreter, safepoint)("switching active_table to normal_table."); // switch to normal dispatch table _notice_safepoints = false; copy_table((address*)&_normal_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address)); + } else { + log_debug(interpreter, safepoint)("single stepping is still active; " + "ignoring ignore_safepoints() call."); } + } else { + log_debug(interpreter, safepoint)("active_table is already normal_table; " + "ignore_safepoints() call is no-op."); } } diff --git a/src/hotspot/share/prims/jvmtiEventController.cpp b/src/hotspot/share/prims/jvmtiEventController.cpp --- a/src/hotspot/share/prims/jvmtiEventController.cpp +++ b/src/hotspot/share/prims/jvmtiEventController.cpp @@ -340,9 +340,12 @@ // will be checked by the interpreter, and the table kept // or changed accordingly. void VM_ChangeSingleStep::doit() { + log_debug(interpreter, safepoint)("changing single step to '%s'", _on ? "on" : "off"); JvmtiEventControllerPrivate::set_should_post_single_step(_on); if (_on) { Interpreter::notice_safepoints(); + } else { + Interpreter::ignore_safepoints(); } }