Author: [email protected]
Date: Mon Mar  9 03:33:31 2009
New Revision: 1448

Modified:
    branches/bleeding_edge/test/mjsunit/debug-script.js

Log:
Change the tests which looks at the number of scripts in the VM after  
startup to ignore native scripts without name.

Native scripts without name are currently only the script holding the empty  
script and the script holding the source for the empty function. These two  
unnamed scripts are created for each context. When running with snapshot an  
additional context is created during startup adding two more native scripts  
that in the non-snapshot case.
Review URL: http://codereview.chromium.org/39333

Modified: branches/bleeding_edge/test/mjsunit/debug-script.js
==============================================================================
--- branches/bleeding_edge/test/mjsunit/debug-script.js (original)
+++ branches/bleeding_edge/test/mjsunit/debug-script.js Mon Mar  9 03:33:31  
2009
@@ -33,28 +33,26 @@
  RegExp();

  // Count script types.
-var native_count = 0;
+var named_native_count = 0;
  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) {
-    native_count++;
+    if (scripts[i].name) {
+      named_native_count++;
+    }
    } else if (scripts[i].type == Debug.ScriptType.Extension) {
      extension_count++;
    } else if (scripts[i].type == Debug.ScriptType.Normal) {
-    if (!scripts[i].name) print("X" + scripts[i].source + "X"); // empty  
script
-    else {
-      print(scripts[i].name);
-      normal_count++;
-      }
+    normal_count++;
    } else {
      assertUnreachable('Unexpected type ' + scripts[i].type);
    }
  }

  // This has to be updated if the number of native scripts change.
-assertEquals(16, native_count);
+assertEquals(12, named_native_count);
  // If no snapshot is used, only the 'gc' extension is loaded.
  // If snapshot is used, all extensions are cached in the snapshot.
  assertTrue(extension_count == 1 || extension_count == 5);

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to