8249137: Remove CollectedHeap::obj_size
Reviewed-by: rkennke, tschatzl, cjplummer
This commit is contained in:
parent
faf4d7ccb7
commit
2d3c928f0b
@ -576,10 +576,6 @@ void CollectedHeap::deduplicate_string(oop str) {
|
||||
// Do nothing, unless overridden in subclass.
|
||||
}
|
||||
|
||||
size_t CollectedHeap::obj_size(oop obj) const {
|
||||
return obj->size();
|
||||
}
|
||||
|
||||
uint32_t CollectedHeap::hash_oop(oop obj) const {
|
||||
const uintptr_t addr = cast_from_oop<uintptr_t>(obj);
|
||||
return static_cast<uint32_t>(addr >> LogMinObjAlignment);
|
||||
|
@ -493,8 +493,6 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
||||
|
||||
virtual bool is_oop(oop object) const;
|
||||
|
||||
virtual size_t obj_size(oop obj) const;
|
||||
|
||||
// Non product verification and debugging.
|
||||
#ifndef PRODUCT
|
||||
// Support for PromotionFailureALot. Return true if it's time to cause a
|
||||
|
@ -486,7 +486,7 @@ jvmtiError
|
||||
JvmtiEnv::GetObjectSize(jobject object, jlong* size_ptr) {
|
||||
oop mirror = JNIHandles::resolve_external_guard(object);
|
||||
NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT);
|
||||
*size_ptr = (jlong)Universe::heap()->obj_size(mirror) * wordSize;
|
||||
*size_ptr = (jlong)mirror->size() * wordSize;
|
||||
return JVMTI_ERROR_NONE;
|
||||
} /* end GetObjectSize */
|
||||
|
||||
|
@ -1065,7 +1065,7 @@ class JvmtiObjectAllocEventMark : public JvmtiClassEventMark {
|
||||
public:
|
||||
JvmtiObjectAllocEventMark(JavaThread *thread, oop obj) : JvmtiClassEventMark(thread, oop_to_klass(obj)) {
|
||||
_jobj = (jobject)to_jobject(obj);
|
||||
_size = Universe::heap()->obj_size(obj) * wordSize;
|
||||
_size = obj->size() * wordSize;
|
||||
};
|
||||
jobject jni_jobject() { return _jobj; }
|
||||
jlong size() { return _size; }
|
||||
|
@ -387,7 +387,7 @@ WB_END
|
||||
|
||||
WB_ENTRY(jlong, WB_GetObjectSize(JNIEnv* env, jobject o, jobject obj))
|
||||
oop p = JNIHandles::resolve(obj);
|
||||
return Universe::heap()->obj_size(p) * HeapWordSize;
|
||||
return p->size() * HeapWordSize;
|
||||
WB_END
|
||||
|
||||
WB_ENTRY(jlong, WB_GetHeapSpaceAlignment(JNIEnv* env, jobject o))
|
||||
|
Loading…
x
Reference in New Issue
Block a user