Disable for-in support in Crankshaft while crashes and regressions are being investig...
authorvegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 27 Feb 2012 10:43:57 +0000 (10:43 +0000)
committervegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 27 Feb 2012 10:43:57 +0000 (10:43 +0000)
R=yangguo@chromium.org

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

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

src/flag-definitions.h
src/hydrogen.cc

index bec85bf..2968445 100644 (file)
@@ -169,6 +169,9 @@ DEFINE_int(stress_runs, 0, "number of stress runs")
 DEFINE_bool(optimize_closures, true, "optimize closures")
 DEFINE_int(loop_weight, 1, "loop weight for representation inference")
 
+DEFINE_bool(optimize_for_in, false,
+            "optimize functions containing for-in loops")
+
 // Experimental profiler changes.
 DEFINE_bool(experimental_profiler, false, "enable all profiler experiments")
 DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability")
index 6bc8af5..4908586 100644 (file)
@@ -3242,6 +3242,10 @@ void HGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
   ASSERT(current_block() != NULL);
   ASSERT(current_block()->HasPredecessor());
 
+  if (!FLAG_optimize_for_in) {
+    return Bailout("ForInStatement optimization is disabled");
+  }
+
   if (!stmt->each()->IsVariableProxy() ||
       !stmt->each()->AsVariableProxy()->var()->IsStackLocal()) {
     return Bailout("ForInStatement with non-local each variable");