-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: Don't allocate string literals inside potential BBJ_THROW candidates #50112
Conversation
@dotnet/jit-contrib PTAL |
Is there a pattern to the methods in this assembly that we might want to reconsider? |
5af58ea
to
e9ed5ba
Compare
@BruceForstall you're right, I've changed the logic to just scan a top-level node of the current statement in @AndyAyersMS from my understanding, |
I believe you're correct. However, have you tried crossgen/crossgen2 libraries SuperPMI asm diffs, or using "jit-diff" without "--pmi", to see if that's the case? |
yeah with crossgen it's 20x smaller:
|
Together with #48589, this PR addresses #48573 (comment)
Example:
Codegen diff for
Main
: https://www.diffchecker.com/tZAYRdBYAs you can see,
nameof(args)
literal is not allocated on heap during JIT compilation, a lazy-allocate helper is emitted instead.jit-diff (
jit-utils -f --pmi
):Quite a size regression (for obvious reasons) but each regression is basically a saved GC allocation.
~ +10 bytes of machine code per each literal (in the cold sections)
PS: 67% of the regression is in
System.Collections.Immutable.dasm