示例#1
0
        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.");
        }
示例#2
0
        static void Main(string[] args)
        {
            JitexManager.AddMethodResolver(MethodResolver);
            int result = SimpleSum(1, 7);

            Console.WriteLine(result);
            Console.ReadKey();
        }
示例#3
0
        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);
        }
示例#4
0
 static ResolveStringTests()
 {
     JitexManager.AddMethodResolver(context => { });
     JitexManager.AddTokenResolver(TokenResolver);
 }
示例#5
0
 static DetourMethodAddress()
 {
     JitexManager.AddMethodResolver(MethodResolver);
 }
示例#6
0
 public void LoadJitexTest()
 {
     JitexManager.AddMethodResolver(MethodResolver);
     JitexManager.AddTokenResolver(TokenResolver);
     Assert.True(JitexManager.IsEnabled, "Jitex is not enabled!");
 }
示例#7
0
 static GenericRecompileTests()
 {
     JitexManager.AddMethodResolver(MethodResolver);
 }
示例#8
0
 public ResolveILTests()
 {
     JitexManager.AddMethodResolver(MethodResolver);
     JitexManager.AddTokenResolver(TokenResolver);
 }
示例#9
0
 public static void Initialize()
 {
     JitexManager.AddMethodResolver(MethodResolver);
     JitexManager.AddTokenResolver(TokenResolver);
 }
示例#10
0
 static ResolveNativeTests()
 {
     JitexManager.AddMethodResolver(MethodResolver);
 }
示例#11
0
 static DetourMethodDelegateTest()
 {
     JitexManager.AddMethodResolver(MethodResolver);
 }
示例#12
0
 public ResolveTokenTests()
 {
     JitexManager.AddMethodResolver(CompileResolver);
     JitexManager.AddTokenResolver(TokenResolver);
 }
示例#13
0
 public ResolveMethodTests()
 {
     JitexManager.AddMethodResolver(MethodResolver);
 }