-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Currently the parameters to configureAll are all nullable references, following the convention of using nullable references in the inputs to core Wasm instructions. However, passing a null value for the prototypes, methods, or data array references is currently an error. We could make these parameters non-nullable if there were any benefit. (In contrast, passing a null value for the constructors object is fine if there are no configured constructors.)
Furthermore, both the prototypes array and methods array contain nullable references. It is an error for a method in the methods array to be null, but we currently allow null values in the prototypes array. Allowing null prototypes is maximally flexible but questionably useful, so we could make the elements of either or both of these arrays non-nullable as well. This is more likely to have a performance impact because this would let us elide many more null checks.
Actually using configureAll on the intended hot path (using array.new_elem) with non-nullable array elements would be blocked on Binaryen supporting non-nullable segment types, which we should probably do anyway (WebAssembly/binaryen#5628).