Bug 1314172 - Add an option to toggle backtracking on inlining failures. r=h4writer

This commit is contained in:
Nicolas B. Pierron 2016-11-25 09:24:38 +00:00
Родитель 1649ee9037
Коммит d981a267d6
4 изменённых файлов: 18 добавлений и 4 удалений

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

@ -30,6 +30,7 @@ enum MethodStatus
enum AbortReason {
AbortReason_Alloc,
AbortReason_Inlining,
AbortReason_PreliminaryObjects,
AbortReason_Disable,
AbortReason_Error,

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

@ -5256,8 +5256,13 @@ IonBuilder::inlineScriptedCall(CallInfo& callInfo, JSFunction* target)
// the inlining was aborted for a non-exception reason.
if (inlineBuilder.abortReason_ == AbortReason_Disable) {
calleeScript->setUninlineable();
current = backup.restore();
return InliningStatus_NotInlined;
if (!JitOptions.disableInlineBacktracking) {
current = backup.restore();
return InliningStatus_NotInlined;
}
abortReason_ = AbortReason_Inlining;
} else if (inlineBuilder.abortReason_ == AbortReason_Inlining) {
abortReason_ = AbortReason_Inlining;
} else if (inlineBuilder.abortReason_ == AbortReason_Alloc) {
abortReason_ = AbortReason_Alloc;
} else if (inlineBuilder.abortReason_ == AbortReason_PreliminaryObjects) {
@ -5286,8 +5291,12 @@ IonBuilder::inlineScriptedCall(CallInfo& callInfo, JSFunction* target)
if (returns.empty()) {
// Inlining of functions that have no exit is not supported.
calleeScript->setUninlineable();
current = backup.restore();
return InliningStatus_NotInlined;
if (!JitOptions.disableInlineBacktracking) {
current = backup.restore();
return InliningStatus_NotInlined;
}
abortReason_ = AbortReason_Inlining;
return InliningStatus_Error;
}
MDefinition* retvalDefn = patchInlinedReturns(callInfo, returns, returnBlock);
if (!retvalDefn)

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

@ -75,6 +75,9 @@ DefaultJitOptions::DefaultJitOptions()
// RangeAnalysis results.
SET_DEFAULT(checkRangeAnalysis, false);
// Toggles whether IonBuilder fallbacks to a call if we fail to inline.
SET_DEFAULT(disableInlineBacktracking, true);
// Toggles whether Alignment Mask Analysis is globally disabled.
SET_DEFAULT(disableAma, false);

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

@ -47,6 +47,7 @@ struct DefaultJitOptions
#endif
bool checkRangeAnalysis;
bool runExtraChecks;
bool disableInlineBacktracking;
bool disableAma;
bool disableEaa;
bool disableEagerSimdUnbox;