Skip to content

Commit 1159b53

Browse files
committed
8369483: Cleanup dead code in HandleArea
Reviewed-by: fandreuzzi, stefank
1 parent b00720e commit 1159b53

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

src/hotspot/share/runtime/handles.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,31 +97,26 @@ DEF_METADATA_HANDLE_FN_NOINLINE(method, Method)
9797
DEF_METADATA_HANDLE_FN_NOINLINE(constantPool, ConstantPool)
9898

9999

100-
static uintx chunk_oops_do(OopClosure* f, Chunk* chunk, char* chunk_top) {
100+
static void chunk_oops_do(OopClosure* f, Chunk* chunk, char* chunk_top) {
101101
oop* bottom = (oop*) chunk->bottom();
102102
oop* top = (oop*) chunk_top;
103-
uintx handles_visited = top - bottom;
104103
assert(top >= bottom && top <= (oop*) chunk->top(), "just checking");
105-
// during GC phase 3, a handle may be a forward pointer that
106-
// is not yet valid, so loosen the assertion
104+
107105
while (bottom < top) {
108106
f->do_oop(bottom++);
109107
}
110-
return handles_visited;
111108
}
112109

113110
void HandleArea::oops_do(OopClosure* f) {
114-
uintx handles_visited = 0;
115111
// First handle the current chunk. It is filled to the high water mark.
116-
handles_visited += chunk_oops_do(f, _chunk, _hwm);
112+
chunk_oops_do(f, _chunk, _hwm);
113+
117114
// Then handle all previous chunks. They are completely filled.
118115
Chunk* k = _first;
119116
while(k != _chunk) {
120-
handles_visited += chunk_oops_do(f, k, k->top());
117+
chunk_oops_do(f, k, k->top());
121118
k = k->next();
122119
}
123-
124-
if (_prev != nullptr) _prev->oops_do(f);
125120
}
126121

127122
void HandleMark::initialize(Thread* thread) {

src/hotspot/share/runtime/handles.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,11 @@ class HandleArea: public Arena {
184184
int _handle_mark_nesting;
185185
int _no_handle_mark_nesting;
186186
#endif
187-
HandleArea* _prev; // link to outer (older) area
188187
public:
189188
// Constructor
190-
HandleArea(MemTag mem_tag, HandleArea* prev) : Arena(mem_tag, Tag::tag_ha, Chunk::tiny_size) {
189+
HandleArea(MemTag mem_tag) : Arena(mem_tag, Tag::tag_ha, Chunk::tiny_size) {
191190
DEBUG_ONLY(_handle_mark_nesting = 0);
192191
DEBUG_ONLY(_no_handle_mark_nesting = 0);
193-
_prev = prev;
194192
}
195193

196194
// Handle allocation

src/hotspot/share/runtime/thread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Thread::Thread(MemTag mem_tag) {
7474
set_osthread(nullptr);
7575
set_resource_area(new (mem_tag) ResourceArea(mem_tag));
7676
DEBUG_ONLY(_current_resource_mark = nullptr;)
77-
set_handle_area(new (mem_tag) HandleArea(mem_tag, nullptr));
77+
set_handle_area(new (mem_tag) HandleArea(mem_tag));
7878
set_metadata_handles(new (mtClass) GrowableArray<Metadata*>(30, mtClass));
7979
set_last_handle_mark(nullptr);
8080

0 commit comments

Comments
 (0)