Fix test-log/EquivalenceOfLoggingAndTraversal
authoryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 Aug 2013 14:56:23 +0000 (14:56 +0000)
committeryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 Aug 2013 14:56:23 +0000 (14:56 +0000)
The test has been marked as intermittently failing since 2011 and since that "code-creation" event signature has changed a bit. I updated the parser in the test but that revealed another issue: "code-creation" events with type 'Script' didn't match functions with type 'LazyCompile' retrieved during the heap traversal because the later had name " :1:1" which didn't match the script's name.

BUG=v8:2857
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/22824043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/cctest.status
test/cctest/log-eq-of-logging-and-traversal.js

index 71d7717..6cd868c 100644 (file)
@@ -42,9 +42,6 @@ test-serialize/DependentTestThatAlwaysFails: FAIL
 # This test always fails.  It tests that LiveEdit causes abort when turned off.
 test-debug/LiveEditDisabled: FAIL
 
-# Bug(2857)
-test-log/EquivalenceOfLoggingAndTraversal: SKIP
-
 # We do not yet shrink weak maps after they have been emptied by the GC
 test-weakmaps/Shrinking: FAIL
 test-weaksets/WeakSet_Shrinking: FAIL
index 05643bf..522a372 100644 (file)
@@ -39,7 +39,7 @@ function parseState(s) {
 function LogProcessor() {
   LogReader.call(this, {
       'code-creation': {
-          parsers: [null, parseInt, parseInt, null, 'var-args'],
+          parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'],
           processor: this.processCodeCreation },
       'code-move': { parsers: [parseInt, parseInt],
           processor: this.processCodeMove },
@@ -55,8 +55,12 @@ function LogProcessor() {
 LogProcessor.prototype.__proto__ = LogReader.prototype;
 
 LogProcessor.prototype.processCodeCreation = function(
-    type, start, size, name, maybe_func) {
+    type, kind, start, size, name, maybe_func) {
   if (type != "LazyCompile" && type != "Script" && type != "Function") return;
+  // Scripts will compile into anonymous functions starting at 1:1. Adjust the
+  // name here so that it matches corrsponding function's name during the heap
+  // traversal.
+  if (type == "Script") name = " :1:1";
   // Discard types to avoid discrepancies in "LazyCompile" vs. "Function".
   type = "";
   if (maybe_func.length) {