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

Fix invalid IL bug with interface sweeping due to parameters #501

Conversation

mrvoorhe
Copy link
Contributor

Fix a bug caused by parameter types not being taken into account in AllPossibleStackTypes

Fix a bug caused by parameter types not being taken into account in `AllPossibleStackTypes`
@mrvoorhe mrvoorhe requested a review from marek-safar as a code owner March 22, 2019 14:48
@marek-safar marek-safar merged commit 3e8f3df into dotnet:master Mar 22, 2019
marek-safar pushed a commit that referenced this pull request Apr 12, 2019
Instance method bodies do not need to be marked until an instance of the type could exist.  Any instance methods that were marked on types that are never instantiated will be converted to a throw.

* A number of existing tests needed to be updated to avoid lazy body marking

* Add a new CodeOptimization to allow disabling this mechanism.  Reasoning was, (1) it's simple to support an option.  (2) It may be helpful if it causes problems. (3) I could see using this option to make writing certain tests easier.

* Marking of some small bodies will not be deferred.  The idea is that the size cost of some methods is less than converting them to a throw.  So we might as well leave them alone.  See `IsWorthConvertingToThrow`

* Factored out `MarkAndCacheNotSupportedCtorString` since I need to call it from multiple places now.

* Expose the `RewriteBody*` methods in CodeRewriterStep for overriding.  A few motivations for this. (1) We have a runtime that doesn't support exceptions.  When we target that runtime we will need to override `ConvertToThrow` with something else.  (2) I will likely override all of the `RewriteBody*` methods so that I can record which bodies are changed and hook it up to logging mechanisms that we have.

Note.  This PR has a test that depends on #501 .  That PR will need to land first and I will need to rebase after that lands.  There will be 1 failing test until that happens.
tkapin pushed a commit to tkapin/runtime that referenced this pull request Jan 31, 2023
Instance method bodies do not need to be marked until an instance of the type could exist.  Any instance methods that were marked on types that are never instantiated will be converted to a throw.

* A number of existing tests needed to be updated to avoid lazy body marking

* Add a new CodeOptimization to allow disabling this mechanism.  Reasoning was, (1) it's simple to support an option.  (2) It may be helpful if it causes problems. (3) I could see using this option to make writing certain tests easier.

* Marking of some small bodies will not be deferred.  The idea is that the size cost of some methods is less than converting them to a throw.  So we might as well leave them alone.  See `IsWorthConvertingToThrow`

* Factored out `MarkAndCacheNotSupportedCtorString` since I need to call it from multiple places now.

* Expose the `RewriteBody*` methods in CodeRewriterStep for overriding.  A few motivations for this. (1) We have a runtime that doesn't support exceptions.  When we target that runtime we will need to override `ConvertToThrow` with something else.  (2) I will likely override all of the `RewriteBody*` methods so that I can record which bodies are changed and hook it up to logging mechanisms that we have.

Note.  This PR has a test that depends on dotnet/linker#501 .  That PR will need to land first and I will need to rebase after that lands.  There will be 1 failing test until that happens.


Commit migrated from dotnet/linker@e9ed848
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants