Stream: git-wasmtime

Topic: wasmtime / PR #5295 cranelift-isle: Specialize for Term a...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2022 at 00:23):

jameysharp requested fitzgen for a review on PR #5295.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2022 at 00:23):

jameysharp opened PR #5295 from isle-root-term to main:

In #5174 we decided it doesn't make sense for a rule to have a bind-pattern at the root of its left-hand side. There's no Rust value corresponding to the root value of such a term, because it actually represents a function declaration with one or more arguments.

This commit takes that to its logical conclusion.

sema::Rule previously had an lhs field whose value must always be a Pattern::Term variant, and anyone using that structure had to deal with the possibility of finding the wrong variant there.

Now the relevant fields from that variant are stored directly in Rule instead. Also, the (tiny!) portion of translate_pattern which applied when the pattern was the root term is now inlined in collect_rules.

Because translate_pattern no longer has to special-case the root term, we can delete its rule_term and is_root arguments. That brings it down to a more manageable four arguments, which means many calls fit on one line now.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2022 at 19:00):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2022 at 19:21):

jameysharp merged PR #5295.


Last updated: Nov 22 2024 at 16:03 UTC