Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: src/debug-debugger.js

Issue 1100183002: debug: cache SharedFunctionInfo for multi-bp set Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-debugger.js
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index 76b5fe1410592f440999d39230978a6e7a1f2666..b145fc9c50290d17dbe9dc45b12ed7d51c39f360 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -469,14 +469,24 @@ ScriptBreakPoint.prototype.clear = function () {
// Function called from runtime when a new script is compiled to set any script
// break points set in this script.
function UpdateScriptBreakPoints(script) {
+ var list = [];
for (var i = 0; i < script_break_points.length; i++) {
var break_point = script_break_points[i];
if ((break_point.type() == Debug.ScriptBreakPointType.ScriptName ||
break_point.type() == Debug.ScriptBreakPointType.ScriptRegExp) &&
break_point.matchesScript(script)) {
- break_point.set(script);
+ list.push(break_point);
}
}
+
+ // Cache the shared infos in script to avoid iterating through heap twice
+ if (list.length > 1) {
+ %CollectSharedFunctionInfoInScript(script);
+ }
+
+ for (var i = 0; i < list.length; i++) {
+ list[i].set(script);
+ }
}
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698