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: defer crossgen update when trying to call unboxed entry #52453

Merged
merged 3 commits into from
May 7, 2021

Conversation

AndyAyersMS
Copy link
Member

Some unboxed entries require an additional generic context argument, and
finding the right form for this argument when prejitting is more complex than
it is for jitting. So, defer this update when prejitting.

Resolves #52450.

Some unboxed entries require an additional generic context argument, and
finding the right form for this argument when prejitting is more complex than
it is for jitting. So, defer this update when prejitting.

Resolves dotnet#52450.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 7, 2021
@AndyAyersMS
Copy link
Member Author

@BruceForstall ptal
cc @dotnet/jit-contrib

Diffs are not as complex as GH default compare makes it seem, try ignoring whitespace: https://github.com/dotnet/runtime/pull/52453/files?diff=split&w=1

{
JITDUMP(
"unboxed entry needs MT arg, but the handle we have is shared. Deferring update.\n");
JITDUMP("unboxed entry needs MT arg, embedding this is complicated for prejit. Deferring "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that we have done work to embed this in crossgen2. Is this just a problem for old crossgen?

We should just throw an NYI exception in old crossgen instead of asserting. It is what we have been doing in other similar situations. We are generally not spending time on keeping parity in old crossgen.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's just a problem for crossgen, and only for a relatively small number of methods.

So I'll revise per your suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crossgen is already throwing here -- but it is asserting first. So looks like I can just remove the assert.

if (IsReadyToRunCompilation())
{
_ASSERTE(!"embedClassHandle");
ThrowHR(E_NOTIMPL);
}

@AndyAyersMS
Copy link
Member Author

Failure is known: #52464

@AndyAyersMS
Copy link
Member Author

I ran crossgen locally on the two examples with asserts, so don't see the need to run outerloop here.

@AndyAyersMS AndyAyersMS merged commit 28cff50 into dotnet:main May 7, 2021
@AndyAyersMS AndyAyersMS deleted the Fix52450 branch May 7, 2021 22:01
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assert failure: !"embedClassHandle"
4 participants