Allow d8 to run a script multiple times, each time with a new context.
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 1 Feb 2012 16:47:06 +0000 (16:47 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 1 Feb 2012 16:47:06 +0000 (16:47 +0000)
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9310001

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

src/d8.cc

index e555c15..31beaf9 100644 (file)
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1485,6 +1485,12 @@ int Shell::Main(int argc, char* argv[]) {
     }
     printf("======== Full Deoptimization =======\n");
     Testing::DeoptimizeAll();
+  } else if (i::FLAG_stress_runs > 0) {
+    int stress_runs = i::FLAG_stress_runs;
+    for (int i = 0; i < stress_runs && result == 0; i++) {
+      printf("============ Run %d/%d ============\n", i + 1, stress_runs);
+      result = RunMain(argc, argv);
+    }
   } else {
     result = RunMain(argc, argv);
   }