Skip to content

Commit

Permalink
Bug 1664357: Tweak thresholds for --fast-warmup r=jandem
Browse files Browse the repository at this point in the history
To make sure we're testing recursive inlining, I've tweaked the thresholds to ensure that we can inline two levels deep without any loops. I've also made the inlining heuristics slightly more conservative, which prevents `check-earley-boyer` from timing out.

I've also included a few drive-by fixes. The change to `isRecursive` in `DoTrialInlining` only affects the jitspew message, because both ways of finding the `InliningRoot` are equivalent for the non-recursive case.

Differential Revision: https://phabricator.services.mozilla.com/D89875
  • Loading branch information
iainireland committed Sep 16, 2020
1 parent fbafb64 commit cf3b84d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
10 changes: 5 additions & 5 deletions js/src/jit/JitOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ void DefaultJitOptions::setEagerIonCompilation() {
void DefaultJitOptions::setFastWarmUp() {
baselineInterpreterWarmUpThreshold = 4;
baselineJitWarmUpThreshold = 10;
trialInliningWarmUpThreshold = 16;
normalIonWarmUpThreshold = 25;
fullIonWarmUpThreshold = 55;
trialInliningWarmUpThreshold = 14;
normalIonWarmUpThreshold = 30;
fullIonWarmUpThreshold = 65;

inliningEntryThreshold = 0;
smallFunctionMaxBytecodeLength = INT32_MAX;
inliningEntryThreshold = 2;
smallFunctionMaxBytecodeLength = 2000;
}

void DefaultJitOptions::setWarpEnabled(bool enable) {
Expand Down
4 changes: 2 additions & 2 deletions js/src/jit/TrialInlining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bool DoTrialInlining(JSContext* cx, BaselineFrame* frame) {

RootedScript script(cx, frame->script());
ICScript* icScript = frame->icScript();
bool isRecursive = !!icScript->inliningRoot();
bool isRecursive = icScript->depth() > 0;

if (!script->canIonCompile()) {
return true;
Expand Down Expand Up @@ -293,7 +293,7 @@ ICScript* TrialInliner::createInlinedICScript(JSFunction* target,
MOZ_ASSERT(result->numICEntries() == targetScript->numICEntries());

JitSpew(JitSpew_WarpTrialInlining,
"Outer ICScript: %p Inner ICScript: %p pcOffset: %u\n", icScript_,
"Outer ICScript: %p Inner ICScript: %p pcOffset: %u", icScript_,
result, pcOffset);

return result;
Expand Down
6 changes: 2 additions & 4 deletions js/src/jit/WarpBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,8 @@ bool WarpBuilder::buildInlinePrologue() {
}

// Initialize local slots.
if (info().nlocals() > 0) {
for (uint32_t i = 0; i < info().nlocals(); i++) {
current->initSlot(info().localSlot(i), undef);
}
for (uint32_t i = 0; i < info().nlocals(); i++) {
current->initSlot(info().localSlot(i), undef);
}

MOZ_ASSERT(current->entryResumePoint()->stackDepth() == info().totalSlots());
Expand Down

0 comments on commit cf3b84d

Please sign in to comment.