Skip to content

[mono] Optimize "constant_string".Length #108857

@xtqqczze

Description

@xtqqczze
static int Test() => "Hello".Length; // replace with just `5`

Before:

movabs rax,0x7fd6c1758160
mov    eax,DWORD PTR [rax]
ret 

Now:

mov    eax,0x5
ret

Originally posted by @EgorBo in mono#5310

Related:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions