RFR: JDK-8211129: [Testbug] compiler/whitebox/ForceNMethodSweepTest.java fails after JDK-8132849

Roman Kennke rkennke at redhat.com
Wed Sep 26 08:30:17 UTC 2018

Please review the following change:

Several tests fail because after forcing nmethod sweep via Whitebox API,
the sweeper doesn't actually kick in.

The reason is the changed heuristic in NMethodSweeper: before
JDK-8132849, we would scan stacks and mark nmethods at every safepoint,
during safepoint cleanup phase. This would subsequently trigger a sweep
cycle via _should_sweep. If no stack-scanning is performed, the sweeper
would skip sweeping because the CompiledMethodIterator _current has not
been reset.

I propose to change the following:

- In the sweep-loop, call into do_stack_scanning() whenever it's forced
(via WhiteBox API) or if should_sweep has been determined by other
heuristics (code-cache-change, time-since-last-sweep,..)

- Instead let do_stack_scanning() not set _should_sweep anymore.


Testing: Fixes previously failing:

Passes: hotspot/jtreg:tier1

More information about the hotspot-dev mailing list