< prev index next >

src/share/vm/ci/ciObject.hpp

Print this page

        

@@ -25,10 +25,11 @@
 #ifndef SHARE_VM_CI_CIOBJECT_HPP
 #define SHARE_VM_CI_CIOBJECT_HPP
 
 #include "ci/ciBaseObject.hpp"
 #include "ci/ciClassList.hpp"
+#include "gc/shared/barrierSet.hpp"
 #include "memory/allocation.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/jniHandles.hpp"
 
 // ciObject

@@ -67,11 +68,13 @@
 
   jobject      handle()  const { return _handle; }
   // Get the VM oop that this object holds.
   oop get_oop() const {
     assert(_handle != NULL, "null oop");
-    return JNIHandles::resolve_non_null(_handle);
+    oop obj = JNIHandles::resolve_non_null(_handle);
+    assert(obj == oopDesc::bs()->write_barrier(obj), "expect to-space copy");
+    return obj;
   }
 
   void init_flags_from(oop x);
 
   // Virtual behavior of the print() method.
< prev index next >