Sanitize and centralize exception throws#2293
Conversation
4e8251b to
a6a1449
Compare
|
a6a1449 to
491d7be
Compare
5409e31 to
786f8b3
Compare
|
@benaadams I'm assuming you're doing this for perf. Were you able to measure any perf gains? |
|
The throwing of exceptions is a bit haphazard in style; so it brings consistency. Currently sometimes methods get an exception from BadHttpRequest then throw inline; other times BadHttpRequest throws for them; other times there's a second method in the class that gets the Exception and then throws out of line. There is even an non-static function that calls a static GetException meaning it has to go via the class This moves everything to BadHttpRequest throwing; except the couple that need to check the local logging state. There will likely be some mild pref improvements from a hotter instructions cache from not throwing inline; and sticking to the out-of-line throw generally used so the asm will be shorter per function; there won't be any big gains as most of the methods won't change to being inlinable as they are quite big. So it more about being consistent in how exceptions are thrown. Some of the current methods are effected strongly by throwing out of line; which is why I was moving to that as the baseline. |
|
@benaadams Could you rebase? @halter73 will look into taking this after. |
786f8b3 to
075d738
Compare
|
Rebased |
|
@benaadams can you show what exceptions look like now? |
|
With line numbers Or without line numbers |
|
Previous G_M44841_IG22:
B901000000 mov ecx, 1
E8D423E6FF call BadHttpRequestException:GetException(int):ref
488BC8 mov rcx, rax
E8ECB6425F call CORINFO_HELP_THROW
G_M44841_IG23:
B904000000 mov ecx, 4
E8C223E6FF call BadHttpRequestException:GetException(int):ref
488BC8 mov rcx, rax
E8DAB6425F call CORINFO_HELP_THROW
G_M44841_IG24:
B911000000 mov ecx, 17
E8B023E6FF call BadHttpRequestException:GetException(int):ref
488BC8 mov rcx, rax
E8C8B6425F call CORINFO_HELP_THROW
CC int3 ; Total bytes of code 754, prolog size 61 for method Http1Connection:TryParseRequest(struct,byref):bool:thisPost G_M44844_IG22:
B901000000 mov ecx, 1
E81420E6FF call BadHttpRequestException:Throw(int)
G_M44844_IG23:
B904000000 mov ecx, 4
E80A20E6FF call BadHttpRequestException:Throw(int)
G_M44844_IG24:
B911000000 mov ecx, 17
E80020E6FF call BadHttpRequestException:Throw(int)
CC int3 ; Total bytes of code 722, prolog size 61 for method Http1Connection:TryParseRequest(struct,byref):bool:this |
|
Fixed your spelling 😉 |
No description provided.