Use --relocation-model=pic for llvm on ios.
[mono.git] / mono / mini / mini-x86.h
index 0c34eb54353bdb865555305098243ef4692f5920..20d2eeb329a793e67a9fab9100b97b40cb6b5cf1 100644 (file)
@@ -228,6 +228,7 @@ typedef struct {
 #endif
 #define MONO_ARCH_GOT_REG X86_EBX
 #define MONO_ARCH_HAVE_GET_TRAMPOLINES 1
+#define MONO_ARCH_HAVE_GENERAL_RGCTX_LAZY_FETCH_TRAMPOLINE 1
 
 #define MONO_ARCH_HAVE_CMOV_OPS 1
 
@@ -260,6 +261,11 @@ typedef struct {
 #define MONO_ARCH_GC_MAPS_SUPPORTED 1
 #define MONO_ARCH_HAVE_CONTEXT_SET_INT_REG 1
 #define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
+#define MONO_ARCH_GSHAREDVT_SUPPORTED 1
+
+#ifdef TARGET_OSX
+#define MONO_ARCH_HAVE_TLS_GET_REG 1
+#endif
 
 gboolean
 mono_x86_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig) MONO_INTERNAL;
@@ -286,6 +292,39 @@ typedef struct {
 
 extern MonoBreakpointInfo mono_breakpoint_info [MONO_BREAKPOINT_ARRAY_SIZE];
 
+/* Return value marshalling for calls between gsharedvt and normal code */
+typedef enum {
+       GSHAREDVT_RET_NONE = 0,
+       GSHAREDVT_RET_IREGS = 1,
+       GSHAREDVT_RET_DOUBLE_FPSTACK = 2,
+       GSHAREDVT_RET_FLOAT_FPSTACK = 3,
+       GSHAREDVT_RET_STACK_POP = 4,
+       GSHAREDVT_RET_I1 = 5,
+       GSHAREDVT_RET_U1 = 6,
+       GSHAREDVT_RET_I2 = 7,
+       GSHAREDVT_RET_U2 = 8,
+       GSHAREDVT_RET_IREG = 9
+} GSharedVtRetMarshal;
+
+typedef struct {
+       /* Method address to call */
+       gpointer addr;
+       /* The trampoline reads this, so keep the size explicit */
+       int ret_marshal;
+       /* If ret_marshal != NONE, this is the stack slot of the vret arg, else -1 */
+       int vret_arg_slot;
+       /* The stack slot where the return value will be stored */
+       int vret_slot;
+       int stack_usage, map_count;
+       /* If not -1, then make a virtual call using this vtable offset */
+       int vcall_offset;
+       /* If 1, make an indirect call to the address in the rgctx reg */
+       int calli;
+       /* Whenever this is a in or an out call */
+       int gsharedvt_in;
+       int map [MONO_ZERO_LEN_ARRAY];
+} GSharedVtCallInfo;
+
 guint8*
 mono_x86_emit_tls_get (guint8* code, int dreg, int tls_offset) MONO_INTERNAL;
 
@@ -306,5 +345,8 @@ mono_x86_throw_corlib_exception (mgreg_t *regs, guint32 ex_token_index,
 void 
 mono_x86_patch (unsigned char* code, gpointer target) MONO_INTERNAL;
 
+gpointer
+mono_x86_start_gsharedvt_call (GSharedVtCallInfo *info, gpointer *caller, gpointer *callee, gpointer mrgctx_reg) MONO_INTERNAL;
+
 #endif /* __MONO_MINI_X86_H__ */