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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 "use strict"; 4 "use strict";
5 5
6 // Default number of frames to include in the response to backtrace request. 6 // Default number of frames to include in the response to backtrace request.
7 var kDefaultBacktraceLength = 10; 7 var kDefaultBacktraceLength = 10;
8 8
9 var Debug = {}; 9 var Debug = {};
10 10
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 462 }
463 } 463 }
464 break_points = remaining_break_points; 464 break_points = remaining_break_points;
465 this.break_points_ = []; 465 this.break_points_ = [];
466 }; 466 };
467 467
468 468
469 // Function called from runtime when a new script is compiled to set any script 469 // Function called from runtime when a new script is compiled to set any script
470 // break points set in this script. 470 // break points set in this script.
471 function UpdateScriptBreakPoints(script) { 471 function UpdateScriptBreakPoints(script) {
472 var list = [];
472 for (var i = 0; i < script_break_points.length; i++) { 473 for (var i = 0; i < script_break_points.length; i++) {
473 var break_point = script_break_points[i]; 474 var break_point = script_break_points[i];
474 if ((break_point.type() == Debug.ScriptBreakPointType.ScriptName || 475 if ((break_point.type() == Debug.ScriptBreakPointType.ScriptName ||
475 break_point.type() == Debug.ScriptBreakPointType.ScriptRegExp) && 476 break_point.type() == Debug.ScriptBreakPointType.ScriptRegExp) &&
476 break_point.matchesScript(script)) { 477 break_point.matchesScript(script)) {
477 break_point.set(script); 478 list.push(break_point);
478 } 479 }
479 } 480 }
481
482 // Cache the shared infos in script to avoid iterating through heap twice
483 if (list.length > 1) {
484 %CollectSharedFunctionInfoInScript(script);
485 }
486
487 for (var i = 0; i < list.length; i++) {
488 list[i].set(script);
489 }
480 } 490 }
481 491
482 492
483 function GetScriptBreakPoints(script) { 493 function GetScriptBreakPoints(script) {
484 var result = []; 494 var result = [];
485 for (var i = 0; i < script_break_points.length; i++) { 495 for (var i = 0; i < script_break_points.length; i++) {
486 if (script_break_points[i].matchesScript(script)) { 496 if (script_break_points[i].matchesScript(script)) {
487 result.push(script_break_points[i]); 497 result.push(script_break_points[i]);
488 } 498 }
489 } 499 }
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 case 'string': 2570 case 'string':
2561 case 'number': 2571 case 'number':
2562 json = value; 2572 json = value;
2563 break; 2573 break;
2564 2574
2565 default: 2575 default:
2566 json = null; 2576 json = null;
2567 } 2577 }
2568 return json; 2578 return json;
2569 } 2579 }
OLDNEW
« 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