|
25 | 25 |
|
26 | 26 | package java.lang.ref;
|
27 | 27 |
|
28 |
| -import jdk.internal.misc.Unsafe; |
29 | 28 | import jdk.internal.vm.annotation.ForceInline;
|
30 | 29 | import jdk.internal.vm.annotation.IntrinsicCandidate;
|
31 | 30 | import jdk.internal.access.JavaLangRefAccess;
|
32 | 31 | import jdk.internal.access.SharedSecrets;
|
33 |
| -import jdk.internal.ref.Cleaner; |
34 | 32 |
|
35 | 33 | /**
|
36 | 34 | * Abstract base class for reference objects. This class defines the
|
@@ -199,11 +197,6 @@ private static class ReferenceHandler extends Thread {
|
199 | 197 | }
|
200 | 198 |
|
201 | 199 | public void run() {
|
202 |
| - // pre-load and initialize Cleaner class so that we don't |
203 |
| - // get into trouble later in the run loop if there's |
204 |
| - // memory shortage while loading/initializing it lazily. |
205 |
| - Unsafe.getUnsafe().ensureClassInitialized(Cleaner.class); |
206 |
| - |
207 | 200 | while (true) {
|
208 | 201 | processPendingReferences();
|
209 | 202 | }
|
@@ -253,18 +246,7 @@ private static void processPendingReferences() {
|
253 | 246 | Reference<?> ref = pendingList;
|
254 | 247 | pendingList = ref.discovered;
|
255 | 248 | ref.discovered = null;
|
256 |
| - |
257 |
| - if (ref instanceof Cleaner) { |
258 |
| - ((Cleaner)ref).clean(); |
259 |
| - // Notify any waiters that progress has been made. |
260 |
| - // This improves latency for nio.Bits waiters, which |
261 |
| - // are the only important ones. |
262 |
| - synchronized (processPendingLock) { |
263 |
| - processPendingLock.notifyAll(); |
264 |
| - } |
265 |
| - } else { |
266 |
| - ref.enqueueFromPending(); |
267 |
| - } |
| 249 | + ref.enqueueFromPending(); |
268 | 250 | }
|
269 | 251 | // Notify any waiters of completion of current round.
|
270 | 252 | synchronized (processPendingLock) {
|
|
0 commit comments