diff options
author | Alon Zakai <azakai@google.com> | 2021-04-20 18:03:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 18:03:54 -0700 |
commit | eb2581d89fee86ac11a1452a946f9c69d4173a48 (patch) | |
tree | 7e36052d5a1a2aaf75d00bc8b952e3ed9d26d00c /src/compiler-support.h | |
parent | 304658d67102d3ddd5aa8ea59bcc94402d8338b8 (diff) | |
download | binaryen-eb2581d89fee86ac11a1452a946f9c69d4173a48.tar.gz binaryen-eb2581d89fee86ac11a1452a946f9c69d4173a48.tar.bz2 binaryen-eb2581d89fee86ac11a1452a946f9c69d4173a48.zip |
Refactor Child*Iterator for simplicity and to allow modifications. NFC (#3826)
Instead of creating a class and doing a traversal, simply use
wasm-delegates-fields to get the children directly. This is simpler and
faster.
This requires a new way to override the behavior by ChildValueIterator.
I ended up using CRTP.
This stores pointers to the children instead of the children. This will
allow modifying the children using these classes (which is the reason
I started this refactoring - next PR will use it). This is also slightly
faster in theory as we avoid doing loads from memory to find the
children (which maybe we never get to doing if the iteration is stopped
early).
Not the goal here, but this speeds up roundtripping by 12%.
This is NFC as nothing uses the new ability to modify things yet.
Diffstat (limited to 'src/compiler-support.h')
0 files changed, 0 insertions, 0 deletions