Only count uniquely named native scripts for debug.

The debugger exposes all native script which might include duplicates
having the same name. This is triggered by debug-script in stress mode
on the gc branch.

R=sgjesse@chromium.org
BUG=v8:1641
TEST=mjsunit/debug-script

Review URL: http://codereview.chromium.org/7740050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 77141f78
......@@ -34,14 +34,20 @@ RegExp();
// Count script types.
var named_native_count = 0;
var named_native_names = {};
var extension_count = 0;
var normal_count = 0;
var scripts = Debug.scripts();
for (i = 0; i < scripts.length; i++) {
if (scripts[i].type == Debug.ScriptType.Native) {
if (scripts[i].name) {
// TODO(1641): Remove check for equally named native scripts once the
// underlying issue is fixed.
if (!named_native_names[scripts[i].name]) {
named_native_names[scripts[i].name] = true;
named_native_count++;
}
}
} else if (scripts[i].type == Debug.ScriptType.Extension) {
extension_count++;
} else if (scripts[i].type == Debug.ScriptType.Normal) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment