Skip to content

Commit

Permalink
8324513: Inline ContiguousSpace::object_iterate_from
Browse files Browse the repository at this point in the history
Reviewed-by: stefank
  • Loading branch information
albertnetymk committed Jan 23, 2024
1 parent fbaaac6 commit 2a01c79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
13 changes: 5 additions & 8 deletions src/hotspot/share/gc/shared/space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,11 @@ bool Space::obj_is_alive(const HeapWord* p) const {
}

void ContiguousSpace::object_iterate(ObjectClosure* blk) {
if (is_empty()) return;
object_iterate_from(bottom(), blk);
}

void ContiguousSpace::object_iterate_from(HeapWord* mark, ObjectClosure* blk) {
while (mark < top()) {
blk->do_object(cast_to_oop(mark));
mark += cast_to_oop(mark)->size();
HeapWord* addr = bottom();
while (addr < top()) {
oop obj = cast_to_oop(addr);
blk->do_object(obj);
addr += obj->size();
}
}

Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/share/gc/shared/space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,6 @@ class ContiguousSpace: public Space {
template <typename OopClosureType>
void oop_since_save_marks_iterate(OopClosureType* blk);

// Same as object_iterate, but starting from "mark", which is required
// to denote the start of an object. Objects allocated by
// applications of the closure *are* included in the iteration.
virtual void object_iterate_from(HeapWord* mark, ObjectClosure* blk);

// Very inefficient implementation.
HeapWord* block_start_const(const void* p) const override;
size_t block_size(const HeapWord* p) const override;
Expand Down

1 comment on commit 2a01c79

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.