Add flags for write barrier elimination and local allocation folding.

R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19382 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 55599b39
...@@ -254,6 +254,9 @@ DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing") ...@@ -254,6 +254,9 @@ DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
DEFINE_bool(use_inlining, true, "use function inlining") DEFINE_bool(use_inlining, true, "use function inlining")
DEFINE_bool(use_escape_analysis, true, "use hydrogen escape analysis") DEFINE_bool(use_escape_analysis, true, "use hydrogen escape analysis")
DEFINE_bool(use_allocation_folding, true, "use allocation folding") 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_inlining_levels, 5, "maximum number of inlining levels")
DEFINE_int(max_inlined_source_size, 600, DEFINE_int(max_inlined_source_size, 600,
"maximum source size in bytes considered for a single inlining") "maximum source size in bytes considered for a single inlining")
......
...@@ -3438,6 +3438,15 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect, ...@@ -3438,6 +3438,15 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
return false; 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); HAllocate* dominator_allocate = HAllocate::cast(dominator);
HValue* dominator_size = dominator_allocate->size(); HValue* dominator_size = dominator_allocate->size();
HValue* current_size = size(); HValue* current_size = size();
......
...@@ -6528,6 +6528,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { ...@@ -6528,6 +6528,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
virtual bool HandleSideEffectDominator(GVNFlag side_effect, virtual bool HandleSideEffectDominator(GVNFlag side_effect,
HValue* dominator) V8_OVERRIDE { HValue* dominator) V8_OVERRIDE {
ASSERT(side_effect == kNewSpacePromotion); ASSERT(side_effect == kNewSpacePromotion);
if (!FLAG_use_write_barrier_elimination) return false;
new_space_dominator_ = dominator; new_space_dominator_ = dominator;
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment