It is implemented in the production environment itself, so there is no C # source code for it.
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Type GetType();
MethodImplOptions.InternalCall used for functions that have a "magic" implementation inside the runtime itself.
For a normal .net implementation, you will not find it at all from your private source. With Rotor or Mono, you are most likely to find c / C ++ in the source code.
I assume that it simply uses a marker pointer at the beginning of each instance to retrieve class information, which then contains a field to access the managed instance Type, possibly creating it on demand.
source
share