From a0dd8ccd5f93c69b02d9a643ed92db3eb774f6eb Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 12 Jun 2024 13:01:27 -0500 Subject: [PATCH] Local ReferenceQueue version is fully customized. FinalizeHistogram class is called by Hotspot, but otherwise unused, so we can exclude it. --- src/IKVM.Java/IKVM.Java.runtime.props | 32 +++++++++++++------ .../local/java/lang/ref/ReferenceQueue.java | 31 +----------------- 2 files changed, 23 insertions(+), 40 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.runtime.props b/src/IKVM.Java/IKVM.Java.runtime.props index 0511e9d4b..81d7770b3 100644 --- a/src/IKVM.Java/IKVM.Java.runtime.props +++ b/src/IKVM.Java/IKVM.Java.runtime.props @@ -52,7 +52,7 @@ - + @@ -61,6 +61,20 @@ + + + + + + + + + + + + + + @@ -71,12 +85,6 @@ - - - - - - @@ -133,6 +141,7 @@ + @@ -203,8 +212,6 @@ - - @@ -337,6 +344,11 @@ + + + + + @@ -373,7 +385,7 @@ - + diff --git a/src/IKVM.Java/local/java/lang/ref/ReferenceQueue.java b/src/IKVM.Java/local/java/lang/ref/ReferenceQueue.java index d814c2273..d3888675e 100644 --- a/src/IKVM.Java/local/java/lang/ref/ReferenceQueue.java +++ b/src/IKVM.Java/local/java/lang/ref/ReferenceQueue.java @@ -205,33 +205,4 @@ private void scanActiveList() curr = curr.next; } } - - /** - * Iterate queue and invoke given action with each Reference. - * Suitable for diagnostic purposes. - * WARNING: any use of this method should make sure to not - * retain the referents of iterated references (in case of - * FinalReference(s)) so that their life is not prolonged more - * than necessary. - */ - void forEach(Consumer> action) { - for (Reference r = head; r != null;) { - action.accept(r); - @SuppressWarnings("unchecked") - Reference rn = r.next; - if (rn == r) { - if (r.queue == ENQUEUED) { - // still enqueued -> we reached end of chain - r = null; - } else { - // already dequeued: r.queue == NULL; -> - // restart from head when overtaken by queue poller(s) - r = head; - } - } else { - // next in chain - r = rn; - } - } - } -} +} \ No newline at end of file