RFR: 8238197: JFR: Rework setting and getting EventHandler
Markus Grönlund
mgronlun at openjdk.java.net
Thu Jun 10 08:54:12 UTC 2021
On Thu, 10 Jun 2021 08:47:21 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:
>> Greetings,
>>
>> please help review this changeset which moves the setting and getting of event handlers to native to avoid allocations.
>>
>> Testing: jdk_jfr, stress
>>
>> Thanks
>> Markus
>
> src/hotspot/share/jfr/jni/jfrJavaSupport.cpp line 777:
>
>> 775: descriptor);
>> 776: return typed_field_holder != NULL ? typed_field_holder : ik->find_field(vmSymbols::eventHandler_name(),
>> 777: vmSymbols::object_signature(), // untyped
>
> When would be the event handler field untyped?
For events in java.base.
> src/hotspot/share/jfr/jni/jfrJavaSupport.cpp line 811:
>
>> 809: assert(java_lang_Class::as_Klass(h_mirror()) == field_holder, "invariant");
>> 810: const oop handler_oop = JNIHandles::resolve(handler);
>> 811: assert(handler_oop != NULL, "invariant");
>
> Should this be rather
>
> if (handler_oop == NULL) {
> return false;
> }
>
> to have it consistent with the code in `get_handler_field_descriptor()`?
Must not be NULL when set.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4445
More information about the hotspot-jfr-dev
mailing list