-
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
JIT: import static readonly fields holding frozen objects as const handles #76112
Merged
Merged
Changes from 51 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
0fdefe2
handle static readonly for frozen objects in jit
EgorBo 07fdafc
Address Jan's feedback
EgorBo ad69145
Address feedback
EgorBo f10b886
Mitigate regressions via getObjectType
EgorBo 9bf46c6
Merge branch 'main' of github.com:dotnet/runtime into frozen-static-r…
EgorBo 97c3cdf
use memcpy
EgorBo fd7e742
Address feedback
EgorBo 75c40ae
make jit-format happy
EgorBo 283b833
Fix FitsI32 assert
EgorBo 00e3e69
clean up in methodcontext
EgorBo f7902d2
Update importer.cpp
EgorBo bf7947f
Implement getObjectType for ILC
EgorBo 3f756d9
Merge branch 'frozen-static-readonly' of github.com:EgorBo/runtime-1 …
EgorBo 5374bea
fix clang/gcc
EgorBo 548dc9c
Update src/coreclr/vm/jitinterface.cpp
EgorBo 1234e97
Address feedback
EgorBo 1c584a1
Initial impl for NativeAOT
EgorBo 1fc50c7
Use PreinitializationInfo
EgorBo 600209f
Handle strings
EgorBo 4cad20a
Update src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
EgorBo 28f2749
Apply suggestions from code review
EgorBo 594a6c2
Merge branch 'frozen-static-readonly' of github.com:EgorBo/runtime-1 …
EgorBo a07232d
clean up
EgorBo 0c6fe27
Add a comment
EgorBo 271f442
Fix build
EgorBo 76f6cdc
Fix build
EgorBo 133c268
Address Michal's feedback
EgorBo 8880954
Address Michal's feedback
EgorBo 63cd7cc
Simplify PM switch
EgorBo 2656719
Implement getObjectType for FrozenObjectNode
EgorBo 1006572
Address feedback
EgorBo 543a5f5
Merge branch 'main' of github.com:dotnet/runtime into frozen-static-r…
EgorBo 0d27470
Add isObjectImmutable
EgorBo 48343ee
Update gcinfo.cpp
EgorBo 7264f67
fix getRuntimeTypePointer on NativeAOT
EgorBo 9aa1b6c
Merge branch 'frozen-static-readonly' of github.com:EgorBo/runtime-1 …
EgorBo 8d4048a
fix getRuntimeTypePointer on NativeAOT
EgorBo edb4cd3
Merge branch 'main' of github.com:dotnet/runtime into frozen-static-r…
EgorBo 0e75429
Merge branch 'main' of github.com:dotnet/runtime into frozen-static-r…
EgorBo 44a8fc6
Fix compilation
EgorBo 256bbd4
Apply suggestions from code review
EgorBo fefbbe1
ILC: use correct TargetPtrSize
EgorBo 3d06a33
Address feedback
EgorBo afefe44
Add support for delegates, empty arrays and objects without fields
EgorBo eece561
Add some comments
EgorBo e2ae117
Update src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/TypePreinit.cs
EgorBo 34b39cb
Apply suggestions from code review
EgorBo 22baa43
Ah, actually we need that condition, it can be a struct
EgorBo 4752354
Address Jakob's feedback
EgorBo 49ab023
fix compilation
EgorBo 08d59f5
Use AssertMapExistsNoMessage
EgorBo 45cd02b
Address feedback
EgorBo b578780
Update src/coreclr/vm/jitinterface.cpp
EgorBo 84de4d2
Address feedback
EgorBo 05e2639
fix compilation
EgorBo 771fd6a
Update src/coreclr/vm/jitinterface.cpp
EgorBo 1acf664
Update src/coreclr/vm/jitinterface.cpp
EgorBo 806e985
Address feedback
EgorBo 2a0fc88
add assert
EgorBo fe169c6
limit to primitives and objects on llc side
EgorBo 30fbd21
fix check
EgorBo 7c2d8dc
Apply suggestions from code review
EgorBo be7c16f
Fix indention since "if" was removed
EgorBo 5fbe665
Apply suggestions from code review
EgorBo 56908b0
Address feedback, align NativeAOT logic with CoreCLR
EgorBo cbe5cd0
Update src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoIm…
EgorBo 76a72d8
Update src/coreclr/vm/jitinterface.cpp
jkotas aa5be51
Keep IsThreadStatic on vm side
EgorBo 0f8b7cd
Merge branch 'main' of github.com:dotnet/runtime into frozen-static-r…
EgorBo e4ce64d
Merge branch 'main' of github.com:dotnet/runtime into frozen-static-r…
EgorBo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
This will work, but later it may be relaxed. This is still an ordinary store, unless it was volatile in IL. We just need to emit it as release, but can do all kind of optimizations. It might need a new flag.
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.
Nit: If we need to emit it as release, it is not really an ordinary store.
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.
What I meant - if it was a regular store in IL, we can still move it around or coalesce with other writes to same location - for optimization purposes it is still a regular store. I think
GTF_IND_VOLATILE
would suppress all that, but it could be ok for now.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.
Yeah, thanks, by the time we reach this phase we already have done all the transformations/optimizations so
GTF_IND_VOLATILE
should not really cause codegen diffs apart from thestr
->stlr
on armThere 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.
Seems to work, here jit decided to use
str
+dmb
instead ofstlr
because of addressing modePS:
printObjectDescription()
can be improved on NativeAOT side 🤔