[code-reflection] RFR: Bytecode locals compaction [v4]

Adam Sotona asotona at openjdk.org
Wed Sep 11 08:18:56 UTC 2024


> `LocalsCompactor` is a bytecode transformation reducing generated method `maxLocals` by re-using local slots.
> Roundtrip of lift and bytecode generation doubles the `maxLocals` value, while `LocalsCompactor` reduces the regression by 50%.
> 
> Lifting of compacted locals revealed bugs in `LocalsTypeMapper` variables graph construction. This patch includes significantly  refactored `LocalsTypeMapper` to support lifting of compacted locals.
> 
> `BytecodeGenerator` has slightly improved performance (so `TestSmallCorpus` finishes in a reasonable time). However performance has not been main focus of this PR.
> 
> `TestSmallCorpus` has been slightly refactored to provide better debugging feedback and compaction statistics. Overall stability is still >99%.
> 
> Please review.
> 
> Thanks,
> Adam

Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:

  Removed oboslete lookup argument.

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

Changes:
  - all: https://git.openjdk.org/babylon/pull/224/files
  - new: https://git.openjdk.org/babylon/pull/224/files/cadb3669..015b1c7f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=babylon&pr=224&range=03
 - incr: https://webrevs.openjdk.org/?repo=babylon&pr=224&range=02-03

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

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


More information about the babylon-dev mailing list