Bug 1660553: Inline FunCall r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D87910
This commit is contained in:
Iain Ireland 2020-08-24 18:27:44 +00:00
Родитель 6000e4634d
Коммит a58061ddd7
2 изменённых файлов: 21 добавлений и 3 удалений

Просмотреть файл

@ -296,8 +296,14 @@ bool TrialInliner::maybeInlineCall(const ICEntry& entry, BytecodeLocation loc) {
return true;
}
// We only inline FunCall if we are calling the js::fun_call builtin.
MOZ_ASSERT_IF(loc.getOp() == JSOp::FunCall,
data->callFlags.getArgFormat() == CallFlags::FunCall);
// TODO: The arguments rectifier is not yet supported.
if (loc.getCallArgc() < data->target->nargs()) {
uint32_t argc =
loc.getOp() == JSOp::FunCall ? loc.getCallArgc() - 1 : loc.getCallArgc();
if (argc < data->target->nargs()) {
return true;
}
@ -326,6 +332,7 @@ bool TrialInliner::tryInlining() {
case JSOp::Call:
case JSOp::CallIgnoresRv:
case JSOp::CallIter:
case JSOp::FunCall:
if (!maybeInlineCall(icScript_->icEntry(icIndex), loc)) {
return false;
}

Просмотреть файл

@ -3216,8 +3216,19 @@ bool WarpCacheIRTranspiler::emitCallInlinedFunction(ObjOperandId calleeId,
uint32_t icScriptOffset,
CallFlags flags) {
if (callInfo_->isInlined()) {
// We are transpiling to generate the correct guards. Code for the inlined
// function itself will be generated in WarpBuilder::buildInlinedCall.
// We are transpiling to generate the correct guards. We also
// update the CallInfo to use the correct arguments. Code for the
// inlined function itself will be generated in
// WarpBuilder::buildInlinedCall.
MDefinition* callee = getOperand(calleeId);
switch (updateCallInfo(callee, flags)) {
case ArgumentLocation::Standard:
break;
case ArgumentLocation::OOM:
return false;
default:
MOZ_CRASH("Unsupported argument location");
}
return true;
}
return emitCallFunction(calleeId, argcId, flags, CallKind::Scripted);