8279534: Consolidate and remove oopDesc::klass_gap methods
Reviewed-by: shade, dholmes
This commit is contained in:
parent
f05ff99654
commit
afd2805ef2
@ -1943,12 +1943,12 @@ run:
|
||||
Copy::fill_to_words(result + hdr_size, obj_size - hdr_size, 0);
|
||||
}
|
||||
|
||||
oop obj = cast_to_oop(result);
|
||||
// Initialize header, mirrors MemAllocator.
|
||||
oopDesc::set_mark(result, markWord::prototype());
|
||||
oopDesc::set_klass_gap(result, 0);
|
||||
oopDesc::release_set_klass(result, ik);
|
||||
|
||||
// Initialize header
|
||||
obj->set_mark(markWord::prototype());
|
||||
obj->set_klass_gap(0);
|
||||
obj->set_klass(ik);
|
||||
oop obj = cast_to_oop(result);
|
||||
|
||||
// Must prevent reordering of stores for object initialization
|
||||
// with stores that publish the new object.
|
||||
|
@ -91,8 +91,6 @@ class oopDesc {
|
||||
static inline void release_set_klass(HeapWord* mem, Klass* k);
|
||||
|
||||
// For klass field compression
|
||||
inline int klass_gap() const;
|
||||
inline void set_klass_gap(int z);
|
||||
static inline void set_klass_gap(HeapWord* mem, int z);
|
||||
|
||||
// size of object header, aligned to platform wordSize
|
||||
|
@ -125,20 +125,12 @@ void oopDesc::release_set_klass(HeapWord* mem, Klass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
int oopDesc::klass_gap() const {
|
||||
return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes());
|
||||
}
|
||||
|
||||
void oopDesc::set_klass_gap(HeapWord* mem, int v) {
|
||||
if (UseCompressedClassPointers) {
|
||||
*(int*)(((char*)mem) + klass_gap_offset_in_bytes()) = v;
|
||||
}
|
||||
}
|
||||
|
||||
void oopDesc::set_klass_gap(int v) {
|
||||
set_klass_gap((HeapWord*)this, v);
|
||||
}
|
||||
|
||||
bool oopDesc::is_a(Klass* k) const {
|
||||
return klass()->is_subtype_of(k);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user