缩写EE在.NET参考源中的含义是什么?

时间:2014-09-18 15:49:55

标签: c# .net

String类的.NET参考源中,有各种注释引用称为EE的内容。

The first is on m_stringLength

//NOTE NOTE NOTE NOTE
//These fields map directly onto the fields in an EE StringObject.  See object.h for the layout.
//
[NonSerialized]private int  m_stringLength;

It's found again again for .Empty

// The Empty constant holds the empty string value. It is initialized by the EE during startup.
// It is treated as intrinsic by the JIT as so the static constructor would never run.
// Leaving it uninitialized would confuse debuggers.
//
//We need to call the String constructor so that the compiler doesn't mark this as a literal.
//Marking this as a literal would mean that it doesn't show up as a field which we can access 
//from native.
public static readonly String Empty;

它也在Length上:

// Gets the length of this string
//
/// This is a EE implemented function so that the JIT can recognise is specially
/// and eliminate checks on character fetchs in a loop like:
///        for(int I = 0; I < str.Length; i++) str[i]
/// The actually code generated for this will be one instruction and will be inlined.

我敢冒险它可能与 E ngine有关,或者 E xternal,但我想要一个实际的参考来定义它是什么。< / p>

EE是什么意思?

1 个答案:

答案 0 :(得分:8)

EEExecution Engine的首字母缩写。

Microsoft Core Execution Engine(在mscoree.dll中找到)是每个.NET程序调用以加载CLR并执行IL代码的引导程序。这是一段无人管理的代码。