2010-02-20 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Sat, 20 Feb 2010 17:43:53 +0000 (17:43 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 20 Feb 2010 17:43:53 +0000 (17:43 -0000)
* unwind.c (mono_unwind_get_cie_program): New function, moved here from
aot-compiler.c, so it can be found even if DISABLE_JIT is set.

* aot-compiler.c xdebug.c: Update callers of mono_arch_unwind_get_cie_program ().

* mini-amd64.c: Fix DISABLE_JIT support.

svn path=/trunk/mono/; revision=152123

mono/mini/ChangeLog
mono/mini/aot-compiler.c
mono/mini/mini-amd64.c
mono/mini/mini-unwind.h
mono/mini/unwind.c
mono/mini/xdebug.c

index 3b91b693a20c317140c5a15b5a81ff350449f55b..3ece7131df143387662c857e736fd3570313cc5a 100755 (executable)
@@ -1,3 +1,12 @@
+2010-02-20  Zoltan Varga  <vargaz@gmail.com>
+
+       * unwind.c (mono_unwind_get_cie_program): New function, moved here from
+       aot-compiler.c, so it can be found even if DISABLE_JIT is set.
+
+       * aot-compiler.c xdebug.c: Update callers of mono_arch_unwind_get_cie_program ().
+
+       * mini-amd64.c: Fix DISABLE_JIT support.
+
 2010-02-20  Geoff Norton  <gnorton@novell.com>
 
        * aot-runtime.c: Ensure we dont leak a held lock when unwinding exceptions.
index 5a409b8df0902fa4dae5665e7e4a626fc4363810..338f3d697e1b7973a20adeb0d2a249f17e25ad09 100644 (file)
@@ -1197,32 +1197,6 @@ arch_emit_autoreg (MonoAotCompile *acfg, char *symbol)
 #endif
 }
 
-/*
- * mono_arch_get_cie_program:
- *
- *   Get the unwind bytecode for the DWARF CIE.
- */
-GSList*
-mono_arch_get_cie_program (void)
-{
-#ifdef TARGET_AMD64
-       GSList *l = NULL;
-
-       mono_add_unwind_op_def_cfa (l, (guint8*)NULL, (guint8*)NULL, AMD64_RSP, 8);
-       mono_add_unwind_op_offset (l, (guint8*)NULL, (guint8*)NULL, AMD64_RIP, -8);
-
-       return l;
-#elif defined(TARGET_POWERPC)
-       GSList *l = NULL;
-
-       mono_add_unwind_op_def_cfa (l, (guint8*)NULL, (guint8*)NULL, ppc_r1, 0);
-
-       return l;
-#else
-       return NULL;
-#endif
-}
-
 /* END OF ARCH SPECIFIC CODE */
 
 static guint32
@@ -6043,7 +6017,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
        img_writer_emit_start (acfg->w);
 
        if (acfg->dwarf)
-               mono_dwarf_writer_emit_base_info (acfg->dwarf, mono_arch_get_cie_program ());
+               mono_dwarf_writer_emit_base_info (acfg->dwarf, mono_unwind_get_cie_program ());
 
        emit_code (acfg);
 
index 3b2033a7287b0ae8d27c6524afc1d25bc998436e..498d4a48248882469f52ce565056abef66510547 100644 (file)
@@ -1013,6 +1013,8 @@ mono_arch_cpu_enumerate_simd_versions (void)
        return sse_opts;        
 }
 
+#ifndef DISABLE_JIT
+
 GList *
 mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
 {
@@ -2184,6 +2186,8 @@ mono_arch_emit_setret (MonoCompile *cfg, MonoMethod *method, MonoInst *val)
        MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg, val->dreg);
 }
 
+#endif /* DISABLE_JIT */
+
 #define EMIT_COND_BRANCH(ins,cond,sign) \
         if (ins->inst_true_bb->native_offset) { \
                x86_branch (code, cond, cfg->native_code + ins->inst_true_bb->native_offset, sign); \
@@ -5623,6 +5627,8 @@ mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, Mono
        }
 }
 
+#ifndef DISABLE_JIT
+
 static int
 get_max_epilog_size (MonoCompile *cfg)
 {
@@ -6565,6 +6571,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
 }
 
+#endif /* DISABLE_JIT */
+
 void*
 mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
 {
@@ -7346,6 +7354,17 @@ mono_arch_find_static_call_vtable (mgreg_t *regs, guint8 *code)
        return (MonoVTable*) regs [MONO_ARCH_RGCTX_REG];
 }
 
+GSList*
+mono_arch_get_cie_program (void)
+{
+       GSList *l = NULL;
+
+       mono_add_unwind_op_def_cfa (l, (guint8*)NULL, (guint8*)NULL, AMD64_RSP, 8);
+       mono_add_unwind_op_offset (l, (guint8*)NULL, (guint8*)NULL, AMD64_RIP, -8);
+
+       return l;
+}
+
 MonoInst*
 mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
 {
index 7dd2256910625794ee779495b9acff10a90252e0..e143468fd9dd60218879a0cf8647136dee274629 100644 (file)
@@ -113,4 +113,6 @@ guint8* mono_get_cached_unwind_info (guint32 index, guint32 *unwind_info_len) MO
 
 guint8* mono_unwind_decode_fde (guint8 *fde, guint32 *out_len, guint32 *code_len, MonoJitExceptionInfo **ex_info, guint32 *ex_info_len, gpointer **type_info) MONO_INTERNAL;
 
+GSList* mono_unwind_get_cie_program (void) MONO_INTERNAL;
+
 #endif
index 23a8f75686b39b58d893e4187f78bd46251c4524..770e1661df3fde12b9a9976a12b8b790d89e75f9 100644 (file)
@@ -911,3 +911,24 @@ mono_unwind_decode_fde (guint8 *fde, guint32 *out_len, guint32 *code_len, MonoJi
 
        return g_realloc (buf, i);
 }
+
+/*
+ * mono_unwind_get_cie_program:
+ *
+ *   Get the unwind bytecode for the DWARF CIE.
+ */
+GSList*
+mono_unwind_get_cie_program (void)
+{
+#ifdef TARGET_AMD64
+       return mono_arch_get_cie_program ();
+#elif defined(TARGET_POWERPC)
+       GSList *l = NULL;
+
+       mono_add_unwind_op_def_cfa (l, (guint8*)NULL, (guint8*)NULL, ppc_r1, 0);
+
+       return l;
+#else
+       return NULL;
+#endif
+}
index 6f212f80bd4852735c72591e48c53a4d0536029c..ce10b80accab999ce93df4f673387bf89103f110 100644 (file)
@@ -155,7 +155,7 @@ mono_xdebug_init (char *options)
        img_writer_emit_section_change (w, ".text", 0);
        img_writer_emit_string (w, "");
 
-       mono_dwarf_writer_emit_base_info (xdebug_writer, mono_arch_get_cie_program ());
+       mono_dwarf_writer_emit_base_info (xdebug_writer, mono_unwind_get_cie_program ());
 }
 
 static void
@@ -174,7 +174,7 @@ xdebug_begin_emit (MonoImageWriter **out_w, MonoDwarfWriter **out_dw)
 
        dw = mono_dwarf_writer_create (w, il_file, il_file_line_index, FALSE);
 
-       mono_dwarf_writer_emit_base_info (dw, mono_arch_get_cie_program ());
+       mono_dwarf_writer_emit_base_info (dw, mono_unwind_get_cie_program ());
 
        *out_w = w;
        *out_dw = dw;