Index: src/debug.cc |
diff --git a/src/debug.cc b/src/debug.cc |
index 2058d48b71e431bf9a89816dbfc47bcf755f11d5..01f6f398af7ee6d9bfe2482af1f3905a25375d52 100644 |
--- a/src/debug.cc |
+++ b/src/debug.cc |
@@ -1223,6 +1223,18 @@ void Debug::FloodWithOneShot(Handle<SharedFunctionInfo> shared) { |
} |
+void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) { |
+ Handle<FixedArray> new_bindings(function->function_bindings()); |
+ Handle<Object> bindee(new_bindings->get(JSFunction::kBoundFunctionIndex)); |
+ |
+ if (!bindee.is_null() && bindee->IsJSFunction() && |
+ !JSFunction::cast(*bindee)->IsBuiltin()) { |
+ Handle<SharedFunctionInfo> shared_info(JSFunction::cast(*bindee)->shared()); |
+ Debug::FloodWithOneShot(shared_info); |
+ } |
+} |
+ |
+ |
void Debug::FloodHandlerWithOneShot() { |
// Iterate through the JavaScript stack looking for handlers. |
StackFrame::Id id = break_frame_id(); |
@@ -1442,8 +1454,10 @@ void Debug::PrepareStep(StepAction step_action, int step_count) { |
expressions_count - 2 - call_function_arg_count); |
if (fun->IsJSFunction()) { |
Handle<JSFunction> js_function(JSFunction::cast(fun)); |
- // Don't step into builtins. |
- if (!js_function->IsBuiltin()) { |
+ if (js_function->shared()->bound()) { |
+ Debug::FloodBoundFunctionWithOneShot(js_function); |
+ } else if (!js_function->IsBuiltin()) { |
+ // Don't step into builtins. |
// It will also compile target function if it's not compiled yet. |
FloodWithOneShot(Handle<SharedFunctionInfo>(js_function->shared())); |
} |
@@ -1639,8 +1653,11 @@ void Debug::HandleStepIn(Handle<JSFunction> function, |
// Flood the function with one-shot break points if it is called from where |
// step into was requested. |
if (fp == step_in_fp()) { |
- // Don't allow step into functions in the native context. |
- if (!function->IsBuiltin()) { |
+ if (function->shared()->bound()) { |
+ // Handle Function.prototype.bind |
+ Debug::FloodBoundFunctionWithOneShot(function); |
+ } else if (!function->IsBuiltin()) { |
+ // Don't allow step into functions in the native context. |
if (function->shared()->code() == |
Isolate::Current()->builtins()->builtin(Builtins::kFunctionApply) || |
function->shared()->code() == |