Bug 1641469 part 5 - Check entered-counts in WarpOracle. r=iain

Transpile the first IC stub if all other stubs have entered-count 0.
We probably want to tune the heuristics at some point, but for now this is a
significant performance improvement.

Differential Revision: https://phabricator.services.mozilla.com/D77243
This commit is contained in:
Jan de Mooij committed 2020-05-29 06:35:42 +00:00
1 parent 32ee126130
commit 180888676d
1 file changed
+10 -3
+10 -3
View File
@@ -675,12 +675,19 @@ AbortReasonOr<Ok> WarpOracle::maybeInlineIC(WarpOpSnapshotList& snapshots,
return Ok();
}
if (!stub->next()->isFallback()) {
// Don't optimize if there are other stubs with entered-count > 0. Counters
// are reset when a new stub is attached so this means the stub that was added
// most recently didn't handle all cases.
for (ICStub* next = stub->next(); next; next = next->next()) {
if (next->getEnteredCount() == 0) {
continue;
}
[[maybe_unused]] unsigned line, column;
LineNumberAndColumn(script, loc, &line, &column);
// More than one optimized stub.
JitSpew(JitSpew_WarpTranspiler, "multiple stubs for JSOp::%s @ %s:%u:%u",
JitSpew(JitSpew_WarpTranspiler,
"multiple active stubs for JSOp::%s @ %s:%u:%u",
CodeName(loc.getOp()), script->filename(), line, column);
return Ok();
}