Remove SafeReflectionInvoker #6693
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Removes SafeReflectionInvoker which was useful in .Net Framework because those methods were annotated with
SecuritySafeCriticalAttributefor partial trust but since .Net Core does not support partial trust, this level of indirection is useless and only hurts performance because of the indirection and the methods are annotated to never be inlined by the JIT.I removed
IsInSystemXamlandIsSystemXamlNonPublicwhich are internal and unused but there are comments that it is by design that they still exist. Those comments dates back to the initial commit of System.Xaml in this repo so it probably comes from the .Net Framework version of WPF. I removed them in a separate commit so it's easy to revert if the WPF does not want to remove those methods.Customer Impact
Should improve performance a bit (Though I wasn't able to properly measure it).
Regression
No.
Testing
Local build + CI + I tested a simple app.
Risk
Low. It is the same code but without indirection.
Microsoft Reviewers: Open in CodeFlow