Skip to content

Instantly share code, notes, and snippets.

@Mrnikbobjeff
Created October 5, 2020 17:10
Show Gist options
  • Save Mrnikbobjeff/3c7e65c8d80cea5ba110fbf4439b40cf to your computer and use it in GitHub Desktop.
Save Mrnikbobjeff/3c7e65c8d80cea5ba110fbf4439b40cf to your computer and use it in GitHub Desktop.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using System.Threading;
using System.Diagnostics.CodeAnalysis;
namespace ObjectPools
{
public class FastRefPool
{
public static Exception GetException => new Exception();
internal static void IsSupported() =>
throw GetException;
internal static void IsHelperSupported() =>
ThrowHelper();
[DoesNotReturn]
internal static void ThrowHelper() => throw new Exception();
}
}
; Core CLR v4.700.20.20201 on x86
ObjectPools.FastRefPool..ctor()
L0000: ret
ObjectPools.FastRefPool.get_GetException()
L0000: mov ecx, 0xfac33c
L0005: call 0x006030cc
L000a: mov dword ptr [eax+0x38], 0xe0434352
L0011: mov dword ptr [eax+0x3c], 0x80131500
L0018: ret
ObjectPools.FastRefPool.IsSupported()
L0000: push esi
L0001: mov ecx, 0xfac33c
L0006: call 0x006030cc
L000b: mov esi, eax
L000d: mov ecx, esi
L000f: call System.Exception..ctor()
L0014: mov ecx, esi
L0016: call 0x71520cb0
L001b: int3
ObjectPools.FastRefPool.IsHelperSupported()
L0000: call dword ptr [0x1b1dc6f8]
L0006: int3
ObjectPools.FastRefPool.ThrowHelper()
L0000: push esi
L0001: mov ecx, 0xfac33c
L0006: call 0x006030cc
L000b: mov esi, eax
L000d: mov ecx, esi
L000f: call System.Exception..ctor()
L0014: mov ecx, esi
L0016: call 0x71520cb0
L001b: int3
{
"version": 1,
"target": "JIT ASM",
"mode": "Release",
"branch": "master"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment