Bug 1269457 - Only set breakpoints for pending bp actors. r=ejpbruel draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 31 May 2016 16:05:39 -0500
changeset 373512 3b22ba246d7b465d30ebfcceda426f9564134028
parent 372306 3e1d7c5d1a58cb1763a2a78de02f96c6bcd2f06d
child 522413 97003e268f84b314f93193f213fd44add58dd465
push id19772
push userbmo:jryans@gmail.com
push dateTue, 31 May 2016 21:09:28 +0000
reviewersejpbruel
bugs1269457, 1225160
milestone49.0a1
Bug 1269457 - Only set breakpoints for pending bp actors. r=ejpbruel The special code path carved out in bug 1225160 dropped the `actor.isPending` check which causes many, many attempts to set a breakpoint on every new source notification, leading to a very slow debugging experience. MozReview-Commit-ID: A3pnHzh5eeh
devtools/server/actors/script.js
--- a/devtools/server/actors/script.js
+++ b/devtools/server/actors/script.js
@@ -2009,17 +2009,19 @@ const ThreadActor = ActorClass({
       // has not completed yet.
       //
       // The root of the problem is that unsafeSynchronize can cause debuggee
       // code to run. Unfortunately, fixing that is prohibitively difficult. The
       // best we can do at the moment is disable source maps for the browser
       // debugger, and carefully avoid the use of unsafeSynchronize in this
       // function when source maps are disabled.
       for (let actor of bpActors) {
-        actor.originalLocation.originalSourceActor._setBreakpoint(actor);
+        if (actor.isPending) {
+          actor.originalLocation.originalSourceActor._setBreakpoint(actor);
+        }
       }
     }
 
     this._debuggerSourcesSeen.add(aSource);
     return true;
   },