Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the acronym EE mean in the .NET reference source? [duplicate]

Tags:

c#

.net

In the .NET reference source for the String class, there are various comments referencing something called the 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;

It's also on 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.

I would venture that it might have something to do with an Engine or is External, but I'd like an actual reference defining what it is.

What does the EE mean?

like image 603
zastrowm Avatar asked Sep 18 '14 15:09

zastrowm


1 Answers

EE is an acronym for the Execution Engine.

The Microsoft Core Execution Engine (as found in mscoree.dll) is the bootstrapper that every .NET program calls to load the CLR and execute the IL code. It's an unmanaged piece of code.

like image 139
nvoigt Avatar answered Oct 24 '22 08:10

nvoigt