|
|
@@ -9,7 +9,7 @@
|
|
|
void EmitReference(ParseNode *pnode, ByteCodeGenerator *byteCodeGenerator, FuncInfo *funcInfo);
|
|
|
void EmitAssignment(ParseNode *asgnNode, ParseNode *lhs, Js::RegSlot rhsLocation, ByteCodeGenerator *byteCodeGenerator, FuncInfo *funcInfo);
|
|
|
void EmitLoad(ParseNode *rhs, ByteCodeGenerator *byteCodeGenerator, FuncInfo *funcInfo);
|
|
|
-void EmitCall(ParseNode* pnode, Js::RegSlot rhsLocation, ByteCodeGenerator* byteCodeGenerator, FuncInfo* funcInfo, BOOL fReturnValue, BOOL fEvaluateComponents, BOOL fHasNewTarget, Js::RegSlot overrideThisLocation = Js::Constants::NoRegister);
|
|
|
+void EmitCall(ParseNode* pnode, ByteCodeGenerator* byteCodeGenerator, FuncInfo* funcInfo, BOOL fReturnValue, BOOL fEvaluateComponents, BOOL fHasNewTarget, Js::RegSlot overrideThisLocation = Js::Constants::NoRegister);
|
|
|
void EmitSuperFieldPatch(FuncInfo* funcInfo, ParseNode* pnode, ByteCodeGenerator* byteCodeGenerator);
|
|
|
void EmitYield(Js::RegSlot inputLocation, Js::RegSlot resultLocation, ByteCodeGenerator* byteCodeGenerator, FuncInfo* funcInfo, Js::RegSlot yieldStarIterator = Js::Constants::NoRegister);
|
|
|
|
|
|
@@ -2404,7 +2404,7 @@ void ByteCodeGenerator::EmitSuperCall(FuncInfo* funcInfo, ParseNode* pnode, BOOL
|
|
|
this->Writer()->Reg2(Js::OpCode::Ld_A, thisForSuperCall, funcInfo->newTargetRegister);
|
|
|
|
|
|
this->Writer()->MarkLabel(makeCallLabel);
|
|
|
- EmitCall(pnode, Js::Constants::NoRegister, this, funcInfo, fReturnValue, /*fEvaluateComponents*/ true, /*fHasNewTarget*/ true, thisForSuperCall);
|
|
|
+ EmitCall(pnode, this, funcInfo, fReturnValue, /*fEvaluateComponents*/ true, /*fHasNewTarget*/ true, thisForSuperCall);
|
|
|
|
|
|
// We have to use another temp for the this value before assigning to this register.
|
|
|
// This is because IRBuilder does not expect us to use the value of a temp after potentially assigning to that same temp.
|
|
|
@@ -7244,7 +7244,7 @@ void EmitLoad(
|
|
|
case knopCall:
|
|
|
funcInfo->AcquireLoc(lhs);
|
|
|
EmitReference(lhs, byteCodeGenerator, funcInfo);
|
|
|
- EmitCall(lhs, /*rhs=*/ Js::Constants::NoRegister, byteCodeGenerator, funcInfo, /*fReturnValue=*/ false, /*fEvaluateComponents=*/ false, /*fHasNewTarget=*/ false);
|
|
|
+ EmitCall(lhs, byteCodeGenerator, funcInfo, /*fReturnValue=*/ false, /*fEvaluateComponents=*/ false, /*fHasNewTarget=*/ false);
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
@@ -7357,7 +7357,6 @@ void EmitArgListStart(
|
|
|
|
|
|
Js::ArgSlot EmitArgListEnd(
|
|
|
ParseNode *pnode,
|
|
|
- Js::RegSlot rhsLocation,
|
|
|
Js::RegSlot thisLocation,
|
|
|
Js::RegSlot evalLocation,
|
|
|
Js::RegSlot newTargetLocation,
|
|
|
@@ -7367,7 +7366,6 @@ Js::ArgSlot EmitArgListEnd(
|
|
|
Js::ProfileId callSiteId)
|
|
|
{
|
|
|
BOOL fEvalInModule = false;
|
|
|
- BOOL fIsPut = (rhsLocation != Js::Constants::NoRegister);
|
|
|
BOOL fIsEval = (evalLocation != Js::Constants::NoRegister);
|
|
|
BOOL fHasNewTarget = (newTargetLocation != Js::Constants::NoRegister);
|
|
|
|
|
|
@@ -7377,14 +7375,6 @@ Js::ArgSlot EmitArgListEnd(
|
|
|
Js::ArgSlot argSlotIndex = (Js::ArgSlot) argIndex;
|
|
|
Js::ArgSlot evalIndex;
|
|
|
|
|
|
- if (fIsPut)
|
|
|
- {
|
|
|
- // Emit the assigned value as an additional operand. Note that the value has already been evaluated.
|
|
|
- // We just need to emit the ArgOut instruction.
|
|
|
- argSlotIndex++;
|
|
|
- byteCodeGenerator->Writer()->ArgOut<true>(argSlotIndex, rhsLocation, callSiteId);
|
|
|
- }
|
|
|
-
|
|
|
if (fIsEval && argSlotIndex > 0)
|
|
|
{
|
|
|
Assert(!fHasNewTarget);
|
|
|
@@ -7454,7 +7444,6 @@ Js::ArgSlot EmitArgListEnd(
|
|
|
|
|
|
Js::ArgSlot EmitArgList(
|
|
|
ParseNode *pnode,
|
|
|
- Js::RegSlot rhsLocation,
|
|
|
Js::RegSlot thisLocation,
|
|
|
Js::RegSlot newTargetLocation,
|
|
|
BOOL fIsEval,
|
|
|
@@ -7490,7 +7479,7 @@ Js::ArgSlot EmitArgList(
|
|
|
|
|
|
size_t argIndex = EmitArgs(pnode, fAssignRegs, byteCodeGenerator, funcInfo, callSiteId, spreadIndices == nullptr ? nullptr : *spreadIndices);
|
|
|
|
|
|
- Js::ArgSlot argumentsCount = EmitArgListEnd(pnode, rhsLocation, thisLocation, evalLocation, newTargetLocation, byteCodeGenerator, funcInfo, argIndex, callSiteId);
|
|
|
+ Js::ArgSlot argumentsCount = EmitArgListEnd(pnode, thisLocation, evalLocation, newTargetLocation, byteCodeGenerator, funcInfo, argIndex, callSiteId);
|
|
|
|
|
|
if (fIsEval)
|
|
|
{
|
|
|
@@ -7635,7 +7624,6 @@ Js::ArgSlot EmitNewObjectOfConstants(
|
|
|
Js::Constants::NoRegister,
|
|
|
Js::Constants::NoRegister,
|
|
|
Js::Constants::NoRegister,
|
|
|
- Js::Constants::NoRegister,
|
|
|
byteCodeGenerator,
|
|
|
funcInfo,
|
|
|
argCount - 1,
|
|
|
@@ -7712,7 +7700,7 @@ void EmitMethodFld(ParseNode *pnode, Js::RegSlot callObjLocation, Js::PropertyId
|
|
|
}
|
|
|
|
|
|
// lhs.apply(this, arguments);
|
|
|
-void EmitApplyCall(ParseNode* pnode, Js::RegSlot rhsLocation, ByteCodeGenerator* byteCodeGenerator, FuncInfo* funcInfo, BOOL fReturnValue)
|
|
|
+void EmitApplyCall(ParseNode* pnode, ByteCodeGenerator* byteCodeGenerator, FuncInfo* funcInfo, BOOL fReturnValue)
|
|
|
{
|
|
|
ParseNode* applyNode = pnode->sxCall.pnodeTarget;
|
|
|
ParseNode* thisNode = pnode->sxCall.pnodeArgs->sxBin.pnode1;
|
|
|
@@ -7778,7 +7766,7 @@ void EmitApplyCall(ParseNode* pnode, Js::RegSlot rhsLocation, ByteCodeGenerator*
|
|
|
byteCodeGenerator->LoadHeapArguments(funcInfo);
|
|
|
|
|
|
byteCodeGenerator->Writer()->MarkLabel(argsAlreadyCreated);
|
|
|
- EmitCall(pnode, rhsLocation, byteCodeGenerator, funcInfo, fReturnValue, /*fEvaluateComponents*/true, /*fHasNewTarget*/false);
|
|
|
+ EmitCall(pnode, byteCodeGenerator, funcInfo, fReturnValue, /*fEvaluateComponents*/true, /*fHasNewTarget*/false);
|
|
|
byteCodeGenerator->Writer()->MarkLabel(afterSlowPath);
|
|
|
}
|
|
|
|
|
|
@@ -7995,7 +7983,6 @@ void EmitCallTarget(
|
|
|
void EmitCallI(
|
|
|
ParseNode *pnode,
|
|
|
BOOL fEvaluateComponents,
|
|
|
- BOOL fIsPut,
|
|
|
BOOL fIsEval,
|
|
|
BOOL fHasNewTarget,
|
|
|
uint32 actualArgCount,
|
|
|
@@ -8020,108 +8007,92 @@ void EmitCallI(
|
|
|
Js::Throw::OutOfMemory();
|
|
|
}
|
|
|
|
|
|
- if (fIsPut)
|
|
|
+
|
|
|
+ if (fEvaluateComponents)
|
|
|
{
|
|
|
- if (pnode->sxCall.spreadArgCount > 0)
|
|
|
- {
|
|
|
- // TODO(tcare): We are disallowing spread with CallIPut for the moment. See DEVDIV2: 876387
|
|
|
- // When CallIPut is migrated to the CallIExtended layout, this can be removed.
|
|
|
- byteCodeGenerator->Writer()->W1(Js::OpCode::RuntimeReferenceError, SCODE_CODE(JSERR_CantAsgCall));
|
|
|
- }
|
|
|
- // Grab a tmp register for the call result.
|
|
|
- Js::RegSlot tmpReg = funcInfo->AcquireTmpRegister();
|
|
|
- byteCodeGenerator->Writer()->CallI(Js::OpCode::CallIFlags, tmpReg, pnodeTarget->location, actualArgSlotCount, callSiteId, Js::CallFlags::CallFlags_NewTarget);
|
|
|
- funcInfo->ReleaseTmpRegister(tmpReg);
|
|
|
+ // Release the call target operands we assigned above. If we didn't assign them here,
|
|
|
+ // we'll need them later, so we can't re-use them for the result of the call.
|
|
|
+ funcInfo->ReleaseLoc(pnodeTarget);
|
|
|
+ }
|
|
|
+ // Grab a register for the call result.
|
|
|
+ if (pnode->isUsed)
|
|
|
+ {
|
|
|
+ funcInfo->AcquireLoc(pnode);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fIsEval)
|
|
|
+ {
|
|
|
+ op = Js::OpCode::CallIExtendedFlags;
|
|
|
+ callFlags = Js::CallFlags::CallFlags_ExtraArg;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (fEvaluateComponents)
|
|
|
+ bool isSuperCall = pnodeTarget->nop == knopSuper;
|
|
|
+
|
|
|
+ if (isSuperCall)
|
|
|
{
|
|
|
- // Release the call target operands we assigned above. If we didn't assign them here,
|
|
|
- // we'll need them later, so we can't re-use them for the result of the call.
|
|
|
- funcInfo->ReleaseLoc(pnodeTarget);
|
|
|
+ callFlags = Js::CallFlags_New;
|
|
|
}
|
|
|
- // Grab a register for the call result.
|
|
|
- if (pnode->isUsed)
|
|
|
+ if (fHasNewTarget)
|
|
|
{
|
|
|
- funcInfo->AcquireLoc(pnode);
|
|
|
+ callFlags = (Js::CallFlags) (callFlags | Js::CallFlags::CallFlags_ExtraArg | Js::CallFlags::CallFlags_NewTarget);
|
|
|
}
|
|
|
|
|
|
- if (fIsEval)
|
|
|
+ if (pnode->sxCall.spreadArgCount > 0)
|
|
|
{
|
|
|
- op = Js::OpCode::CallIExtendedFlags;
|
|
|
- callFlags = Js::CallFlags::CallFlags_ExtraArg;
|
|
|
+ op = (isSuperCall || fHasNewTarget) ? Js::OpCode::CallIExtendedFlags : Js::OpCode::CallIExtended;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bool isSuperCall = pnodeTarget->nop == knopSuper;
|
|
|
-
|
|
|
- if (isSuperCall)
|
|
|
- {
|
|
|
- callFlags = Js::CallFlags_New;
|
|
|
- }
|
|
|
- if (fHasNewTarget)
|
|
|
- {
|
|
|
- callFlags = (Js::CallFlags) (callFlags | Js::CallFlags::CallFlags_ExtraArg | Js::CallFlags::CallFlags_NewTarget);
|
|
|
- }
|
|
|
-
|
|
|
- if (pnode->sxCall.spreadArgCount > 0)
|
|
|
- {
|
|
|
- op = (isSuperCall || fHasNewTarget) ? Js::OpCode::CallIExtendedFlags : Js::OpCode::CallIExtended;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- op = (isSuperCall || fHasNewTarget) ? Js::OpCode::CallIFlags : Js::OpCode::CallI;
|
|
|
- }
|
|
|
+ op = (isSuperCall || fHasNewTarget) ? Js::OpCode::CallIFlags : Js::OpCode::CallI;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- if (op == Js::OpCode::CallI || op == Js::OpCode::CallIFlags)
|
|
|
+ if (op == Js::OpCode::CallI || op == Js::OpCode::CallIFlags)
|
|
|
+ {
|
|
|
+ if (pnodeTarget->nop == knopSuper)
|
|
|
{
|
|
|
- if (pnodeTarget->nop == knopSuper)
|
|
|
- {
|
|
|
- Js::RegSlot tmpReg = byteCodeGenerator->EmitLdObjProto(Js::OpCode::LdFuncObjProto, pnodeTarget->location, funcInfo);
|
|
|
- byteCodeGenerator->Writer()->CallI(op, pnode->location, tmpReg, actualArgSlotCount, callSiteId, callFlags);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- byteCodeGenerator->Writer()->CallI(op, pnode->location, pnodeTarget->location, actualArgSlotCount, callSiteId, callFlags);
|
|
|
- }
|
|
|
+ Js::RegSlot tmpReg = byteCodeGenerator->EmitLdObjProto(Js::OpCode::LdFuncObjProto, pnodeTarget->location, funcInfo);
|
|
|
+ byteCodeGenerator->Writer()->CallI(op, pnode->location, tmpReg, actualArgSlotCount, callSiteId, callFlags);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- uint spreadIndicesSize = 0;
|
|
|
- Js::CallIExtendedOptions options = Js::CallIExtended_None;
|
|
|
-
|
|
|
- if (pnode->sxCall.spreadArgCount > 0)
|
|
|
- {
|
|
|
- Assert(spreadIndices != nullptr);
|
|
|
- spreadExtraAlloc = spreadIndices->count * sizeof(uint32);
|
|
|
- spreadIndicesSize = sizeof(*spreadIndices) + spreadExtraAlloc;
|
|
|
- options = Js::CallIExtended_SpreadArgs;
|
|
|
- }
|
|
|
-
|
|
|
- if (pnodeTarget->nop == knopSuper)
|
|
|
- {
|
|
|
- Js::RegSlot tmpReg = byteCodeGenerator->EmitLdObjProto(Js::OpCode::LdFuncObjProto, pnodeTarget->location, funcInfo);
|
|
|
- byteCodeGenerator->Writer()->CallIExtended(op, pnode->location, tmpReg, actualArgSlotCount, options, spreadIndices, spreadIndicesSize, callSiteId, callFlags);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- byteCodeGenerator->Writer()->CallIExtended(op, pnode->location, pnodeTarget->location, actualArgSlotCount, options, spreadIndices, spreadIndicesSize, callSiteId, callFlags);
|
|
|
- }
|
|
|
+ byteCodeGenerator->Writer()->CallI(op, pnode->location, pnodeTarget->location, actualArgSlotCount, callSiteId, callFlags);
|
|
|
}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ uint spreadIndicesSize = 0;
|
|
|
+ Js::CallIExtendedOptions options = Js::CallIExtended_None;
|
|
|
|
|
|
if (pnode->sxCall.spreadArgCount > 0)
|
|
|
{
|
|
|
- Assert(spreadExtraAlloc != 0);
|
|
|
- AdeletePlus(byteCodeGenerator->GetAllocator(), spreadExtraAlloc, spreadIndices);
|
|
|
+ Assert(spreadIndices != nullptr);
|
|
|
+ spreadExtraAlloc = spreadIndices->count * sizeof(uint32);
|
|
|
+ spreadIndicesSize = sizeof(*spreadIndices) + spreadExtraAlloc;
|
|
|
+ options = Js::CallIExtended_SpreadArgs;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pnodeTarget->nop == knopSuper)
|
|
|
+ {
|
|
|
+ Js::RegSlot tmpReg = byteCodeGenerator->EmitLdObjProto(Js::OpCode::LdFuncObjProto, pnodeTarget->location, funcInfo);
|
|
|
+ byteCodeGenerator->Writer()->CallIExtended(op, pnode->location, tmpReg, actualArgSlotCount, options, spreadIndices, spreadIndicesSize, callSiteId, callFlags);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ byteCodeGenerator->Writer()->CallIExtended(op, pnode->location, pnodeTarget->location, actualArgSlotCount, options, spreadIndices, spreadIndicesSize, callSiteId, callFlags);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (pnode->sxCall.spreadArgCount > 0)
|
|
|
+ {
|
|
|
+ Assert(spreadExtraAlloc != 0);
|
|
|
+ AdeletePlus(byteCodeGenerator->GetAllocator(), spreadExtraAlloc, spreadIndices);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void EmitCallInstrNoEvalComponents(
|
|
|
ParseNode *pnode,
|
|
|
- BOOL fIsPut,
|
|
|
BOOL fIsEval,
|
|
|
Js::RegSlot thisLocation,
|
|
|
Js::RegSlot callObjLocation,
|
|
|
@@ -8146,14 +8117,14 @@ void EmitCallInstrNoEvalComponents(
|
|
|
Js::PropertyId propertyId = pnodeTarget->sxBin.pnode2->sxPid.PropertyIdFromNameNode();
|
|
|
|
|
|
EmitMethodFld(pnodeTarget, callObjLocation, propertyId, byteCodeGenerator, funcInfo);
|
|
|
- EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsPut, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
+ EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case knopIndex:
|
|
|
{
|
|
|
EmitMethodElem(pnodeTarget, pnodeTarget->sxBin.pnode1->location, pnodeTarget->sxBin.pnode2->location, byteCodeGenerator);
|
|
|
- EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsPut, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
+ EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
@@ -8170,21 +8141,20 @@ void EmitCallInstrNoEvalComponents(
|
|
|
|
|
|
Js::PropertyId propertyId = pnodeTarget->sxPid.PropertyIdFromNameNode();
|
|
|
EmitMethodFld(pnodeTarget, callObjLocation, propertyId, byteCodeGenerator, funcInfo);
|
|
|
- EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsPut, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
+ EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
// FALL THROUGH
|
|
|
|
|
|
default:
|
|
|
- EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsPut, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
+ EmitCallI(pnode, /*fEvaluateComponents*/ FALSE, fIsEval, /*fHasNewTarget*/ FALSE, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void EmitCallInstr(
|
|
|
ParseNode *pnode,
|
|
|
- BOOL fIsPut,
|
|
|
BOOL fIsEval,
|
|
|
BOOL fHasNewTarget,
|
|
|
Js::RegSlot thisLocation,
|
|
|
@@ -8211,7 +8181,7 @@ void EmitCallInstr(
|
|
|
funcInfo->ReleaseTmpRegister(callObjLocation);
|
|
|
}
|
|
|
|
|
|
- EmitCallI(pnode, /*fEvaluateComponents*/ TRUE, fIsPut, fIsEval, fHasNewTarget, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
+ EmitCallI(pnode, /*fEvaluateComponents*/ TRUE, fIsEval, fHasNewTarget, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
}
|
|
|
|
|
|
void EmitNew(ParseNode* pnode, ByteCodeGenerator* byteCodeGenerator, FuncInfo* funcInfo)
|
|
|
@@ -8281,7 +8251,7 @@ void EmitNew(ParseNode* pnode, ByteCodeGenerator* byteCodeGenerator, FuncInfo* f
|
|
|
|
|
|
|
|
|
Js::AuxArray<uint32> *spreadIndices = nullptr;
|
|
|
- actualArgCount = EmitArgList(pnode->sxCall.pnodeArgs, Js::Constants::NoRegister, Js::Constants::NoRegister, Js::Constants::NoRegister,
|
|
|
+ actualArgCount = EmitArgList(pnode->sxCall.pnodeArgs, Js::Constants::NoRegister, Js::Constants::NoRegister,
|
|
|
false, true, byteCodeGenerator, funcInfo, callSiteId, pnode->sxCall.spreadArgCount, &spreadIndices);
|
|
|
funcInfo->ReleaseLoc(pnode->sxCall.pnodeTarget);
|
|
|
|
|
|
@@ -8312,7 +8282,6 @@ void EmitNew(ParseNode* pnode, ByteCodeGenerator* byteCodeGenerator, FuncInfo* f
|
|
|
|
|
|
void EmitCall(
|
|
|
ParseNode* pnode,
|
|
|
- Js::RegSlot rhsLocation,
|
|
|
ByteCodeGenerator* byteCodeGenerator,
|
|
|
FuncInfo* funcInfo,
|
|
|
BOOL fReturnValue,
|
|
|
@@ -8320,7 +8289,6 @@ void EmitCall(
|
|
|
BOOL fHasNewTarget,
|
|
|
Js::RegSlot overrideThisLocation)
|
|
|
{
|
|
|
- BOOL fIsPut = (rhsLocation != Js::Constants::NoRegister);
|
|
|
// If the call returns a float, we'll note this in the byte code.
|
|
|
Js::RegSlot thisLocation = Js::Constants::NoRegister;
|
|
|
Js::RegSlot callObjLocation = Js::Constants::NoRegister;
|
|
|
@@ -8339,9 +8307,9 @@ void EmitCall(
|
|
|
return;*/
|
|
|
}
|
|
|
|
|
|
- unsigned int argCount = CountArguments(pnode->sxCall.pnodeArgs, &fSideEffectArgs) + (unsigned int)fIsPut;
|
|
|
+ unsigned int argCount = CountArguments(pnode->sxCall.pnodeArgs, &fSideEffectArgs);
|
|
|
|
|
|
- BOOL fIsEval = !fIsPut && pnode->sxCall.isEvalCall;
|
|
|
+ BOOL fIsEval = pnode->sxCall.isEvalCall;
|
|
|
|
|
|
if (fIsEval)
|
|
|
{
|
|
|
@@ -8428,16 +8396,16 @@ void EmitCall(
|
|
|
|
|
|
byteCodeGenerator->Writer()->StartCall(Js::OpCode::StartCall, argSlotCount);
|
|
|
Js::AuxArray<uint32> *spreadIndices;
|
|
|
- Js::ArgSlot actualArgCount = EmitArgList(pnodeArgs, rhsLocation, thisLocation, newTargetLocation, fIsEval, fEvaluateComponents, byteCodeGenerator, funcInfo, callSiteId, spreadArgCount, &spreadIndices);
|
|
|
+ Js::ArgSlot actualArgCount = EmitArgList(pnodeArgs, thisLocation, newTargetLocation, fIsEval, fEvaluateComponents, byteCodeGenerator, funcInfo, callSiteId, spreadArgCount, &spreadIndices);
|
|
|
Assert(argSlotCount == actualArgCount);
|
|
|
|
|
|
if (!fEvaluateComponents)
|
|
|
{
|
|
|
- EmitCallInstrNoEvalComponents(pnode, fIsPut, fIsEval, thisLocation, callObjLocation, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
+ EmitCallInstrNoEvalComponents(pnode, fIsEval, thisLocation, callObjLocation, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- EmitCallInstr(pnode, fIsPut, fIsEval, fHasNewTarget, releaseThisLocation ? thisLocation : Js::Constants::NoRegister, callObjLocation, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
+ EmitCallInstr(pnode, fIsEval, fHasNewTarget, releaseThisLocation ? thisLocation : Js::Constants::NoRegister, callObjLocation, actualArgCount, byteCodeGenerator, funcInfo, callSiteId, spreadIndices);
|
|
|
}
|
|
|
|
|
|
// End call, pop param space
|
|
|
@@ -10869,11 +10837,11 @@ void Emit(ParseNode *pnode, ByteCodeGenerator *byteCodeGenerator, FuncInfo *func
|
|
|
if (pnode->sxCall.isApplyCall && funcInfo->GetApplyEnclosesArgs())
|
|
|
{
|
|
|
// TODO[ianhall]: Can we remove the ApplyCall bytecode gen time optimization?
|
|
|
- EmitApplyCall(pnode, Js::Constants::NoRegister, byteCodeGenerator, funcInfo, fReturnValue);
|
|
|
+ EmitApplyCall(pnode, byteCodeGenerator, funcInfo, fReturnValue);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- EmitCall(pnode, Js::Constants::NoRegister, byteCodeGenerator, funcInfo, fReturnValue, /*fEvaluateComponents*/ true, /*fHasNewTarget*/ false);
|
|
|
+ EmitCall(pnode, byteCodeGenerator, funcInfo, fReturnValue, /*fEvaluateComponents*/ true, /*fHasNewTarget*/ false);
|
|
|
}
|
|
|
}
|
|
|
|