Skip to content

Keep this alive for classes with finalizers#103813

Closed
EgorBo wants to merge 2 commits into
dotnet:mainfrom
EgorBo:keep-this-alive-finalizers
Closed

Keep this alive for classes with finalizers#103813
EgorBo wants to merge 2 commits into
dotnet:mainfrom
EgorBo:keep-this-alive-finalizers

Conversation

@EgorBo

@EgorBo EgorBo commented Jun 21, 2024

Copy link
Copy Markdown
Member

Let's see how diffs look like, based on @jakobbotsch's suggestion #103522 (comment)

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 21, 2024
@EgorBo

EgorBo commented Jun 21, 2024

Copy link
Copy Markdown
Member Author

@MihuBot

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

if (resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD))
resultflags.RemoveInstructionSet(InstructionSet_AVX512CD_VL);
if (resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))
resultflags.RemoveInstructionSet(InstructionSet_AVX512CD_VL);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I guess someone didn't use gen.bat and modified this file by hands

@EgorBo

EgorBo commented Jun 21, 2024

Copy link
Copy Markdown
Member Author

@MihuBot

if ((info.compCompHnd->getClassAttribs(info.compClassHnd) & CORINFO_FLG_HAS_FINALIZER) != 0)
{
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this handle extending this lifetime for inlined methods?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good question, it does not. E.g. for synchronized methods we simply never inline them, which is too conservative to do in this case. So the fix has to be done in the importer

@EgorBo EgorBo closed this Jun 21, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2024
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.

2 participants