[Service] Apply WebAssembly.compileForCaching() 60/294260/5
authorDongHyun Song <dh81.song@samsung.com>
Thu, 15 Jun 2023 06:35:40 +0000 (15:35 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Thu, 15 Jun 2023 10:03:28 +0000 (19:03 +0900)
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>
node_modules/typescript/lib/lib.dom.d.ts
wrt_app/service/builtins/wasm_builder.ts

index 56e99f0..0d9afde 100644 (file)
@@ -19082,6 +19082,8 @@ declare namespace WebAssembly {
     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>;
index b9ceca9..3ec7fe8 100644 (file)
@@ -9,7 +9,7 @@ function compileWasmForCaching(files: string[]) {
       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})`);