RFR: 8294676: [JVMCI] InstalledCode.deoptimize(false) should not touch address field

Tom Rodriguez never at openjdk.org
Fri Sep 30 16:48:20 UTC 2022


On Fri, 30 Sep 2022 16:32:25 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

> The ability to make an nmethod non-entrant via an `InstalledCode` object was added by [JDK-8292917](https://bugs.openjdk.org/browse/JDK-8292917). However, the make non-entrant path clears `InstalledCode.address`.
> This breaks the connection between an `InstalledCode` object and the nmethod. This makes it impossible to subsequently deoptimize the code via the `InstalledCode` object as shown below:
> 
> 
> InstalledCode tier1Code = ...;
> // Make tier1Code non-entrant (e.g. it is being replaced by a more optimized version, tier2Code)
> // but do not deoptimize it as it is still valid. Let current executions of tier1Code complete.
> tier1Code.invalidate(false);
> 
> ...
> 
> // Some assumption used in compiling tier1Code is about to be invalidated
> // so it must now be deoptimized.
> tier1Code.invalidate(true)
> 
> 
> Prior to this PR, the last statement above does nothing which leads to `tier1Code` incorrectly being executed as soon as the assumption in question is invalidated.

The new test looks good.

-------------

Marked as reviewed by never (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10514


More information about the hotspot-compiler-dev mailing list