You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the initial publish commit of coreclr, FEATURE_ARRAYSTUB_AS_IL was not enabled for win-x86. Now it's 10 years later and our JIT compiler is able to produce better code than hand written assemblies. It's also much easier to maintain the logic in IL.
A little portion of dead code accessing ESP+offset is not removed in stublinkerx86.
In ILStubCache::CreateNewMethodDesc, the stub type is detected for each stub. For StubVirtualStaticMethodDispatch, it's detection is not in else if, but another block separated from the if-else if tree:
Thus for SVM dispatch stubs, the stub type is set as the fallback StubCLRToNativeInterop, then StubVirtualStaticMethodDispatch.
However in DynamicMethodDesc::SetILStubType, the stub type bits are |'d, without clearing existing flag:
So the stub type will actually be set as StubCLRToNativeInterop|StubVirtualStaticMethodDispatch. The value of StubCLRToNativeInterop is 0x01, and for all other configurations and previously Windows x86, the value of StubVirtualStaticMethodDispatch is odd, so the |'d result is still StubVirtualStaticMethodDispatch.
By enabling StubArrayOp, this PR changes the value on Windows x86 from 0x09 to 0x0a, then the result of StubCLRToNativeInterop|StubVirtualStaticMethodDispatch becomes 0x0b, which is out of range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Since the initial publish commit of coreclr, FEATURE_ARRAYSTUB_AS_IL was not enabled for win-x86. Now it's 10 years later and our JIT compiler is able to produce better code than hand written assemblies. It's also much easier to maintain the logic in IL.
A little portion of dead code accessing ESP+offset is not removed in stublinkerx86.