Skip to content

OSR method may require kept-alive this in cases where base method didn't #47532

@AndyAyersMS

Description

@AndyAyersMS

A couple examples in the OSR stress weekend experimental runs.

Because of inlining the reporting of this for generic contexts is needed in an OSR method, but not in the base method. This violates an assumption that both methods would agree on this aspect.

// OSR methods use the original method slot for the cached kept alive this,
// so don't need to allocate a slot on the new frame.
if (opts.IsOSR())
{
if (lvaKeepAliveAndReportThis())
{
PatchpointInfo* ppInfo = info.compPatchpointInfo;
assert(ppInfo->HasKeptAliveThis());
int originalOffset = ppInfo->KeptAliveThisOffset();
lvaCachedGenericContextArgOffs = originalFrameStkOffs + originalOffset;
}
}

Should not be too hard to report the kept-alive this in the OSR method on it's part of the frame. Looks like CodeGen::genReportGenericContextArg might just work for OSR frames, though that needs to be verified.

category:correctness
theme:osr
skill-level:intermediate
cost:small
impact:small

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions