Skip to content

Commit 248303d

Browse files
committed
[Wisp] Fix missing oops_do for WispThread
Summary: Wisp unfortunately missed doing do_oop() for WispThread, which is corresponded to a Coroutine data structure. We shall add it. Test Plan: all wisp tests Reviewed-by: yuleil, sanhong Issue: #189
1 parent 8c150d1 commit 248303d

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

hotspot/src/share/vm/runtime/coroutine.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,10 @@ const char* WispThread::print_blocking_status(int status) {
965965
}
966966
}
967967

968+
void WispThread::oops_do(OopClosure *f, CLDClosure *cld_f, CodeBlobClosure *cf) {
969+
f->do_oop((oop*) &_threadObj);
970+
}
971+
968972
void Coroutine::after_safepoint(JavaThread* thread) {
969973
assert(Thread::current() == thread, "sanity check");
970974

hotspot/src/share/vm/runtime/coroutine.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ class WispThread: public JavaThread {
445445
return thread->is_Wisp_thread() ? (WispThread*) thread :
446446
((JavaThread*) thread)->current_coroutine()->wisp_thread();
447447
}
448+
449+
// Memory operations
450+
void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
448451
};
449452

450453
// we supported coroutine stealing for following native calls:

hotspot/src/share/vm/runtime/thread.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,6 +3094,9 @@ void JavaThread::oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf)
30943094
Coroutine* current = _coroutine_list;
30953095
do {
30963096
current->oops_do(f, cld_f, cf);
3097+
if (UseWispMonitor) {
3098+
current->wisp_thread()->oops_do(f, cld_f, cf);
3099+
}
30973100
current = current->next();
30983101
} while (current != _coroutine_list);
30993102
}

hotspot/src/share/vm/runtime/thread.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ typedef void (*ThreadFunction)(JavaThread*, TRAPS);
818818

819819
class JavaThread: public Thread {
820820
friend class VMStructs;
821+
friend class WispThread;
821822
private:
822823
JavaThread* _next; // The next thread in the Threads list
823824
oop _threadObj; // The Java level thread object

0 commit comments

Comments
 (0)