diff options
author | Alon Zakai <azakai@google.com> | 2021-10-20 09:51:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 16:51:40 +0000 |
commit | 24226e6fc3250300e484c8cbe9d1090be5be5dc0 (patch) | |
tree | 3163e045f7e8f028547c045c752d139109110083 /test/binaryen.js/zero-filled-memory.js | |
parent | 055ac806810c1355b2f9b807a7c51cd1bbfbf4ce (diff) | |
download | binaryen-24226e6fc3250300e484c8cbe9d1090be5be5dc0.tar.gz binaryen-24226e6fc3250300e484c8cbe9d1090be5be5dc0.tar.bz2 binaryen-24226e6fc3250300e484c8cbe9d1090be5be5dc0.zip |
[Wasm GC] Global Type Optimization: Remove unread fields (#4255)
Add struct.get tracking, and if a field is never read from, simply remove
it.
This will error if a field is written using struct.new with a value with side
effects. It is not clear we can handle that, as if the struct.new is in a
global then we can't save the other values to locals etc. to reorder
things. We could perhaps use other globals for it (ugh) but at least for
now, that corner case does not happen on any code I can see.
This allows a quite large code size reduction on j2wasm output (20%). The
reason is that many vtable fields are not actually read, and so removing
them and the ref.func they hold allows us to get rid of those functions,
and code that they reach.
Diffstat (limited to 'test/binaryen.js/zero-filled-memory.js')
0 files changed, 0 insertions, 0 deletions