зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1660553: Inline FunCall r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D87910
This commit is contained in:
Родитель
6000e4634d
Коммит
a58061ddd7
|
@ -296,8 +296,14 @@ bool TrialInliner::maybeInlineCall(const ICEntry& entry, BytecodeLocation loc) {
|
||||||
return true;
|
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.
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,6 +332,7 @@ bool TrialInliner::tryInlining() {
|
||||||
case JSOp::Call:
|
case JSOp::Call:
|
||||||
case JSOp::CallIgnoresRv:
|
case JSOp::CallIgnoresRv:
|
||||||
case JSOp::CallIter:
|
case JSOp::CallIter:
|
||||||
|
case JSOp::FunCall:
|
||||||
if (!maybeInlineCall(icScript_->icEntry(icIndex), loc)) {
|
if (!maybeInlineCall(icScript_->icEntry(icIndex), loc)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3216,8 +3216,19 @@ bool WarpCacheIRTranspiler::emitCallInlinedFunction(ObjOperandId calleeId,
|
||||||
uint32_t icScriptOffset,
|
uint32_t icScriptOffset,
|
||||||
CallFlags flags) {
|
CallFlags flags) {
|
||||||
if (callInfo_->isInlined()) {
|
if (callInfo_->isInlined()) {
|
||||||
// We are transpiling to generate the correct guards. Code for the inlined
|
// We are transpiling to generate the correct guards. We also
|
||||||
// function itself will be generated in WarpBuilder::buildInlinedCall.
|
// 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 true;
|
||||||
}
|
}
|
||||||
return emitCallFunction(calleeId, argcId, flags, CallKind::Scripted);
|
return emitCallFunction(calleeId, argcId, flags, CallKind::Scripted);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче