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

Doug Simon dnsimon at openjdk.org
Thu Jul 7 13:41:05 UTC 2022


On Thu, 7 Jul 2022 13:12:16 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> Yes, I see the bodies are guarded. I was referring to the declarations here in `jfrResolution.hpp`. Shouldn't it be something like:
>> 
>> #ifdef COMPILER1
>>   static void on_c1_resolution(const GraphBuilder * builder, const ciKlass * holder, const ciMethod * target);
>> #endif
>> #ifdef COMPILER2
>>   static void on_c2_resolution(const Parse * parse, const ciKlass * holder, const ciMethod * target);
>> #endif
>> 
>> and likewise in `jfr.hpp`:
>> 
>> #ifdef COMPILER2
>>   static void on_resolution(const Parse* parse, const ciKlass* holder, const ciMethod* target);
>> #endif
>> #ifdef COMPILER1
>>   static void on_resolution(const GraphBuilder* builder, const ciKlass* holder, const ciMethod* target);
>> #endif
>
> In general, we would like to reduce the amount of conditionalization because it makes the code harder to read and follow. Compilers should not require a definition until a definition is actually needed. Are you seeing compilation errors?

No I'm not which surprised me. I agree though, if the compilers don't complain, fewer conditional macros is better.

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

PR: https://git.openjdk.org/jdk/pull/8383


More information about the hotspot-jfr-dev mailing list