changeset 54646:415b58a33943 fibers

Merge
author rpressler
date Tue, 02 Apr 2019 17:58:06 +0100
parents 7ee61aa892c9 9a49d5f37cb0
children 419e6264f37c
files
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/runtime/continuation.cpp	Tue Apr 02 16:47:11 2019 +0100
+++ b/src/hotspot/share/runtime/continuation.cpp	Tue Apr 02 17:58:06 2019 +0100
@@ -1754,7 +1754,10 @@
   }
 };
 
-#ifndef PRODUCT
+static inline void clear_anchor(JavaThread* thread) {
+  thread->frame_anchor()->clear();
+}
+
 static void set_anchor(JavaThread* thread, FrameInfo* fi) {
   JavaFrameAnchor* anchor = thread->frame_anchor();
   anchor->set_last_Java_sp((intptr_t*)fi->sp);
@@ -1779,11 +1782,6 @@
 //   set_anchor(cont.thread(), &fi);
 // }
 
-static inline void clear_anchor(JavaThread* thread) {
-  thread->frame_anchor()->clear();
-}
-#endif
-
 static const VMReg vmRegRbp = rbp->as_VMReg();
 static const VMReg vmRegRbpNext = vmRegRbp->next();
 
@@ -2450,7 +2448,7 @@
   cont.write();
 
   if (JvmtiExport::should_post_continuation_yield()) {
-   JvmtiExport::post_continuation_yield(JavaThread::current(), num_java_frames(cont));
+    JvmtiExport::post_continuation_yield(JavaThread::current(), num_java_frames(cont));
   }
 
   cont.post_jfr_event(&event);
@@ -3168,8 +3166,9 @@
 
   DEBUG_ONLY(log_debug(jvmcont)("THAW ### #" INTPTR_FORMAT, cont.hash()));
 
+  int java_frame_count = -1;
   if (!return_barrier && JvmtiExport::should_post_continuation_run()) {
-   JvmtiExport::post_continuation_run(JavaThread::current(), num_java_frames(cont));
+    java_frame_count = num_java_frames(cont);
   }
 
 // #ifndef PRODUCT
@@ -3254,6 +3253,11 @@
   //   jvmti_state->invalidate_cur_stack_depth();
   // }
 
+  if (!return_barrier && JvmtiExport::should_post_continuation_run()) {
+    set_anchor(thread, fi); // ensure thawed frames are visible
+    JvmtiExport::post_continuation_run(JavaThread::current(), java_frame_count);
+    clear_anchor(thread);
+  }
   cont.post_jfr_event(&event);
 
 #ifdef ASSERT