|
|
@ -4842,21 +4842,28 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreArrayLiteralElement) { |
|
|
|
// Check whether debugger and is about to step into the callback that is passed
|
|
|
|
// to a built-in function such as Array.forEach.
|
|
|
|
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) { |
|
|
|
if (!isolate->IsDebuggerActive()) return isolate->heap()->false_value(); |
|
|
|
#ifdef ENABLE_DEBUGGER_SUPPORT |
|
|
|
if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) { |
|
|
|
return isolate->heap()->false_value(); |
|
|
|
} |
|
|
|
CONVERT_ARG_CHECKED(Object, callback, 0); |
|
|
|
// We do not step into the callback if it's a builtin or not even a function.
|
|
|
|
if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) { |
|
|
|
return isolate->heap()->false_value(); |
|
|
|
} |
|
|
|
return isolate->heap()->true_value(); |
|
|
|
#else |
|
|
|
return isolate->heap()->false_value(); |
|
|
|
#endif // ENABLE_DEBUGGER_SUPPORT
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { |
|
|
|
#ifdef ENABLE_DEBUGGER_SUPPORT |
|
|
|
Debug* debug = isolate->debug(); |
|
|
|
if (!debug->IsStepping()) return NULL; |
|
|
|
if (!debug->IsStepping()) return isolate->heap()->undefined_value(); |
|
|
|
CONVERT_ARG_CHECKED(Object, callback, 0); |
|
|
|
HandleScope scope(isolate); |
|
|
|
Handle<SharedFunctionInfo> shared_info(JSFunction::cast(callback)->shared()); |
|
|
@ -4865,7 +4872,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { |
|
|
|
// again, we need to clear the step out at this point.
|
|
|
|
debug->ClearStepOut(); |
|
|
|
debug->FloodWithOneShot(shared_info); |
|
|
|
return NULL; |
|
|
|
#endif // ENABLE_DEBUGGER_SUPPORT
|
|
|
|
return isolate->heap()->undefined_value(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|