Skip to content

Commit

Permalink
Inline has_klass_gap()
Browse files Browse the repository at this point in the history
  • Loading branch information
rkennke committed Nov 14, 2024
1 parent 9e770b8 commit 7f7f0df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/hotspot/share/oops/oop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ bool oopDesc::is_array_noinline() const { return is_array(); }
bool oopDesc::is_objArray_noinline() const { return is_objArray(); }
bool oopDesc::is_typeArray_noinline() const { return is_typeArray(); }

bool oopDesc::has_klass_gap() {
return ObjLayout::oop_has_klass_gap();
}

#if INCLUDE_CDS_JAVA_HEAP
void oopDesc::set_narrow_klass(narrowKlass nk) {
assert(CDSConfig::is_dumping_heap(), "Used by CDS only. Do not abuse!");
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/oop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class oopDesc {
inline bool mark_must_be_preserved() const;
inline bool mark_must_be_preserved(markWord m) const;

static bool has_klass_gap();
inline static bool has_klass_gap();

// for code generation
static int mark_offset_in_bytes() { return (int)offset_of(oopDesc, _mark); }
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/oops/oop.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ void oopDesc::release_set_klass(HeapWord* mem, Klass* k) {
}
}

inline bool oopDesc::has_klass_gap() {
return ObjLayout::oop_has_klass_gap();
}

void oopDesc::set_klass_gap(HeapWord* mem, int v) {
assert(has_klass_gap(), "precondition");
*(int*)(((char*)mem) + klass_gap_offset_in_bytes()) = v;
Expand Down

0 comments on commit 7f7f0df

Please sign in to comment.