[code-reflection] RFR: Unreachable method or lambda exit [v2]

Paul Sandoz psandoz at openjdk.org
Thu Oct 17 22:56:09 UTC 2024


> Incorrect code models are generated for cases where a return operation (with no operand) is inserted for an unreachable area of code. This is ambiguous when the method or lambda body returns a value.
> 
> For such cases we can instead insert an unreachable operation. Transformations can more easily ignore that.
> 
> We could take this further and replace a yield or java.continue operation with an unreachable operation e.g. for say
> 
>         {
>             {
>                 return;
>             }
>             // unreachable
>         }
>         // unreachable
> ``` 
> or 
> 
> 
>         while (true) {
>             while(true) {
> 
>             }
>             // unreachable
>         }
>         // unreachable
> 
> 
> However, in such cases there is no ambiguity regarding the yield or java.continue operation since they never accept an operand in such cases and transformations can more easily ignore them if need be. For now i have left this as is.

Paul Sandoz has updated the pull request incrementally with two additional commits since the last revision:

 - Remove line number information
 - Remove debug stuff

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

Changes:
  - all: https://git.openjdk.org/babylon/pull/257/files
  - new: https://git.openjdk.org/babylon/pull/257/files/dc1105be..9925c9bc

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

  Stats: 11 lines in 2 files changed: 0 ins; 1 del; 10 mod
  Patch: https://git.openjdk.org/babylon/pull/257.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/257/head:pull/257

PR: https://git.openjdk.org/babylon/pull/257


More information about the babylon-dev mailing list