Skip to content

Commit e2345e7

Browse files
author
Thomas Moore
committed
[1.6>1.7] [MERGE #3584 @thomasmo] OS#13419689 - DOMFastPathGetter instructions 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.
2 parents fe2ddd3 + 91c7699 commit e2345e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Backend/Inline.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3755,7 +3755,11 @@ void Inline::InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const Function
37553755

37563756
StackSym * tmpSym = StackSym::New(ldFldInstr->GetDst()->GetType(), ldFldInstr->m_func);
37573757
IR::Opnd * tmpDst = IR::RegOpnd::New(tmpSym, tmpSym->GetType(), ldFldInstr->m_func);
3758-
3758+
// Ensure that the original LdFld's dst profile data is also copied to the new instruction for later
3759+
// type-specific optimizations. Otherwise, this optimization to reduce calls into the host will also
3760+
// result in relatively more expensive calls in the runtime.
3761+
tmpDst->SetValueType(ldFldInstr->GetDst()->GetValueType());
3762+
37593763
IR::Opnd * callInstrDst = ldFldInstr->UnlinkDst();
37603764
ldFldInstr->SetDst(tmpDst);
37613765

0 commit comments

Comments
 (0)