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

Unified Diff: src/debug-debugger.js

Issue 296953005: Fix leak in debug mirror cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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') | test/mjsunit/debug-scripts-request.js » ('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 660ea790389ae4e828681fe786683ee0f3a7a3a4..5462b53b6b0ba823218e144663bebcebff06facd 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -486,6 +486,12 @@ function GetScriptBreakPoints(script) {
}
+function GetLoadedScripts() {
+ ClearMirrorCache(); // The mirror cache may be holding onto scripts.
+ return %DebugGetLoadedScripts();
yurys 2014/06/03 08:07:21 This change looks wrong to me. By design of V8 deb
Yang 2014/06/03 08:12:46 Not sure I understand. Which code path does blink
+}
+
+
Debug.setListener = function(listener, opt_data) {
if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) {
throw new Error('Parameters have wrong types.');
@@ -915,7 +921,7 @@ Debug.showBreakPoints = function(f, full, opt_position_alignment) {
// scanning the heap.
Debug.scripts = function() {
// Collect all scripts in the heap.
- return %DebugGetLoadedScripts();
+ return GetLoadedScripts();
};
@@ -2244,7 +2250,7 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
}
// Collect all scripts in the heap.
- var scripts = %DebugGetLoadedScripts();
+ var scripts = GetLoadedScripts();
response.body = [];
@@ -2316,7 +2322,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(
var script_id = request.arguments.script_id;
var preview_only = !!request.arguments.preview_only;
- var scripts = %DebugGetLoadedScripts();
+ var scripts = GetLoadedScripts();
var the_script = null;
for (var i = 0; i < scripts.length; i++) {
« no previous file with comments | « src/debug.cc ('k') | test/mjsunit/debug-scripts-request.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698