国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

C#代碼的編譯與執行過程(摘自ms inside c#)

2024-07-21 02:20:19
字體:
來源:轉載
供稿:網友
1.you write source code in c#.

2.you then compile it using the c# compiler (csc.exe) into an exe.

3.the c# compiler outputs the msil code and a manifest into a read-only part of the exe that has a standard pe (win32-portable executable) header.
  so far, so good. however, here's the important part: when the compiler creates the output, it also imports a function named _ corexemain from the .net runtime.

4.when the application is executed, the operating system loads the pe, as well as any dependent dynamic-link libraries (dlls), such as the one that exports the _ corexemain function (mscoree.dll), just as it does with any valid pe.
5.the operating system loader then jumps to the entry point inside the pe, which is put there by the c# compiler. once again, this is exactly how any other pe is executed in windows.
however, since the operating system obviously can't execute the msil code, the entry point is just a small stub that jumps to the _ corexemain function in mscoree.dll.

6.the _ corexemain function starts the execution of the msil code that was placed in the pe.

7.since msil code cannot be executed directly—because it's not in a machine-executable format—the clr compiles the msil by using a just-in-time (jit) compiler (or jitter) into native cpu instructions as it processes the msil. jit compiling occurs only as methods in the program are called. the compiled executable code is cached on the machine and is recompiled only if there's some change to the source code.
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 扶沟县| 奇台县| 西畴县| 原阳县| 桓仁| 登封市| 宜城市| 白河县| 永安市| 平原县| 阳春市| 英山县| 古田县| 七台河市| 德化县| 任丘市| 神木县| 宜阳县| 龙胜| 仙桃市| 清水县| 民勤县| 武安市| 通州市| 金山区| 龙泉市| 屏山县| 连山| 平乐县| 罗山县| 郸城县| 宜丰县| 玉屏| 沂南县| 通化县| 九龙城区| 湘阴县| 宜春市| 军事| 岳西县| 故城县|