Skip to content

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Jul 13, 2023

This change simplifies the conditon and also makes it more robust. There are situation where the IL code pointer can differ for the same method.

This change simplifies the conditon and also makes it more robust. There
are situation where the IL code pointer can differ for the same method.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 13, 2023
@ghost ghost assigned jkotas Jul 13, 2023
@jkotas
Copy link
Member Author

jkotas commented Jul 13, 2023

Related to #88749

@jkotas jkotas requested a review from AndyAyersMS July 13, 2023 16:43
@ghost
Copy link

ghost commented Jul 13, 2023

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

Issue Details

This change simplifies the conditon and also makes it more robust. There are situation where the IL code pointer can differ for the same method.

Author: jkotas
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Any simple explanation as to why this address might vary or differ during a single jit invocation?

I vaguely remember something like this a while back from the crossgen2 host where the IL buffer wasn't kept pinned for long enough.

@jkotas
Copy link
Member Author

jkotas commented Jul 13, 2023

I vaguely remember something like this a while back from the crossgen2 host where the IL buffer wasn't kept pinned for long enough.

Right, that is one possible case. The AOT compilers cache the IL bodies (that can be computed or altered by trimming) and flush the cache every once in a while:

// Flush the cache when it grows too big
if (_methodILCache.Count > 1000)
_methodILCache = new ILCache(_methodILCache.ILProvider);

Another one is profiler IL rewriting. The profilers can change the method IL body at will.

@jkotas jkotas merged commit 1318299 into dotnet:main Jul 14, 2023
@jkotas jkotas deleted the recursive branch July 23, 2023 18:38
@ghost ghost locked as resolved and limited conversation to collaborators Aug 22, 2023
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