| Index: src/runtime/runtime-debug.cc
|
| diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
|
| index 8bdec1061b1f92af06c7938db61fdbe7d9b7c83c..31e87c2efbe469bb56fff46063238c3cfdcac12f 100644
|
| --- a/src/runtime/runtime-debug.cc
|
| +++ b/src/runtime/runtime-debug.cc
|
| @@ -1658,25 +1658,15 @@ RUNTIME_FUNCTION(Runtime_DebugCallbackSupportsStepping) {
|
| }
|
|
|
|
|
| -void FloodDebugSubjectWithOneShot(Debug* debug, Handle<JSFunction> function) {
|
| - if (function->shared()->IsSubjectToDebugging() ||
|
| - function->shared()->bound()) {
|
| - // When leaving the function, step out has been activated, but not performed
|
| - // if we do not leave the builtin. To be able to step into the function
|
| - // again, we need to clear the step out at this point.
|
| - debug->ClearStepOut();
|
| - debug->FloodWithOneShotGeneric(function);
|
| - }
|
| -}
|
| -
|
| -
|
| // Set one shot breakpoints for the callback function that is passed to a
|
| // built-in function such as Array.forEach to enable stepping into the callback,
|
| // if we are indeed stepping and the callback is subject to debugging.
|
| RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
|
| DCHECK(args.length() == 1);
|
| Debug* debug = isolate->debug();
|
| - if (!DebugStepInIsActive(debug)) return isolate->heap()->undefined_value();
|
| + if (debug->in_debug_scope() || !DebugStepInIsActive(debug)) {
|
| + return isolate->heap()->undefined_value();
|
| + }
|
|
|
| HandleScope scope(isolate);
|
| CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
|
| @@ -1689,22 +1679,18 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
|
| Handle<JSGeneratorObject>::cast(object)->function(), isolate);
|
| }
|
|
|
| - FloodDebugSubjectWithOneShot(debug, fun);
|
| + debug->ClearStepOut();
|
| + debug->FloodWithOneShotGeneric(fun);
|
| return isolate->heap()->undefined_value();
|
| }
|
|
|
|
|
| RUNTIME_FUNCTION(Runtime_DebugPushPromise) {
|
| - DCHECK(args.length() == 3);
|
| + DCHECK(args.length() == 2);
|
| HandleScope scope(isolate);
|
| CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
|
| CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 1);
|
| - CONVERT_ARG_HANDLE_CHECKED(Object, handler, 2);
|
| isolate->PushPromise(promise, function);
|
| - Debug* debug = isolate->debug();
|
| - if (handler->IsJSFunction() && DebugStepInIsActive(debug)) {
|
| - FloodDebugSubjectWithOneShot(debug, Handle<JSFunction>::cast(handler));
|
| - }
|
| return isolate->heap()->undefined_value();
|
| }
|
|
|
|
|