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

Question: Difference between CORINFO_FLG_CONTAINS_GC_PTR and varDsc->HasGCPtr() #1740

Closed
yowl opened this issue Nov 21, 2021 · 1 comment
Closed
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) question Further information is requested

Comments

@yowl
Copy link
Contributor

yowl commented Nov 21, 2021

A while back there was some discussion on a means to decide if a struct should be GC tracked for the LLVM/Wasm backend.
#1647 (comment)
and
#1647 (comment)

There's a different between these 2 for Span<char> as one method includes type.IsByReferenceOfT and one doesn't. Why is that and should type.IsByReferenceOfT be considered when passing Span<char> as an argument?

Currently the IL->LLVM backed passes Span<char> on the LLVM stack, so is that correct?

@jkotas
Copy link
Member

jkotas commented Nov 21, 2021

Span<char> has to be GC tracked, so it means varDsc->HasGCPtr() is what you need.

There was a discussion about CORINFO_FLG_CONTAINS_GC_PTR back in the day when Span<T> was introduced, and we agreed that it should not be set for Span: dotnet/runtime#6909 (comment)

@jkotas jkotas added area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) question Further information is requested labels Nov 21, 2021
@yowl yowl closed this as completed Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants