From 32987854369f2386c4befd5c3c64b675473f526b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Fri, 11 Oct 2024 11:27:54 +0200 Subject: [PATCH] rust benchmark wip --- frontend/render_v2/rs/src/main.rs | 133 +++++--- .../src/app/main/ui/workspace/viewport.cljs | 4 +- frontend/src/app/render_v2/rs.cljs | 6 +- frontend/src/app/render_v2/rs.js | 308 +++++++----------- 4 files changed, 210 insertions(+), 241 deletions(-) diff --git a/frontend/render_v2/rs/src/main.rs b/frontend/render_v2/rs/src/main.rs index 4738aa7784..6d49ffd0fb 100644 --- a/frontend/render_v2/rs/src/main.rs +++ b/frontend/render_v2/rs/src/main.rs @@ -1,9 +1,16 @@ -use std::boxed::Box; +// use skia_safe::{ +// gpu::{self, gl::FramebufferInfo, DirectContext}, +// textlayout::{ +// FontCollection, ParagraphBuilder, ParagraphStyle, TextStyle, TypefaceFontProvider, +// }, +// Canvas, Data, EncodedImageFormat, FontMgr, Paint, PaintStyle, Path, SurfaceProps, +// }; use skia_safe::{ gpu::{self, gl::FramebufferInfo, DirectContext}, - textlayout::{FontCollection, ParagraphBuilder, ParagraphStyle, TextStyle, TypefaceFontProvider}, - FontMgr, Paint, Path, PaintStyle, EncodedImageFormat, Data, Canvas, SurfaceProps + textlayout::TypefaceFontProvider, + PaintStyle, }; +use std::boxed::Box; use skia_safe as skia; @@ -29,12 +36,22 @@ pub struct State { gpu_state: GpuState, surface: skia::Surface, typeface_font_provider: TypefaceFontProvider, - default_font: skia_safe::Font + default_font: skia_safe::Font, } impl State { - fn new(gpu_state: GpuState, surface: skia::Surface, typeface_font_provider: TypefaceFontProvider, default_font: skia_safe::Font) -> Self { - State { gpu_state, surface, typeface_font_provider, default_font } + fn new( + gpu_state: GpuState, + surface: skia::Surface, + typeface_font_provider: TypefaceFontProvider, + default_font: skia_safe::Font, + ) -> Self { + State { + gpu_state, + surface, + typeface_font_provider, + default_font, + } } fn set_surface(&mut self, surface: skia::Surface) { @@ -105,15 +122,15 @@ pub extern "C" fn init(width: i32, height: i32) -> Box { // skia_safe::Font::default() is empty, let's use something better let font_mgr = skia_safe::FontMgr::new(); let typeface = font_mgr - .new_from_data(ROBOTO_REGULAR, None) - .expect("Failed to load ROBOTO font"); + .new_from_data(ROBOTO_REGULAR, None) + .expect("Failed to load ROBOTO font"); let default_font = skia_safe::Font::new(typeface.clone(), 10.0); let typeface_font_provider = { - let mut typeface_font_provider = TypefaceFontProvider::new(); - // We need a system font manager to be able to load typefaces. - typeface_font_provider.register_typeface(typeface, TYPEFACE_ALIAS); - typeface_font_provider + let mut typeface_font_provider = TypefaceFontProvider::new(); + // We need a system font manager to be able to load typefaces. + typeface_font_provider.register_typeface(typeface, TYPEFACE_ALIAS); + typeface_font_provider }; let state = State::new(gpu_state, surface, typeface_font_provider, default_font); @@ -153,7 +170,7 @@ pub struct Rect { #[no_mangle] pub extern "C" fn alloc_rects(len: usize) -> *mut Rect { // create a new mutable buffer with capacity `len` - let mut buf : Vec = Vec::with_capacity(len); + let mut buf: Vec = Vec::with_capacity(len); let ptr = buf.as_mut_ptr(); // take ownership of the memory block and ensure the its destructor is not // called when the object goes out of scope at the end of the function @@ -167,7 +184,6 @@ pub unsafe fn free_rects(ptr: *mut Rect, len: usize) { std::mem::forget(buf); } - /// Draws a rect at the specified coordinates with the give ncolor /// # Safety #[no_mangle] @@ -199,7 +215,6 @@ pub unsafe extern "C" fn scale(state: *mut State, sx: f32, sy: f32) { #[no_mangle] pub unsafe extern "C" fn reset_canvas(state: *mut State) { - println!("reset_canvas"); let state = unsafe { state.as_mut() }.expect("got an invalid state pointer"); state.surface.canvas().clear(skia_safe::Color::TRANSPARENT); state.surface.canvas().reset_matrix(); @@ -207,7 +222,14 @@ pub unsafe extern "C" fn reset_canvas(state: *mut State) { } #[no_mangle] -pub unsafe extern "C" fn draw_shapes(state: *mut State, ptr: *mut Rect, len: usize, zoom: f32, dx: f32, dy: f32) { +pub unsafe extern "C" fn draw_shapes( + state: *mut State, + ptr: *mut Rect, + len: usize, + zoom: f32, + dx: f32, + dy: f32, +) { let state = unsafe { state.as_mut() }.expect("got an invalid state pointer"); reset_canvas(state); scale(state, zoom, zoom); @@ -226,50 +248,62 @@ pub unsafe extern "C" fn draw_shapes(state: *mut State, ptr: *mut Rect, len: usi path_paint.set_stroke_width(1.0); path_paint.set_style(PaintStyle::Stroke); - let svg_canvas = skia_safe::svg::Canvas::new(skia_safe::Rect::from_size((10000, 10000)), None); + // let svg_canvas = skia_safe::svg::Canvas::new(skia_safe::Rect::from_size((10000, 10000)), None); - let mut memory = Vec::new(); - let mut document = skia_safe::pdf::new_document(&mut memory, None).begin_page((10000, 10000), None); - let pdf_canvas = document.canvas(); + // let mut memory = Vec::new(); + // let mut document = + // skia_safe::pdf::new_document(&mut memory, None).begin_page((10000, 10000), None); + // // let pdf_canvas = document.canvas(); for rect in buf.iter() { let r = skia::Rect::new(rect.left, rect.top, rect.right, rect.bottom); - let color = skia::Color::from_argb((rect.a * 255.0) as u8, rect.r as u8, rect.g as u8, rect.b as u8); + let color = skia::Color::from_argb( + (rect.a * 255.0) as u8, + rect.r as u8, + rect.g as u8, + rect.b as u8, + ); render_rect(&mut state.surface, r, color); let mut paint = skia::Paint::default(); paint.set_style(skia::PaintStyle::Fill); paint.set_color(color); paint.set_anti_alias(true); - svg_canvas.draw_rect(r, &paint); - pdf_canvas.draw_rect(r, &paint); + // svg_canvas.draw_rect(r, &paint); + // pdf_canvas.draw_rect(r, &paint); text_paint.set_color(color); - state.surface.canvas().draw_str("SKIA TEXT", (rect.left, rect.top), &state.default_font, &text_paint); - svg_canvas.draw_str("SKIA TEXT", (rect.left, rect.top), &state.default_font, &text_paint); - pdf_canvas.draw_str("SKIA TEXT", (rect.left, rect.top), &state.default_font, &text_paint); + state.surface.canvas().draw_str( + "SKIA TEXT", + (rect.left, rect.top), + &state.default_font, + &text_paint, + ); + // svg_canvas.draw_str("SKIA TEXT", (rect.left, rect.top), &state.default_font, &text_paint); + // pdf_canvas.draw_str("SKIA TEXT", (rect.left, rect.top), &state.default_font, &text_paint); - let mut path = Path::new(); - path.move_to((rect.left, rect.top)); - path.line_to((rect.right, rect.bottom)); - state.surface.canvas().draw_path(&path, &path_paint); - svg_canvas.draw_path(&path, &path_paint); - pdf_canvas.draw_path(&path, &path_paint); + // let mut path = Path::new(); + // path.move_to((rect.left, rect.top)); + // path.line_to((rect.right, rect.bottom)); + // state.surface.canvas().draw_path(&path, &path_paint); + // svg_canvas.draw_path(&path, &path_paint); + // pdf_canvas.draw_path(&path, &path_paint); - // https://github.com/rust-skia/rust-skia/blob/02c89a87649af8d2870fb631aae4a5e171887367/skia-org/src/skparagraph_example.rs#L18 - let mut font_collection = FontCollection::new(); - font_collection.set_default_font_manager(Some(state.typeface_font_provider.clone().into()), None); - let paragraph_style = ParagraphStyle::new(); - let mut paragraph_builder = ParagraphBuilder::new(¶graph_style, font_collection); - let mut ts = TextStyle::new(); - ts.set_foreground_paint(&Paint::default()) - .set_font_families(&[TYPEFACE_ALIAS]); - paragraph_builder.push_style(&ts); - paragraph_builder.add_text("Other skia text"); - let mut paragraph = paragraph_builder.build(); - paragraph.layout(256.0); - paragraph.paint(state.surface.canvas(), (rect.left, rect.top)); - paragraph.paint(&svg_canvas, (rect.left, rect.top)); + // https://github.com/rust-skia/rust-skia/blob/02c89a87649af8d2870fb631aae4a5e171887367/skia-org/src/skparagraph_example.rs#L18 + // let mut font_collection = FontCollection::new(); + // font_collection + // .set_default_font_manager(Some(state.typeface_font_provider.clone().into()), None); + // let paragraph_style = ParagraphStyle::new(); + // let mut paragraph_builder = ParagraphBuilder::new(¶graph_style, font_collection); + // let mut ts = TextStyle::new(); + // ts.set_foreground_paint(&Paint::default()) + // .set_font_families(&[TYPEFACE_ALIAS]); + // paragraph_builder.push_style(&ts); + // paragraph_builder.add_text("Other skia text"); + // let mut paragraph = paragraph_builder.build(); + // paragraph.layout(256.0); + // paragraph.paint(state.surface.canvas(), (rect.left, rect.top)); + // paragraph.paint(&svg_canvas, (rect.left, rect.top)); } /* @@ -277,7 +311,7 @@ pub unsafe extern "C" fn draw_shapes(state: *mut State, ptr: *mut Rect, len: usi let image = state.surface.image_snapshot(); let mut context = state.surface.direct_context(); let encoded_image = image.encode(context.as_mut(), EncodedImageFormat::PNG, None).unwrap(); - let base64_image = base64::encode(&encoded_image.as_bytes()); + let base64_image = base64::encode(&encoded_image.as_bytes()); println!("data:image/png;base64,{}", base64_image); // SVG representation @@ -302,8 +336,3 @@ pub unsafe extern "C" fn draw_shapes(state: *mut State, ptr: *mut Rect, len: usi fn main() { init_gl(); } - -#[cfg(test)] -mod tests { - use super::*; -} diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index a4ee20d09c..b7d5944101 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -272,9 +272,9 @@ (when (render-v2/is-enabled?) ;; set up canvas and first render (mf/with-effect - [canvas-ref] + [canvas-ref vbox'] (let [canvas (mf/ref-val canvas-ref)] - (when (some? canvas) + (when (and (some? canvas) (some? vbox')) (-> (p/then (render-v2/init) (fn [] (mf/set-ref-val! canvas-init? true) diff --git a/frontend/src/app/render_v2/rs.cljs b/frontend/src/app/render_v2/rs.cljs index a003a55d3c..3cc669ab00 100644 --- a/frontend/src/app/render_v2/rs.cljs +++ b/frontend/src/app/render_v2/rs.cljs @@ -26,6 +26,7 @@ scale (gobj/get ^js internal-module "_scale") flush (gobj/get ^js internal-module "_flush") draw-shapes (gobj/get ^js internal-module "_draw_shapes")] + (js/console.log "vbox" vbox "zoom" zoom) (js/requestAnimationFrame (fn [] (draw-shapes gpu-state shapes-ptr shapes-size zoom (- (:x vbox)) (- (:y vbox))))))) @@ -73,13 +74,12 @@ (set! (.-width canvas) (.-clientWidth canvas)) (set! (.-height canvas) (.-clientHeight canvas)) (set! gpu-state state) - (set-objects vbox zoom objects) - (println "set-canvas ok" (.-width canvas) (.-height canvas)))) + (set-objects vbox zoom objects))) (defn on-init [module'] (set! internal-module module') - (println "on-init ok")) + ) (defn init [] diff --git a/frontend/src/app/render_v2/rs.js b/frontend/src/app/render_v2/rs.js index 4ae16ba380..a4c27962cd 100644 --- a/frontend/src/app/render_v2/rs.js +++ b/frontend/src/app/render_v2/rs.js @@ -700,7 +700,7 @@ function createWasm() { } } - if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary(); + wasmBinaryFile ??= findWasmBinary(); // If instantiation fails, reject the module ready promise. instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch(readyPromiseReject); @@ -752,45 +752,51 @@ function isExportedByForceFilesystem(name) { name === 'removeRunDependency'; } -function missingGlobal(sym, msg) { - if (typeof globalThis != 'undefined') { +/** + * Intercept access to a global symbol. This enables us to give informative + * warnings/errors when folks attempt to use symbols they did not include in + * their build, or no symbols that no longer exist. + */ +function hookGlobalSymbolAccess(sym, func) { + if (typeof globalThis != 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) { Object.defineProperty(globalThis, sym, { configurable: true, get() { - warnOnce(`\`${sym}\` is not longer defined by emscripten. ${msg}`); + func(); return undefined; } }); } } +function missingGlobal(sym, msg) { + hookGlobalSymbolAccess(sym, () => { + warnOnce(`\`${sym}\` is not longer defined by emscripten. ${msg}`); + }); +} + missingGlobal('buffer', 'Please use HEAP8.buffer or wasmMemory.buffer'); missingGlobal('asm', 'Please use wasmExports instead'); function missingLibrarySymbol(sym) { - if (typeof globalThis != 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) { - Object.defineProperty(globalThis, sym, { - configurable: true, - get() { - // Can't `abort()` here because it would break code that does runtime - // checks. e.g. `if (typeof SDL === 'undefined')`. - var msg = `\`${sym}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`; - // DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in - // library.js, which means $name for a JS name with no prefix, or name - // for a JS name like _name. - var librarySymbol = sym; - if (!librarySymbol.startsWith('_')) { - librarySymbol = '$' + sym; - } - msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`; - if (isExportedByForceFilesystem(sym)) { - msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; - } - warnOnce(msg); - return undefined; - } - }); - } + hookGlobalSymbolAccess(sym, () => { + // Can't `abort()` here because it would break code that does runtime + // checks. e.g. `if (typeof SDL === 'undefined')`. + var msg = `\`${sym}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`; + // DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in + // library.js, which means $name for a JS name with no prefix, or name + // for a JS name like _name. + var librarySymbol = sym; + if (!librarySymbol.startsWith('_')) { + librarySymbol = '$' + sym; + } + msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`; + if (isExportedByForceFilesystem(sym)) { + msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; + } + warnOnce(msg); + }); + // Any symbol that is not included from the JS library is also (by definition) // not exported on the Module object. unexportedRuntimeSymbol(sym); @@ -2140,6 +2146,8 @@ function dbg(...args) { }, filesystems:null, syncFSRequests:0, + readFiles:{ + }, FSStream:class { constructor() { // TODO(https://github.com/emscripten-core/emscripten/issues/21414): @@ -3039,7 +3047,6 @@ function dbg(...args) { stream.stream_ops.open(stream); } if (Module['logReadFiles'] && !(flags & 1)) { - if (!FS.readFiles) FS.readFiles = {}; if (!(path in FS.readFiles)) { FS.readFiles[path] = 1; } @@ -3460,7 +3467,7 @@ function dbg(...args) { createDevice(parent, name, input, output) { var path = PATH.join2(typeof parent == 'string' ? parent : FS.getPath(parent), name); var mode = FS_getMode(!!input, !!output); - if (!FS.createDevice.major) FS.createDevice.major = 64; + FS.createDevice.major ??= 64; var dev = FS.makedev(FS.createDevice.major++, 0); // Create a fake device that a set of stream ops to emulate // the old behavior. @@ -4013,34 +4020,16 @@ function dbg(...args) { throw new EmscriptenSjLj; }; + + + + + var convertI32PairToI53Checked = (lo, hi) => { assert(lo == (lo >>> 0) || lo == (lo|0)); // lo should either be a i32 or a u32 assert(hi === (hi|0)); // hi should be a i32 return ((hi + 0x200000) >>> 0 < 0x400001 - !!lo) ? (lo >>> 0) + hi * 4294967296 : NaN; }; - function __gmtime_js(time_low, time_high,tmPtr) { - var time = convertI32PairToI53Checked(time_low, time_high); - - - var date = new Date(time * 1000); - HEAP32[((tmPtr)>>2)] = date.getUTCSeconds(); - HEAP32[(((tmPtr)+(4))>>2)] = date.getUTCMinutes(); - HEAP32[(((tmPtr)+(8))>>2)] = date.getUTCHours(); - HEAP32[(((tmPtr)+(12))>>2)] = date.getUTCDate(); - HEAP32[(((tmPtr)+(16))>>2)] = date.getUTCMonth(); - HEAP32[(((tmPtr)+(20))>>2)] = date.getUTCFullYear()-1900; - HEAP32[(((tmPtr)+(24))>>2)] = date.getUTCDay(); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = ((date.getTime() - start) / (1000 * 60 * 60 * 24))|0; - HEAP32[(((tmPtr)+(28))>>2)] = yday; - ; - } - - - - - - function __mmap_js(len,prot,flags,fd,offset_low, offset_high,allocated,addr) { var offset = convertI32PairToI53Checked(offset_low, offset_high); @@ -4135,12 +4124,7 @@ function dbg(...args) { var _emscripten_date_now = () => Date.now(); - var _emscripten_get_now; - // Modern environment where performance.now() is supported: - // N.B. a shorter form "_emscripten_get_now = performance.now;" is - // unfortunately not allowed even in current browsers (e.g. FF Nightly 75). - _emscripten_get_now = () => performance.now(); - ; + var _emscripten_get_now = () => performance.now(); var GLctx; @@ -7992,8 +7976,6 @@ var wasmImports = { /** @export */ _emscripten_throw_longjmp: __emscripten_throw_longjmp, /** @export */ - _gmtime_js: __gmtime_js, - /** @export */ _mmap_js: __mmap_js, /** @export */ _munmap_js: __munmap_js, @@ -8864,8 +8846,6 @@ var wasmImports = { /** @export */ invoke_iiff, /** @export */ - invoke_iiffi, - /** @export */ invoke_iii, /** @export */ invoke_iiii, @@ -8898,8 +8878,6 @@ var wasmImports = { /** @export */ invoke_vi, /** @export */ - invoke_vif, - /** @export */ invoke_viffff, /** @export */ invoke_viffi, @@ -8910,8 +8888,6 @@ var wasmImports = { /** @export */ invoke_viif, /** @export */ - invoke_viiff, - /** @export */ invoke_viii, /** @export */ invoke_viiii, @@ -8968,12 +8944,6 @@ var ___cxa_increment_exception_refcount = createExportWrapper('__cxa_increment_e var ___get_exception_message = createExportWrapper('__get_exception_message', 3); var ___cxa_can_catch = createExportWrapper('__cxa_can_catch', 3); var ___cxa_get_exception_ptr = createExportWrapper('__cxa_get_exception_ptr', 1); -var dynCall_iiiji = Module['dynCall_iiiji'] = createExportWrapper('dynCall_iiiji', 6); -var dynCall_ji = Module['dynCall_ji'] = createExportWrapper('dynCall_ji', 2); -var dynCall_iiji = Module['dynCall_iiji'] = createExportWrapper('dynCall_iiji', 5); -var dynCall_iijjiii = Module['dynCall_iijjiii'] = createExportWrapper('dynCall_iijjiii', 9); -var dynCall_iij = Module['dynCall_iij'] = createExportWrapper('dynCall_iij', 4); -var dynCall_vijjjii = Module['dynCall_vijjjii'] = createExportWrapper('dynCall_vijjjii', 10); var dynCall_viji = Module['dynCall_viji'] = createExportWrapper('dynCall_viji', 5); var dynCall_vijiii = Module['dynCall_vijiii'] = createExportWrapper('dynCall_vijiii', 7); var dynCall_viiiiij = Module['dynCall_viiiiij'] = createExportWrapper('dynCall_viiiiij', 8); @@ -8981,6 +8951,7 @@ var dynCall_jii = Module['dynCall_jii'] = createExportWrapper('dynCall_jii', 3); var dynCall_vij = Module['dynCall_vij'] = createExportWrapper('dynCall_vij', 4); var dynCall_jiiiiii = Module['dynCall_jiiiiii'] = createExportWrapper('dynCall_jiiiiii', 7); var dynCall_jiiiiji = Module['dynCall_jiiiiji'] = createExportWrapper('dynCall_jiiiiji', 8); +var dynCall_ji = Module['dynCall_ji'] = createExportWrapper('dynCall_ji', 2); var dynCall_iijj = Module['dynCall_iijj'] = createExportWrapper('dynCall_iijj', 6); var dynCall_iiij = Module['dynCall_iiij'] = createExportWrapper('dynCall_iiij', 5); var dynCall_viij = Module['dynCall_viij'] = createExportWrapper('dynCall_viij', 5); @@ -8994,39 +8965,6 @@ var dynCall_iiiiij = Module['dynCall_iiiiij'] = createExportWrapper('dynCall_iii var dynCall_iiiiijj = Module['dynCall_iiiiijj'] = createExportWrapper('dynCall_iiiiijj', 9); var dynCall_iiiiiijj = Module['dynCall_iiiiiijj'] = createExportWrapper('dynCall_iiiiiijj', 10); -function invoke_iiii(index,a1,a2,a3) { - var sp = stackSave(); - try { - return getWasmTableEntry(index)(a1,a2,a3); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - -function invoke_ii(index,a1) { - var sp = stackSave(); - try { - return getWasmTableEntry(index)(a1); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - -function invoke_vi(index,a1) { - var sp = stackSave(); - try { - getWasmTableEntry(index)(a1); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - function invoke_vii(index,a1,a2) { var sp = stackSave(); try { @@ -9038,54 +8976,10 @@ function invoke_vii(index,a1,a2) { } } -function invoke_v(index) { +function invoke_iiiii(index,a1,a2,a3,a4) { var sp = stackSave(); try { - getWasmTableEntry(index)(); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - -function invoke_viii(index,a1,a2,a3) { - var sp = stackSave(); - try { - getWasmTableEntry(index)(a1,a2,a3); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - -function invoke_viiii(index,a1,a2,a3,a4) { - var sp = stackSave(); - try { - getWasmTableEntry(index)(a1,a2,a3,a4); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - -function invoke_iii(index,a1,a2) { - var sp = stackSave(); - try { - return getWasmTableEntry(index)(a1,a2); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - -function invoke_vifi(index,a1,a2,a3) { - var sp = stackSave(); - try { - getWasmTableEntry(index)(a1,a2,a3); + return getWasmTableEntry(index)(a1,a2,a3,a4); } catch(e) { stackRestore(sp); if (!(e instanceof EmscriptenEH)) throw e; @@ -9104,10 +8998,43 @@ function invoke_viiiii(index,a1,a2,a3,a4,a5) { } } -function invoke_iiiii(index,a1,a2,a3,a4) { +function invoke_vi(index,a1) { var sp = stackSave(); try { - return getWasmTableEntry(index)(a1,a2,a3,a4); + getWasmTableEntry(index)(a1); + } catch(e) { + stackRestore(sp); + if (!(e instanceof EmscriptenEH)) throw e; + _setThrew(1, 0); + } +} + +function invoke_ii(index,a1) { + var sp = stackSave(); + try { + return getWasmTableEntry(index)(a1); + } catch(e) { + stackRestore(sp); + if (!(e instanceof EmscriptenEH)) throw e; + _setThrew(1, 0); + } +} + +function invoke_viii(index,a1,a2,a3) { + var sp = stackSave(); + try { + getWasmTableEntry(index)(a1,a2,a3); + } catch(e) { + stackRestore(sp); + if (!(e instanceof EmscriptenEH)) throw e; + _setThrew(1, 0); + } +} + +function invoke_iii(index,a1,a2) { + var sp = stackSave(); + try { + return getWasmTableEntry(index)(a1,a2); } catch(e) { stackRestore(sp); if (!(e instanceof EmscriptenEH)) throw e; @@ -9137,10 +9064,10 @@ function invoke_viiiiffii(index,a1,a2,a3,a4,a5,a6,a7,a8) { } } -function invoke_iiffi(index,a1,a2,a3,a4) { +function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6) { var sp = stackSave(); try { - return getWasmTableEntry(index)(a1,a2,a3,a4); + return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6); } catch(e) { stackRestore(sp); if (!(e instanceof EmscriptenEH)) throw e; @@ -9148,10 +9075,10 @@ function invoke_iiffi(index,a1,a2,a3,a4) { } } -function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6) { +function invoke_iiii(index,a1,a2,a3) { var sp = stackSave(); try { - return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6); + return getWasmTableEntry(index)(a1,a2,a3); } catch(e) { stackRestore(sp); if (!(e instanceof EmscriptenEH)) throw e; @@ -9214,6 +9141,17 @@ function invoke_iiff(index,a1,a2,a3) { } } +function invoke_viiii(index,a1,a2,a3,a4) { + var sp = stackSave(); + try { + getWasmTableEntry(index)(a1,a2,a3,a4); + } catch(e) { + stackRestore(sp); + if (!(e instanceof EmscriptenEH)) throw e; + _setThrew(1, 0); + } +} + function invoke_iif(index,a1,a2) { var sp = stackSave(); try { @@ -9225,28 +9163,6 @@ function invoke_iif(index,a1,a2) { } } -function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) { - var sp = stackSave(); - try { - getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - -function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) { - var sp = stackSave(); - try { - getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7); - } catch(e) { - stackRestore(sp); - if (!(e instanceof EmscriptenEH)) throw e; - _setThrew(1, 0); - } -} - function invoke_iiiiffii(index,a1,a2,a3,a4,a5,a6,a7) { var sp = stackSave(); try { @@ -9258,10 +9174,10 @@ function invoke_iiiiffii(index,a1,a2,a3,a4,a5,a6,a7) { } } -function invoke_vif(index,a1,a2) { +function invoke_vifi(index,a1,a2,a3) { var sp = stackSave(); try { - getWasmTableEntry(index)(a1,a2); + getWasmTableEntry(index)(a1,a2,a3); } catch(e) { stackRestore(sp); if (!(e instanceof EmscriptenEH)) throw e; @@ -9269,10 +9185,21 @@ function invoke_vif(index,a1,a2) { } } -function invoke_viiff(index,a1,a2,a3,a4) { +function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) { var sp = stackSave(); try { - getWasmTableEntry(index)(a1,a2,a3,a4); + getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6); + } catch(e) { + stackRestore(sp); + if (!(e instanceof EmscriptenEH)) throw e; + _setThrew(1, 0); + } +} + +function invoke_v(index) { + var sp = stackSave(); + try { + getWasmTableEntry(index)(); } catch(e) { stackRestore(sp); if (!(e instanceof EmscriptenEH)) throw e; @@ -9368,6 +9295,17 @@ function invoke_diii(index,a1,a2,a3) { } } +function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) { + var sp = stackSave(); + try { + getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7); + } catch(e) { + stackRestore(sp); + if (!(e instanceof EmscriptenEH)) throw e; + _setThrew(1, 0); + } +} + function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) { var sp = stackSave(); try { @@ -9538,12 +9476,14 @@ var missingLibrarySymbols = [ 'setImmediateWrapped', 'clearImmediateWrapped', 'polyfillSetImmediate', + 'registerPostMainLoop', + 'registerPreMainLoop', 'getPromise', 'makePromise', 'idsToPromises', 'makePromiseCallback', 'Browser_asyncPrepareDataCounter', - 'setMainLoop', + 'safeRequestAnimationFrame', 'isLeapYear', 'ydayFromDate', 'arraySum',