Skip to content

Commit a1fd679

Browse files
committed
abort inlining dom fastpath if it didn't get registered
1 parent 4f5a9d9 commit a1fd679

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

lib/Backend/Inline.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -3708,7 +3708,7 @@ Inline::InlineFunctionCommon(IR::Instr *callInstr, bool originalCallTargetOpndIs
37083708
// A functionInfo->Index# table is created in scriptContext (and potentially movable to threadContext if WS is not a concern).
37093709
// we use the table to identify the helper that needs to be lowered.
37103710
// At lower time we create the call to helper, which is function entrypoint at this time.
3711-
IR::Instr * Inline::InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const FunctionJITTimeInfo *const inlineeData, const FunctionJITTimeInfo *const inlinerData)
3711+
void Inline::InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const FunctionJITTimeInfo *const inlineeData, const FunctionJITTimeInfo *const inlinerData)
37123712
{
37133713
intptr_t functionInfo = inlineeData->GetFunctionInfoAddr();
37143714

@@ -3719,7 +3719,11 @@ IR::Instr * Inline::InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const F
37193719

37203720
// Find the helper routine for this functionInfo.
37213721
IR::JnHelperMethod helperMethod = this->topFunc->GetScriptContextInfo()->GetDOMFastPathHelper(functionInfo);
3722-
3722+
if (helperMethod == IR::HelperInvalid)
3723+
{
3724+
// abort inlining if helper isn't found
3725+
return;
3726+
}
37233727
// Find the instance object (External object).
37243728
PropertySym * fieldSym = ldFldInstr->GetSrc1()->AsSymOpnd()->m_sym->AsPropertySym();
37253729
IR::RegOpnd * instanceOpnd = IR::RegOpnd::New(fieldSym->m_stackSym, TyMachPtr, ldFldInstr->m_func);
@@ -3761,8 +3765,6 @@ IR::Instr * Inline::InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const F
37613765
this->topFunc->SetHasInlinee();
37623766

37633767
InsertStatementBoundary(ldInstr->m_next);
3764-
3765-
return ldInstr->m_next;
37663768
}
37673769
#endif
37683770
void

lib/Backend/Inline.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Inline
3939
intptr_t TryOptimizeInstrWithFixedDataProperty(IR::Instr *&instr);
4040
IR::Instr * InlineScriptFunction(IR::Instr *callInstr, const FunctionJITTimeInfo *const inlineeData, const StackSym *symThis, const Js::ProfileId profileId, bool* pIsInlined, uint recursiveInlineDepth);
4141
#ifdef ENABLE_DOM_FAST_PATH
42-
IR::Instr * InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const FunctionJITTimeInfo *const inlineeData, const FunctionJITTimeInfo *const inlinerData);
42+
void InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const FunctionJITTimeInfo *const inlineeData, const FunctionJITTimeInfo *const inlinerData);
4343
#endif
4444
IR::Instr * InlineGetterSetterFunction(IR::Instr *accessorInstr, const FunctionJITTimeInfo *const inlineeData, const StackSym *symCallerThis, const uint inlineCacheIndex, bool isGetter, bool *pIsInlined, uint recursiveInlineDepth);
4545
IR::Instr * InlineFunctionCommon(IR::Instr *callInstr, bool originalCallTargetOpndIsJITOpt, StackSym* originalCallTargetStackSym, const FunctionJITTimeInfo *funcInfo, Func *inlinee, IR::Instr *instrNext,

lib/Backend/ServerScriptContext.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,12 @@ ServerScriptContext::GetEmitBufferManager(bool asmJsManager)
335335
IR::JnHelperMethod
336336
ServerScriptContext::GetDOMFastPathHelper(intptr_t funcInfoAddr)
337337
{
338-
IR::JnHelperMethod helper;
338+
IR::JnHelperMethod helper = IR::HelperInvalid;
339339

340340
m_domFastPathHelperMap->LockResize();
341-
bool found = m_domFastPathHelperMap->TryGetValue(funcInfoAddr, &helper);
341+
m_domFastPathHelperMap->TryGetValue(funcInfoAddr, &helper);
342342
m_domFastPathHelperMap->UnlockResize();
343343

344-
Assert(found);
345344
return helper;
346345
}
347346

0 commit comments

Comments
 (0)