From afc5646382b29c018ec2f430b8845d47abae0902 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Sun, 9 Mar 2025 18:07:40 +0100 Subject: [PATCH] removed NativeImageReinitialize annotation --- .../classes/jdk/vm/ci/common/InitTimer.java | 4 +-- .../vm/ci/common/NativeImageReinitialize.java | 36 ------------------- .../classes/jdk/vm/ci/hotspot/Cleaner.java | 5 ++- .../vm/ci/hotspot/HotSpotConstantPool.java | 5 ++- .../hotspot/HotSpotJVMCICompilerConfig.java | 5 ++- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 17 +++++---- .../jdk/vm/ci/hotspot/HotSpotMethodData.java | 5 ++- .../HotSpotMethodHandleAccessProvider.java | 5 ++- .../hotspot/HotSpotResolvedPrimitiveType.java | 5 ++- .../classes/jdk/vm/ci/runtime/JVMCI.java | 7 ++-- 10 files changed, 25 insertions(+), 69 deletions(-) delete mode 100644 src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/NativeImageReinitialize.java diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/InitTimer.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/InitTimer.java index a75ba3874dd2c..94fb6f4e9b00d 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/InitTimer.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/InitTimer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,7 +82,7 @@ private static boolean isEnabled() { /** * Cache for value of {@code jvmci.InitTimer} system property. */ - @NativeImageReinitialize private static Boolean enabledPropertyValue; + private static Boolean enabledPropertyValue; private static AtomicInteger nesting; private static final String SPACES = " "; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/NativeImageReinitialize.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/NativeImageReinitialize.java deleted file mode 100644 index 21981da7245e9..0000000000000 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/common/NativeImageReinitialize.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.common; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Denotes a field that should have the default value for its type in an ahead of time image. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD}) -public @interface NativeImageReinitialize { -} diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/Cleaner.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/Cleaner.java index 87760efb8a0e8..d9d82b413ebc0 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/Cleaner.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/Cleaner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,6 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; -import jdk.vm.ci.common.NativeImageReinitialize; import jdk.vm.ci.meta.ResolvedJavaType; /** @@ -41,7 +40,7 @@ public abstract class Cleaner extends WeakReference { /** * Head of linked list of cleaners. */ - @NativeImageReinitialize private static Cleaner first; + private static Cleaner first; /** * Linked list pointers. diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java index 93956a5a525c2..84fb21d1948d0 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ import java.util.stream.Collectors; import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.common.NativeImageReinitialize; import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; @@ -182,7 +181,7 @@ JvmConstant get(int tag) { throw new JVMCIError("Unknown JvmConstant tag %s", tag); } - @NativeImageReinitialize private static volatile JvmConstants instance; + private static volatile JvmConstants instance; static JvmConstants instance() { JvmConstants result = instance; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java index 6bff3ce58cff5..d4c824f6a27ce 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ import java.util.Set; import jdk.vm.ci.code.CompilationRequest; -import jdk.vm.ci.common.NativeImageReinitialize; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; @@ -78,7 +77,7 @@ public boolean isGCSupported(int gcIdentifier) { /** * Factory of the selected system compiler. */ - @NativeImageReinitialize private static JVMCICompilerFactory compilerFactory; + private static JVMCICompilerFactory compilerFactory; /** * Gets the selected system compiler factory. diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 0943b0f816230..ebe2778ca3c8e 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,6 @@ import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.common.InitTimer; import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.common.NativeImageReinitialize; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaField; @@ -84,7 +83,7 @@ public final class HotSpotJVMCIRuntime implements JVMCIRuntime { /** * Singleton instance lazily initialized via double-checked locking. */ - @NativeImageReinitialize private static volatile HotSpotJVMCIRuntime instance; + private static volatile HotSpotJVMCIRuntime instance; private HotSpotResolvedObjectTypeImpl javaLangObject; private HotSpotResolvedObjectTypeImpl javaLangInvokeMethodHandle; @@ -287,7 +286,7 @@ public enum Option { private static final String NULL_VALUE = "NULL"; private final Class type; - @NativeImageReinitialize private Object value; + private Object value; private final Object defaultValue; boolean isDefault = true; private final String[] helpLines; @@ -491,12 +490,12 @@ public static JavaKind getHostWordKind() { private volatile JVMCICompiler compiler; protected final HotSpotJVMCIReflection reflection; - @NativeImageReinitialize private volatile boolean creatingCompiler; + private volatile boolean creatingCompiler; /** * Cache for speeding up {@link #fromClass(Class)}. */ - @NativeImageReinitialize private volatile ClassValue> resolvedJavaType; + private volatile ClassValue> resolvedJavaType; /** * To avoid calling ClassValue.remove to refresh the weak reference, which under certain @@ -538,20 +537,20 @@ public KlassWeakReference(Long klassPointer, HotSpotResolvedObjectTypeImpl refer * A mapping from the {@code Klass*} to the corresponding {@link HotSpotResolvedObjectTypeImpl}. The value is * held weakly through a {@link KlassWeakReference} so that unused types can be unloaded when the compiler no longer needs them. */ - @NativeImageReinitialize private HashMap resolvedJavaTypes; + private HashMap resolvedJavaTypes; /** * A {@link ReferenceQueue} to track when {@link KlassWeakReference}s have been freed so that the corresponding * entry in {@link #resolvedJavaTypes} can be cleared. */ - @NativeImageReinitialize private ReferenceQueue resolvedJavaTypesQueue; + private ReferenceQueue resolvedJavaTypesQueue; /** * Stores the value set by {@link #excludeFromJVMCICompilation(Module...)} so that it can be * read from the VM. */ @SuppressWarnings("unused")// - @NativeImageReinitialize private Module[] excludeFromJVMCICompilation; + private Module[] excludeFromJVMCICompilation; private final Map, JVMCIBackend> backends = new HashMap<>(); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodData.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodData.java index bc76b7656fa2a..454949a2e2527 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodData.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ import java.util.Arrays; -import jdk.vm.ci.common.NativeImageReinitialize; import jdk.internal.misc.Unsafe; import jdk.vm.ci.meta.DeoptimizationReason; import jdk.vm.ci.meta.JavaMethodProfile; @@ -144,7 +143,7 @@ private int cellsToBytes(int cells) { /** * Singleton instance lazily initialized via double-checked locking. */ - @NativeImageReinitialize private static volatile VMState instance; + private static volatile VMState instance; static VMState instance() { VMState result = instance; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java index 4685ff4d1b4b5..6211bd5063ae9 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ import java.lang.invoke.MethodHandle; import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.common.NativeImageReinitialize; import jdk.vm.ci.hotspot.HotSpotMethodData.VMState; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; @@ -107,7 +106,7 @@ private Internals() { /** * Singleton instance lazily initialized via double-checked locking. */ - @NativeImageReinitialize private static volatile Internals instance; + private static volatile Internals instance; static Internals instance() { Internals result = instance; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java index d95824998bceb..4425ade0880a1 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ import java.util.List; import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.common.NativeImageReinitialize; import jdk.vm.ci.meta.AnnotationData; import jdk.vm.ci.meta.Assumptions.AssumptionResult; import jdk.vm.ci.meta.JavaConstant; @@ -46,7 +45,7 @@ */ public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType { - @NativeImageReinitialize static HotSpotResolvedPrimitiveType[] primitives; + static HotSpotResolvedPrimitiveType[] primitives; private JavaKind kind; HotSpotObjectConstantImpl mirror; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/runtime/JVMCI.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/runtime/JVMCI.java index 12ad2bb30d34a..d07df2ba75d26 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/runtime/JVMCI.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/runtime/JVMCI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,6 @@ import java.util.Formatter; -import jdk.vm.ci.common.NativeImageReinitialize; import jdk.vm.ci.services.Services; public class JVMCI { @@ -32,9 +31,9 @@ public class JVMCI { /** * Singleton instance lazily initialized via double-checked locking. */ - @NativeImageReinitialize private static volatile JVMCIRuntime runtime; + private static volatile JVMCIRuntime runtime; - @NativeImageReinitialize private static boolean initializing; + private static boolean initializing; public static void initialize() { // force static initializer