summaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-08-31 08:21:51 -0700
committerGitHub <noreply@github.com>2022-08-31 08:21:51 -0700
commit8e1abd1eff79fa25f0dda7ccb529f672f0d90388 (patch)
treed8ccab7a8d7a01a4bbddef273952f028b8a87d0e /CHANGELOG.md
parentda24ef6ed7055f64299fce22a051ba0e85284c23 (diff)
downloadbinaryen-8e1abd1eff79fa25f0dda7ccb529f672f0d90388.tar.gz
binaryen-8e1abd1eff79fa25f0dda7ccb529f672f0d90388.tar.bz2
binaryen-8e1abd1eff79fa25f0dda7ccb529f672f0d90388.zip
[Wasm GC] Support non-nullable locals in the "1a" form (#4959)
An overview of this is in the README in the diff here (conveniently, it is near the top of the diff). Basically, we fix up nn locals after each pass, by default. This keeps things easy to reason about - what validates is what is valid wasm - but there are some minor nuances as mentioned there, in particular, we ignore nameless blocks (which are commonly added by various passes; ignoring them means we can keep more locals non-nullable). The key addition here is LocalStructuralDominance which checks which local indexes have the "structural dominance" property of 1a, that is, that each get has a set in its block or an outer block that precedes it. I optimized that function quite a lot to reduce the overhead of running that logic after each pass. The overhead is something like 2% on J2Wasm and 0% on Dart (0%, because in this mode we shrink code size, so there is less work actually, and it balances out). Since we run fixups after each pass, this PR removes logic to manually call the fixup code from various places we used to call it (like eh-utils and various passes). Various passes are now marked as requiresNonNullableLocalFixups => false. That lets us skip running the fixups after them, which we normally do automatically. This helps avoid overhead. Most passes still need the fixups, though - any pass that adds a local, or a named block, or moves code around, likely does. This removes a hack in SimplifyLocals that is no longer needed. Before we worked to avoid moving a set into a try, as it might not validate. Now, we just do it and let fixups happen automatically if they need to: in the common code they probably don't, so the extra complexity seems not worth it. Also removes a hack from StackIR. That hack tried to avoid roundtrip adding a nondefaultable local. But we have the logic to fix that up now, and opts will likely keep it non-nullable as well. Various tests end up updated here because now a local can be non-nullable - previous fixups are no longer needed. Note that this doesn't remove the gc-nn-locals feature. That has been useful for testing, and may still be useful in the future - it basically just allows nn locals in all positions (that can't read the null default value at the entry). We can consider removing it separately. Fixes #4824
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7e005f6e8..04f4525ff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ full changeset diff at the end of each section.
Current Trunk
-------------
+- Add support for non-nullable locals in wasm GC.
- Add a new flag to Directize, `--pass-arg=directize-initial-contents-immutable`
which indicates the initial table contents are immutable. That is the case for
LLVM, for example, and it allows us to optimize more indirect calls to direct