nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/ClassMap.java
equal
deleted
inserted
replaced
89 import java.security.PrivilegedAction; |
89 import java.security.PrivilegedAction; |
90 import java.util.Map; |
90 import java.util.Map; |
91 import java.util.WeakHashMap; |
91 import java.util.WeakHashMap; |
92 import java.util.concurrent.ConcurrentHashMap; |
92 import java.util.concurrent.ConcurrentHashMap; |
93 import java.util.concurrent.ConcurrentMap; |
93 import java.util.concurrent.ConcurrentMap; |
94 import jdk.internal.dynalink.linker.support.Guards; |
94 import jdk.internal.dynalink.internal.InternalTypeUtilities; |
95 |
95 |
96 /** |
96 /** |
97 * A dual map that can either strongly or weakly reference a given class depending on whether the class is visible from |
97 * A dual map that can either strongly or weakly reference a given class depending on whether the class is visible from |
98 * a class loader or not. |
98 * a class loader or not. |
99 * |
99 * |
151 assert newV != null; |
151 assert newV != null; |
152 |
152 |
153 final Boolean canReferenceDirectly = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { |
153 final Boolean canReferenceDirectly = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { |
154 @Override |
154 @Override |
155 public Boolean run() { |
155 public Boolean run() { |
156 return Guards.canReferenceDirectly(classLoader, clazz.getClassLoader()); |
156 return InternalTypeUtilities.canReferenceDirectly(classLoader, clazz.getClassLoader()); |
157 } |
157 } |
158 }, ClassLoaderGetterContextProvider.GET_CLASS_LOADER_CONTEXT); |
158 }, ClassLoaderGetterContextProvider.GET_CLASS_LOADER_CONTEXT); |
159 |
159 |
160 // If allowed to strongly reference, put it in the fast map |
160 // If allowed to strongly reference, put it in the fast map |
161 if(canReferenceDirectly) { |
161 if(canReferenceDirectly) { |