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
This commit is contained in:
parent
1f8adc1503
commit
dc7fe989ae
@ -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++) {
|
||||
|
@ -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.
|
||||
|
@ -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");
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user