--- 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;