RFR: 8282420: JFR: Remove event handlers [v2]

Erik Gahlin egahlin at openjdk.java.net
Sat May 7 02:38:23 UTC 2022


On Thu, 5 May 2022 07:05:07 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

>> Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Cleanups
>
> src/hotspot/share/jfr/instrumentation/jfrResolution.hpp line 41:
> 
>> 39:   static void on_resolution(const CallInfo & info, TRAPS);
>> 40:   static void on_resolution(const Parse * parse, const ciKlass * holder, const ciMethod * target);
>> 41:   static void on_resolution(const GraphBuilder * builder, const ciKlass * holder, const ciMethod * target);
> 
> Could you add brief comments as when will each callback be called?
> Eg. the second form is called from C1 and the third form is called from C2 (assuming based on what I see in the cpp file)?

Renamed the methods to on_runtime_resolution, on_c1_resolution and on_c2_resolution to make it clearer. I hope this is sufficient.

> src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java line 92:
> 
>> 90: 
>> 91:         public boolean isString() {
>> 92:             return ASMToolkit.TYPE_STRING.getDescriptor().equals(fieldDescriptor);
> 
> If this is to be called often it might be beneficial to cache the descriptor instead of recreating it each time.

Turns out this method is not needed, so I removed it. I also changed the classes FieldInfo and SettingInfo into record classes and while at it, I also made EventInstrumentation (shallow) immutable so guardEventConfiguration is now passed in the constructor.

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

PR: https://git.openjdk.java.net/jdk/pull/8383


More information about the hotspot-jfr-dev mailing list