[code-reflection] RFR: Make sure method parameters keep their slots when lowering

Hannes Greule hgreule at openjdk.org
Sat Jan 27 08:12:06 UTC 2024


On Fri, 26 Jan 2024 21:23:41 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> The approach looks good. (Note this area is very much a prototype and we will almost certainly find more issues as progress.)
> 
> A possible simplification is to modify lines 482 to 483:
> 
> ```
>             // If b is the entry block then all its parameters conservatively require slots
>             // Some unused parameters might be declared before others that are used
>             b.parameters().forEach(p -> c.getOrAssignSlot(p, pb == null));
> ```
> 
> Testing-wise I think we only need to test static methods for an unused int and double parameter, since refs behave like int.
> 
> Renaming the boolean to `assignIfUnused` seems clearer.

Thank you for your suggestions, I changed the code accordingly. I had to add the overloaded method to `LoweringContext` now, but I guess that's fine for a prototype.

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

PR Comment: https://git.openjdk.org/babylon/pull/8#issuecomment-1913071665


More information about the babylon-dev mailing list