Skip to content

Commit 2e7dfc6

Browse files
committedMar 30, 2022
Minor cleanups to oop_oop_iterate_stack closures
1 parent 611b5bb commit 2e7dfc6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed
 

‎src/hotspot/share/oops/instanceStackChunkKlass.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,13 @@ template<typename OopClosureType>
116116
class StackChunkOopIterateFilterClosure: public OopClosure {
117117
private:
118118
OopClosureType* const _closure;
119-
stackChunkOop _chunk;
120119
MemRegion _bound;
121120

122121
public:
123122
int _num_oops;
124123

125-
StackChunkOopIterateFilterClosure(OopClosureType* closure, stackChunkOop chunk, MemRegion bound)
124+
StackChunkOopIterateFilterClosure(OopClosureType* closure, MemRegion bound)
126125
: _closure(closure),
127-
_chunk(chunk),
128126
_bound(bound),
129127
_num_oops(0) {}
130128

@@ -134,7 +132,6 @@ class StackChunkOopIterateFilterClosure: public OopClosure {
134132
template <typename T>
135133
void do_oop_work(T* p) {
136134
if (_bound.contains(p)) {
137-
T before = *p;
138135
Devirtualizer::do_oop(_closure, p);
139136
_num_oops++;
140137
}
@@ -168,7 +165,7 @@ void InstanceStackChunkKlass::mark_methods(stackChunkOop chunk, OopIterateClosur
168165
chunk->iterate_stack(&closure);
169166
}
170167

171-
class OopOopIterateStackClosure {
168+
class OopIterateStackChunkFrameClosure {
172169
stackChunkOop _chunk;
173170
OopIterateClosure* const _closure;
174171
MemRegion _bound;
@@ -178,7 +175,7 @@ class OopOopIterateStackClosure {
178175
int _num_frames;
179176
int _num_oops;
180177

181-
OopOopIterateStackClosure(stackChunkOop chunk, OopIterateClosure* closure, MemRegion mr)
178+
OopIterateStackChunkFrameClosure(stackChunkOop chunk, OopIterateClosure* closure, MemRegion mr)
182179
: _chunk(chunk),
183180
_closure(closure),
184181
_bound(mr),
@@ -195,7 +192,7 @@ class OopOopIterateStackClosure {
195192
MarkMethodsStackClosure(_closure).do_frame(f, map);
196193
}
197194

198-
StackChunkOopIterateFilterClosure<OopIterateClosure> cl(_closure, _chunk, _bound);
195+
StackChunkOopIterateFilterClosure<OopIterateClosure> cl(_closure, _bound);
199196
f.iterate_oops(&cl, map);
200197
_num_oops += cl._num_oops;
201198

@@ -204,7 +201,7 @@ class OopOopIterateStackClosure {
204201
};
205202

206203
void InstanceStackChunkKlass::oop_oop_iterate_stack_slow(stackChunkOop chunk, OopIterateClosure* closure, MemRegion mr) {
207-
OopOopIterateStackClosure frame_closure(chunk, closure, mr);
204+
OopIterateStackChunkFrameClosure frame_closure(chunk, closure, mr);
208205
chunk->iterate_stack(&frame_closure);
209206

210207
assert(frame_closure._num_frames >= 0, "");

0 commit comments

Comments
 (0)
Please sign in to comment.