Skip to content

Commit

Permalink
[1.6>1.7] [MERGE #3584 @thomasmo] OS#13419689 - DOMFastPathGetter ins…
Browse files Browse the repository at this point in the history
…tructions do not propagate destination profile data, adding overhead to inlined getter calls

Merge pull request #3584 from thomasmo:domfastpathgetter_dst_profile

This change addresses the issue of Get/SetElement being used a TypedArrays from the host, which should have specialized calls
from the backend. This bug happens because, when the Inliner creates the DOMFastPathGetter instruction to replace a LdFld
instruction, it does not propagate dst's profile data. Thus, though DOMFastPathGetter avoids calling into the host, it also
introduces a new cost of making generic calls because the type is unknown.
This change ensures that the original LdFld's dst profile data is also copied to the new instruction for later type-specific
optimizations.
  • Loading branch information
Thomas Moore committed Aug 25, 2017
2 parents fe2ddd3 + 91c7699 commit e2345e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Backend/Inline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3755,7 +3755,11 @@ void Inline::InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const Function

StackSym * tmpSym = StackSym::New(ldFldInstr->GetDst()->GetType(), ldFldInstr->m_func);
IR::Opnd * tmpDst = IR::RegOpnd::New(tmpSym, tmpSym->GetType(), ldFldInstr->m_func);

// Ensure that the original LdFld's dst profile data is also copied to the new instruction for later
// type-specific optimizations. Otherwise, this optimization to reduce calls into the host will also
// result in relatively more expensive calls in the runtime.
tmpDst->SetValueType(ldFldInstr->GetDst()->GetValueType());

IR::Opnd * callInstrDst = ldFldInstr->UnlinkDst();
ldFldInstr->SetDst(tmpDst);

Expand Down

0 comments on commit e2345e7

Please sign in to comment.