-
Notifications
You must be signed in to change notification settings - Fork 5.3k
NativeAOT: Partially expand static initialization #83911
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
7100058
Expand static initialization in JIT
EgorBo 023e2c8
Clean up
EgorBo 6019949
Address feedback, clean up
EgorBo 791244b
Address feedback, baby steps towards NAOT impl
EgorBo 4f7c857
Remove test that always expects CORINFO_HELP_GETSHARED_NONGCSTATIC_BA…
EgorBo 620bbd1
NativeAOT non-GC impl
EgorBo 4279269
Fix NAOT
EgorBo 7b9a259
Enable GC statics for NativeAOT
EgorBo a79eba7
Merge branch 'main' of github.com:dotnet/runtime into expand-static-init
EgorBo c1744bc
Fix assert
EgorBo 141e99e
code clean up
EgorBo 9ab6dc1
Merge branch 'main' of github.com:dotnet/runtime into expand-static-init
EgorBo 0131b3c
Merge branch 'main' of github.com:dotnet/runtime into expand-static-init
EgorBo e073da4
Flip condition to "*isInited == 1"
EgorBo 5256957
Update comments
EgorBo 6cb5d30
Merge branch 'main' of github.com:dotnet/runtime into expand-static-init
EgorBo bc46cbd
Split getIsClassInitedFieldAddress into two functions
EgorBo 9229e5d
Cache static base to a local
EgorBo 95f0f7a
Merge branch 'main' of github.com:dotnet/runtime into expand-static-init
EgorBo bebf956
Merge branch 'main' of github.com:dotnet/runtime into expand-static-init
EgorBo 86ccf98
Update src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoIm…
EgorBo 96bd745
Address feedback
EgorBo efa8dfa
clean up
EgorBo c3f389b
Address feedback
EgorBo 61bf741
Address feedback
EgorBo 19d1484
use GTF_ICON_GLOBAL_PTR
EgorBo 6d7ea49
Merge branch 'main' of github.com:dotnet/runtime into expand-static-init
EgorBo 742c948
Update src/coreclr/jit/flowgraph.cpp
EgorBo dbb4a0c
Update src/coreclr/jit/flowgraph.cpp
EgorBo deb4eb6
Update src/coreclr/jit/flowgraph.cpp
EgorBo f0a44ba
Update src/coreclr/jit/flowgraph.cpp
EgorBo 9b11b91
Merge branch 'expand-static-init' of github.com:EgorBo/runtime-1 into…
EgorBo 2570f84
formatting
EgorBo 16c75b2
Address feedback (1st round)
EgorBo 2bbf5bf
Address feedback (round 2)
EgorBo ddc1731
Address feedback
EgorBo f65d080
Fix assert on NAOT
EgorBo c7bc7d8
Apply suggestions from code review
EgorBo 6d1d18a
Update src/coreclr/jit/flowgraph.cpp
EgorBo cc56182
Address feedback
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
clean up
- Loading branch information
commit efa8dfaa69fa4c1ff37f68db165ade4dc7fe3b5b
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -617,19 +617,20 @@ PhaseStatus Compiler::fgExpandStaticInit() | |
| isInitAdrNode = gtNewIndOfIconHandleNode(TYP_INT, (size_t)flagAddr.addr, GTF_ICON_CONST_PTR, true); | ||
| } | ||
|
|
||
| ssize_t isInitedValue = 1; | ||
| GenTree* isInitedValue; | ||
| if (!IsTargetAbi(CORINFO_NATIVEAOT_ABI)) | ||
| { | ||
| // In JIT we only check a single bit (see ClassInitFlags::INITIALIZED_FLAG) | ||
| isInitAdrNode = gtNewOperNode(GT_AND, TYP_INT, isInitAdrNode, gtNewIconNode(1)); | ||
| isInitedValue = gtNewIconNode(1); | ||
| } | ||
| else | ||
| { | ||
| // It was flipped to 0 for better codegen in https://github.com/dotnet/runtime/pull/83937 | ||
EgorBo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| isInitedValue = 0; | ||
| isInitedValue = gtNewIconNode(0, TYP_I_IMPL); | ||
| } | ||
|
|
||
| GenTree* isInitedCmp = gtNewOperNode(GT_EQ, TYP_INT, isInitAdrNode, gtNewIconNode(isInitedValue)); | ||
| GenTree* isInitedCmp = gtNewOperNode(GT_EQ, TYP_INT, isInitAdrNode, isInitedValue); | ||
| isInitedCmp->gtFlags |= GTF_RELOP_JMP_USED; | ||
|
||
| BasicBlock* isInitedBb = | ||
| fgNewBBFromTreeAfter(BBJ_COND, prevBb, gtNewOperNode(GT_JTRUE, TYP_VOID, isInitedCmp), debugInfo); | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.