Skip to content

Commit 8b59173

Browse files
committed
Substitute FinalReference-specific methods in JDK16+.
1 parent 0cd0526 commit 8b59173

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/Target_java_lang_ref_Reference.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,22 @@ static boolean waitForReferenceProcessing() throws InterruptedException {
197197
static void reachabilityFence(Object ref) {
198198
GraalDirectives.blackhole(ref);
199199
}
200+
201+
@Substitute //
202+
@TargetElement(onlyWith = JDK16OrLater.class) //
203+
T getFromInactiveFinalReference() {
204+
// assert this instanceof FinalReference;
205+
assert next != null; // I.e. FinalReference is inactive
206+
return get();
207+
}
208+
209+
@Substitute //
210+
@TargetElement(onlyWith = JDK16OrLater.class) //
211+
void clearInactiveFinalReference() {
212+
// assert this instanceof FinalReference;
213+
assert next != null; // I.e. FinalReference is inactive
214+
clear();
215+
}
200216
}
201217

202218
/** We provide our own {@link com.oracle.svm.core.heap.ReferenceHandler}. */

0 commit comments

Comments
 (0)