`DefNewGeneration::collect` use `MarkingNMethodClosure` to process oops inside nmethods during young-gc. However, since young-gc using scavenging, instead of marking, there is no need for `MarkingNMethodClosure` -- `NMethodToOopClosure` is enough.
After switching to `NMethodToOopClosure`, `StrongRootsScope` is not needed any more, which is used to undo the effect of nmethod-claiming inside `MarkingNMethodClosure`.
After switching to `NMethodToOopClosure`, `StrongRootsScope` is not needed any more, which is used to undo the effect of nmethod-claiming inside `MarkingNMethodClosure`.
- links to
-
Review(master) openjdk/jdk/27226