Тема: Горе .NET
Показать сообщение отдельно
Старый 21.05.2018, 20:06   #7  
belugin is offline
belugin
Участник
Аватар для belugin
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,622 / 2922 (107) +++++++++
Регистрация: 16.01.2004
Записей в блоге: 5
Насколько я понял, классифицируют по отношению к программе - если компилируется до запуска - это AOT, если в рантайме - это JIT

https://docs.microsoft.com/en-us/dot...to_native_code

Compilation by the JIT Compiler
JIT compilation converts MSIL to native code on demand at application run time, when the contents of an assembly are loaded and executed.

...
Instead of using time and memory to convert all the MSIL in a PE file to native code, it converts the MSIL as needed during execution and stores the resulting native code in memory so that it is accessible for subsequent calls in the context of that process. The loader creates and attaches a stub to each method in a type when the type is loaded and initialized. When a method is called for the first time, the stub passes control to the JIT compiler, which converts the MSIL for that method into native code and modifies the stub to point directly to the generated native code. Therefore, subsequent calls to the JIT-compiled method go directly to the native code

To allow the generated code to be shared across multiple invocations of an application or across multiple processes that share a set of assemblies, the common language runtime supports an ahead-of-time compilation mode. This ahead-of-time compilation mode uses the Ngen.exe (Native Image Generator)

В википедии собственно написано, почему это комбинация AOT и интепретации:

A common implementation of JIT compilation is to first have AOT compilation to bytecode (virtual machine code), known as bytecode compilation, and then have JIT compilation to machine code (dynamic compilation), rather than interpretation of the bytecode.

То есть, AOT в данном случае относится к компиляции в байткод.

То есть и в HotSpot и в CLR загруженная сборка может быть скомпилирована в машинный код частично, просто в CLR то, что выполняется, точно скомпилировано. Можно конечно, чисто назвать это пометодной AOT, но обычно под AOT понимают немного другое.

Про core clr не знаю, натыкался на то, что там внутри есть ограниченный интерпретатор, скорее всего используемый для теста на новых платформах.

А вот открытое issue, не сделать ли там jit с интерпретатором https://github.com/dotnet/coreclr/issues/4331

Говорят про startup time а не про hotswap.

Последний раз редактировалось belugin; 21.05.2018 в 20:18.