mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
b40ac20343
This commit implements a framework for creating 'intrinsics' which are natively implemented functions that are exposable as wasm functions that can be called or linked against. A simple 8-bit vector product for flexible vectors is implemented as a proof of concept. The basic API is: ``` let module = wasmIntrinsicI8VecMul(); // WebAssembly.Module let memory = new WebAssembly.Module({ initial: pageSize }); let instance = new WebAssembly.Instance(module, { "": { memory } }); instance.exports.i8vecmul(dest, src1, src2, len); ``` The implementation is mainly done through `CompileIntrisicModule` which manually builds a ModuleEnvironment with an imported memory, and a single exported function which is of the bytecode form: ``` (func (params ...) local.get 0 ... local.get n private_intrinsic_opcode ) ``` The private_intrinsic_opcode is implemented as an instance call. An additional heap base parameter is added which allows quick bounds checking, similar to Instance::memory32Copy. A followup will implement the intrinsic for the firefox translations project. Differential Revision: https://phabricator.services.mozilla.com/D119919 |
||
---|---|---|
.. | ||
ductwork/debugger | ||
examples | ||
public | ||
src | ||
xpconnect | ||
app.mozbuild | ||
ffi.configure | ||
moz.build | ||
moz.configure | ||
sub.configure |