public void DisableReadyToRun() { #if NETCOREAPP2 || NETCOREAPP3_0 return; #endif if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { return; } MethodBase clampMethod = typeof(Math).GetMethod("Clamp", new[] { typeof(int), typeof(int), typeof(int) }); bool disabled = MethodHelper.DisableReadyToRun(clampMethod); Assert.True(disabled); bool isClampCompiled = false; JitexManager.AddMethodResolver(context => { if (context.Method.Name == clampMethod.Name) { isClampCompiled = true; } }); Math.Clamp(1, 1, 1); Assert.True(isClampCompiled, "Method was not compiled."); }
static void Main(string[] args) { JitexManager.AddMethodResolver(MethodResolver); int result = SimpleSum(1, 7); Console.WriteLine(result); Console.ReadKey(); }
public TestConfiguration(IMessageSink messageSink) : base(messageSink) { ILogger logger = new LoggerConfiguration() .MinimumLevel.Verbose() .CreateLogger(); ILoggerFactory loggerFactory = new LoggerFactory().AddSerilog(logger); JitexLogger.SetLogger(loggerFactory); JitexManager.AddMethodResolver(MethodResolver); JitexManager.AddInterceptor(InterceptorCall); }
static ResolveStringTests() { JitexManager.AddMethodResolver(context => { }); JitexManager.AddTokenResolver(TokenResolver); }
static DetourMethodAddress() { JitexManager.AddMethodResolver(MethodResolver); }
public void LoadJitexTest() { JitexManager.AddMethodResolver(MethodResolver); JitexManager.AddTokenResolver(TokenResolver); Assert.True(JitexManager.IsEnabled, "Jitex is not enabled!"); }
static GenericRecompileTests() { JitexManager.AddMethodResolver(MethodResolver); }
public ResolveILTests() { JitexManager.AddMethodResolver(MethodResolver); JitexManager.AddTokenResolver(TokenResolver); }
public static void Initialize() { JitexManager.AddMethodResolver(MethodResolver); JitexManager.AddTokenResolver(TokenResolver); }
static ResolveNativeTests() { JitexManager.AddMethodResolver(MethodResolver); }
static DetourMethodDelegateTest() { JitexManager.AddMethodResolver(MethodResolver); }
public ResolveTokenTests() { JitexManager.AddMethodResolver(CompileResolver); JitexManager.AddTokenResolver(TokenResolver); }
public ResolveMethodTests() { JitexManager.AddMethodResolver(MethodResolver); }