WebAssembly / WebAssembly/binaryen

Further enhancements to ExpressionRunner

Open
#2,786 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interpreter
Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

I've meanwhile integrated the new ExpressionRunner (https://github.com/WebAssembly/binaryen/pull/2702) and it does what I've been hoping for, except for one edge case:

The expression runner allows to evaluate just the value of an expression, but if we have code like

(block
 (drop
  (local.get $0)
 )
 (i32.const 0)
)

and there is no known value for the local.get, it considers the expression a NONCONSTANT_FLOW and stops, instead of recognizing that the local.get is being dropped anyway, returning i32.const(0). Have looked at the code again, but supporting this seems like a non-trivial change. Any suggestions?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ExpressionRunner implementation and its existing tests, focusing on how unknown local.get expressions are classified inside dropped expressions. Reproduce the WAT example and trace the NONCONSTANT_FLOW result; done means the dropped unknown value no longer prevents the surrounding expression from evaluating to i32.const(0), with regression coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.