mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 16:41:45 +03:00
Introduce hash seed to invaldiate caches (#9082)
This commit is contained in:
parent
642d5a691e
commit
fe0f9046db
@ -171,6 +171,10 @@ Every `Persistance` class has a unique identifier. In order to keep definitions
|
||||
consistent one should not attempt to use smaller `id`s than previously assigned.
|
||||
One should also not delete any `Persistance` classes.
|
||||
|
||||
Additionally, `PerMap.serialVersionUID` version provides a seed to the version
|
||||
stamp calculated from all `Persistance` classes. Increasing the
|
||||
`serialVersionUID` will invalidate all caches.
|
||||
|
||||
## Loading the IR
|
||||
|
||||
Loading the IR is a multi-stage process that involves performing integrity
|
||||
|
@ -21,10 +21,6 @@ import scala.annotation.unused
|
||||
* @param definedEntities the list of entities defined in the current module
|
||||
* @param currentModule the module holding these bindings
|
||||
*/
|
||||
|
||||
@SerialVersionUID(
|
||||
9057L // Use BindingsMap
|
||||
)
|
||||
case class BindingsMap(
|
||||
definedEntities: List[DefinedEntity],
|
||||
currentModule: ModuleReference
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.enso.compiler.core;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
import org.enso.compiler.core.ir.DiagnosticStorage;
|
||||
@ -28,9 +27,7 @@ import scala.collection.immutable.List;
|
||||
*
|
||||
* <p>See also: Note [IR Equality and hashing]
|
||||
*/
|
||||
public interface IR extends Serializable {
|
||||
|
||||
long serialVersionUID = 9057L; // Scala to Java
|
||||
public interface IR {
|
||||
|
||||
/**
|
||||
* Storage for metadata that the node has been tagged with as the result of various compiler
|
||||
|
@ -19,9 +19,6 @@ import java.util.UUID
|
||||
* @param passData the pass metadata associated with this node
|
||||
* @param diagnostics compiler diagnostics for this node
|
||||
*/
|
||||
@SerialVersionUID(
|
||||
9057L // Use BindingsMap
|
||||
) // prevents reading broken caches, see PR-3692 for details
|
||||
final case class Module(
|
||||
imports: List[Import],
|
||||
exports: List[Export],
|
||||
|
@ -7,6 +7,8 @@ import java.util.Map;
|
||||
import org.openide.util.lookup.Lookups;
|
||||
|
||||
final class PerMap {
|
||||
|
||||
private static final int serialVersionUID = 8689; // Use PR number
|
||||
private static final Collection<? extends Persistance> ALL;
|
||||
|
||||
static {
|
||||
@ -20,7 +22,7 @@ final class PerMap {
|
||||
final int versionStamp;
|
||||
|
||||
private PerMap() {
|
||||
int hash = 0;
|
||||
int hash = serialVersionUID;
|
||||
for (var orig : ALL) {
|
||||
var p = orig.newClone();
|
||||
var prevId = ids.put(p.id, p);
|
||||
|
Loading…
Reference in New Issue
Block a user