changeset 52179:597ed181a9e8

8212186: JVMTI lacks a few GC barriers/hooks Reviewed-by: eosterlund, shade
author rkennke
date Wed, 17 Oct 2018 22:26:41 +0200
parents 199658d1ef86
children a817954f4081
files src/hotspot/share/prims/jvmtiExport.cpp src/hotspot/share/prims/jvmtiTagMap.cpp
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/prims/jvmtiExport.cpp	Wed Oct 17 18:31:48 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiExport.cpp	Wed Oct 17 22:26:41 2018 +0200
@@ -1044,7 +1044,7 @@
  public:
    JvmtiObjectAllocEventMark(JavaThread *thread, oop obj) : JvmtiClassEventMark(thread, oop_to_klass(obj)) {
      _jobj = (jobject)to_jobject(obj);
-     _size = obj->size() * wordSize;
+     _size = Universe::heap()->obj_size(obj) * wordSize;
    };
    jobject jni_jobject() { return _jobj; }
    jlong size() { return _size; }
--- a/src/hotspot/share/prims/jvmtiTagMap.cpp	Wed Oct 17 18:31:48 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiTagMap.cpp	Wed Oct 17 22:26:41 2018 +0200
@@ -105,7 +105,7 @@
   }
 
   inline bool equals(oop object) {
-    return object == object_peek();
+    return oopDesc::equals(object, object_peek());
   }
 
   inline JvmtiTagHashmapEntry* next() const        { return _next; }
@@ -186,6 +186,7 @@
 
     // shift right to get better distribution (as these bits will be zero
     // with aligned addresses)
+    key = Access<>::resolve(key);
     unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key));
 #ifdef _LP64
     return (addr >> 3) % size;