Skip to content

Avoid boxing ArgumentNullException.ThrowIfNull arguments in Tier-0 #104512

@jkotas

Description

@jkotas

ArgumentNullException.ThrowIfNull can incur boxing when applied to argument of generic type. Tier-1 JIT optimizations are able to optimize this boxing in steady state, but Tier-0 JIT optimization are not. It can result into excessive allocations during startup.

@dotnet/jit-contrib What would it take to augment Tier-0 to avoid boxing in this case?

From @AndyAyersMS: We'd have to mark the method as intrinsic and add new logic to impBoxPatternMatch.

More context and discussion of alternatives:

#104504
#82227
#100406

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions