This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Add RuntimeHelpers.IsReferenceOrContainsReferences<T>()#9541
Merged
Conversation
Member
Author
|
cc @benaadams I will fix this up if your change gets in first. |
Rename JitHelpers.ContainsReferences<T>() to RuntimeHelpers.IsReferenceOrContainsReferences<T>() and make it public. Work towards https://github.com/dotnet/corefx/issues/14047
a44545d to
3b8e6b1
Compare
Member
|
is asm emitted for this for reference types (in current incarnation)? from #9540 (comment) G_M58440_IG01:
56 push rsi
4883EC30 sub rsp, 48
48894C2428 mov qword ptr [rsp+28H], rcx ; putting something stack 40
488BF1 mov rsi, rcx ; putting it in rsi
G_M58440_IG02:
488B0E mov rcx, qword ptr [rsi] ;** ?? --- redundant load?
448B4618 mov r8d, dword ptr [rsi+24] ; int size = _size;
33C9 xor ecx, ecx ;** 0 ----^ clears earlier move
894E18 mov dword ptr [rsi+24], ecx ; _size = 0;
FF461C inc dword ptr [rsi+28] ; _version++;
4585C0 test r8d, r8d ; if (size > 0)
7E15 jle SHORT G_M58440_IG04 ; ---> jmp size == 0
488B4E08 mov rcx, gword ptr [rsi+8] ; _items
33D2 xor edx, edx ; 0
488D0500000000 lea rax, [(reloc)] ; Array.Clear;
G_M58440_IG03:
4883C430 add rsp, 48
5E pop rsi
48FFE0 rex.jmp rax ; Array.Clear(_items, 0, size);
G_M58440_IG04:
4883C430 add rsp, 48
5E pop rsi
C3 ret There seems to be extra unnecessary register stuff going on; which could also be entirely unrelated. Also I'm not entirely fluent in asm or ABI so I might be wrong. Was trying to work out if the startup part could be reduced any; but not sure how it relates to the code |
Member
Author
|
The redundant load is unused left over temp - opened #9547 on it. The unnecessary frame maybe side-effect of the unused left over temp. |
jorive
pushed a commit
to guhuro/coreclr
that referenced
this pull request
May 4, 2017
Rename JitHelpers.ContainsReferences<T>() to RuntimeHelpers.IsReferenceOrContainsReferences<T>() and make it public. Work towards https://github.com/dotnet/corefx/issues/14047
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…lr#9541) Rename JitHelpers.ContainsReferences<T>() to RuntimeHelpers.IsReferenceOrContainsReferences<T>() and make it public. Work towards https://github.com/dotnet/corefx/issues/14047 Commit migrated from dotnet/coreclr@7b66079
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rename JitHelpers.ContainsReferences() to RuntimeHelpers.IsReferenceOrContainsReferences() and make it public.
Work towards https://github.com/dotnet/corefx/issues/14047