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

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


> Previously, unused method parameters didn't get a slot, resulting in either wrong results or bad classfiles.
> 
> I propose a simple fix: Make sure that all parameters of the entry block get a slot, in the order they are defined.
> I didn't want to change too much code here, so I decided to add a boolean flag to indicate that even values without uses get a slot.
> If you have a better idea or more plans on this, please let me know.
> 
> I also added multiple test cases showcasing the issue: One that results in the wrong value returned, one with a type mismatch resulting in a VerifyError, and one with a type mismatch due to being non-static, also causing a VerifyError (this is the case that made me discover this issue).
> 
> I ran the tests in `langtools/tools/javac/reflect/` and `java/lang/reflect/code/` to make sure they all (still) pass.

Hannes Greule has updated the pull request incrementally with one additional commit since the last revision:

  apply suggestions

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

Changes:
  - all: https://git.openjdk.org/babylon/pull/8/files
  - new: https://git.openjdk.org/babylon/pull/8/files/12e71fc8..f6044b9e

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

  Stats: 39 lines in 2 files changed: 9 ins; 23 del; 7 mod
  Patch: https://git.openjdk.org/babylon/pull/8.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/8/head:pull/8

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


More information about the babylon-dev mailing list