RFR: 8322538: remove fatal from JVM_VirtualThread functions for !INCLUDE_JVMTI

Serguei Spitsyn sspitsyn at openjdk.org
Thu Dec 21 02:36:05 UTC 2023


The macro `#else` branch conditions of `#if INCLUDE_JVMTI` in the `JVM_VirtualThread*` methods/functions (see `jvm.cpp`) are incorrect and have to be removed.
For example, the lines 4022-4023 have to be removed from the fragment below:

  4013	JVM_ENTRY(void, JVM_VirtualThreadDisableSuspend(JNIEnv* env, jobject vthread, jboolean enter))
  4014	#if INCLUDE_JVMTI
  4015	  if (!DoJVMTIVirtualThreadTransitions) {
  4016	    assert(!JvmtiExport::can_support_virtual_threads(), "sanity check");
  4017	    return;
  4018	  }
  4019	  assert(thread->is_disable_suspend() != (bool)enter,
  4020	         "nested or unbalanced monitor enter/exit is not allowed");
  4021	  thread->toggle_is_disable_suspend();
  4022	#else
  4023	  fatal("Should only be called with JVMTI enabled");
  4024	#endif
  4025	JVM_END

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

Commit messages:
 - 8322538: remove fatal from JVM_VirtualThread functions for !INCLUDE_JVMTI

Changes: https://git.openjdk.org/jdk/pull/17174/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17174&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8322538
  Stats: 12 lines in 1 file changed: 0 ins; 12 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/17174.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17174/head:pull/17174

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


More information about the hotspot-dev mailing list