Move leap seconds DateTime configuration statics into LeapSecondCache#77163
Merged
jkotas merged 1 commit intodotnet:mainfrom Oct 18, 2022
Merged
Move leap seconds DateTime configuration statics into LeapSecondCache#77163jkotas merged 1 commit intodotnet:mainfrom
jkotas merged 1 commit intodotnet:mainfrom
Conversation
… class This enables AOT initialization of public readonly DateTime statics like DateTime.Min/MaxValue.
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Member
Author
|
Context: #77102 (comment) |
Member
|
Thanks, validate locally with changes from #77102 that this: static bool Test(DateTime dt) => dt == DateTime.MinValue;Emits: ; Assembly listing for method Program:Test(System.DateTime):bool
; Emitting BLENDED_CODE for X64 CPU with SSE2 - Windows
; ReadyToRun compilation
; optimized code
; rsp based frame
; partially interruptible
; Final local variable assignments
;
;* V00 arg0 [V00 ] ( 0, 0 ) struct ( 8) zero-ref single-def
;# V01 OutArgs [V01 ] ( 1, 1 ) lclBlk ( 0) [rsp+00H] "OutgoingArgSpace"
;* V02 tmp1 [V02 ] ( 0, 0 ) struct ( 8) zero-ref "folding static ro fld struct"
;* V03 tmp2 [V03 ] ( 0, 0 ) struct ( 8) zero-ref "Inlining Arg"
;* V04 tmp3 [V04 ] ( 0, 0 ) struct ( 8) zero-ref "Inlining Arg"
; V05 tmp4 [V05,T00] ( 2, 2 ) long -> rcx single-def V00._dateData(offs=0x00) P-INDEP "field V00._dateData (fldOffset=0x0)"
;* V06 tmp5 [V06 ] ( 0, 0 ) long -> zero-ref V02._dateData(offs=0x00) P-INDEP "field V02._dateData (fldOffset=0x0)"
;* V07 tmp6 [V07 ] ( 0, 0 ) long -> zero-ref V03._dateData(offs=0x00) P-INDEP "field V03._dateData (fldOffset=0x0)"
;* V08 tmp7 [V08 ] ( 0, 0 ) long -> zero-ref V04._dateData(offs=0x00) P-INDEP "field V04._dateData (fldOffset=0x0)"
;
; Lcl frame size = 0
G_M44292_IG01: ;; offset=0000H
;; size=0 bbWeight=1 PerfScore 0.00
G_M44292_IG02: ;; offset=0000H
48C1E102 shl rcx, 2
0F94C0 sete al
0FB6C0 movzx rax, al
;; size=10 bbWeight=1 PerfScore 1.75
G_M44292_IG03: ;; offset=000AH
C3 ret
;; size=1 bbWeight=1 PerfScore 1.00
; Total bytes of code 11, prolog size 0, PerfScore 3.85, instruction count 4, allocated bytes for code 11 (MethodHash=313f52fb) for method Program:Test(System.DateTime):bool
; ============================================================on NativeAOT |
EgorBo
approved these changes
Oct 18, 2022
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This enables AOT initialization of public readonly DateTime statics like DateTime.Min/MaxValue.