In #13487 the processing of ConstExpr has moved from the runtime to compiled code. As pointed out here, however, this results in some duplication of processing ConstOp internally within Wasmtime. It should in theory be possible to more-or-less implement From<ConstOp> 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)
In #13487 the processing of
ConstExprhas moved from the runtime to compiled code. As pointed out here, however, this results in some duplication of processingConstOpinternally within Wasmtime. It should in theory be possible to more-or-less implementFrom<ConstOp> for wasmparser::Operatorand reuse the existing operator translation inFuncEnvironmentinstead of duplicating it intranslate_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 theFuncValidatorwhichtranslate_operatorrequires, likely resulting in modifications towasmparserto create a special kind of validator for const expressions (or something like that)