Skip to content

Port arm64 INLINE_GETTHREAD from NativeAOT - #99648

Merged
VSadov merged 4 commits into
dotnet:mainfrom
VSadov:arm64tls
Mar 13, 2024
Merged

VSadov merged 4 commits into
dotnet:mainfrom
VSadov:arm64tls

Conversation

@VSadov

@VSadov VSadov commented Mar 12, 2024 •

Copy link
Copy Markdown
Member

The NativeAOT version is slightly better as it does not need the INLINE_GETTHREAD_CONSTANT_POOL

NOTE: this is a windows-specific change.
Also the macro is not used as extensively as in NativeAOT, but still makes sense to copy over.

@ghost ghost added the area-VM-coreclr label Mar 12, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

__SECTIONREL_gCurrentThreadInfo SETS "$__SECTIONREL_gCurrentThreadInfo":CC:"_"

INLINE_GET_TLS_VAR $destReg, $trashReg, $gCurrentThreadInfo
ldr $destReg, [$destReg] ;; return gCurrentThreadInfo.m_pThread

@VSadov VSadov Mar 13, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EgorBo @mangod9 @jkotas as an example - this indirection would not be needed in NativeAOT as there is no ThreadInfo referring to Thread.
Instead the Thread itself is a tls object and the allocation context is inlined in it as first few fields.

Re: #99661

@VSadov
VSadov marked this pull request as ready for review March 13, 2024 05:17
@VSadov

VSadov commented Mar 13, 2024 •

Copy link
Copy Markdown
Member Author

I assume CI runs some tests on win-arm64. I do not have an easy way to test this locally, but it should either work or fail nearly everything.

Better be sure.

@VSadov

VSadov commented Mar 13, 2024

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines Bot Mar 13, 2024
@VSadov

VSadov commented Mar 13, 2024

Copy link
Copy Markdown
Member Author

Thanks!!

@VSadov
VSadov merged commit df50407 into dotnet:main Mar 13, 2024
@VSadov
VSadov deleted the arm64tls branch March 13, 2024 07:07
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants