< prev index next >

src/hotspot/share/prims/jvmtiImpl.cpp

Print this page

        

@@ -37,10 +37,11 @@
 #include "prims/jvmtiAgentThread.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #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"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"

@@ -550,11 +551,11 @@
 
 vframe *VM_GetOrSetLocal::get_vframe() {
   if (!_thread->has_last_Java_frame()) {
     return NULL;
   }
-  RegisterMap reg_map(_thread);
+  RegisterMap reg_map(_thread, true, true);
   vframe *vf = _thread->last_java_vframe(&reg_map);
   int d = 0;
   while ((vf != NULL) && (d < _depth)) {
     vf = vf->java_sender();
     d++;

@@ -619,10 +620,20 @@
 //   JVMTI_ERROR_TYPE_MISMATCH
 // Returns: 'true' - everything is Ok, 'false' - error code
 
 bool VM_GetOrSetLocal::check_slot_type_lvt(javaVFrame* jvf) {
   Method* method_oop = jvf->method();
+  if (!method_oop->has_localvariable_table()) {
+    // Just to check index boundaries
+    jint extra_slot = (_type == T_LONG || _type == T_DOUBLE) ? 1 : 0;
+    if (_index < 0 || _index + extra_slot >= method_oop->max_locals()) {
+      _result = JVMTI_ERROR_INVALID_SLOT;
+      return false;
+    }
+    return true;
+  }
+
   jint num_entries = method_oop->localvariable_table_length();
   if (num_entries == 0) {
     _result = JVMTI_ERROR_INVALID_SLOT;
     return false;       // There are no slots
   }

@@ -720,10 +731,15 @@
 
 bool VM_GetOrSetLocal::doit_prologue() {
   _jvf = get_java_vframe();
   NULL_CHECK(_jvf, false);
 
+  if (_set && Continuation::is_frame_in_continuation(_jvf->thread(), _jvf->fr())) {
+    _result = JVMTI_ERROR_OPAQUE_FRAME; // deferred locals currently unsupported in continuations
+    return false;
+  }
+
   Method* method_oop = _jvf->method();
   if (method_oop->is_native()) {
     if (getting_receiver() && !method_oop->is_static()) {
       return true;
     } else {
< prev index next >