On Thu, 30 Nov 2023 17:35:57 GMT, Daniel D. Daugherty <dcu...@openjdk.org> 
wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   review: remove newly added ThreadsListHandle from enter_interp_only_mode
>
> src/hotspot/share/prims/jvmtiThreadState.cpp line 536:
> 
>> 534:     JvmtiEventController::thread_started(thread);
>> 535:   }
>> 536:   if (JvmtiExport::should_post_vthread_start()) {
> 
> Why is this check: `if (JvmtiExport::can_support_virtual_threads()) {` 
> removed?

It is because the `JvmtiExport::should_post_vthread_start()` returns `true` 
only if the `JvmtiExport::can_support_virtual_threads()` returns `true`.

The JVMTI `SetEventNotificationMode()` function checks for a required event 
capability by using the `JvmtiUtil::has_event_capability()` function that is 
defined in the `jvmtiEnter.cpp` generated with the `jvmtiEnter.xsl` script.

It looks like this:

// Check Event Capabilities
bool JvmtiUtil::has_event_capability(jvmtiEvent event_type, const 
jvmtiCapabilities* capabilities_ptr) {
  switch (event_type) {
    . . .
    case JVMTI_EVENT_VIRTUAL_THREAD_START:
      return capabilities_ptr->can_support_virtual_threads != 0;
    case JVMTI_EVENT_VIRTUAL_THREAD_END:
      return capabilities_ptr->can_support_virtual_threads != 0;
    . . .

> src/hotspot/share/prims/jvmtiThreadState.cpp line 552:
> 
>> 550:     JvmtiExport::post_vthread_unmount(vthread);
>> 551:   }
>> 552:   if (JvmtiExport::can_support_virtual_threads()) {
> 
> Why is this check: if (JvmtiExport::can_support_virtual_threads()) { removed?

The same reason as above. Thank you for checking this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16686#discussion_r1411269738
PR Review Comment: https://git.openjdk.org/jdk/pull/16686#discussion_r1411271722

Reply via email to