> In special cases, an upcall could emerge from a new native thread. No prior 
> Java frame is present. FFM upcall stub will attach to JVM and then back to 
> the Java world.
> 
> This patch updates **find_initial_Java_frame()** of ASGCT. Like entry frame 
> (JNI's upcall), it detects the upcall stub (FFM upcall) which is the first 
> Java frame. If so, stop probing the initial Java frame and return false 
> immediately. This fixes two cases in `forte_fill_call_trace_given_top()`:
> 
> 1. No initial java frame is found. Skip stackwalking because 
> `initial_Java_frame.safe_for_sender()` is false.
> 2. An initial frame is found. It's not the upcall stub frame, but a java 
> callee. `vframeStreamCommon::fill_from_frame()` will encounter the upcall 
> stub frame, set at_end_mode and terminate stackwalking.
> 
> This patch doesn't touch the loop under #ifdef ZERO. It is because there's no 
> upcall stub in zero build. FFM will use FallbackLinker and entry_frame.
> 
> 
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Xin Liu has updated the pull request with a new target base due to a merge or a 
rebase. The incremental webrev excludes the unrelated changes brought in by the 
merge/rebase. The pull request contains two additional commits since the last 
revision:

 - Merge branch 'openjdk:master' into JDK-8397000
 - 8397000: find_initial_Java_frame should return false for the first frame of 
upcall
   
   In special cases, an upcall emerges from a new native thread. No prior java
   frame is present. FFM upcall stub will attach to JVM and then back to the 
Java
   world.
   
   This patch updates find_initial_Java_frame() of ASGCT. Like entry frame 
(JNI's
   upcall), it detects the upcall stub (FFM upcall) which is the 1st Java frame.
   If so, stop probing the initial Java frame and return false immediately. This
   fixes two cases in forte_fill_call_trace_given_top():
   
   1. No initial java frame is found. Skip stackwalking because
      initial_Java_frame.safe_for_sender() is false.
   2. An initial frame is found. It's not the upcall stub frame, but a java 
callee.
      vframeStreamCommon::fill_from_frame() will encounter the upcall stub 
frame,
      set at_end_mode and terminate stackwalking.
   
   This patch doesn't touch the loop under #ifdef ZERO. It is because there's no
   upcall stub in zero build. FFM will use FallbackLinker and entry_frame.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/33832/files
  - new: https://git.openjdk.org/jdk/pull/33832/files/5ee247ad..ba763814

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=33832&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=33832&range=00-01

  Stats: 19708 lines in 633 files changed: 11897 ins; 1308 del; 6503 mod
  Patch: https://git.openjdk.org/jdk/pull/33832.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33832/head:pull/33832

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

Reply via email to