* one trampoline.
* - fast generic virtual calls are not supported.
*/
+#ifdef ENABLE_LLVM
+gboolean mono_use_llvm = TRUE;
+#else
gboolean mono_use_llvm = FALSE;
+#endif
#define mono_jit_lock() EnterCriticalSection (&jit_mutex)
#define mono_jit_unlock() LeaveCriticalSection (&jit_mutex)
{
return mono_jump_info_token_new2 (mp, image, token, NULL);
}
+
+/*
+ * mono_tramp_info_create:
+ *
+ * Create a MonoTrampInfo structure from the arguments. This function assumes ownership
+ * of NAME, JI, and UNWIND_OPS.
+ */
+MonoTrampInfo*
+mono_tramp_info_create (const char *name, guint8 *code, guint32 code_size, MonoJumpInfo *ji, GSList *unwind_ops)
+{
+ MonoTrampInfo *info = g_new0 (MonoTrampInfo, 1);
+
+ info->name = (char*)name;
+ info->code = code;
+ info->code_size = code_size;
+ info->ji = ji;
+ info->unwind_ops = unwind_ops;
+
+ return info;
+}
+
+void
+mono_tramp_info_free (MonoTrampInfo *info)
+{
+ g_free (info->name);
+
+ // FIXME: ji + unwind_ops
+}
#define MONO_INIT_VARINFO(vi,id) do { \
(vi)->range.first_use.pos.bid = 0xffff; \
mono_decompose_array_access_opts (cfg);
if (cfg->got_var) {
+#ifndef MONO_ARCH_GOT_REG
GList *regs;
+#endif
+ int got_reg;
g_assert (cfg->got_var_allocated);
* branches problem. Testcase: mcs crash in
* System.MonoCustomAttrs:GetCustomAttributes.
*/
+#ifdef MONO_ARCH_GOT_REG
+ got_reg = MONO_ARCH_GOT_REG;
+#else
regs = mono_arch_get_global_int_regs (cfg);
g_assert (regs);
+ got_reg = GPOINTER_TO_INT (regs->data);
+ g_list_free (regs);
+#endif
cfg->got_var->opcode = OP_REGVAR;
- cfg->got_var->dreg = GPOINTER_TO_INT (regs->data);
+ cfg->got_var->dreg = got_reg;
cfg->used_int_regs |= 1LL << cfg->got_var->dreg;
-
- g_list_free (regs);
}
/*
}
if ((cfg->opt & MONO_OPT_LINEARS) && !cfg->globalra) {
- GList *vars, *regs;
+ GList *vars, *regs, *l;
/* fixme: maybe we can avoid to compute livenesss here if already computed ? */
cfg->comp_done &= ~MONO_COMP_LIVENESS;
if ((vars = mono_arch_get_allocatable_int_vars (cfg))) {
regs = mono_arch_get_global_int_regs (cfg);
- if (cfg->got_var)
- regs = g_list_delete_link (regs, regs);
+ /* Remove the reg reserved for holding the GOT address */
+ if (cfg->got_var) {
+ for (l = regs; l; l = l->next) {
+ if (GPOINTER_TO_UINT (l->data) == cfg->got_var->dreg) {
+ regs = g_list_delete_link (regs, l);
+ break;
+ }
+ }
+ }
mono_linear_scan (cfg, vars, regs, &cfg->used_int_regs);
}
}