[vm/bytecode] No need to set breakpoints in bytecode if interpreter is not used.

Breakpoints are still set in compiled bytecode.
When the interpreter is used, breakpoints are set in both interpreted and
compiled bytecode, as before.
This fixes service/breakpoint_async_break_test in app-jit mode.

Change-Id: Ia60f6f99497821b476b664fe8b86ee4aa15748a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116840
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Régis Crelier 2019-09-12 01:01:35 +00:00 committed by commit-bot@chromium.org
parent 531cb02331
commit 596a4ab14d

View file

@ -3293,7 +3293,7 @@ void Debugger::FindCompiledFunctions(
(function.end_token_pos() == end_pos) &&
(function.script() == script.raw())) {
if (function.is_debuggable()) {
if (function.HasBytecode()) {
if (FLAG_enable_interpreter && function.HasBytecode()) {
bytecode_function_list->Add(function);
}
if (function.HasCode()) {
@ -3303,7 +3303,7 @@ void Debugger::FindCompiledFunctions(
if (function.HasImplicitClosureFunction()) {
function = function.ImplicitClosureFunction();
if (function.is_debuggable()) {
if (function.HasBytecode()) {
if (FLAG_enable_interpreter && function.HasBytecode()) {
bytecode_function_list->Add(function);
}
if (function.HasCode()) {
@ -3337,11 +3337,12 @@ void Debugger::FindCompiledFunctions(
ASSERT(!function.IsNull());
bool function_added = false;
if (function.is_debuggable() &&
(function.HasCode() || function.HasBytecode()) &&
(function.HasCode() ||
(FLAG_enable_interpreter && function.HasBytecode())) &&
function.token_pos() == start_pos &&
function.end_token_pos() == end_pos &&
function.script() == script.raw()) {
if (function.HasBytecode()) {
if (FLAG_enable_interpreter && function.HasBytecode()) {
bytecode_function_list->Add(function);
}
if (function.HasCode()) {
@ -3352,7 +3353,7 @@ void Debugger::FindCompiledFunctions(
if (function_added && function.HasImplicitClosureFunction()) {
function = function.ImplicitClosureFunction();
if (function.is_debuggable()) {
if (function.HasBytecode()) {
if (FLAG_enable_interpreter && function.HasBytecode()) {
bytecode_function_list->Add(function);
}
if (function.HasCode()) {
@ -3498,6 +3499,7 @@ BreakpointLocation* Debugger::SetCodeBreakpoints(
intptr_t requested_column,
TokenPosition exact_token_pos,
const GrowableObjectArray& functions) {
ASSERT(!in_bytecode || FLAG_enable_interpreter);
Function& function = Function::Handle();
function ^= functions.At(0);
TokenPosition breakpoint_pos =
@ -4722,6 +4724,10 @@ void Debugger::HandleCodeChange(bool bytecode_loaded, const Function& func) {
// Return with minimal overhead if there are no breakpoints.
return;
}
if (bytecode_loaded && !FLAG_enable_interpreter) {
// We do not set breakpoints in bytecode if the interpreter is not used.
return;
}
if (!func.is_debuggable()) {
// Nothing to do if the function is not debuggable. If there is
// a pending breakpoint in an inner function (that is debuggable),