< prev index next >

src/share/vm/code/debugInfo.cpp

Print this page

        

@@ -21,10 +21,11 @@
  * questions.
  *
  */
 
 #include "precompiled.hpp"
+#include "ci/ciUtilities.hpp"
 #include "code/debugInfo.hpp"
 #include "code/debugInfoRec.hpp"
 #include "code/nmethod.hpp"
 #include "runtime/handles.inline.hpp"
 

@@ -202,10 +203,22 @@
 }
 
 // ConstantOopWriteValue
 
 void ConstantOopWriteValue::write_on(DebugInfoWriteStream* stream) {
+  if (UseShenandoahGC) {
+    // Work around the compiler bug: we cannot touch JNIHandles when Shenandoah Full GC
+    // is running. Doing so would invoke obj_equals, which would dereference via broken
+    // fwdptr, and crash the VM. Solve that by forcing compiler thread to enter VM here.
+    VM_ENTRY_MARK;
+    write_on_impl(stream);
+  } else {
+    write_on_impl(stream);
+  }
+}
+
+void ConstantOopWriteValue::write_on_impl(DebugInfoWriteStream* stream) {
   assert(JNIHandles::resolve(value()) == NULL ||
          Universe::heap()->is_in_reserved(JNIHandles::resolve(value())),
          "Should be in heap");
   stream->write_int(CONSTANT_OOP_CODE);
   stream->write_handle(value());
< prev index next >