Skip to content

ReadyToRun: JIT helper not supported: CORINFO_HELP_INITCLASS #6902

Closed

Description

@MichalStrehovsky

Running crossgen on the below code results in following messages

ReadyToRun: JIT helper not supported: CORINFO_HELP_INITCLASS
ReadyToRun: JIT helper not supported: CORINFO_HELP_INITINSTCLASS

Infrastructure to support this has been added to RyuJIT with dotnet/coreclr#7842, but this is currently excluded with eeGetEEInfo()->targetAbi == CORINFO_CORERT_ABI because only CoreRT knows how to generate the helper.

using System;

class Gen1<T> where T: class
{
    static Gen1()
    {
    }

    public static string Get1()
    {
        return ("Hello" as T) as string;
    }

    public static string Get2<U>()
    {
        return ("Hello" as T) as string;
    }
}

class Gen2<T> where T: class
{
    public static string GetFromClassParam()
    {
        return (Gen1<T>.Get1() as T) as string;
    }

    public static string GetFromMethodParam()
    {
        return (Gen1<T>.Get2<T>() as T) as string;
    }
}

internal class Program
{
    private static int Main()
    {
        return Gen2<string>.GetFromClassParam().Length + Gen2<string>.GetFromMethodParam().Length;
    }
}

Activity

  1. assigned and unassigned on Jan 25, 2018
  2. transferred this issue fromdotnet/coreclron Jan 31, 2020
  3. added this to the Future milestone on Jan 31, 2020
  4. ghost added
    backlog-cleanup-candidateAn inactive issue that has been marked for automated closure.
    on Oct 27, 2022
  5. ghost closed this as completedon Nov 10, 2022
  6. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions