Let StarlarkSemantics memoize the hashCode(). This is used as part of the
MethodDescriptorKey of a FuncallExpression and thus performance is critical.
RELNOTES: None.
package com.google.devtools.build.lib.syntax;
import com.google.auto.value.AutoValue;
+import com.google.auto.value.extension.memoized.Memoized;
import com.google.common.base.Ascii;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@@ -203,6 +204,10 @@ public abstract class StarlarkSemantics {
public abstract boolean incompatibleRestrictStringEscapes();
+ @Memoized
+ @Override
+ public abstract int hashCode();
+
/** Returns a {@link Builder} initialized with the values of this instance. */
public abstract Builder toBuilder();
