Skip to content

Commit 2a01c79

Browse files
committedJan 23, 2024
8324513: Inline ContiguousSpace::object_iterate_from
Reviewed-by: stefank
1 parent fbaaac6 commit 2a01c79

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed
 

‎src/hotspot/share/gc/shared/space.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,11 @@ bool Space::obj_is_alive(const HeapWord* p) const {
146146
}
147147

148148
void ContiguousSpace::object_iterate(ObjectClosure* blk) {
149-
if (is_empty()) return;
150-
object_iterate_from(bottom(), blk);
151-
}
152-
153-
void ContiguousSpace::object_iterate_from(HeapWord* mark, ObjectClosure* blk) {
154-
while (mark < top()) {
155-
blk->do_object(cast_to_oop(mark));
156-
mark += cast_to_oop(mark)->size();
149+
HeapWord* addr = bottom();
150+
while (addr < top()) {
151+
oop obj = cast_to_oop(addr);
152+
blk->do_object(obj);
153+
addr += obj->size();
157154
}
158155
}
159156

‎src/hotspot/share/gc/shared/space.hpp

-5
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,6 @@ class ContiguousSpace: public Space {
283283
template <typename OopClosureType>
284284
void oop_since_save_marks_iterate(OopClosureType* blk);
285285

286-
// Same as object_iterate, but starting from "mark", which is required
287-
// to denote the start of an object. Objects allocated by
288-
// applications of the closure *are* included in the iteration.
289-
virtual void object_iterate_from(HeapWord* mark, ObjectClosure* blk);
290-
291286
// Very inefficient implementation.
292287
HeapWord* block_start_const(const void* p) const override;
293288
size_t block_size(const HeapWord* p) const override;

0 commit comments

Comments
 (0)