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

Move MonoClass:inlinearray_value out of MonoClass #109363

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

syfFerdinand
Copy link

@syfFerdinand syfFerdinand commented Oct 29, 2024

Summary

This PR addresses issue #103913 by moving the inlinearray_value property from MonoClass to the infrequent_data structure. This change aims to optimize memory usage by storing rarely used properties in a less frequently accessed structure.

Details

  • Moved inlinearray_value from MonoClass to MonoPropertyBag within the infrequent_data structure.
  • Set explicit value for PROP_INLINEARRAY_VALUE in InfrequentDataKind enum, as per review comments.
  • Updated relevant getters and setters to reflect the new structure.
  • Marked mono_class_get_inlinearray_value with MONO_COMPONENT_API as per review suggestion to ensure proper export when compiled as shared libraries.
  • Modified all occurrences of inlinearray_value access to use the new structure.
  • Performed testing to ensure no functionality is broken due to this change.

Related Issue

Fixes #103913

@syfFerdinand
Copy link
Author

@dotnet-policy-service agree

@lambdageek
Copy link
Member

Thanks for the contribution @syfFerdinand !

@lambdageek
Copy link
Member

/cc @steveisok

src/mono/mono/metadata/property-bag.h Outdated Show resolved Hide resolved
@syfFerdinand syfFerdinand changed the title Moved inlinearray_value to infrequent_data structure in MonoClass Move MonoClass:inlinearray_value out of MonoClass Nov 8, 2024
@steveisok
Copy link
Member

@kg can you please give this a review?

@kg
Copy link
Member

kg commented Nov 9, 2024

Is it normal for this to change the MonoAOTOffsets? I assume because a field was removed from MonoClass?

@lambdageek
Copy link
Member

Is it normal for this to change the MonoAOTOffsets? I assume because a field was removed from MonoClass?

yea that's the most likely reason

@kg
Copy link
Member

kg commented Nov 10, 2024

If nobody else gets to it I will try to fix the offsets this week

@syfFerdinand
Copy link
Author

Hi @kg and @lambdageek,

I'll be working on updating the MonoAOTOffsets. Should I just remove the line DECL_OFFSET2(MonoClass,inlinearray_value,128) from MonoAOTOffsets, or is there something more specific I need to do?

Thanks for your guidance!

@kg
Copy link
Member

kg commented Nov 11, 2024

Can you see https://dev.azure.com/dnceng-public/public/_build/results?buildId=865527&view=artifacts&pathAsName=false&type=publishedArtifacts ? I believe there are downloads for the offsets there, which might be what you need.

@steveisok
Copy link
Member

Can you see https://dev.azure.com/dnceng-public/public/_build/results?buildId=865527&view=artifacts&pathAsName=false&type=publishedArtifacts ? I believe there are downloads for the offsets there, which might be what you need.

Note #109612 added the actual offset files. Any updates should go into these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VM-meta-mono community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[metadata] Move MonoClass:inlinearray_value out of MonoClass
4 participants