Top Description Fields Constructors Methods
jdk.vm.ci.hotspot

pack-priv abstract Class Cleaner

extends WeakReference<Object>
Class Inheritance
Known Direct Subclasses
jdk.vm.ci.hotspot.HandleCleaner, jdk.vm.ci.hotspot.HotSpotSpeculationLog.LogCleaner
Imports
java.lang.ref.ReferenceQueue, .WeakReference, jdk.vm.ci.common.NativeImageReinitialize, jdk.vm.ci.meta.ResolvedJavaType

A cleaner tracks a referent object and includes some cleanup code that is run some time after the referent object has become weakly-reachable. This is like java.lang.ref.Cleaner but with weak semantics instead of phantom. Objects referenced by this might be referenced by ResolvedJavaType which is kept alive by a WeakReference so we need equivalent reference strength.

Field Summary

Modifier and TypeField and Description
private static Cleaner
first

Head of linked list of cleaners.

private Cleaner
next

Hides java.lang.ref.Reference.next.

Linked list pointers.
private Cleaner
private static final ReferenceQueue<Object>
queue

Hides java.lang.ref.Reference.queue.

The ReferenceQueue to which Cleaners are enqueued once their referents' become unreachable.

Constructor Summary

AccessConstructor and Description
pack-priv
Cleaner(Object referent)

Method Summary

Modifier and TypeMethod and Description
private static synchronized Cleaner
pack-priv static void
clean()

Remove the cleaners whose referents have become weakly reachable.

pack-priv abstract boolean

Returns:

true if the clean up action cleared the referent of an oop handle and requires a subsequent call to CompilerToVM#releaseClearedOopHandles() to reclaim the resources of the handle itself
doCleanup
()

Performs the cleanup action now that this object's referent has become weakly reachable.

private static synchronized void
remove(Cleaner cl)

Removes cl from the linked list of cleaners.

Field Detail

firstback to summary
private static Cleaner first

Head of linked list of cleaners.

Annotations
@NativeImageReinitialize
nextback to summary
private Cleaner next

Hides java.lang.ref.Reference.next.

Linked list pointers.

prevback to summary
private Cleaner prev
queueback to summary
private static final ReferenceQueue<Object> queue

Hides java.lang.ref.Reference.queue.

The ReferenceQueue to which Cleaners are enqueued once their referents' become unreachable.

Constructor Detail

Cleanerback to summary
pack-priv Cleaner(Object referent)

Method Detail

addback to summary
private static synchronized Cleaner add(Cleaner cl)
cleanback to summary
pack-priv static void clean()

Remove the cleaners whose referents have become weakly reachable.

doCleanupback to summary
pack-priv abstract boolean doCleanup()

Performs the cleanup action now that this object's referent has become weakly reachable.

Returns:boolean

true if the clean up action cleared the referent of an oop handle and requires a subsequent call to CompilerToVM#releaseClearedOopHandles() to reclaim the resources of the handle itself

removeback to summary
private static synchronized void remove(Cleaner cl)

Removes cl from the linked list of cleaners.