RFR: 8307818: Convert Indify tool to Classfile API [v16]

Adam Sotona asotona at openjdk.org
Wed Jul 24 08:19:40 UTC 2024


On Wed, 24 Jul 2024 07:58:31 GMT, ExE Boss <duke at openjdk.org> wrote:

>> This transformation is called only after the `classModel` is transformed: 
>> - at line 472  and 380 when the `transformToBytes()` method is called is after effectively transforming the `classModel` inside the `Logic` class.
>
> There isn’t currently any API for converting a `ClassModel` directly to a `byte[]` without calling a `ClassFile​::transformClass(…)` method.

Repeated parsing (bytes -> model) and transforming back (model -> bytes) is an anti-pattern. Indify tool should operate as a single-pass transformation. Looping on a class model methods / instructions while replacing the class model itself (with something partially transformed) is not the right approach.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18841#discussion_r1689346557


More information about the core-libs-dev mailing list