compileForCaching() has been introduced to fix wasm caching
issue from:
https://review.tizen.org/gerrit/293822/
Change-Id: I93e3cba22da23ff222e9514b2e3a21249d9463bd
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
type ModuleImports = Record<string, ImportValue>;
type Imports = Record<string, ModuleImports>;
function compile(bytes: BufferSource): Promise<Module>;
+ /** compileForCaching has been introduced for wasm caching builtin service **/
+ function compileForCaching(bytes: BufferSource): Promise<Module>;
function compileStreaming(source: Response | Promise<Response>): Promise<Module>;
function instantiate(bytes: BufferSource, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;
function instantiate(moduleObject: Module, importObject?: Imports): Promise<Instance>;
console.debug(`Requesting WASM compilation for building a cache, file_path:(${filePath})`);
let source = fs.readFileSync(filePath);
let file = new Uint8Array(source);
- await WebAssembly.compile(file);
+ await WebAssembly.compileForCaching(file);
});
} catch (e) {
console.error(`An error occurred while compiling a wasm module. error:(${e})`);