reduce PsiLock contention: don't take it when there's no AST reference to clear
authorpeter <peter@jetbrains.com>
Wed, 28 Oct 2015 15:46:57 +0000 (16:46 +0100)
committerpeter <peter@jetbrains.com>
Wed, 28 Oct 2015 16:03:45 +0000 (17:03 +0100)
platform/core-impl/src/com/intellij/psi/impl/source/PsiFileImpl.java

index 8659b8d92036dbe6ef00aefd685344845d92dc43..3bc81989c02abefab8c1fb088c787f8dc1dfd791 100644 (file)
@@ -126,7 +126,9 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
 
   private FileElement derefTreeElement() {
     Getter<FileElement> pointer = myTreeElementPointer;
-    FileElement treeElement = SoftReference.deref(pointer);
+    if (pointer == null) return null;
+
+    FileElement treeElement = pointer.get();
     if (treeElement != null) return treeElement;
 
     synchronized (PsiLock.LOCK) {