RFR: 8318124: JFR: Rewrite instrumentation to use Class-File API

Erik Gahlin egahlin at openjdk.org
Mon Oct 16 00:50:51 UTC 2023


On Sun, 15 Oct 2023 23:34:01 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Hi,
>> 
>> Could I have a review of an enhancement that replaces the use of ASM with the new Class-File API. This change only deals with bytecode that writes event data into buffers. Bytecode transformations carried out by classes in jdk.jfr.internal.intrument package are kept as is. Plan is to try to replace those with events in java.base.
>> 
>> To simplify the review process, I have tried to keep the code in the classes EventInstrumentation and EventClassBuilder similar to what existed before. Further refactorizations may happen at a later stage. 
>> 
>> Testing: tier1-3 + jdk/jdk/jfr
>> 
>> Thanks
>> Erik
>
> src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java line 73:
> 
>> 71:         byte[] bytes = Classfile.of().build(ClassDesc.of(fullClassName), cb -> build(cb));
>> 72:         try {
>> 73:             String name = "/Users/egahlin/DynamicEvent" + (idCounter.longValue() - 1);
> 
> You probably wish to use `Bytecode.log` instead.

Yes, looks like I missed some changes. Thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16195#discussion_r1359996178


More information about the hotspot-jfr-dev mailing list