From: yangguo@chromium.org Date: Tue, 10 Jun 2014 09:42:41 +0000 (+0000) Subject: Do not clear mirror cache when fetching loaded scripts. X-Git-Tag: upstream/4.7.83~8760 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc7fe989ae5e50e142ff53e3ab831a7bb2acff28;p=platform%2Fupstream%2Fv8.git Do not clear mirror cache when fetching loaded scripts. R=yurys@chromium.org BUG=376534 LOG=N Review URL: https://codereview.chromium.org/309313002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21737 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/debug-debugger.js b/src/debug-debugger.js index 5462b53..660ea79 100644 --- a/src/debug-debugger.js +++ b/src/debug-debugger.js @@ -486,12 +486,6 @@ function GetScriptBreakPoints(script) { } -function GetLoadedScripts() { - ClearMirrorCache(); // The mirror cache may be holding onto scripts. - return %DebugGetLoadedScripts(); -} - - Debug.setListener = function(listener, opt_data) { if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) { throw new Error('Parameters have wrong types.'); @@ -921,7 +915,7 @@ Debug.showBreakPoints = function(f, full, opt_position_alignment) { // scanning the heap. Debug.scripts = function() { // Collect all scripts in the heap. - return GetLoadedScripts(); + return %DebugGetLoadedScripts(); }; @@ -2250,7 +2244,7 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) { } // Collect all scripts in the heap. - var scripts = GetLoadedScripts(); + var scripts = %DebugGetLoadedScripts(); response.body = []; @@ -2322,7 +2316,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function( var script_id = request.arguments.script_id; var preview_only = !!request.arguments.preview_only; - var scripts = GetLoadedScripts(); + var scripts = %DebugGetLoadedScripts(); var the_script = null; for (var i = 0; i < scripts.length; i++) { diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js index f878f5a..897413c 100644 --- a/src/mirror-debugger.js +++ b/src/mirror-debugger.js @@ -18,15 +18,6 @@ function ToggleMirrorCache(value) { } -/** - * Clear the mirror handle cache. - */ -function ClearMirrorCache() { - next_handle_ = 0; - mirror_cache_ = []; -} - - // Wrapper to check whether an object is a Promise. The call may not work // if promises are not enabled. // TODO(yangguo): remove try-catch once promises are enabled by default. diff --git a/test/mjsunit/debug-mirror-cache.js b/test/mjsunit/debug-mirror-cache.js index 07aaf88..c690aa0 100644 --- a/test/mjsunit/debug-mirror-cache.js +++ b/test/mjsunit/debug-mirror-cache.js @@ -62,6 +62,9 @@ function listener(event, exec_state, event_data, data) { json = '{"seq":0,"type":"request","command":"backtrace"}' dcp.processDebugJSONRequest(json); + // Make sure looking up loaded scripts does not clear the cache. + Debug.scripts(); + // Some mirrors where cached. assertFalse(debug.next_handle_ == 0, "Mirror cache not used"); assertFalse(debug.mirror_cache_.length == 0, "Mirror cache not used"); diff --git a/tools/generate-runtime-tests.py b/tools/generate-runtime-tests.py index a4414be..71b46c6 100755 --- a/tools/generate-runtime-tests.py +++ b/tools/generate-runtime-tests.py @@ -51,7 +51,7 @@ EXPECTED_FUNCTION_COUNT = 358 EXPECTED_FUZZABLE_COUNT = 325 EXPECTED_CCTEST_COUNT = 6 EXPECTED_UNKNOWN_COUNT = 5 -EXPECTED_BUILTINS_COUNT = 798 +EXPECTED_BUILTINS_COUNT = 796 # Don't call these at all.