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

[metadata] Cleanup some uses of m_class_get_this_arg #60557

Merged
merged 2 commits into from
Oct 18, 2021

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Oct 18, 2021

Two cleanups:

  1. In cases where m_class_get_this_arg is just used to create a byref MonoType - not to get a MonoType that will be used as a this argument, use mono_class_get_byref_type to indicate intent. No functional change.
  2. Remove call to type_check_context_used (m_class_get_this_arg (klass), FALSE); in generic sharing - since m_class_get_this_arg and m_class_get_byval_arg just differ by the byref bit and type_check_context_used will return the same result both times.

…s byrefs

In cases where it's evident the intent is to create a byref type around a known
type, use mono_class_get_byref_type instead of the this_arg getter.

No functional change, but sets the stage.
type_check_context_used for  this_arg will be the same as for byval_arg
@@ -153,7 +153,6 @@ mono_class_check_context_used (MonoClass *klass)
{
int context_used = 0;

context_used |= type_check_context_used (m_class_get_this_arg (klass), FALSE);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vargaz I think this is ok to remove. type_check_context_used ignores MonoType:byref so it always returns the same result for this_arg and byref_arg, as far as I can tell.

@lambdageek lambdageek merged commit 66d2600 into dotnet:main Oct 18, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 17, 2021
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.

2 participants