Skip to content

Commit

Permalink
Usage of Map & co. must be behind @TruffleBoundary
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Dec 20, 2024
1 parent e2760ff commit 630ec62
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ private MultiType(Type[] types) {
this.types = types;
}

@TruffleBoundary
static MultiType create(Type[] types, int from, int to) {
var mt = new MultiType(Arrays.copyOfRange(types, from, to));
return ALL_TYPES.computeIfAbsent(mt, java.util.function.Function.identity());
Expand All @@ -545,13 +546,15 @@ private int find(EnsoContext ctx, Type type) {
}

@Override
@TruffleBoundary
public int hashCode() {
int hash = 7;
hash = 89 * hash + Arrays.deepHashCode(this.types);
return hash;
}

@Override
@TruffleBoundary
public boolean equals(Object obj) {
if (this == obj) {
return true;
Expand Down Expand Up @@ -579,6 +582,7 @@ private Type[] allTypesWith(MultiType nextOrNull) {
}

@Override
@TruffleBoundary
public String toString() {
return "MultiType{" + "types=" + Arrays.toString(types) + '}';
}
Expand Down

0 comments on commit 630ec62

Please sign in to comment.