This repository was archived by the owner on Aug 2, 2023. It is now read-only.
Improved Exception handling#793
Merged
Merged
Conversation
Member
Author
|
e.g. public static void Requires(bool condition) Pre ; Assembly listing for method Contract:Requires(bool)
; Emitting BLENDED_CODE for X64 CPU with SSE2
; optimized code
; rsp based frame
; partially interruptible
; Final local variable assignments
;
; V00 arg0 [V00,T00] ( 3, 3 ) bool -> rcx
; V01 OutArgs [V01 ] ( 1, 1 ) lclBlk (32) [rsp+0x00]
;
; Lcl frame size = 40
G_M36318_IG01:
sub rsp, 40
nop
G_M36318_IG02:
test cl, cl
je SHORT G_M36318_IG04
G_M36318_IG03:
add rsp, 40
ret
G_M36318_IG04:
call [Contract:NewArgumentException():ref]
mov rcx, rax
call CORINFO_HELP_THROW
int3
; Total bytes of code 29, prolog size 5 for method Contract:Requires(bool)Post ; Assembly listing for method Contract:Requires(bool)
; Emitting BLENDED_CODE for X64 CPU with SSE2
; optimized code
; rsp based frame
; partially interruptible
; Final local variable assignments
;
; V00 arg0 [V00,T00] ( 3, 3 ) bool -> rcx
; V01 OutArgs [V01 ] ( 1, 1 ) lclBlk (32) [rsp+0x00]
;
; Lcl frame size = 40
G_M36319_IG01:
sub rsp, 40
nop
G_M36319_IG02:
test cl, cl
je SHORT G_M36319_IG04
G_M36319_IG03:
add rsp, 40
ret
G_M36319_IG04:
call [Contract:ThrowArgumentException()]
int3
; Total bytes of code 21, prolog size 5 for method Contract:Requires(bool) |
Member
Author
|
Likewise it means: Span`1:.ctor(ref):this ends like ret
G_M44205_IG06:
call [Contract:ThrowArgumentException()]
G_M44205_IG07:
call [Contract:ThrowArgumentException()]
int3
; Total bytes of code 137, prolog size 13 for method Span`1:.ctor(ref):thisinstead of ret
G_M44203_IG06:
call [Contract:NewArgumentException():ref]
mov rcx, rax
call CORINFO_HELP_THROW
G_M44203_IG07:
call [Contract:NewArgumentException():ref]
mov rcx, rax
call CORINFO_HELP_THROW
int3
; Total bytes of code 153, prolog size 13 for method Span`1:.ctor(ref):this |
Member
|
@dotnet-bot test this please |
Member
|
Thanks! |
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.
Throw the exceptions directly from the void method, don't mark as no-inlining
Post dotnet/coreclr#6103 "Do not inline methods that never return" this will give the best result. (As shown in dotnet/coreclr#6634)
It won't inline the exception Throw function, will mark the call to the Throw function as cold code, and won't preform any register prep for the function (push+pop)