This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Marker("foreach over an IEnumerable"); | |
0000062c mov ecx,12853408h | |
00000631 mov rcx,qword ptr [rcx] | |
00000634 call FFFFFFFFFFFFF668 | |
132: foreach (var num in numsEnumerable) | |
00000639 mov rcx,qword ptr [rbp-40h] | |
0000063d mov r11,7FE987F0020h | |
00000647 cmp dword ptr [rcx],ecx | |
00000649 call qword ptr [r11] | |
0000064c mov qword ptr [rbp-48h],rax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main() | |
{ | |
Console.WriteLine("Hello, CoreCLR!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.assembly ActionTest {} | |
.assembly extern mscorlib | |
{ | |
.ver 4:0:0:0 | |
.publickeytoken = (B7 7A 5C 56 19 34 E0 89) | |
} | |
.namespace Test | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
namespace AyendeInterviewQuestion | |
{ | |
public class Indexer | |
{ | |
// This maps Terms to a list of DocId's for the Docs that contain them | |
private readonly Dictionary<string, HashSet<string>> terms = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection.Emit; | |
class Program | |
{ | |
delegate object FuncObjectObject(Object o); | |
static void Main(string[] args) | |
{ | |
var dm = new DynamicMethod("", typeof(object), new [] { typeof(object) }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Windows\assembly\gac_32\CustomMarshalers\2.0.0.0__b03f5f7f11d50a3a\CustomMarshalers.dll - 4 types that don't override ToString() | |
C:\Windows\assembly\gac_32\ISymWrapper\2.0.0.0__b03f5f7f11d50a3a\ISymWrapper.dll - 8 types that don't override ToString() | |
C:\Windows\assembly\gac_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll - 561 types that don't override ToString() | |
C:\Windows\assembly\gac_32\PresentationCore\3.0.0.0__31bf3856ad364e35\PresentationCore.dll - 506 types that don't override ToString() | |
C:\Windows\assembly\gac_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll - 164 types that don't override ToString() | |
C:\Windows\assembly\gac_32\System.Data.OracleClient\2.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll - 19 types that don't override ToString() | |
C:\Windows\assembly\gac_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll - 62 types that don't override ToString() | |
C:\Windows\assembly\gac_32\System.Printing\3.0.0.0__31bf3856ad364e35\System.Printing.dll - 38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Windows\assembly\gac_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll - 29 types that don't override ToString() | |
C:\Windows\assembly\gac_32\PresentationCore\3.0.0.0__31bf3856ad364e35\PresentationCore.dll - 8 types that don't override ToString() | |
C:\Windows\assembly\gac_32\System.Data.OracleClient\2.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll - 1 types that don't override ToString() | |
C:\Windows\assembly\gac_32\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll - 1 types that don't override ToString() | |
C:\Windows\assembly\gac_msil\FSharp.Core\2.3.0.0__b03f5f7f11d50a3a\FSharp.Core.dll - 2 types that don't override ToString() | |
C:\Windows\assembly\gac_msil\Microsoft.VisualStudio.Debugger.Metadata\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Metadata.dll - 1 types that don't override ToString() | |
C:\Windows\assembly\gac_msil\Microsoft.VisualStudio.VIL\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.vil.dll - 1 types that don't override ToString() | |
C:\Windows\assembly\gac_msi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Windows\assembly\gac_32\CustomMarshalers\2.0.0.0__b03f5f7f11d50a3a\CustomMarshalers.dll - 4 types that don't override ToString() | |
System.Runtime.InteropServices.CustomMarshalers.ExpandoToDispatchExMarshaler | |
System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler | |
System.Runtime.InteropServices.CustomMarshalers.TypeToTypeInfoMarshaler | |
System.Runtime.InteropServices.CustomMarshalers.EnumerableToDispatchMarshaler | |
C:\Windows\assembly\gac_32\ISymWrapper\2.0.0.0__b03f5f7f11d50a3a\ISymWrapper.dll - 8 types that don't override ToString() | |
System.Diagnostics.SymbolStore.SymDocument | |
System.Diagnostics.SymbolStore.SymDocumentWriter | |
System.Diagnostics.SymbolStore.SymMethod | |
System.Diagnostics.SymbolStore.SymReader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Windows\assembly\gac_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll - 29 types that don't override ToString() | |
System.ArraySegment`1 | |
System.ArgIterator | |
System.ConsoleKeyInfo | |
System.RuntimeArgumentHandle | |
System.RuntimeTypeHandle | |
System.RuntimeMethodHandle | |
System.RuntimeFieldHandle | |
System.ModuleHandle | |
System.TypedReference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ChangeToReturnFalse(MethodInfo methodInfo) | |
{ | |
var intPtrConstructor = typeof(IntPtr).GetConstructor(new[] { typeof(void*) }); | |
var method = new DynamicMethod("ChangeToReturnFalse", typeof(IntPtr), Type.EmptyTypes, typeof(ServiceLocationModule)); | |
var generator = method.GetILGenerator(); | |
generator.Emit(OpCodes.Ldftn, methodInfo); | |
generator.Emit(OpCodes.Newobj, intPtrConstructor); | |
generator.Emit(OpCodes.Ret); | |
var addressFunctor = (Func<IntPtr>)method.CreateDelegate(typeof(Func<IntPtr>)); | |
var address = addressFunctor(); |