+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.
#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
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);
return sse_opts;
}
+#ifndef DISABLE_JIT
+
GList *
mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
{
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); \
}
}
+#ifndef DISABLE_JIT
+
static int
get_max_epilog_size (MonoCompile *cfg)
{
}
+#endif /* DISABLE_JIT */
+
void*
mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
{
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)
{
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
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
+}
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
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;