Merge pull request #5668 from kumpera/wasm-work-p4
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Mon, 2 Oct 2017 23:36:39 +0000 (16:36 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2017 23:36:39 +0000 (16:36 -0700)
More WASM fixes.

mono/mini/aot-runtime-wasm.c
mono/mini/mixed.cs
mono/sgen/sgen-marksweep.c

index d3b286cd0457418313aaee3dfb651e008074de6c..b5328ffc99dd3a24edc960b3a752e9a60e78c56d 100644 (file)
@@ -196,6 +196,15 @@ wasm_invoke_iiiiii (void *target_func, InterpMethodArguments *margs)
        *(int*)margs->retval = res;
 }
 
+static void
+wasm_invoke_iiiiiiiii (void *target_func, InterpMethodArguments *margs)
+{
+       int (*func)(gpointer a, gpointer b, gpointer c, gpointer d, gpointer e, gpointer f, gpointer g, gpointer h) = target_func;
+       int res = func (margs->iargs [0], margs->iargs [1], margs->iargs [2], margs->iargs [3], margs->iargs [4], margs->iargs [5], margs->iargs [6], margs->iargs [7]);
+       *(int*)margs->retval = res;
+}
+
+
 typedef union {
        gint64 l;
        struct {
@@ -363,6 +372,8 @@ wasm_enter_icall_trampoline (void *target_func, InterpMethodArguments *margs)
                wasm_invoke_iiiii (target_func, margs);
        else if (!strcmp ("IIIIII", cookie))
                wasm_invoke_iiiiii (target_func, margs);
+       else if (!strcmp ("IIIIIIIII", cookie))
+               wasm_invoke_iiiiiiiii (target_func, margs);
        else if (!strcmp ("L", cookie))
                wasm_invoke_l (target_func, margs);
        else if (!strcmp ("LL", cookie))
index 568589ebe2758600e2b68e95d7b813c3903bafa1..940c19345e16e174ead8e7a28996fc89a858b3a4 100644 (file)
@@ -244,6 +244,7 @@ class Tests
                return 1;
        }
 
+       [Category ("!WASM")] //Stack traces / EH are super broken on WASM + Interpreter
        public static int test_0_stack_traces () {
                //
                // Get a stacktrace for an interp->jit->interp call stack
index e06ac6d3f83f22177fa54f48f5dc96fa23870e98..3f14d5ee7acab33c1d35ccb0b84b3640bc9eb7e8 100644 (file)
@@ -2167,7 +2167,7 @@ major_free_swept_blocks (size_t section_reserve)
 {
        SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Sweeping must have finished before freeing blocks");
 
-#if defined(HOST_WIN32) || defined(HOST_ORBIS)
+#if defined(HOST_WIN32) || defined(HOST_ORBIS) || defined (HOST_WASM)
                /*
                 * sgen_free_os_memory () asserts in mono_vfree () because windows doesn't like freeing the middle of
                 * a VirtualAlloc ()-ed block.