diff options
author | Andy Clement <aclement@pivotal.io> | 2017-09-28 16:03:17 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2017-09-28 16:03:17 -0700 |
commit | ba551b09e4c873f30c0675193e70e0a0eb62c3ca (patch) | |
tree | b28159ecf6270fde24fc95c24db0f1dae35b6ec0 /bcel-builder | |
parent | b7e4aff1c15a0984d4ca772ffb82cdd9b0f6fa57 (diff) | |
download | aspectj-ba551b09e4c873f30c0675193e70e0a0eb62c3ca.tar.gz aspectj-ba551b09e4c873f30c0675193e70e0a0eb62c3ca.zip |
Fixes Bug 525293 - Spring AOP could be faster
Multiple changes here:
- annotation unpacking is smarter and if it only needs runtime
retention annotations it uses reflection and doesn't unpack the
bytes to discover class level retention annotations.
- Reflection worlds are shared if for the same classloader.
Diffstat (limited to 'bcel-builder')
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/util/ClassLoaderRepository.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/util/ClassLoaderRepository.java b/bcel-builder/src/org/aspectj/apache/bcel/util/ClassLoaderRepository.java index eb33d8b4e..e3c59556b 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/util/ClassLoaderRepository.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/util/ClassLoaderRepository.java @@ -88,15 +88,13 @@ public class ClassLoaderRepository implements Repository { private ClassLoaderReference loaderRef; // Choice of cache... - private WeakHashMap /* <URL,SoftRef(JavaClass)> */<URL, SoftReference<JavaClass>> localCache = new WeakHashMap<URL, SoftReference<JavaClass>>(); - private static SoftHashMap /* <URL,JavaClass> */sharedCache = new SoftHashMap(Collections - .synchronizedMap(new HashMap<Object, SpecialValue>())); + private WeakHashMap<URL, SoftReference<JavaClass>> localCache = new WeakHashMap<URL, SoftReference<JavaClass>>(); + private static SoftHashMap /* <URL,JavaClass> */sharedCache = new SoftHashMap(Collections.synchronizedMap(new HashMap<Object, SpecialValue>())); // For fast translation of the classname *intentionally not static* private SoftHashMap /* <String,URL> */nameMap = new SoftHashMap(new HashMap(), false); - public static boolean useSharedCache = System.getProperty("org.aspectj.apache.bcel.useSharedCache", "true").equalsIgnoreCase( - "true"); + public static boolean useSharedCache = System.getProperty("org.aspectj.apache.bcel.useSharedCache", "true").equalsIgnoreCase("true"); private static int cacheHitsShared = 0; private static int missSharedEvicted = 0; // Misses in shared cache access due to reference GC |