Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[Merge chakra-core/ChakraCore@e2345e7d4a] [1.6>1.7] [MERGE #3584 @tho…
Browse files Browse the repository at this point in the history
…masmo] 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.
  • Loading branch information
chakrabot committed Aug 26, 2017
1 parent 7cda2d1 commit b344ac7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deps/chakrashim/core/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 b344ac7

Please sign in to comment.