Based on the log I've attached, it looks like typescript has the most missing pretenuring. If I run a local comparison report on that benchmark, I do see minor GC as the most important bucket, with a 40x difference in time. WSL also seems to have quite a bit, and a comparison report there again shows that minor GC is the top bucket with a 20x difference. We probably won't close the entire gap by pretenuring, but that's still enough evidence to mark this as perf-next. **js-perf-next**: Add alloc sites to scripted constructor calls in baseline, and use this information to pretenure them. Bug 1898270 is a recent example of adding alloc sites for lambdas. As described above, the tricky part with this patch is that the thisObject is allocated by [https://searchfox.org/mozilla-central/rev/771bc161e016e2bd1f7982a88d387916fdf350dd/js/src/jit/BaselineCacheIRCompiler.cpp#3666-3670), which is inside shared code used by a variety of different calls. (In particular, both CallScriptedFunction and CallBoundScriptedFunction can reach this point.) Right now, information about the `this` object is stored in a preceding `MetaScriptedThisShape` op that [generates no code](https://searchfox.org/mozilla-central/rev/771bc161e016e2bd1f7982a88d387916fdf350dd/js/src/jit/CacheIRCompiler.cpp#9780-9781), but [is used in the transpiler](https://searchfox.org/mozilla-central/rev/771bc161e016e2bd1f7982a88d387916fdf350dd/js/src/jit/WarpCacheIRTranspiler.cpp#6751-6776) to allocate `this`. I think there are two reasonable options for making this work. One, as described above, is to add a new CallKnownScriptedConstructor op that would replace the MetaScriptedThisShape/CallScriptedFunction pair. (This might also need a CallKnownBoundScriptedConstructor op to handle the bound function case?) The second option, easier but more of a hack, would be to add an alloc site to MetaScriptedThisShape (and maybe rename it), rewrite CacheIRCompiler::emitMetaScriptedThis to store an allocSite offset internally in the CacheIRCompiler, and then use that allocsite offset if it exists in BaselineCacheIRCompiler::createThis to load the alloc site out of the stub fields and use it.
Bug 1966773 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Based on the log I've attached, it looks like typescript has the most missing pretenuring. If I run a local comparison report on that benchmark, I do see minor GC as the most important bucket, with a 40x difference in time. WSL also seems to have quite a bit, and a comparison report there again shows that minor GC is the top bucket with a 20x difference. We probably won't close the entire gap by pretenuring, but that's still enough evidence to mark this as perf-next. **js-perf-next**: Add alloc sites to scripted constructor calls in baseline, and use this information to pretenure them. Bug 1898270 is a recent example of adding alloc sites for lambdas. As described above, the tricky part with this patch is that the thisObject is allocated by [this code](https://searchfox.org/mozilla-central/rev/771bc161e016e2bd1f7982a88d387916fdf350dd/js/src/jit/BaselineCacheIRCompiler.cpp#3666-3670), which is inside shared code used by a variety of different calls. (In particular, both CallScriptedFunction and CallBoundScriptedFunction can reach this point.) Right now, information about the `this` object is stored in a preceding `MetaScriptedThisShape` op that [generates no code](https://searchfox.org/mozilla-central/rev/771bc161e016e2bd1f7982a88d387916fdf350dd/js/src/jit/CacheIRCompiler.cpp#9780-9781), but [is used in the transpiler](https://searchfox.org/mozilla-central/rev/771bc161e016e2bd1f7982a88d387916fdf350dd/js/src/jit/WarpCacheIRTranspiler.cpp#6751-6776) to allocate `this`. I think there are two reasonable options for making this work. One, as described above, is to add a new CallKnownScriptedConstructor op that would replace the MetaScriptedThisShape/CallScriptedFunction pair. (This might also need a CallKnownBoundScriptedConstructor op to handle the bound function case?) The second option, easier but more of a hack, would be to add an alloc site to MetaScriptedThisShape (and maybe rename it), rewrite CacheIRCompiler::emitMetaScriptedThis to store an allocSite offset internally in the CacheIRCompiler, and then use that allocsite offset if it exists in BaselineCacheIRCompiler::createThis to load the alloc site out of the stub fields and use it.