Revision: 19382
Author:   [email protected]
Date:     Fri Feb 14 14:58:05 2014 UTC
Log: Add flags for write barrier elimination and local allocation folding.

[email protected]

Review URL: https://codereview.chromium.org/166163003
http://code.google.com/p/v8/source/detail?r=19382

Modified:
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/hydrogen-instructions.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h

=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Thu Feb 13 16:09:28 2014 UTC +++ /branches/bleeding_edge/src/flag-definitions.h Fri Feb 14 14:58:05 2014 UTC
@@ -254,6 +254,9 @@
 DEFINE_bool(use_inlining, true, "use function inlining")
 DEFINE_bool(use_escape_analysis, true, "use hydrogen escape analysis")
 DEFINE_bool(use_allocation_folding, true, "use allocation folding")
+DEFINE_bool(use_local_allocation_folding, false, "only fold in basic blocks")
+DEFINE_bool(use_write_barrier_elimination, true,
+ "eliminate write barriers targeting allocations in optimized code")
 DEFINE_int(max_inlining_levels, 5, "maximum number of inlining levels")
 DEFINE_int(max_inlined_source_size, 600,
            "maximum source size in bytes considered for a single inlining")
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Thu Feb 13 16:09:28 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Fri Feb 14 14:58:05 2014 UTC
@@ -3437,6 +3437,15 @@
     }
     return false;
   }
+
+  // Check whether we are folding within the same block for local folding.
+  if (FLAG_use_local_allocation_folding && dominator->block() != block()) {
+    if (FLAG_trace_allocation_folding) {
+      PrintF("#%d (%s) cannot fold into #%d (%s), crosses basic blocks\n",
+          id(), Mnemonic(), dominator->id(), dominator->Mnemonic());
+    }
+    return false;
+  }

   HAllocate* dominator_allocate = HAllocate::cast(dominator);
   HValue* dominator_size = dominator_allocate->size();
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Thu Feb 13 16:09:28 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Feb 14 14:58:05 2014 UTC
@@ -6528,6 +6528,7 @@
   virtual bool HandleSideEffectDominator(GVNFlag side_effect,
                                          HValue* dominator) V8_OVERRIDE {
     ASSERT(side_effect == kNewSpacePromotion);
+    if (!FLAG_use_write_barrier_elimination) return false;
     new_space_dominator_ = dominator;
     return false;
   }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to