Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT Compilation type returns none for MinOptJitted method in .NET 6.0 #1231

Open
bananabr opened this issue Jan 2, 2024 · 0 comments
Open

Comments

@bananabr
Copy link

bananabr commented Jan 2, 2024

The following MethodDesc will have its compilation type set to None when it should be considered a Jitted method.

!DumpMD /d 00007ffb2d7b3798
Method Name:          HelloWriter.Echo()
Class:                00007ffb2d7c0000
MethodTable:          00007ffb2d7b37e0
mdToken:              0000000006000009
Module:               00007ffb2d7a6910
IsJitted:             yes
Current CodeAddr:     00007ffb2d6e9900
Version History:
  ILCodeVersion:      0000000000000000
  ReJIT ID:           0
  IL Addr:            0000029623292117
     CodeAddr:           00007ffb2d6e9900  (MinOptJitted)
     NativeCodeVersion:  0000000000000000

The target is the following .NET 6.0 program.

using System.Diagnostics;
public class HelloWriter
{
    private string message;
    public event EventHandler spoken;
    public HelloWriter(string msg) { this.message = msg; }

    public static void None() { return; }
    public void Echo()
    {
        Console.WriteLine(this.message);
        spoken?.Invoke(this, new EventArgs());
    }
    public void NeverCalled() { Console.WriteLine("Never called"); }
}
public class Program
{
    public static void Main()
    {
        var hello = new HelloWriter("Hello World");
        hello.spoken += Hello_spoken;
        int pid = Process.GetCurrentProcess().Id;

        for (int i = 0; i < int.MaxValue; i++)
        {
            Console.WriteLine();
            hello.Echo();
            Console.WriteLine($"Iteration: {i} - {pid}");
            Thread.Sleep(10000);
        }
    }
    private static void Hello_spoken(object sender, EventArgs e)
    {
        return;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant