@@ -69,7 +69,7 @@ Inline::Optimize(Func *func, __in_ecount_opt(callerArgOutCount) IR::Instr *calle
69
69
70
70
if (instr->AsLabelInstr ()->m_isForInExit )
71
71
{
72
- Assert (this ->currentForInDepth != 0 );
72
+ AssertOrFailFast (this ->currentForInDepth != 0 );
73
73
this ->currentForInDepth --;
74
74
}
75
75
}
@@ -2158,14 +2158,12 @@ Inline::InlineBuiltInFunction(IR::Instr *callInstr, const FunctionJITTimeInfo *
2158
2158
IR::Instr *inlineBuiltInEndInstr = nullptr ;
2159
2159
if (inlineCallOpCode == Js::OpCode::InlineFunctionApply)
2160
2160
{
2161
- inlineBuiltInEndInstr = InlineApply (callInstr, inlineeData, inlinerData, symCallerThis, pIsInlined, profileId, recursiveInlineDepth, inlineCallArgCount - (usesThisArgument ? 1 : 0 ));
2162
- return inlineBuiltInEndInstr->m_next ;
2161
+ return InlineApply (callInstr, inlineeData, inlinerData, symCallerThis, pIsInlined, profileId, recursiveInlineDepth, inlineCallArgCount - (usesThisArgument ? 1 : 0 ));
2163
2162
}
2164
2163
2165
2164
if (inlineCallOpCode == Js::OpCode::InlineFunctionCall)
2166
2165
{
2167
- inlineBuiltInEndInstr = InlineCall (callInstr, inlineeData, inlinerData, symCallerThis, pIsInlined, profileId, recursiveInlineDepth);
2168
- return inlineBuiltInEndInstr->m_next ;
2166
+ return InlineCall (callInstr, inlineeData, inlinerData, symCallerThis, pIsInlined, profileId, recursiveInlineDepth);
2169
2167
}
2170
2168
2171
2169
@@ -2415,9 +2413,10 @@ IR::Instr* Inline::InlineApply(IR::Instr *callInstr, const FunctionJITTimeInfo *
2415
2413
// We may still decide not to inline.
2416
2414
*pIsInlined = false ;
2417
2415
2416
+ IR::Instr* instrNext = callInstr->m_next ;
2418
2417
if (argsCount == 0 )
2419
2418
{
2420
- return callInstr ;
2419
+ return instrNext ;
2421
2420
}
2422
2421
2423
2422
Js::BuiltinFunction builtInId = Js::JavascriptLibrary::GetBuiltInForFuncInfo (applyData->GetLocalFunctionId ());
@@ -2459,7 +2458,7 @@ IR::Instr* Inline::InlineApply(IR::Instr *callInstr, const FunctionJITTimeInfo *
2459
2458
if (PHASE_OFF1 (Js::InlineApplyWithoutArrayArgPhase))
2460
2459
{
2461
2460
*pIsInlined = false ;
2462
- return callInstr ;
2461
+ return instrNext ;
2463
2462
}
2464
2463
*pIsInlined = true ;
2465
2464
@@ -2490,7 +2489,7 @@ IR::Instr* Inline::InlineApply(IR::Instr *callInstr, const FunctionJITTimeInfo *
2490
2489
{
2491
2490
INLINE_TESTTRACE (_u (" INLINING: Skip Inline: Supporting inlining func.apply(this, array) or func.apply(this, arguments) with formals in the parent function only when func is a built-in inlinable as apply target \t Caller: %s (%s)\n " ),
2492
2491
inlinerData->GetBody ()->GetDisplayName (), inlinerData->GetDebugNumberSet (debugStringBuffer));
2493
- return callInstr ;
2492
+ return instrNext ;
2494
2493
}
2495
2494
}
2496
2495
@@ -2506,6 +2505,7 @@ IR::Instr* Inline::InlineApply(IR::Instr *callInstr, const FunctionJITTimeInfo *
2506
2505
2507
2506
IR::Instr * Inline::InlineApplyWithArgumentsObject (IR::Instr * callInstr, IR::Instr * argsObjectArgInstr, const FunctionJITTimeInfo * funcInfo)
2508
2507
{
2508
+ IR::Instr* instrNext = callInstr->m_next ;
2509
2509
IR::Instr* ldHeapArguments = argsObjectArgInstr->GetSrc1 ()->GetStackSym ()->GetInstrDef ();
2510
2510
argsObjectArgInstr->ReplaceSrc1 (ldHeapArguments->GetDst ());
2511
2511
@@ -2595,14 +2595,15 @@ IR::Instr * Inline::InlineApplyWithArgumentsObject(IR::Instr * callInstr, IR::In
2595
2595
2596
2596
argout = IR::Instr::New (Js::OpCode::ArgOut_A_Dynamic, linkOpnd2, explicitThisArgOut->GetSrc1 (), linkOpnd1, callInstr->m_func ); // push explicit this as this pointer
2597
2597
callInstr->InsertBefore (argout);
2598
- return callInstr ;
2598
+ return instrNext ;
2599
2599
}
2600
2600
2601
2601
/*
2602
2602
This method will only do CallDirect style inlining of built-in targets. No script function inlining.
2603
2603
*/
2604
2604
IR::Instr * Inline::InlineApplyBuiltInTargetWithArray (IR::Instr * callInstr, const FunctionJITTimeInfo * applyInfo, const FunctionJITTimeInfo * builtInInfo)
2605
2605
{
2606
+ IR::Instr* instrNext = callInstr->m_next ;
2606
2607
IR::Instr * implicitThisArgOut = nullptr ;
2607
2608
IR::Instr * explicitThisArgOut = nullptr ;
2608
2609
IR::Instr * arrayArgOut = nullptr ;
@@ -2620,7 +2621,7 @@ IR::Instr * Inline::InlineApplyBuiltInTargetWithArray(IR::Instr * callInstr, con
2620
2621
IR::Instr* applyTargetLdInstr = nullptr ;
2621
2622
if (!TryGetApplyAndTargetLdInstrs (callInstr, &applyLdInstr, &applyTargetLdInstr))
2622
2623
{
2623
- return callInstr ;
2624
+ return instrNext ;
2624
2625
}
2625
2626
// Fixed function/function object checks for target built-in
2626
2627
callInstr->ReplaceSrc1 (applyTargetLdInstr->GetDst ());
@@ -2685,11 +2686,12 @@ IR::Instr * Inline::InlineApplyBuiltInTargetWithArray(IR::Instr * callInstr, con
2685
2686
callInstr->ReplaceSrc1 (helperCallOpnd);
2686
2687
callInstr->ReplaceSrc2 (argOut->GetDst ());
2687
2688
2688
- return callInstr ;
2689
+ return instrNext ;
2689
2690
}
2690
2691
2691
2692
IR::Instr * Inline::InlineApplyWithoutArrayArgument (IR::Instr *callInstr, const FunctionJITTimeInfo * applyInfo, const FunctionJITTimeInfo * applyTargetInfo)
2692
2693
{
2694
+ IR::Instr* instrNext = callInstr->m_next ;
2693
2695
IR::Instr * implicitThisArgOut = nullptr ;
2694
2696
IR::Instr * explicitThisArgOut = nullptr ;
2695
2697
IR::Instr * dummyInstr = nullptr ;
@@ -2728,12 +2730,12 @@ IR::Instr * Inline::InlineApplyWithoutArrayArgument(IR::Instr *callInstr, const
2728
2730
2729
2731
if (!callTargetStackSym->IsSingleDef ())
2730
2732
{
2731
- return callInstr ;
2733
+ return instrNext ;
2732
2734
}
2733
2735
2734
2736
if (!applyTargetInfo)
2735
2737
{
2736
- return callInstr ;
2738
+ return instrNext ;
2737
2739
}
2738
2740
2739
2741
bool safeThis = false ;
@@ -2745,7 +2747,7 @@ IR::Instr * Inline::InlineApplyWithoutArrayArgument(IR::Instr *callInstr, const
2745
2747
callInstr->InsertBefore (bytecodeUses);
2746
2748
}
2747
2749
2748
- return callInstr ;
2750
+ return instrNext ;
2749
2751
}
2750
2752
2751
2753
void Inline::GetArgInstrsForCallAndApply (IR::Instr* callInstr, IR::Instr** implicitThisArgOut, IR::Instr** explicitThisArgOut, IR::Instr** argumentsOrArrayArgOut, uint &argOutCount)
@@ -3015,7 +3017,7 @@ Inline::InlineCallApplyTarget_Shared(IR::Instr *callInstr, bool originalCallTarg
3015
3017
// instrNext
3016
3018
IR::Instr* instrNext = callInstr->m_next ;
3017
3019
3018
- return InlineFunctionCommon (callInstr, originalCallTargetOpndIsJITOpt, originalCallTargetStackSym, inlineeData, inlinee, instrNext, returnValueOpnd, callInstr, nullptr , recursiveInlineDepth, safeThis, isApplyTarget)-> m_prev ;
3020
+ return InlineFunctionCommon (callInstr, originalCallTargetOpndIsJITOpt, originalCallTargetStackSym, inlineeData, inlinee, instrNext, returnValueOpnd, callInstr, nullptr , recursiveInlineDepth, safeThis, isApplyTarget);
3019
3021
}
3020
3022
3021
3023
IR::Opnd *
@@ -3029,14 +3031,15 @@ Inline::ConvertToInlineBuiltInArgOut(IR::Instr * argInstr)
3029
3031
IR::Instr*
3030
3032
Inline::InlineCall (IR::Instr *callInstr, const FunctionJITTimeInfo *funcInfo, const FunctionJITTimeInfo * inlinerData, const StackSym *symCallerThis, bool * pIsInlined, uint callSiteId, uint recursiveInlineDepth)
3031
3033
{
3034
+ IR::Instr* instrNext = callInstr->m_next ;
3032
3035
Func *func = callInstr->m_func ;
3033
3036
Js::BuiltinFunction builtInId = Js::JavascriptLibrary::GetBuiltInForFuncInfo (funcInfo->GetLocalFunctionId ());
3034
3037
3035
3038
*pIsInlined = false ;
3036
3039
if (PHASE_OFF (Js::InlineCallPhase, this ->topFunc ) || PHASE_OFF (Js::InlineCallPhase, func)
3037
3040
|| !this ->topFunc ->GetJITFunctionBody ()->GetInParamsCount ())
3038
3041
{
3039
- return callInstr ;
3042
+ return instrNext ;
3040
3043
}
3041
3044
3042
3045
// Convert all the current ARG_OUT to ArgOut_A_InlineBuiltIn
@@ -3045,7 +3048,7 @@ Inline::InlineCall(IR::Instr *callInstr, const FunctionJITTimeInfo *funcInfo, co
3045
3048
if (!GetDefInstr (linkOpnd)->GetSrc2 ()->IsSymOpnd ())
3046
3049
{
3047
3050
// There is no benefit of inlining.call() with no arguments.
3048
- return callInstr ;
3051
+ return instrNext ;
3049
3052
}
3050
3053
3051
3054
*pIsInlined = true ;
@@ -3125,7 +3128,7 @@ Inline::InlineCall(IR::Instr *callInstr, const FunctionJITTimeInfo *funcInfo, co
3125
3128
}
3126
3129
clonedArgout->SetSrc2 (startCall->GetDst ());
3127
3130
Assert (GetDefInstr (orgLinkOpnd) == argImplicitInstr);
3128
- return callInstr ;
3131
+ return instrNext ;
3129
3132
}
3130
3133
3131
3134
bool
0 commit comments