Click here to Skip to main content
15,886,963 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 946 Pin
Amarnath S20-Jan-24 21:04
professionalAmarnath S20-Jan-24 21:04 
GeneralRe: Wordle 946 - 4 4 me Pin
pkfox20-Jan-24 21:23
professionalpkfox20-Jan-24 21:23 
GeneralRe: Wordle 946 Pin
GuyThiebaut20-Jan-24 23:44
professionalGuyThiebaut20-Jan-24 23:44 
GeneralRe: Wordle 946 Pin
Cp-Coder21-Jan-24 0:33
Cp-Coder21-Jan-24 0:33 
GeneralRe: Wordle 946 Pin
GKP199221-Jan-24 4:02
professionalGKP199221-Jan-24 4:02 
GeneralRe: Wordle 946 Pin
David O'Neil21-Jan-24 10:57
professionalDavid O'Neil21-Jan-24 10:57 
GeneralRe: Wordle 946 Pin
StarNamer@work22-Jan-24 12:47
professionalStarNamer@work22-Jan-24 12:47 
GeneralDoes anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 6:13
mvahoney the codewitch20-Jan-24 6:13 
Basically I am not sure about a number of things regarding how it works

C#
if((this.current >= 'A' && this.current <= 'Z') || 
    (this.current >= 'a' && this.current <= 'z')) {
    // do something
}


In MSIL you'd have to pepper the IL you drop for that if construct with a bunch of extra Ldarg_0 arguments to retrieve the this reference for *each* comparison.

On x86 CPUs (and well, most any CPU with registers, which IL doesn't really have unless you stretch the terminology to include its list of function arguments and locals) you'd load the this pointer into a register and work off that rather than repeatedly loading it onto the stack every time you need to access it as you would in IL. On pretty much any supporting architecture this is much faster than hitting stack. Maybe an order of magnitude.

So my question is for example, is the JIT compiler smart enough to resolve those repeated Ldarg_0s into register access? That's just one thing I want to know.

Some avenues of research I considered to figure this out:
1. Running the code through a debugger and dropping to assembly. The only way I can do that reliably is with debug info, which may change how the JITter drops native instructions. I can't rely on it.
2. Using ngen and then disassembling the result but again, that's not JITted, but rather precompiled so things like whole program optimization are in play. I can't rely on it.

And I can't find any material that will help me figure that out short of the very dry and difficult specs they release, which I'm not even sure tell me that, since the JIT compiler's actual implementation details aren't part of the standard.

What I'm hoping for is something some clever Microsoft employee or blogger wrote that describes the behavior of Microsoft's JITter in some detail.

There are some real world implications for some C# code that my library generates. I need to make some decisions about it and I feel like I don't have all the information I need.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
0x01AA20-Jan-24 6:17
mve0x01AA20-Jan-24 6:17 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 6:20
mvahoney the codewitch20-Jan-24 6:20 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
trønderen20-Jan-24 7:47
trønderen20-Jan-24 7:47 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 8:04
mvahoney the codewitch20-Jan-24 8:04 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
trønderen20-Jan-24 9:30
trønderen20-Jan-24 9:30 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 10:00
mvahoney the codewitch20-Jan-24 10:00 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
trønderen20-Jan-24 10:12
trønderen20-Jan-24 10:12 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 19:04
mvahoney the codewitch20-Jan-24 19:04 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
trønderen20-Jan-24 10:01
trønderen20-Jan-24 10:01 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 10:03
mvahoney the codewitch20-Jan-24 10:03 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
Amarnath S20-Jan-24 13:45
professionalAmarnath S20-Jan-24 13:45 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 15:04
mvahoney the codewitch20-Jan-24 15:04 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
11917640 Member 20-Jan-24 18:53
11917640 Member 20-Jan-24 18:53 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 18:58
mvahoney the codewitch20-Jan-24 18:58 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
11917640 Member 20-Jan-24 22:07
11917640 Member 20-Jan-24 22:07 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch20-Jan-24 23:28
mvahoney the codewitch20-Jan-24 23:28 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
11917640 Member 21-Jan-24 0:01
11917640 Member 21-Jan-24 0:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.