11 #include "interp/interp.h"
16 type_to_c (MonoType
*t
)
23 case MONO_TYPE_BOOLEAN
:
34 case MONO_TYPE_SZARRAY
:
36 case MONO_TYPE_OBJECT
:
37 case MONO_TYPE_STRING
:
49 case MONO_TYPE_VALUETYPE
:
50 if (m_class_is_enumtype (t
->data
.klass
)) {
51 t
= mono_class_enum_basetype_internal (t
->data
.klass
);
56 case MONO_TYPE_GENERICINST
:
57 if (m_class_is_valuetype (t
->data
.klass
))
61 g_warning ("CANT TRANSLATE %s", mono_type_full_name (t
));
66 #if TARGET_SIZEOF_VOID_P == 4
67 #define FIDX(x) ((x) * 2)
83 get_long_arg (InterpMethodArguments
*margs
, int idx
)
86 p
.pair
.lo
= (gint32
)(gssize
)margs
->iargs
[idx
];
87 p
.pair
.hi
= (gint32
)(gssize
)margs
->iargs
[idx
+ 1];
91 #include "wasm_m2n_invoke.g.h"
94 mono_wasm_interp_to_native_trampoline (void *target_func
, InterpMethodArguments
*margs
)
99 MonoMethodSignature
*sig
= margs
->sig
;
101 c_count
= sig
->param_count
+ sig
->hasthis
+ 1;
102 g_assert (c_count
< sizeof (cookie
)); //ensure we don't overflow the local
104 cookie
[0] = type_to_c (sig
->ret
);
107 for (int i
= 0; i
< sig
->param_count
; ++i
) {
108 cookie
[1 + sig
->hasthis
+ i
] = type_to_c (sig
->params
[i
]);
110 cookie
[c_count
] = 0;
112 icall_trampoline_dispatch (cookie
, target_func
, margs
);
115 #else /* TARGET_WASM */
117 MONO_EMPTY_SOURCE_FILE (aot_runtime_wasm
);
119 #endif /* TARGET_WASM */