openj9
openj9 copied to clipboard
Loom: GC Thread scanning
Threads should be scanned as they normally would. If a thread is mounted with a VirtualThread, then the virtual thread stack will be scanned, the carrier thread stack will be stored in a continuation instance.
currentContinuation field of the J9vmThread point to either NULL or the continuation with carrier thread stack(mounting with a VirtualThread case). scanning currentContinuation if needed.
currentContinuation Object also can be retrieved via j9vmThread->threadObject (virtualThread Object).
In general, java stack in currentContinuation could also be scanned via scanning Continuation Object in Heap( mounted j9vmThread->threadObject (virtualThread Object)--> the continuation Object), scanning currentContinuation is unnecessary for "normal case", but it would help generational GC case(we don't need to add tenured continuation Object in rememberedSet if it mount to the carrier thread).
#depends: https://github.com/eclipse-openj9/openj9/pull/15603 #fix: https://github.com/eclipse-openj9/openj9/issues/15179 Signed-off-by: Lin Hu [email protected]