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

Intrinsify CreateSpan in static constructor interpreter #81747

Merged
merged 4 commits into from
Feb 14, 2023

Conversation

MichalStrehovsky
Copy link
Member

Introduction of CreateSpan and its use in CoreLib regressed the number of types we can preinitialize. To add insult to injury, we were also hitting throwing paths in the cctor interpreter because the patterns generated by the C# compiler got lumped into uninteresting IL-only sequences we treated as invalid IL (the cctor interpreter should really only throw for invalid IL, but sometimes we throw for valid-but-uncommon IL too). As a result, even a hello world was hitting half a dozen first chance exceptions.

This adds intrinsic treatment to CreateSpan. We also need to treat ReadOnlySpan specially because of #78681. That issue is basically a rewrite of the interpreter memory model and likely won't be addressed anytime soon.

Cc @dotnet/ilc-contrib

@ghost
Copy link

ghost commented Feb 7, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Introduction of CreateSpan and its use in CoreLib regressed the number of types we can preinitialize. To add insult to injury, we were also hitting throwing paths in the cctor interpreter because the patterns generated by the C# compiler got lumped into uninteresting IL-only sequences we treated as invalid IL (the cctor interpreter should really only throw for invalid IL, but sometimes we throw for valid-but-uncommon IL too). As a result, even a hello world was hitting half a dozen first chance exceptions.

This adds intrinsic treatment to CreateSpan. We also need to treat ReadOnlySpan specially because of #78681. That issue is basically a rewrite of the interpreter memory model and likely won't be addressed anytime soon.

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@EgorBo
Copy link
Member

EgorBo commented Feb 7, 2023

Is it possible to somehow test this behavior? the fact that a constructor is pre-evaluated in a console test

@MichalStrehovsky
Copy link
Member Author

Is it possible to somehow test this behavior? the fact that a constructor is pre-evaluated in a console test

Yeah - the test in this PR is doing it

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky MichalStrehovsky merged commit 9060368 into dotnet:main Feb 14, 2023
@MichalStrehovsky MichalStrehovsky deleted the createSpan branch February 14, 2023 02:39
@ghost ghost locked as resolved and limited conversation to collaborators Mar 16, 2023
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.

4 participants