Weakly retained memoized functions moved out of util.runtime
This commit is contained in:
committed by
Alexander Udalov
parent
5ebbe0d772
commit
0765e89b19
+1
-3
@@ -25,8 +25,6 @@ import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.storage.MemoizedFunctionToNullable;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
|
||||
import static org.jetbrains.jet.storage.StorageManager.ReferenceKind.STRONG;
|
||||
|
||||
public abstract class AbstractDescriptorFinder implements DescriptorFinder {
|
||||
|
||||
private final MemoizedFunctionToNullable<ClassId, ClassDescriptor> findClass;
|
||||
@@ -52,7 +50,7 @@ public abstract class AbstractDescriptorFinder implements DescriptorFinder {
|
||||
classDescriptorCreated(classDescriptor);
|
||||
return classDescriptor;
|
||||
}
|
||||
}, STRONG);
|
||||
});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+1
-3
@@ -37,8 +37,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.storage.StorageManager.ReferenceKind.STRONG;
|
||||
|
||||
public class TypeDeserializer {
|
||||
|
||||
public interface TypeParameterResolver {
|
||||
@@ -99,7 +97,7 @@ public class TypeDeserializer {
|
||||
public ClassDescriptor invoke(Integer fqNameIndex) {
|
||||
return computeClassDescriptor(fqNameIndex);
|
||||
}
|
||||
}, STRONG);
|
||||
});
|
||||
}
|
||||
|
||||
/* package */ DescriptorFinder getDescriptorFinder() {
|
||||
|
||||
+1
-2
@@ -45,7 +45,6 @@ import java.util.*;
|
||||
import static org.jetbrains.jet.descriptors.serialization.TypeDeserializer.TypeParameterResolver.NONE;
|
||||
import static org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getClassObjectName;
|
||||
import static org.jetbrains.jet.storage.StorageManager.ReferenceKind.STRONG;
|
||||
|
||||
public class DeserializedClassDescriptor extends AbstractClassDescriptor implements ClassDescriptor {
|
||||
|
||||
@@ -497,7 +496,7 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
||||
descriptorFinder.findClass(classId.createNestedClassId(name)) :
|
||||
null;
|
||||
}
|
||||
}, STRONG);
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+2
-4
@@ -33,8 +33,6 @@ import org.jetbrains.jet.storage.StorageManager;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.jet.storage.StorageManager.ReferenceKind.STRONG;
|
||||
|
||||
public abstract class DeserializedMemberScope implements JetScope {
|
||||
|
||||
private static final Filter<ProtoBuf.Callable.CallableKind> FUNCTION = new Filter<ProtoBuf.Callable.CallableKind>() {
|
||||
@@ -78,13 +76,13 @@ public abstract class DeserializedMemberScope implements JetScope {
|
||||
public Collection<FunctionDescriptor> invoke(Name name) {
|
||||
return computeFunctions(name);
|
||||
}
|
||||
}, STRONG);
|
||||
});
|
||||
this.properties = storageManager.createMemoizedFunction(new Function1<Name, Collection<VariableDescriptor>>() {
|
||||
@Override
|
||||
public Collection<VariableDescriptor> invoke(Name name) {
|
||||
return computeProperties(name);
|
||||
}
|
||||
}, STRONG);
|
||||
});
|
||||
this.allDescriptors = storageManager.createLazyValue(new Function0<Collection<DeclarationDescriptor>>() {
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> invoke() {
|
||||
|
||||
Reference in New Issue
Block a user