-
I build runtime on linux first.I find a file named crossgen2. google say
It means crossgen2 can generate native code without jit?
I notice System.Private.CoreLib.dll use crossgen2 , it generates System.Private.CoreLib.ni.r2rmap and System.Private.CoreLib.dll. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's an ahead-of-time compiler which generates native code and saves it into the managed assembly in a R2R format, so that the runtime can load and execute those native code from the assembly directly on startup without need of jitting them. Basically, it is used for speeding up the startup. Note that crossgen2 won't generate native code for all your code (as some are versionable while some others require dynamic code generation or runtime generic instantiation, etc.), so it still needs IL code for JIT.
It's a mix of IL code and native code If you are looking into a way to build your app and run it without the need of JIT, you can check out ilc, which is the compiler used by NativeAOT. While in fact crossgen2 and ilc are sharing a lot of code. |
Beta Was this translation helpful? Give feedback.
It's an ahead-of-time compiler which generates native code and saves it into the managed assembly in a R2R format, so that the runtime can load and execute those native code from the assembly directly on startup without need of jitting them. Basically, it is used for speeding up the startup.
Note that crossgen2 won't generate native code for all your code (as some are versionable while some others require dynamic code generation or runtime generic instantiation, etc.), so it still needs IL code for JIT.
It's a mix of IL code and native code
If you are looking into a way to build your app and run it without the need of JIT, you can check out ilc, which i…