调试,我们经常性需要了解和分析这类函数。下面将从 CLR 内部使用与实现 InternalCall 函数的不同角度,对其做一个粗略的分析。 作为一个 BCL 函数,被定义成 InternalCall 的函数使用上与普通 IL 函数没有任何区别。如同我前面《用WinDbg探索CLR世界 [3] 跟踪方法的 JIT 过程》一文中所述,它们在 MethodTable 中,最初的入口地址也被指向 mscorwks!PreStubWorker,可以通过 sos 查看之: 以下为引用: 0:003> !Name2EE mscorlib.dll System.String -------------------------------------- MethodTable: 79b7daf8 EEClass: 79b7de44 Name: System.String 0:003> !DumpMT -MD 79b7daf8 EEClass : 79b7de44 Module : 79b66000 Name: System.String mdToken: 0200000f (e:windowsmicrosoft.net rameworkv1.1.4322mscorlib.dll) MethodTable Flags : 2000000 Number of elements in array: 2 Number of IFaces in IFaceMap : 4 Interface Map : 79b7de24 Slots in VTable : 190 -------页码:[1] [2] [3] [4] [5] [6] [7] [8] [9] 第2页、共9页 |