Skip to content

Commit df1959f

Browse files
committed
8340838: Clean up MutableCallSite to use explicit release fence instead of AtomicInteger
Reviewed-by: jrose, redestad, shade
1 parent 1b2d40a commit df1959f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/java.base/share/classes/java/lang/invoke/MutableCallSite.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
2626
package java.lang.invoke;
2727

2828
import java.util.Objects;
29-
import java.util.concurrent.atomic.AtomicInteger;
29+
30+
import static java.lang.invoke.MethodHandleStatics.UNSAFE;
3031

3132
/**
3233
* A {@code MutableCallSite} is a {@link CallSite} whose target variable
@@ -274,11 +275,10 @@ public final MethodHandle dynamicInvoker() {
274275
*/
275276
public static void syncAll(MutableCallSite[] sites) {
276277
if (sites.length == 0) return;
277-
STORE_BARRIER.lazySet(0);
278+
UNSAFE.storeFence();
278279
for (MutableCallSite site : sites) {
279280
Objects.requireNonNull(site); // trigger NPE on first null
280281
}
281282
// FIXME: NYI
282283
}
283-
private static final AtomicInteger STORE_BARRIER = new AtomicInteger();
284284
}

0 commit comments

Comments
 (0)