Chromium Code Reviews| Index: src/runtime/runtime-debug.cc |
| diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc |
| index 281ba29695d54ebd8d26aba7376706641180dbc9..af234b56cddc9b42ecb99fb4758424788fa979b2 100644 |
| --- a/src/runtime/runtime-debug.cc |
| +++ b/src/runtime/runtime-debug.cc |
| @@ -5,6 +5,7 @@ |
| #include "src/runtime/runtime-utils.h" |
| #include "src/arguments.h" |
| +#include "src/compiler.h" |
| #include "src/debug/debug-evaluate.h" |
| #include "src/debug/debug-frames.h" |
| #include "src/debug/debug-scopes.h" |
| @@ -1846,14 +1847,18 @@ RUNTIME_FUNCTION(Runtime_ScriptSourceLine) { |
| return *str; |
| } |
| -// 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) { |
| +// Perform %DebugPrepareStepInIfStepping and a read-only check. |
|
jgruber
2017/01/11 16:12:39
This comment is out of date.
Yang
2017/01/12 06:04:51
Done.
|
| +RUNTIME_FUNCTION(Runtime_DebugOnFunctionCall) { |
| HandleScope scope(isolate); |
| DCHECK_EQ(1, args.length()); |
| CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
| - isolate->debug()->PrepareStepIn(fun); |
| + if (isolate->debug()->last_step_action() >= StepIn) { |
| + isolate->debug()->PrepareStepIn(fun); |
| + } |
| + if (isolate->needs_side_effect_check() && |
| + !isolate->debug()->PerformSideEffectCheck(fun)) { |
| + return isolate->heap()->exception(); |
| + } |
| return isolate->heap()->undefined_value(); |
| } |