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
This commit is contained in:
mstarzinger@chromium.org 2014-02-14 14:58:05 +00:00
parent 55599b395a
commit 984af9c721
3 changed files with 13 additions and 0 deletions

View File

@ -254,6 +254,9 @@ DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
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")

View File

@ -3438,6 +3438,15 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
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();
HValue* current_size = size();

View File

@ -6528,6 +6528,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
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;
}