-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
void Foo()
{
var arr = new int[10];
var len = arr.Length;
}Codegen:
; Method Program:Foo():this
G_M52879_IG01:
4883EC28 sub rsp, 40
G_M52879_IG02:
48B928E4DFFCF87F0000 mov rcx, 0x7FF8FCDFE428 ; int[]
BA0A000000 mov edx, 10
E8384A865F call CORINFO_HELP_NEWARR_1_VC
8B4008 mov eax, dword ptr [rax+08H] ;; <----
G_M52879_IG03:
4883C428 add rsp, 40
C3 ret
; Total bytes of code: 32and other patterns where JIT should be able to detect that ARR_LEN/IND is invoked on something known to be non-null, e.g.:
void Foo(int[] arr)
{
if (arr != null)
{
var _ = arr.Length;
}
}Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged