On Mon, 14 Sep 2020 05:08:39 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> Richard Reingruber has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Changes based on dholmes' feedback. >> >> EscapeBarrier::sync_and_suspend_all(): >> >> - Set suspend flags before handshake because then the setting will be >> visible >> after leaving the _thread_blocked state in >> JavaThread::wait_for_object_deoptimization() >> >> JavaThread::wait_for_object_deoptimization() >> >> - Reuse SpinYield instead of new custom spinning code. >> >> - Do safepoint check after the loop. This is possible because the >> set_obj_deopt_flag is done before the handshake. >> >> - Don't set_suspend_equivalent() anymore for more simplicity. It's just >> an >> optimization (that won't pay off here). >> >> Added/updated source code comments. >> >> Additional smaller enhancements. > > src/hotspot/share/prims/whitebox.cpp line 884: > >> 882: >> 883: WB_ENTRY(jboolean, WB_IsFrameDeoptimized(JNIEnv* env, jobject o, jint >> depth)) >> 884: JavaThread* t = JavaThread::current(); > > A WB_ENTRY is a JNI_ENTRY which means the current JavaThread is already > available via the `thread` variable. Done. > src/hotspot/share/runtime/thread.cpp line 2660: > >> 2658: // showed 5% better performance when spinning. >> 2659: if (should_spin_wait) { >> 2660: // Inspired by HandshakeSpinYield > > Can we not reuse any existing spinning code in the VM? Good point. I wasn't aware of SpinYield. I use it now for the spinning. I use 10 * SpinYield::default_spin_limit as spin limit based on microbenchmarking: http://cr.openjdk.java.net/~rrich/webrevs/8227745/pr116v2.microbenchmark/ ------------- PR: https://git.openjdk.java.net/jdk/pull/119