[jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC

Jorn Vernee jvernee at openjdk.java.net
Mon Jun 28 17:44:28 UTC 2021

This patch rewrites the prologue and epilogue of panama upcalls, in order to fix the test failure from the title.

Previously, we did a call to potentially attach the current thread to the VM, and then afterwards did the same suspend and stack reguard checks that we do on the back-edge of a native downcall. Then, on the back edge of the upcall we did another conditional call to detach the thread.

I've changed these 2 calls to mimic what is done by JavaCallWrapper instead (with attach and detach included), and removed the old suspend and stack reguard checks (now handled by the call).

FWIW, this removes the JavaFrameAnchor save/restore MacroAssembler code. This is now written in C++. Also, MacroAssembler code was added to save/restore the result of the upcall around the call on the back-edge, which was previously missing. Since the new code allocates a handle block as well, I've added handling for those oops to frame & OptimizedUpcallBlob.

Testing: local running of `jdk_foreign` on Windows and Linux (WSL). Tier 1-3


Commit messages:
 - Remove whitespace
 - Add Shenandoah test case as well
 - Add zgc requires tags
 - Typo in MACOS_AARCH64_ONLY part
 - Polish
 - Some more build fixes
 - build fixes
 - re-write upcall code to mimic JavaCallWrapper

Changes: https://git.openjdk.java.net/jdk17/pull/149/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=149&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269240
  Stats: 516 lines in 18 files changed: 338 ins; 147 del; 31 mod
  Patch: https://git.openjdk.java.net/jdk17/pull/149.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/149/head:pull/149

PR: https://git.openjdk.java.net/jdk17/pull/149

More information about the hotspot-gc-dev mailing list