< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java

Print this page

        

*** 22,31 **** --- 22,33 ---- */ package org.graalvm.compiler.hotspot.meta; + import static jdk.vm.ci.services.Services.IS_BUILDING_NATIVE_IMAGE; + import static jdk.vm.ci.services.Services.IS_IN_NATIVE_IMAGE; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; import java.util.ArrayList; import java.util.List;
*** 61,71 **** * volatile to support double-checked locking lazy initialization. */ private volatile List<ResolvedJavaField> nonEmbeddableFields; protected boolean isEmbeddableField(ResolvedJavaField field) { ! if (nonEmbeddableFields == null) { synchronized (this) { if (nonEmbeddableFields == null) { List<ResolvedJavaField> fields = new ArrayList<>(); try { fields.add(metaAccess.lookupJavaField(Boolean.class.getDeclaredField("TRUE"))); --- 63,73 ---- * volatile to support double-checked locking lazy initialization. */ private volatile List<ResolvedJavaField> nonEmbeddableFields; protected boolean isEmbeddableField(ResolvedJavaField field) { ! if (!IS_IN_NATIVE_IMAGE && (IS_BUILDING_NATIVE_IMAGE || nonEmbeddableFields == null)) { synchronized (this) { if (nonEmbeddableFields == null) { List<ResolvedJavaField> fields = new ArrayList<>(); try { fields.add(metaAccess.lookupJavaField(Boolean.class.getDeclaredField("TRUE")));
< prev index next >