RFR: 8317336: Assertion error thrown during 'this' escape analysis [v2]

Archie Cobbs acobbs at openjdk.org
Tue Oct 3 18:17:07 UTC 2023


> The 'this' escape analyzer was assuming that lambas could always be treated like blocks, in the sense that we can assume a block can never end in a plain expression. This assumption is not true for lambda's of the form `() -> foo` which do exactly that. In the case that `foo` was `this`, an assertion failure would ensue.
> 
> This patch relaxes this invariant check to allow for this case.
> 
> This also fixes another variant of the same bug caused by certain enhanced `for()` loops.

Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:

  Add fix and unit test for another variant of the assertion failure.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16001/files
  - new: https://git.openjdk.org/jdk/pull/16001/files/8ad1247a..03cda07e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16001&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16001&range=00-01

  Stats: 21 lines in 2 files changed: 16 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/16001.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16001/head:pull/16001

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


More information about the compiler-dev mailing list