3 ms·
First of all: it's a bit of an ill-defined term and someone else might have a different definition that contradicts mine. I'm not too familiar with .NET but ba
by exDM69 10y ago
First of all: it's a bit of an ill-defined term and someone else might have a different definition that contradicts mine.
I'm not too familiar with .NET but based on your description, no I would not qualify that as a JIT according to the definition I gave above.
If you could as well do it ahead of time, I would not call it a JIT.
Is the reason for .NET's late compilation to generate code for the target CPU architecture? Or does it do some optimization based on runtime information (this would qualify as JIT)?
It doesn't necessarily have to be a (bytecode) interpreter to call it a JIT, but it does have to compile code at runtime and have the control return back to the framework for compiling more code as needed.
- johncolanduoni 10y agoI don't believe it does any runtime optimization, but it does compile code on-demand. Compiled code returns control to the compiler, but not interpreted code since there is none. IIRC this is done in a similar manner to garbage collection pauses (via interception of bad memory accesses).
- exDM69 10y agoIf the control returns from the compiled code, I'd call it a JIT. Do you know why it's doing incremental compilation? Is there something that can't be done ahead of time? E.g. inlining dynamic ("virtual function") calls and then applying optimization?
- johncolanduoni 10y agoMostly to avoid compiling much code that doesn't actually get executed. For the most part you can do everything ahead of time via static analysis (Xamarin's iOS toolchain does this). The only exception is access of code via reflection, which is harder to statically analyze and will also invoke the JIT.