Skip to content
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

Refactor memory copies in SafeBuffer #105206

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Jul 21, 2024

No diffs expected, except from the changes to sign-extension.

Diffs are an improvement: MihuBot/runtime-utils#548

System.Runtime.InteropServices.SafeBuffer:Read[ubyte](ulong):ubyte:this
 G_M48575_IG03:
-       lea      rsi, [rbp-0x20]
-       mov      rdi, gword ptr [rbp-0x28]
+       lea      rsi, [rbp-0x10]
+       mov      rdi, gword ptr [rbp-0x18]
        mov      rax, 0xD1FFAB1E      ; code for System.Runtime.InteropServices.SafeHandle:DangerousAddRef(byref):this
        call     [rax]System.Runtime.InteropServices.SafeHandle:DangerousAddRef(byref):this
-       mov      edx, r15d
-       lea      rdi, [rbp-0x18]
-       mov      rsi, rbx
-       mov      rax, 0xD1FFAB1E      ; code for System.SpanHelpers:Memmove(byref,byref,ulong)
-       call     [rax]System.SpanHelpers:Memmove(byref,byref,ulong)
-       nop      
-						;; size=43 bbWeight=1 PerfScore 9.25
+       movzx    rbx, byte  ptr [rbx]
+						;; size=23 bbWeight=1 PerfScore 6.75

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 21, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 21, 2024
@xtqqczze
Copy link
Contributor Author

@MihuBot -arm64

@xtqqczze
Copy link
Contributor Author

@MihuBot -arm64

@xtqqczze
Copy link
Contributor Author

@MihuBot

Copy link
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime.InteropServices community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants