Merge pull request #832 from xplicit/webperf1
[mono.git] / mono / mini / mini-amd64.h
index cb590add880220f05469ba8c72600c118c0e4ef1..b523d9981cd5df64e67e02d64ef9bac4b83c81a6 100644 (file)
@@ -47,7 +47,7 @@ struct sigcontext {
        guint64 eip;
 };
 
-typedef void (* MonoW32ExceptionHandler) (int _dummy, EXCEPTION_RECORD *info, void *context);
+typedef void (* MonoW32ExceptionHandler) (int _dummy, EXCEPTION_POINTERS *info, void *context);
 void win32_seh_init(void);
 void win32_seh_cleanup(void);
 void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler);
@@ -159,16 +159,17 @@ struct sigcontext {
 
 struct MonoLMF {
        /* 
-        * If the lowest bit is set to 1, then this LMF has the rip field set. Otherwise,
+        * If the lowest bit is set, then this LMF has the rip field set. Otherwise,
         * the rip field is not set, and the rsp field points to the stack location where
         * the caller ip is saved.
-        * If the second lowest bit is set to 1, then this is a MonoLMFExt structure, and
+        * If the second lowest bit is set, then this is a MonoLMFExt structure, and
         * the other fields are not valid.
+        * If the third lowest bit is set, then this is a MonoLMFTramp structure.
         */
        gpointer    previous_lmf;
+#ifdef HOST_WIN32
        gpointer    lmf_addr;
-       /* This is only set in trampoline LMF frames */
-       MonoMethod *method;
+#endif
 #if defined(__default_codegen__) || defined(HOST_WIN32)
        guint64     rip;
 #elif defined(__native_client_codegen__)
@@ -189,6 +190,13 @@ struct MonoLMF {
 #endif
 };
 
+/* LMF structure used by the JIT trampolines */
+typedef struct {
+       struct MonoLMF lmf;
+       guint64 *regs;
+       gpointer lmf_addr;
+} MonoLMFTramp;
+
 typedef struct MonoCompileArch {
        gint32 localloc_offset;
        gint32 reg_save_area_offset;
@@ -334,9 +342,7 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
 
 #define MONO_ARCH_ENABLE_REGALLOC_IN_EH_BLOCKS 1
-#if !defined(__APPLE__)
 #define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
-#endif
 #define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
 #define MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE 1
 #define MONO_ARCH_HAVE_ATOMIC_ADD 1
@@ -397,6 +403,7 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
 #define MONO_ARCH_HAVE_CREATE_LLVM_NATIVE_THUNK 1
 #define MONO_ARCH_HAVE_OP_TAIL_CALL 1
+#define MONO_ARCH_HAVE_TRANSLATE_TLS_OFFSET 1
 
 #if defined(TARGET_OSX) || defined(__linux__)
 #define MONO_ARCH_HAVE_TLS_GET_REG 1