bytecodealliance / bytecodealliance/wasmtime

Deduplicate translation of constant expressions and general operators in func_environ.rs

Open
#13,501 0 comments 0 reactions 0 assignees View on GitHub
enhancement wasmtime
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

In https://github.com/bytecodealliance/wasmtime/pull/13487 the processing of `ConstExpr` has moved from the runtime to compiled code. As pointed out [here](https://github.com/bytecodealliance/wasmtime/pull/13487#discussion_r3313862045), however, this results in some duplication of processing `ConstOp` internally within Wasmtime. It should in theory be possible to more-or-less implement `From for wasmparser::Operator` and reuse the existing operator translation in `FuncEnvironment` instead of duplicating it in `translate_const_expr`. This isn't being done in #13487, but it's still a worthwhile thing to look into in the future. The main blocker right now is creation of the `FuncValidator` which `translate_operator` requires, likely resulting in modifications to `wasmparser` to create a special kind of validator for const expressions (or something like that)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.