Index: src/debug/debug.cc |
diff --git a/src/debug/debug.cc b/src/debug/debug.cc |
index 3830d8eed863c3092529de7f64016e80296a98ca..22676eb37cfdb086c762b141e3cbd2311716eeb3 100644 |
--- a/src/debug/debug.cc |
+++ b/src/debug/debug.cc |
@@ -731,6 +731,13 @@ void Debug::ClearAllBreakPoints() { |
void Debug::FloodWithOneShot(Handle<JSFunction> function, |
BreakLocatorType type) { |
+ if (!function->shared()->IsSubjectToDebugging()) { |
+ // Builtin functions are not subject to stepping, but need to be |
+ // deoptimized, because optimized code does not check for debug |
+ // step in at call sites. |
+ Deoptimizer::DeoptimizeFunction(*function); |
+ return; |
+ } |
// Make sure the function is compiled and has set up the debug info. |
Handle<SharedFunctionInfo> shared(function->shared()); |
if (!EnsureDebugInfo(shared, function)) { |
@@ -2279,6 +2286,9 @@ void Debug::HandleDebugBreak() { |
isolate_->stack_guard()->ClearDebugBreak(); |
+ // Clear stepping to avoid duplicate breaks. |
+ ClearStepping(); |
+ |
ProcessDebugMessages(debug_command_only); |
} |