changeset 51288:0f91391e2926 fibers

merge
author rpressler
date Tue, 21 Aug 2018 20:38:34 +0100
parents 9f6876d65ac0 115813e6880d
children 876a8f3fa9b8
files
diffstat 4 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/prims/jvmtiImpl.cpp	Mon Aug 13 23:32:59 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiImpl.cpp	Tue Aug 21 20:38:34 2018 +0100
@@ -38,6 +38,7 @@
 #include "prims/jvmtiImpl.hpp"
 #include "prims/jvmtiRedefineClasses.hpp"
 #include "runtime/atomic.hpp"
+#include "runtime/continuation.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
@@ -719,6 +720,11 @@
   _jvf = get_java_vframe();
   NULL_CHECK(_jvf, false);
 
+  if (Continuation::is_frame_in_continuation(_jvf->thread(), _jvf->fr())) {
+    _result = JVMTI_ERROR_OPAQUE_FRAME;
+    return false;
+  }
+
   if (_jvf->method()->is_native()) {
     if (getting_receiver() && !_jvf->method()->is_static()) {
       return true;
--- a/src/hotspot/share/runtime/continuation.cpp	Mon Aug 13 23:32:59 2018 +0100
+++ b/src/hotspot/share/runtime/continuation.cpp	Tue Aug 21 20:38:34 2018 +0100
@@ -2446,6 +2446,10 @@
   return f;
 }
 
+bool Continuation::is_frame_in_continuation(JavaThread* thread, const frame& f) {
+  return find_continuation_for_frame(thread, f.sp()) != NULL;
+}
+
 ///// DEBUGGING
 
 static void print_oop(void *p, oop obj, outputStream* st) {
--- a/src/hotspot/share/runtime/continuation.hpp	Mon Aug 13 23:32:59 2018 +0100
+++ b/src/hotspot/share/runtime/continuation.hpp	Tue Aug 21 20:38:34 2018 +0100
@@ -64,6 +64,7 @@
   static bool is_continuation_entry_frame(const frame& f);
   static bool is_cont_bottom_frame(const frame& f);
   static bool is_return_barrier_entry(const address pc);
+  static bool is_frame_in_continuation(JavaThread* thread, const frame& f);
   static address sender_pc_past_barrier(JavaThread* thread, const frame& f);
   static address get_entry_pc_past_barrier(JavaThread* thread, const frame& f);
   static address fix_continuation_bottom_sender(const frame* callee, RegisterMap* map, address pc);
--- a/src/hotspot/share/runtime/vframe_hp.cpp	Mon Aug 13 23:32:59 2018 +0100
+++ b/src/hotspot/share/runtime/vframe_hp.cpp	Tue Aug 21 20:38:34 2018 +0100
@@ -34,6 +34,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/basicLock.hpp"
+#include "runtime/continuation.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/monitorChunk.hpp"
@@ -103,6 +104,7 @@
 
 void compiledVFrame::update_deferred_value(BasicType type, int index, jvalue value) {
   assert(fr().is_deoptimized_frame(), "frame must be scheduled for deoptimization");
+  assert(Continuation::is_frame_in_continuation(thread(), fr()), "No support for deferred values in continuations");
   GrowableArray<jvmtiDeferredLocalVariableSet*>* deferred = thread()->deferred_locals();
   jvmtiDeferredLocalVariableSet* locals = NULL;
   if (deferred != NULL ) {