| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |