Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Remove NoInlining/StackCrawlMarks from Tasks #9342

Merged
merged 2 commits into from Feb 5, 2017

Conversation

stephentoub
Copy link
Member

These crawl marks in Tasks aren't relevant in coreclr (they're passed down to ExecutionContext, which in coreclr just ignores them), yet they required NoInlining, which does impact coreclr. Removing them all from tasks.

cc: @jkotas, @kouvel

@jkotas
Copy link
Member

jkotas commented Feb 5, 2017

Delete the method that takes StackCrawlMark from ExecutionContext?

LGTM otherwise.

@benaadams
Copy link
Member

Has conflicts

@stephentoub
Copy link
Member Author

Has conflicts

Yes, I'm working on this.

These crawl marks in Tasks aren't relevant in coreclr (they're passed down to ExecutionContext, which in coreclr just ignores them), yet they required NoInlining, which does impact coreclr.  Removing them all from tasks.
Addressed PR comment about removing ExecutionContext.Capture(ref StackCrawlMark, ...), which led me to remove NoInlining/StackCrawlMarks from some other places in Timer, Thread, ThreadPool, and Overlapped.

In doing so, I found several other unnecessary members on ExecutionContext that could be removed with minor tweaks elsewhere in the source, e.g.
- Dispose is a nop, so we can remove explicit try/finally's to clean it up
- ExecutionContext.Run(..., bool) just ignores the bool arg, so it can be removed and all call sites redirected (but I've left it in EC, as it appears it's used via internals visible from a library in corefx)
- FastCapture() just calls Capture, so the call sites can be changed (but I've left it in EC for a similar reason)
- PreAllocatedDefault can be removed in favor of Default; etc.
- ExecutionContext.Capture itself checks whether flow is suppressed; doing a check before it adds a TLS lookup and in doing so optimizes for an uncommon case in exchange for making the common case more expensive.  I've removed those checks.

And in the process, I also noticed that several lazily initialized delegates that no longer need to be, and cleaned those up.  These were lazy due to needing to be for security checks that aren't relevant in coreclr.
@stephentoub
Copy link
Member Author

Delete the method that takes StackCrawlMark from ExecutionContext?

It was still being used by some other calls in Timer, Overlapped, ThreadPool, and Thread, so I went through and cleaned up those as well, and deleted this Capture overload. As long as I was doing so, I also cleaned up a few other things I noticed along the way.

@stephentoub stephentoub merged commit a8c08f3 into dotnet:master Feb 5, 2017
@stephentoub stephentoub deleted the tasks_inlining branch February 5, 2017 17:18
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Remove NoInlining/StackCrawlMarks from Tasks

Commit migrated from dotnet/coreclr@a8c08f3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants