-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Convert pointers in a couple tables to relative #78801
Conversation
`EmbeddedPointerIndirection` is used in: * Array of pointers to dispatch maps * Array of pointers to GC static infos * Array of pointers to eager constructors I'm also updating array of module initializers emission since the code to interpret this table at runtime is the same as eager constructors.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue Details
I'm also updating array of module initializers emission since the code to interpret this table at runtime is the same as eager constructors. I'd guess this saves another ~1% on Linux. I didn't measure Windows this time. There will a couple kilobytes of savings for hello world on Windows for sure. Cc @dotnet/ilc-contrib
|
|
||
for (byte* pCurrent = pInitializers; | ||
pCurrent < (pInitializers + length); | ||
pCurrent += MethodTable.SupportsRelativePointers ? sizeof(int) : sizeof(nint)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracting this logic into a property instead of c&p?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we still need to switch on the size of the element later in the loop, so while it would be fewer characters, whoever is reading the code would now need to scroll to the definition to match it with the inner logic.
The ultimate improvement would be to split the code that reads the data structures from the code that interprets it with a struct iterator. But this is code that we only touch once every few years and mostly just forget it exists, so I didn't spend time to make it pretty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Opened dotnet/arcade#11723 on the test failures |
EmbeddedPointerIndirection
is used in:I'm also updating array of module initializers emission since the code to interpret this table at runtime is the same as eager constructors.
I'd guess this saves another ~1% on Linux. I didn't measure Windows this time. There will a couple kilobytes of savings for hello world on Windows for sure.
Cc @dotnet/ilc-contrib