Skip to content

Commit

Permalink
Persist all caches
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Nov 9, 2023
1 parent 4a5809a commit 5413e2f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
@Persistable(clazz = ModuleAnnotations.Annotations.class, id = 1118)
@Persistable(clazz = AliasAnalysis.Graph.class, id = 1119)
@Persistable(clazz = AliasAnalysis$Info$Scope$Root.class, id = 1120)
@Persistable(clazz = DataflowAnalysis$DependencyInfo$Type$Static.class, id = 1121)
@Persistable(clazz = DataflowAnalysis$DependencyInfo$Type$Dynamic.class, id = 1122)
@Persistable(clazz = AliasAnalysis$Info$Scope$Child.class, id = 1123)
@Persistable(clazz = AliasAnalysis$Graph$Scope.class, id = 1124)
@Persistable(clazz = AliasAnalysis$Graph$Occurrence$Use.class, id = 1125)
@Persistable(clazz = AliasAnalysis$Graph$Occurrence$Def.class, id = 1126)
public final class PassPersistance {
private PassPersistance() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.UUID;
import java.util.jar.Attributes;

import org.enso.compiler.core.Persistance;
import org.enso.compiler.core.ir.expression.Application;
import org.enso.compiler.core.ir.expression.Case;
Expand All @@ -16,6 +19,7 @@
import org.enso.compiler.core.ir.type.Set;
import org.enso.interpreter.dsl.Persistable;
import org.openide.util.lookup.ServiceProvider;

import scala.Option;
import scala.Tuple2;
import scala.collection.Iterator;
Expand Down Expand Up @@ -49,6 +53,8 @@
@Persistable(clazz = Set.Union.class, id = 772)
@Persistable(clazz = Foreign.Definition.class, id = 781)
@Persistable(clazz = Type.Function.class, id = 782)
@Persistable(clazz = Name.BuiltinAnnotation.class, id = 783)
@Persistable(clazz = Type.Error.class, id = 784)
public final class IrPersistance {
private IrPersistance() {}

Expand All @@ -70,6 +76,24 @@ protected IdentifiedLocation readObject(Input in) throws IOException, ClassNotFo
}
}

@ServiceProvider(service = Persistance.class)
public static final class PersistUUID extends Persistance<UUID> {
public PersistUUID() {
super(UUID.class, false, 27);
}

@Override
protected void writeObject(UUID obj, Output out) throws IOException {
out.writeUTF(obj.toString());
}

@Override
protected UUID readObject(Input in) throws IOException, ClassNotFoundException {
var str = in.readUTF();
return UUID.fromString(str);
}
}

@ServiceProvider(service = Persistance.class)
public static final class PersistScalaOption extends Persistance<Option> {
public PersistScalaOption() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ public record Metadata(
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$Intersect.class, id=33018)
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$AllowedResolution.class, id=33019)
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$All$.class, id=33020)
@Persistable(clazz=BindingsMap.Resolution.class, id=33021)
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$Hiding.class, id=33021)
@Persistable(clazz=BindingsMap.Resolution.class, id=33029)
@Persistable(clazz=BindingsMap.ResolvedConstructor.class, id=33030)
@Persistable(clazz=BindingsMap.ResolvedPolyglotSymbol.class, id=33031)
@Persistable(clazz=BindingsMap.ResolvedPolyglotField.class, id=33032)
@ServiceProvider(service = Persistance.class)
public static final class PersistBindingsMap extends Persistance<BindingsMap> {
public PersistBindingsMap() {
Expand Down

0 comments on commit 5413e2f

Please sign in to comment.