This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Allow jit to examine type of initonly static ref typed fields #20886
Merged
AndyAyersMS
merged 10 commits into
dotnet:master
from
AndyAyersMS:GetExactTypeForRefClassReadonlyStatics
Nov 12, 2018
Merged
Allow jit to examine type of initonly static ref typed fields #20886
AndyAyersMS
merged 10 commits into
dotnet:master
from
AndyAyersMS:GetExactTypeForRefClassReadonlyStatics
Nov 12, 2018
Commits on Nov 12, 2018
-
Allow jit to examine type of initonly static ref typed fields
The jit incorporates the value of integer and float typed initonly static fields into its codegen, if the class initializer has already run. The jit can't incorporate the values of ref typed initonly static fields, but the types of those values can't change, and the jit can use this knowledge to enable type based optimizations like devirtualization. In particular for static fields initialized by complex class factory logic the jit can now see the end result of that logic instead of having to try and deduce the type of object that will initialize or did initialize the field. Examples of this factory pattern in include `EqualityComparer<T>.Default` and `Comparer<T>.Default`. The former is already optimized in some cases by via special-purpose modelling in the framework, jit, and runtime (see dotnet#14125) but the latter is not. With this change calls through `Comparer<T>.Default` may now also devirtualize (though won't yet inline as the devirtualization happens late). Addresses #4108.
Configuration menu - View commit details
-
Copy full SHA for 7e39a00 - Browse repository at this point
Copy the full SHA 7e39a00View commit details -
Configuration menu - View commit details
-
Copy full SHA for c007a9f - Browse repository at this point
Copy the full SHA c007a9fView commit details -
ensure class is fully initialized
Also remove assert for collectible classes and fix typo.
Configuration menu - View commit details
-
Copy full SHA for ccbbc71 - Browse repository at this point
Copy the full SHA ccbbc71View commit details -
Flip the sense of the return flag for getStaticFieldCurrentClass and update remainder of code accordingly. Change jit to not ask for speculative results.
Configuration menu - View commit details
-
Copy full SHA for 5085778 - Browse repository at this point
Copy the full SHA 5085778View commit details -
Rename bool out parameters to have `p` prefix for clarity. Defer fetching field attributes if class is not initialized.
Configuration menu - View commit details
-
Copy full SHA for 577d924 - Browse repository at this point
Copy the full SHA 577d924View commit details -
Configuration menu - View commit details
-
Copy full SHA for 64deef4 - Browse repository at this point
Copy the full SHA 64deef4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2df3553 - Browse repository at this point
Copy the full SHA 2df3553View commit details -
Configuration menu - View commit details
-
Copy full SHA for c32f9c8 - Browse repository at this point
Copy the full SHA c32f9c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3b07c5 - Browse repository at this point
Copy the full SHA d3b07c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf3c1a5 - Browse repository at this point
Copy the full SHA bf3c1a5View commit details
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.