diff options
author | Bernhard Urban <bernhard.urban@xamarin.com> | 2018-11-12 06:00:48 +0300 |
---|---|---|
committer | Ludovic Henry <luhenry@microsoft.com> | 2018-11-12 06:00:48 +0300 |
commit | 06e00cd38db11312fefd807b1484dd0819bc2c03 (patch) | |
tree | a1cf27afce4de122a2beb1d31e57d7d60238d41e | |
parent | 521b8a0b3c49a2741035d0076b81fa9cea13e0ed (diff) |
[wasm] add DDI signature to managed2native transitions (#11642)
Mentioned by a user here: https://github.com/mono/mono/issues/8711#issuecomment-437638741
-rw-r--r-- | mono/mini/m2n-gen.cs | 1 | ||||
-rw-r--r-- | mono/mini/wasm_m2n_invoke.g.h | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/mono/mini/m2n-gen.cs b/mono/mini/m2n-gen.cs index 533672fe8eb..393f6986bc7 100644 --- a/mono/mini/m2n-gen.cs +++ b/mono/mini/m2n-gen.cs @@ -49,6 +49,7 @@ class Driver { "LIL", "LILII", "DD", + "DDI", "DDD", "VIF", "VIFF", diff --git a/mono/mini/wasm_m2n_invoke.g.h b/mono/mini/wasm_m2n_invoke.g.h index bb0e7a159a2..7a2e140bebc 100644 --- a/mono/mini/wasm_m2n_invoke.g.h +++ b/mono/mini/wasm_m2n_invoke.g.h @@ -226,6 +226,16 @@ wasm_invoke_dd (void *target_func, InterpMethodArguments *margs) } static void +wasm_invoke_ddi (void *target_func, InterpMethodArguments *margs) +{ + typedef double (*T)(double arg_0, int arg_1); + T func = (T)target_func; + double res = func (margs->fargs [FIDX (0)], (int)margs->iargs [0]); + *(double*)margs->retval = res; + +} + +static void wasm_invoke_ddd (void *target_func, InterpMethodArguments *margs) { typedef double (*T)(double arg_0, double arg_1); @@ -496,6 +506,8 @@ icall_trampoline_dispatch (const char *cookie, void *target_func, InterpMethodAr wasm_invoke_lilii (target_func, margs); else if (!strcmp ("DD", cookie)) wasm_invoke_dd (target_func, margs); + else if (!strcmp ("DDI", cookie)) + wasm_invoke_ddi (target_func, margs); else if (!strcmp ("DDD", cookie)) wasm_invoke_ddd (target_func, margs); else if (!strcmp ("VIF", cookie)) |