<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=CIL</id>
	<title>CIL - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=CIL"/>
	<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=CIL&amp;action=history"/>
	<updated>2026-04-06T20:03:02Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=CIL&amp;diff=334&amp;oldid=prev</id>
		<title>Zhang3：创建页面，内容为“{{stub}}  '''Common Intermediate Language 通用中间语言 ''' ('''CIL' ''，以前被称为 '''MSIL''') 是 .NET Framework 中使用的字节码中间语言。 编译为CLI字节码的代码被认为是 “托管代码”，可以由任何 CLI 兼容的编译器 (例如  C# 编译器) 创建，并由 Virtual Execution System (VES虚拟执行系统) 执行。 它是CPU和平台无关的。  大多数时候，开发人员不会直接…”</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=CIL&amp;diff=334&amp;oldid=prev"/>
		<updated>2022-01-27T09:02:32Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“{{stub}}  &amp;#039;&amp;#039;&amp;#039;Common Intermediate Language 通用中间语言 &amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;CIL&amp;#039; &amp;#039;&amp;#039;，以前被称为 &amp;#039;&amp;#039;&amp;#039;MSIL&amp;#039;&amp;#039;&amp;#039;) 是 &lt;a href=&quot;/index.php?title=.NET_Framework&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;.NET Framework（页面不存在）&quot;&gt;.NET Framework&lt;/a&gt; 中使用的字节码中间语言。 编译为CLI字节码的代码被认为是 “托管代码”，可以由任何 &lt;a href=&quot;/index.php?title=CLI&quot; title=&quot;CLI&quot;&gt;CLI&lt;/a&gt; 兼容的编译器 (例如 &lt;a href=&quot;/index.php?title=C_Sharp&quot; title=&quot;C Sharp&quot;&gt; C# 编译器&lt;/a&gt;) 创建，并由 &lt;a href=&quot;/index.php?title=Virtual_Execution_System&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Virtual Execution System（页面不存在）&quot;&gt;Virtual Execution System&lt;/a&gt; (VES虚拟执行系统) 执行。 它是CPU和平台无关的。  大多数时候，开发人员不会直接…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{stub}}&lt;br /&gt;
&lt;br /&gt;
'''Common Intermediate Language 通用中间语言 ''' ('''CIL' ''，以前被称为 '''MSIL''') 是 [[.NET Framework]] 中使用的字节码中间语言。 编译为CLI字节码的代码被认为是 “托管代码”，可以由任何 [[CLI]] 兼容的编译器 (例如 [[C Sharp | C# 编译器]]) 创建，并由 [[Virtual Execution System]] (VES虚拟执行系统) 执行。 它是CPU和平台无关的。&lt;br /&gt;
&lt;br /&gt;
大多数时候，开发人员不会直接在CIL中编程，而是使用更高级别的语言，例如 [[C Sharp | C#]]，[[C++/CLI]]，[[Visual Basic .NET]] 和 [[J#]]。 但是，CIL有自己的汇编语言，可以由ILAsm (&amp;lt;code&amp;gt;ilasm.exe&amp;lt;/code&amp;gt;) 汇编。 要以汇编语言显示字节代码，请使用CIL反汇编程序ILDAsm (&amp;lt;code&amp;gt;ildasm.exe&amp;lt;/code&amp;gt;)。 然而，一些专门的工具如.NET Reflector可以将字节码表示为任何支持的例如C#这样的高级语言，包括类，方法和其他元数据。&lt;br /&gt;
&lt;br /&gt;
== 安全不安全的代码 ==&lt;br /&gt;
CIL字节代码既可以被认为是安全的，也可以被认为是不安全的。 默认情况下，所有C# 都是安全的，这意味着执行系统始终知道所有数据在哪里。 因此，不可能在安全代码中使用指针。 得益于此属性，消除了最常见的安全性和稳定性问题，例如缓冲区溢出和悬空(dangling)指针。 使用 [[Garbage collection| 垃圾回收器]] 来尽可能高效地使用内存。&lt;br /&gt;
&lt;br /&gt;
=== 不安全的代码 ===&lt;br /&gt;
尽管在安全代码中无法使用指针，但CIL支持不安全的代码，该代码确实支持指针。 不安全的代码包含在标记为 “不安全” 的代码块中，在C # 中，它使用与C和C相同的语法。 对象可以被 “pinned”，以便 [[垃圾回收 | 垃圾收集器]] 不会移动数据，并且指针保持有效。 使用不安全的代码是完全合法的，尽管在正常的应用程序编程中不鼓励使用，并且可能用于编写内核级方法。&lt;br /&gt;
&lt;br /&gt;
==Executing CIL Code==&lt;br /&gt;
CIL code is executed by a [[Virtual Execution System]] much like Java byte code. Usually this is in the form of a [[Just In Time compiler]], which translates the byte code into a native machine code, usually utilizing optimizations specific to that processor (for example SSE if available). [http://www.mono-project.com Mono] is an open-source .NET project, which consists of an CIL JIT'er (and interpreter for unsupported architectures) as well as a C#-&amp;gt;CLI compiler. The JIT'er and can be [http://www.mono-project.com/Embedding_Mono embedded] in to any program or stand alone. The basic JIT'er and compiler is written in C and only requires the C Standard Library to run.&lt;br /&gt;
&lt;br /&gt;
== Metadata 元数据 ==&lt;br /&gt;
CIL字节码只是.NET程序集的一半。 另一半是元数据，VES使用它来查找需要调用的方法。 这使得继承或扩展类和覆盖方法成为可能，这样正确的覆盖方法将在运行时调用，而无需重新编译调用程序集。&lt;/div&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
</feed>