RFR: Verifier should avoid pushing on
Aleksey Shipilev
shade at redhat.com
Tue Aug 1 17:34:31 UTC 2017
This little change cuts down testing time for about 30%:
$ hg diff
diff -r b514d97e3d24 src/share/vm/gc/shenandoah/shenandoahVerifier.cpp
--- a/src/share/vm/gc/shenandoah/shenandoahVerifier.cpp Tue Aug 01 17:33:56 2017 +0200
+++ b/src/share/vm/gc/shenandoah/shenandoahVerifier.cpp Tue Aug 01 19:26:00 2017 +0200
@@ -607,12 +607,15 @@
oop obj = oop(addr);
cl.verify_oop_standalone(obj);
- // Verify everything reachable from that object too:
- stack.push(obj);
+ // Verify everything reachable from that object too, hopefully realizing
+ // everything was already marked, and never touching further:
+ cl.verify_oops_from(obj);
+ (*processed)++;
+
while (!stack.is_empty()) {
- (*processed)++;
ShenandoahVerifierTask task = stack.pop();
cl.verify_oops_from(task.obj());
+ (*processed)++;
}
}
};
The reason is, doing the initial Stack.push() is costly when stack is empty, which it almost always is.
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list