8266936: Add a finalization JFR event

Reviewed-by: coleenp, mchung, egahlin
This commit is contained in:
Markus Grönlund 2021-10-18 16:52:36 +00:00
parent bcbe3845d9
commit 72a976ef05
36 changed files with 1517 additions and 551 deletions

View file

@ -86,6 +86,7 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
assert finalizee != null;
if (!(finalizee instanceof java.lang.Enum)) {
jla.invokeFinalize(finalizee);
reportComplete(finalizee);
// Clear stack slot containing this variable, to decrease
// the chances of false retention with a conservative GC
@ -95,6 +96,8 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
super.clear();
}
private static native void reportComplete(Object finalizee);
/* Create a privileged secondary finalizer thread in the system thread
* group for the given Runnable, and wait for it to complete.
*