diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e048dfaeb..afbdc90625f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All PRs to the Wasmer repository must add to this file. Blocks of changes will separated by version increments. ## **[Unreleased]** +- [#515](https://github.com/wasmerio/wasmer/pull/510) Improved Emscripten dyncalls - [#513](https://github.com/wasmerio/wasmer/pull/510) Fix emscripten lseek implementation. - [#510](https://github.com/wasmerio/wasmer/pull/510) Simplify construction of floating point constants in LLVM backend. Fix LLVM assertion failure due to definition of %ctx. diff --git a/lib/emscripten/src/emscripten_target.rs b/lib/emscripten/src/emscripten_target.rs index 7e0b81af29b..3ec4b83af45 100644 --- a/lib/emscripten/src/emscripten_target.rs +++ b/lib/emscripten/src/emscripten_target.rs @@ -634,6 +634,11 @@ pub fn invoke_iij(ctx: &mut Ctx, index: i32, a1: i32, a2: i32, a3: i32) -> i32 { invoke!(ctx, dyn_call_iij, index, a1, a2, a3) } +pub fn invoke_iji(ctx: &mut Ctx, index: i32, a1: i32, a2: i32, a3: i32) -> i32 { + debug!("emscripten::invoke_iji"); + invoke!(ctx, dyn_call_iji, index, a1, a2, a3) +} + pub fn invoke_iiji(ctx: &mut Ctx, index: i32, a1: i32, a2: i32, a3: i32, a4: i32) -> i32 { debug!("emscripten::invoke_iiji"); invoke!(ctx, dyn_call_iiji, index, a1, a2, a3, a4) @@ -853,6 +858,10 @@ pub fn invoke_vijj(ctx: &mut Ctx, index: i32, a1: i32, a2: i32, a3: i32, a4: i32 panic!("dyn_call_vijj is set to None"); } } +pub fn invoke_vidd(ctx: &mut Ctx, index: i32, a1: i32, a2: f64, a3: f64) { + debug!("emscripten::invoke_viid"); + invoke_no_return!(ctx, dyn_call_vidd, index, a1, a2, a3); +} pub fn invoke_viid(ctx: &mut Ctx, index: i32, a1: i32, a2: i32, a3: f64) { debug!("emscripten::invoke_viid"); invoke_no_return!(ctx, dyn_call_viid, index, a1, a2, a3); diff --git a/lib/emscripten/src/lib.rs b/lib/emscripten/src/lib.rs index e7b51a26a91..a61d02295b2 100644 --- a/lib/emscripten/src/lib.rs +++ b/lib/emscripten/src/lib.rs @@ -124,6 +124,7 @@ pub struct EmscriptenData<'a> { pub dyn_call_viiiiiiiiii: Option>, pub dyn_call_iij: Option>, + pub dyn_call_iji: Option>, pub dyn_call_iiji: Option>, pub dyn_call_iiijj: Option>, pub dyn_call_j: Option>, @@ -146,6 +147,7 @@ pub struct EmscriptenData<'a> { pub dyn_call_vijiii: Option>, pub dyn_call_vijj: Option>, pub dyn_call_viid: Option>, + pub dyn_call_vidd: Option>, pub dyn_call_viidii: Option>, pub dyn_call_viidddddddd: Option>, @@ -197,6 +199,7 @@ impl<'a> EmscriptenData<'a> { let dyn_call_viiiiiiiii = instance.func("dynCall_viiiiiiiii").ok(); let dyn_call_viiiiiiiiii = instance.func("dynCall_viiiiiiiiii").ok(); let dyn_call_iij = instance.func("dynCall_iij").ok(); + let dyn_call_iji = instance.func("dynCall_iji").ok(); let dyn_call_iiji = instance.func("dynCall_iiji").ok(); let dyn_call_iiijj = instance.func("dynCall_iiijj").ok(); let dyn_call_j = instance.func("dynCall_j").ok(); @@ -218,6 +221,7 @@ impl<'a> EmscriptenData<'a> { let dyn_call_vijiii = instance.func("dynCall_vijiii").ok(); let dyn_call_vijj = instance.func("dynCall_vijj").ok(); let dyn_call_viid = instance.func("dynCall_viid").ok(); + let dyn_call_vidd = instance.func("dynCall_vidd").ok(); let dyn_call_viidii = instance.func("dynCall_viidii").ok(); let dyn_call_viidddddddd = instance.func("dynCall_viidddddddd").ok(); @@ -263,6 +267,7 @@ impl<'a> EmscriptenData<'a> { dyn_call_viiiiiiiii, dyn_call_viiiiiiiiii, dyn_call_iij, + dyn_call_iji, dyn_call_iiji, dyn_call_iiijj, dyn_call_j, @@ -284,6 +289,7 @@ impl<'a> EmscriptenData<'a> { dyn_call_vijiii, dyn_call_vijj, dyn_call_viid, + dyn_call_vidd, dyn_call_viidii, dyn_call_viidddddddd, temp_ret_0: 0, @@ -912,6 +918,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject "invoke_viiiiiiiii" => func!(crate::emscripten_target::invoke_viiiiiiiii), "invoke_viiiiiiiiii" => func!(crate::emscripten_target::invoke_viiiiiiiiii), "invoke_iij" => func!(crate::emscripten_target::invoke_iij), + "invoke_iji" => func!(crate::emscripten_target::invoke_iji), "invoke_iiji" => func!(crate::emscripten_target::invoke_iiji), "invoke_iiijj" => func!(crate::emscripten_target::invoke_iiijj), "invoke_j" => func!(crate::emscripten_target::invoke_j), @@ -930,6 +937,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject "invoke_viji" => func!(crate::emscripten_target::invoke_viji), "invoke_vijiii" => func!(crate::emscripten_target::invoke_vijiii), "invoke_vijj" => func!(crate::emscripten_target::invoke_vijj), + "invoke_vidd" => func!(crate::emscripten_target::invoke_vidd), "invoke_viid" => func!(crate::emscripten_target::invoke_viid), "invoke_viidii" => func!(crate::emscripten_target::invoke_viidii), "invoke_viidddddddd" => func!(crate::emscripten_target::invoke_viidddddddd),