mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8329597: C2: Intrinsify Reference.clear
Reviewed-by: rcastanedalo, eosterlund, kvn
This commit is contained in:
parent
1cc32237ae
commit
7625b29920
26 changed files with 362 additions and 21 deletions
|
@ -77,6 +77,19 @@ public non-sealed class PhantomReference<T> extends Reference<T> {
|
|||
@IntrinsicCandidate
|
||||
private native boolean refersTo0(Object o);
|
||||
|
||||
/* Override the implementation of Reference.clear.
|
||||
* Phantom references are weaker than finalization, so the referent
|
||||
* access needs to be handled differently for garbage collectors that
|
||||
* do reference processing concurrently.
|
||||
*/
|
||||
@Override
|
||||
void clearImpl() {
|
||||
clear0();
|
||||
}
|
||||
|
||||
@IntrinsicCandidate
|
||||
private native void clear0();
|
||||
|
||||
/**
|
||||
* Creates a new phantom reference that refers to the given object and
|
||||
* is registered with the given queue.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue